# Joint Task Offloading and Resource Allocation Strategy for DiffServ in Vehicular Cloud System

Authors: Ya Kang; Zhanjun Liu; Qianbin Chen; Yingdi Dai
Journal: Wireless Communications and Mobile Computing
 (2020)

---

## Abstract

A vehicular cloud (VC) can reduce latency and improve resource utilization of the Internet of vehicles by effectively using the underutilized computing resources of nearby vehicles. Although the task offloading of the VC enhances road safety and traffic management on the Internet of vehicles and meets the low-latency requirements for driving safety services on the Internet of vehicles business, there are still some key challenges such as the resource allocation mechanism of differentiated services (DiffServ) and task offloading mechanism of improving user experience. To address these issues, we study the task offloading and resource allocation strategy of the VC system where tasks generated by vehicles can be offloaded and executed cooperatively by vehicles in VC. Specifically, the computing task is further divided into independent subtasks and executed in different vehicles in VC to maximize the offloading utility. Considering the mobility of vehicles, the deadline of tasks, and the limited computing resources, we propose the optimization problem of task offloading in the VC system in the cause of improved user experience. To characterize the difference in service requirements resulting from the diversity of tasks, a DiffServ model focusing on the pricing of a task is utilized. The initial pricing of a task is tailored by the characteristics of the task and the uniqueness of the network status. In this model, tasks are sorted and processed in order according to task pricing, so as to optimize resource allocation. Numerical results show that the proposed scheme can effectively increase the resource utilization and task completion ratio.


---

## Body

## 1. Introduction

In a vehicle network [1], the cloud composed of vehicles with strong computing power is called VC [2]. The task offloading of the VC [3] has a significant impact on the performance of the Internet of vehicles [4], which enhances vehicle road safety and traffic management by effectively utilizing the underutilized computation resources of nearby vehicles and reduces traffic congestion and accidents, thus improving the network performance of the Internet of vehicles. The processing of emerging message-type safety applications in the vehicle network requires a large amount of computing resources, such as 4 K/8 K ultrahigh real-time traffic video streaming, multiview video stitching processing of autonomous vehicles, and AR-assisted applications related to safety warnings. However, the collaborative scheduling of information and data by offloading computing tasks to the vehicular cloud can effectively enhance the utilization of computing resources due to the limited computing resources of vehicles. At the same time, due to its proximity to users and rich computing resources, the vehicular cloud can meet the low delay requirements for safe driving on the Internet of vehicles business, which is a key technology in the existing Internet of vehicles.Owing to the fast-moving characteristics of vehicles, computing resources of vehicles are dynamic. For example, the connection of mobile vehicles can be connected or disconnected at any time, which will bring about unstable computing resource availability. Accordingly, in order to ensure the offloading of the task, the task should be offloaded within vehicle contact time [5]. In vehicular cloud computing, task offloading is inseparable from efficient resource allocation technology. Resources involved in the entire process of offloading the task of the vehicle to the vehicular cloud are mainly divided into the communication resources and the computing resources [6]. [7–9]. For the task offloading of VC, Wu et al. assume that each vehicle task can be divided into several independent subtasks, and then, the task allocation problem is solved [10]. Under the condition of ensuring user service experience, Liu et al. study how to allocate limited computing resources to maximize the economic benefits of MEC service providers when vehicles offload tasks to MEC servers [11]. In order to solve the users’ selfishness, Liu et al. have established a kind of new type of computing sharing market in the vehicle network [12]. Several other works, such as [13, 14], use the method of task replication to allow a task to be executed by multiple vehicles so as to maximize the possibility of completing the task before a given deadline and improve the reliability.In recent years, game theory has become an incentive mechanism to analyze and allocate resources. A game model can effectively capture the interaction between users and servers [15], so game theory has become a way to analyze and allocate resources [16]. For the sake of creating greater social and economic benefits in the process of resource management, a pricing strategy as an effective way of network resource management on the basis of game theory is proposed, in [16]. The forementioned research believes that the pricing mechanism is an effective way to improve resource utilization. However, how to use the pricing mechanism to distinguish different services in the VC system in game theory has not been well explored. It also can be seen from the above literatures that most of the resource allocation process VC system does not DiffServ. That is to say, the relationship between default services is equal. Unlike the resource management [17] scheme that considers the priority of a task in the general VC computing scenario, we propose a game theory-based DiffServ resource allocation mechanism that DiffServ through a task’s differentiated pricing. In other words, the higher the initial pricing of the task, the higher the service requirements of the business. The initial pricing of a task mainly involves two factors, namely, the urgency of the task vehicle and the network condition around the task. Finally, we maximize the offloading utility of tasks in the VC system and consider the mobility of vehicles and meet task delay constraints to maximize the completion of tasks. The main contributions of our paper are summarized as follows.
(i)
To meet the requirements of the diversity of tasks while effectively using computing resources, we propose a resource allocation mechanism for differentiated services and offload each task according to the pricing order(ii)
To improve the completion ratio of whole tasks in the vehicular cloud system, a task offloading mechanism that maximizes the offloading utility is proposed and considers the mobility of vehicles and the deadline of tasks(iii)
To address the problem of task offloading and resource allocation, a distributed resource allocation algorithm and Lagrange dual method are used, respectively


## 2. System Model

We consider a dynamic traffic scenario in which the vehicle can be either a service requester or a service provider in a finite two-way straight road. Leti∈1,2,⋯,M be the group of M TaVs (task vehicles). We use three parameters di,ci,Tideadline to indicate the generated task of TaV i, by which di (in bits) specifies the data size of the task, where ci=κdi, ci (in CPU cycles per bit) is the computing resource required to processing the task, κ is the mapping between CPU cycles and task size, and Tideadline is the deadline for task execution. When the task processing delay exceeds the deadline, the task processing fails. fi0 indicates the local computing ability of TaV i. At the same time, j∈i,2,⋯,N is denoted as a group of vehicles with free resources, which is called SeVs (service vehicles), where the computing resource of SeV j is defined as Fjmax. Figure 1 depicts a simple example of a vehicular cloud system. Here, TaV 1, TaV 2, and TaV 3 form a vehicular cloud with SeVs within their covering radius, respectively. It is assumed that the communication radius of each vehicle is Z.Figure 1
Vehicular cloud system model.


### 2.1. Task Offloading Model

Since the size of the output task is usually much smaller than the size of the input task, we can ignore the return time in offloading [18, 19]. Each TaV first offloads the computing task to one or more surrounding SeVs for processing and then handles the size of the remaining task by itself to ensure that the task is completed within the deadline. The total offloading delay for SeV j to process the size of a task assigned by TaV i is given as
(1)Tij=dijRij+cijfij,where dij is the task size of the TaV i offloading to SeV j, Rij is the transmission rate of TaV i to SeV j, cij is the required computation resource to complete task dij, and fij is the computing resource provided by SeV j to TaV i.


### 2.2. Local Processing Model

When the task is not completely offloaded, the size of the remaining task is processed locally, and the local processing delay is expressed as follows:(2)Ti0=ci−∑j=1Ncijfi0.


### 2.3. Mobility Model

Assuming that the initial position of TaVi and the initial position of SeV j is, respectively, xTaVi,yTaVi and xSeVj,ySeVj, the speed of each vehicle is defined as vTaVi,vSeVj∈vmin,vmax that the vehicle maintains a uniform linear motion during task processing, so the motion angle θ=0,π, after moving the time slot Δt, the position of the TaV i is changed to xTaViΔt=xTaVi+vTaViΔtcosθ, yTaViΔt=yTaVi+vTaViΔtsinθ. The position of SeV j is changed to xSeVjΔt=xSeVj+vSeVjΔtcosθ, ySeVjΔt=ySeVj+vSeVjΔtsinθ. According to Euclid’s theorem, after TaV i and SeV j move through the time slot Δt, the distance between the two vehicles is
(3)s=xTaViΔt−xSeVjΔt2+yTaViΔt−ySeVjΔt2.Communication between each other can be achieved only when SeVj is within the communication radius Z of TaV i. The connection time between vehicles is predicted as follows:
(4)Z2=xTaViTijre−xSeVjTijre2+yTaViTijre−ySeVjTijre2.


### 2.4. Offloading Utility Function

Considering all the TaVs in the VC system, the total offloading utility obtained of offloading TaVs to SeVs can be defined as(5)U=∑i=1Mui−Ci,where ui is denoted as the offloading revenue of TaV i and Ci is the offload cost of the TaV i.The total offloading revenue obtained by TaVi for offloading tasks to the VC is expressed as follows [20]:
(6)ui=αi∑j=1Nlog21+dij,where αi represents the task offloading revenue weight parameter of TaV j, and its value is greater than zero.The transmission cost required by TaVi to offload tasks to the VC is expressed as follows:
(7)Ci=χ∑j=1Ndij,where χ is the unit transmission cost required for transmiting 1 Mb data to any SeV.With the aim of maximizing the task offloading of TaVs in the VC system, the following optimization is formulated P1:(8)maxdijUs.t.C1:Tij≤Tideadline,∀i∈M,∀j∈NC2:∑j=1Ndij≤di,∀i∈M,∀j∈NC3:dij≥0,∀i∈M,∀j∈NC4:Tij≤Tijre,∀i∈M,∀j∈N.C1 means that the processing delay of each subtask is limited by the deadline of the task. C2 and C3 ensure that the size of total tasks offloading is not greater than the generated task size and the size of offloading is positive. C4 indicates that TaVi and SeV j should not spend more time on task processing than the connection time between the two vehicles.


## 2.1. Task Offloading Model

Since the size of the output task is usually much smaller than the size of the input task, we can ignore the return time in offloading [18, 19]. Each TaV first offloads the computing task to one or more surrounding SeVs for processing and then handles the size of the remaining task by itself to ensure that the task is completed within the deadline. The total offloading delay for SeV j to process the size of a task assigned by TaV i is given as
(1)Tij=dijRij+cijfij,where dij is the task size of the TaV i offloading to SeV j, Rij is the transmission rate of TaV i to SeV j, cij is the required computation resource to complete task dij, and fij is the computing resource provided by SeV j to TaV i.


## 2.2. Local Processing Model

When the task is not completely offloaded, the size of the remaining task is processed locally, and the local processing delay is expressed as follows:(2)Ti0=ci−∑j=1Ncijfi0.


## 2.3. Mobility Model

Assuming that the initial position of TaVi and the initial position of SeV j is, respectively, xTaVi,yTaVi and xSeVj,ySeVj, the speed of each vehicle is defined as vTaVi,vSeVj∈vmin,vmax that the vehicle maintains a uniform linear motion during task processing, so the motion angle θ=0,π, after moving the time slot Δt, the position of the TaV i is changed to xTaViΔt=xTaVi+vTaViΔtcosθ, yTaViΔt=yTaVi+vTaViΔtsinθ. The position of SeV j is changed to xSeVjΔt=xSeVj+vSeVjΔtcosθ, ySeVjΔt=ySeVj+vSeVjΔtsinθ. According to Euclid’s theorem, after TaV i and SeV j move through the time slot Δt, the distance between the two vehicles is
(3)s=xTaViΔt−xSeVjΔt2+yTaViΔt−ySeVjΔt2.Communication between each other can be achieved only when SeVj is within the communication radius Z of TaV i. The connection time between vehicles is predicted as follows:
(4)Z2=xTaViTijre−xSeVjTijre2+yTaViTijre−ySeVjTijre2.


## 2.4. Offloading Utility Function

Considering all the TaVs in the VC system, the total offloading utility obtained of offloading TaVs to SeVs can be defined as(5)U=∑i=1Mui−Ci,where ui is denoted as the offloading revenue of TaV i and Ci is the offload cost of the TaV i.The total offloading revenue obtained by TaVi for offloading tasks to the VC is expressed as follows [20]:
(6)ui=αi∑j=1Nlog21+dij,where αi represents the task offloading revenue weight parameter of TaV j, and its value is greater than zero.The transmission cost required by TaVi to offload tasks to the VC is expressed as follows:
(7)Ci=χ∑j=1Ndij,where χ is the unit transmission cost required for transmiting 1 Mb data to any SeV.With the aim of maximizing the task offloading of TaVs in the VC system, the following optimization is formulated P1:(8)maxdijUs.t.C1:Tij≤Tideadline,∀i∈M,∀j∈NC2:∑j=1Ndij≤di,∀i∈M,∀j∈NC3:dij≥0,∀i∈M,∀j∈NC4:Tij≤Tijre,∀i∈M,∀j∈N.C1 means that the processing delay of each subtask is limited by the deadline of the task. C2 and C3 ensure that the size of total tasks offloading is not greater than the generated task size and the size of offloading is positive. C4 indicates that TaVi and SeV j should not spend more time on task processing than the connection time between the two vehicles.


## 3. Computing Resource Allocation Based on Game Theory

For the sake of enabling SeVs to share their own resources to others, we propose an incentive method which is based on game theory as well as introduce a paid resource allocation strategy. The offloading delay for TaVi to offload the task to SeV j in the process of task offloading is as follows:
(9)Tij=diRij+cifij.With the purpose of simplifying the problem, we will considerRij as a fixed value. According to (9), the delay for task offloading is affected by computing resources provided by SeV j to TaV i. It is impossible for SeV j to provide computing resources to TaV i for free because of the selfishness of vehicles. According to messages exchanged between vehicles, we design a distributed incentive mechanism for resource allocation. The specific details are shown as follows.


### 3.1. Utility and Cost Functions

(1)
With the aim of maximizing utility of SeVj, the following optimization problem is formulated:(10)maxfijVj=δjln1+pifij−ccjfijs.t.C1:fij>0C2:fij≤Fjmax,where ccj represents the unit resource cost price of SeV j; δj is the willingness of SeV j, with δj≥1; pi represents the bid for TaV i; C1 indicates that the resources provided by SeV j are larger than zero; and C2 indicates that the total resources provided by SeV j are not larger than the maximum resources provided by itself.Theorem 1.
For any price given by each TaV, there must be a unique Nash equilibrium solution in the noncooperative game between SeVs.Proof.
The first-order derivative ofVj with respect to fij is expressed as follows:
(11)∂Vj∂fij=δjpi1+pifij−ccj.
The second-order derivative ofVj with respect to fij is expressed as follows:
(12)∂2Vj∂fij2=−δjpi1+pifij2.As the values of all parameters in (12) are positive, the second-order derivative of utility function is lower than zero, namely, ∂2Vj/∂fij2<0. Therefore, the utility function of SeV j is a concave function with maximum value. The corresponding optimal solution fij=δj/ccj−1/pi can be obtained by ∂Vj/∂fij=0, and there is a unique Nash equilibrium in the noncooperative game between SeVs given the price of the TaV.
(2)
In order to maximize economic benefits, we should minimize offloading cost. With the aim of minimizing cost function of TaVi, the following optimization problem is formulated:(13)minfijpi∑j=1Nfijs.t.C1:fij≥0C2:fimin<∑j=1Nfij≤fimaxC3:Pmin≤pi≤Pmax,where C2 means that the total computing resources provided by SeVs are larger than the minimum required resources fimin, but it is smaller than the maximum required resources fimax. C3 indicates that the bids of TaVs are larger than the lowest price Pmin, but it is smaller than the highest price Pmax.


### 3.2. TaV Pricing Rules

This section defines the concept of “pricing” for tasks by their service requirements, for the purpose of solving the problem of resource allocation. The pricing function is used to classify tasks requested by TaVs and further distinguish the priority of tasks. The definition of the pricing function of the TaVs task mainly involves two factors, namely, the urgency of the task and the network conditions around the TaV. Accordingly, the pricing of the TaV is obtained by the urgency of the task and the network status around the TaV. Then, the urgency of the task is related to the size of the task generated by the TaV and the deadline of the task. The network condition around the TaV is related to the number of requests received and the number of answers received in the previous slot.


#### 3.2.1. Distribution of the Number of Vehicles within the TaV Coverage

Owing to the stability of the network, the network condition of the previous and the next moment is unchanged. Suppose that TaVi and SeV j are randomly distributed on the road. Then, it is known that the TaV kk=i receives Rk requests and Sk responses at the previous time. According to the conditional probability, the distribution function of the number of TaVs mk and the distribution function of the number of SeVs nk in the coverage area is obtained.
(a)
Distribution function of the number of TaVsmk within the coverage of TaV k is expressed as follows:(14)PmkRk=Pmk,RkPRk=Pmk,Rk∑mk=Rk∞Pmk,Rk=CmkRkP1Rk1−P1mk−Rk∑mk=Rk∞CmkRkP1Rk1−P1mk−Rk,where (mk, Rk) indicates that there are totally mk TaVs within the coverage of TaV k, among which TaV k receives Rk requests, and P1 indicates the probability of any TaV sending out requests.
(b)
Distribution function of the number of SeVsnk within the coverage of TaV k is expressed as follows:(15)PnkSk=Pnk,SkPSk=Pnk,Sk∑nk=Sk∞Pnk,Sk=CnkSkP2Sk1−P2nk−Sk∑nk=Sk∞CnkSkP2Sk1−P2nk−Sk,where (nk, Sk) means there are a total of nk SeVs within the coverage of TaV k, among which TaV k receives Sk responses, and P2 means the probability that any SeV will respond to a TaV after receiving it.


#### 3.2.2. Average Number of Vehicles within the Coverage of TaVk

(a)
The average number of TaVs within the coverage of TaVk is expressed as follows:(16)Emk=∑mk=Rk∞mkPmkRk(b)
The average number of SeVs within the coverage of TaVk is expressed as follows:(17)Enk=∑nk=Sk∞nkPnkSk


#### 3.2.3. Remaining Resources within the Coverage of TaVk

Suppose that the resource requirements of each TaV obey the normal distribution ofQ1~μ1,δ12 and the resources provided by each SeV obey the normal distribution of Q2~μ2,δ22, the remaining resources around TaV k obtained by (16) and (17) are expressed as follows:
(18)Qk=EnkQ2−EmkQ1.On account of the independence ofQ1 and Q2, we can obtain the mean and variance value of Qk:
(19)EQk=Enkμ2−Emkμ1,(20)DQk=Enk2δ22−Emk2δ12.According to (19) and (20), we can get the distribution of the remaining resources Qk. In other words, a new normal distribution is expressed as follows:
(21)FQk=12πDQk∫−∞Qke−t−EQk2/2DQk.


#### 3.2.4. Initial Pricing of TaVk

According to (21), the remaining resources covered by TaV k are expressed as follows:
(22)EQk=Enkμ2−Emkμ1.The initial pricing of TaVk [21] is
(23)Pk=λkPmid−Pmin+Pmin,EQk≥0,−λkPmax−Pmid+Pmid,EQk<0,(24)λk=2πarctanfkminEQk,where fkmin means the minimum resources obtained by TaV k, fkmin=dk/Tkdeadline. From the pricing function, we can see that when the surrounding remaining resources are greater than zero, the price will be raised by the lowest price; otherwise, the price will be raised by the middle price.After getting the best initial pricing, we develop a distributed resource allocation algorithm. The algorithm dynamically changes the price of the TaV to ensure the maximum utility of the SeV, and the TaV can obtain resources to meet its needs. The algorithm is introduced in detail in Algorithm1. Firstly, the TaV sends the business request (including the price); meanwhile, all vehicles within the coverage of the TaV will receive the request message. Then, the SeV that received the request message maximizes its utility to obtain the size of computing resources that can be provided (Steps 4-14 of Algorithm 1). Next, the SeV sends a response (resources that the SeV can be provided) to the TaV; meanwhile, the TaV receives the response and adds up resources provided by SeVs. Finally, if the sum of the total resources provided is greater than the maximum resource demand of the TaV, the price will be reduced; otherwise, the price will be increased if the total resources provided are less than the minimum resource demand of the TaV. Otherwise, the price is the optimal price, and the optimal resource allocation result of the SeV is obtained (Steps 15-30 of Algorithm 1).Algorithm 1: Distributed resource allocation algorithm.
1: Initialization: The cost priceccj of the SeV j and the maximum resource it can provide are Fjmax; the TaV i the required computing resource is fimin<fi≤fimax2: For t=0, TaVi to set the price pit, and send it to the vehicles within the coverage3:fort=1,2,3.⋯do4:fori=1,2,⋯,Mdo5:   forj=1,2,⋯,Ndo6:    According to∂V/∂fij=0, compute fij7:fork=1:ido8:a=a+fkj9:end for10:Ifa>Fjmaxthen11:fij=012:end if13end for14:end for15:If∑j=1Nfij≥fimaxthen16:   decrease the price,pit+1=pit−v17:else18:if∑j=1Nfij≤fiminthe19:    increase the price,pit+1=pit+v20:else21:pit+1=pit22:end if23:Ifpit+1==pitthen24:    break25:else26:    report the new pricepit+127:    back to 328:end if29:end if30:end for


## 3.1. Utility and Cost Functions

(1)
With the aim of maximizing utility of SeVj, the following optimization problem is formulated:(10)maxfijVj=δjln1+pifij−ccjfijs.t.C1:fij>0C2:fij≤Fjmax,where ccj represents the unit resource cost price of SeV j; δj is the willingness of SeV j, with δj≥1; pi represents the bid for TaV i; C1 indicates that the resources provided by SeV j are larger than zero; and C2 indicates that the total resources provided by SeV j are not larger than the maximum resources provided by itself.Theorem 1.
For any price given by each TaV, there must be a unique Nash equilibrium solution in the noncooperative game between SeVs.Proof.
The first-order derivative ofVj with respect to fij is expressed as follows:
(11)∂Vj∂fij=δjpi1+pifij−ccj.
The second-order derivative ofVj with respect to fij is expressed as follows:
(12)∂2Vj∂fij2=−δjpi1+pifij2.As the values of all parameters in (12) are positive, the second-order derivative of utility function is lower than zero, namely, ∂2Vj/∂fij2<0. Therefore, the utility function of SeV j is a concave function with maximum value. The corresponding optimal solution fij=δj/ccj−1/pi can be obtained by ∂Vj/∂fij=0, and there is a unique Nash equilibrium in the noncooperative game between SeVs given the price of the TaV.
(2)
In order to maximize economic benefits, we should minimize offloading cost. With the aim of minimizing cost function of TaVi, the following optimization problem is formulated:(13)minfijpi∑j=1Nfijs.t.C1:fij≥0C2:fimin<∑j=1Nfij≤fimaxC3:Pmin≤pi≤Pmax,where C2 means that the total computing resources provided by SeVs are larger than the minimum required resources fimin, but it is smaller than the maximum required resources fimax. C3 indicates that the bids of TaVs are larger than the lowest price Pmin, but it is smaller than the highest price Pmax.


## 3.2. TaV Pricing Rules

This section defines the concept of “pricing” for tasks by their service requirements, for the purpose of solving the problem of resource allocation. The pricing function is used to classify tasks requested by TaVs and further distinguish the priority of tasks. The definition of the pricing function of the TaVs task mainly involves two factors, namely, the urgency of the task and the network conditions around the TaV. Accordingly, the pricing of the TaV is obtained by the urgency of the task and the network status around the TaV. Then, the urgency of the task is related to the size of the task generated by the TaV and the deadline of the task. The network condition around the TaV is related to the number of requests received and the number of answers received in the previous slot.


### 3.2.1. Distribution of the Number of Vehicles within the TaV Coverage

Owing to the stability of the network, the network condition of the previous and the next moment is unchanged. Suppose that TaVi and SeV j are randomly distributed on the road. Then, it is known that the TaV kk=i receives Rk requests and Sk responses at the previous time. According to the conditional probability, the distribution function of the number of TaVs mk and the distribution function of the number of SeVs nk in the coverage area is obtained.
(a)
Distribution function of the number of TaVsmk within the coverage of TaV k is expressed as follows:(14)PmkRk=Pmk,RkPRk=Pmk,Rk∑mk=Rk∞Pmk,Rk=CmkRkP1Rk1−P1mk−Rk∑mk=Rk∞CmkRkP1Rk1−P1mk−Rk,where (mk, Rk) indicates that there are totally mk TaVs within the coverage of TaV k, among which TaV k receives Rk requests, and P1 indicates the probability of any TaV sending out requests.
(b)
Distribution function of the number of SeVsnk within the coverage of TaV k is expressed as follows:(15)PnkSk=Pnk,SkPSk=Pnk,Sk∑nk=Sk∞Pnk,Sk=CnkSkP2Sk1−P2nk−Sk∑nk=Sk∞CnkSkP2Sk1−P2nk−Sk,where (nk, Sk) means there are a total of nk SeVs within the coverage of TaV k, among which TaV k receives Sk responses, and P2 means the probability that any SeV will respond to a TaV after receiving it.


### 3.2.2. Average Number of Vehicles within the Coverage of TaVk

(a)
The average number of TaVs within the coverage of TaVk is expressed as follows:(16)Emk=∑mk=Rk∞mkPmkRk(b)
The average number of SeVs within the coverage of TaVk is expressed as follows:(17)Enk=∑nk=Sk∞nkPnkSk


### 3.2.3. Remaining Resources within the Coverage of TaVk

Suppose that the resource requirements of each TaV obey the normal distribution ofQ1~μ1,δ12 and the resources provided by each SeV obey the normal distribution of Q2~μ2,δ22, the remaining resources around TaV k obtained by (16) and (17) are expressed as follows:
(18)Qk=EnkQ2−EmkQ1.On account of the independence ofQ1 and Q2, we can obtain the mean and variance value of Qk:
(19)EQk=Enkμ2−Emkμ1,(20)DQk=Enk2δ22−Emk2δ12.According to (19) and (20), we can get the distribution of the remaining resources Qk. In other words, a new normal distribution is expressed as follows:
(21)FQk=12πDQk∫−∞Qke−t−EQk2/2DQk.


### 3.2.4. Initial Pricing of TaVk

According to (21), the remaining resources covered by TaV k are expressed as follows:
(22)EQk=Enkμ2−Emkμ1.The initial pricing of TaVk [21] is
(23)Pk=λkPmid−Pmin+Pmin,EQk≥0,−λkPmax−Pmid+Pmid,EQk<0,(24)λk=2πarctanfkminEQk,where fkmin means the minimum resources obtained by TaV k, fkmin=dk/Tkdeadline. From the pricing function, we can see that when the surrounding remaining resources are greater than zero, the price will be raised by the lowest price; otherwise, the price will be raised by the middle price.After getting the best initial pricing, we develop a distributed resource allocation algorithm. The algorithm dynamically changes the price of the TaV to ensure the maximum utility of the SeV, and the TaV can obtain resources to meet its needs. The algorithm is introduced in detail in Algorithm1. Firstly, the TaV sends the business request (including the price); meanwhile, all vehicles within the coverage of the TaV will receive the request message. Then, the SeV that received the request message maximizes its utility to obtain the size of computing resources that can be provided (Steps 4-14 of Algorithm 1). Next, the SeV sends a response (resources that the SeV can be provided) to the TaV; meanwhile, the TaV receives the response and adds up resources provided by SeVs. Finally, if the sum of the total resources provided is greater than the maximum resource demand of the TaV, the price will be reduced; otherwise, the price will be increased if the total resources provided are less than the minimum resource demand of the TaV. Otherwise, the price is the optimal price, and the optimal resource allocation result of the SeV is obtained (Steps 15-30 of Algorithm 1).Algorithm 1: Distributed resource allocation algorithm.
1: Initialization: The cost priceccj of the SeV j and the maximum resource it can provide are Fjmax; the TaV i the required computing resource is fimin<fi≤fimax2: For t=0, TaVi to set the price pit, and send it to the vehicles within the coverage3:fort=1,2,3.⋯do4:fori=1,2,⋯,Mdo5:   forj=1,2,⋯,Ndo6:    According to∂V/∂fij=0, compute fij7:fork=1:ido8:a=a+fkj9:end for10:Ifa>Fjmaxthen11:fij=012:end if13end for14:end for15:If∑j=1Nfij≥fimaxthen16:   decrease the price,pit+1=pit−v17:else18:if∑j=1Nfij≤fiminthe19:    increase the price,pit+1=pit+v20:else21:pit+1=pit22:end if23:Ifpit+1==pitthen24:    break25:else26:    report the new pricepit+127:    back to 328:end if29:end if30:end for


## 3.2.1. Distribution of the Number of Vehicles within the TaV Coverage

Owing to the stability of the network, the network condition of the previous and the next moment is unchanged. Suppose that TaVi and SeV j are randomly distributed on the road. Then, it is known that the TaV kk=i receives Rk requests and Sk responses at the previous time. According to the conditional probability, the distribution function of the number of TaVs mk and the distribution function of the number of SeVs nk in the coverage area is obtained.
(a)
Distribution function of the number of TaVsmk within the coverage of TaV k is expressed as follows:(14)PmkRk=Pmk,RkPRk=Pmk,Rk∑mk=Rk∞Pmk,Rk=CmkRkP1Rk1−P1mk−Rk∑mk=Rk∞CmkRkP1Rk1−P1mk−Rk,where (mk, Rk) indicates that there are totally mk TaVs within the coverage of TaV k, among which TaV k receives Rk requests, and P1 indicates the probability of any TaV sending out requests.
(b)
Distribution function of the number of SeVsnk within the coverage of TaV k is expressed as follows:(15)PnkSk=Pnk,SkPSk=Pnk,Sk∑nk=Sk∞Pnk,Sk=CnkSkP2Sk1−P2nk−Sk∑nk=Sk∞CnkSkP2Sk1−P2nk−Sk,where (nk, Sk) means there are a total of nk SeVs within the coverage of TaV k, among which TaV k receives Sk responses, and P2 means the probability that any SeV will respond to a TaV after receiving it.


## 3.2.2. Average Number of Vehicles within the Coverage of TaVk

(a)
The average number of TaVs within the coverage of TaVk is expressed as follows:(16)Emk=∑mk=Rk∞mkPmkRk(b)
The average number of SeVs within the coverage of TaVk is expressed as follows:(17)Enk=∑nk=Sk∞nkPnkSk


## 3.2.3. Remaining Resources within the Coverage of TaVk

Suppose that the resource requirements of each TaV obey the normal distribution ofQ1~μ1,δ12 and the resources provided by each SeV obey the normal distribution of Q2~μ2,δ22, the remaining resources around TaV k obtained by (16) and (17) are expressed as follows:
(18)Qk=EnkQ2−EmkQ1.On account of the independence ofQ1 and Q2, we can obtain the mean and variance value of Qk:
(19)EQk=Enkμ2−Emkμ1,(20)DQk=Enk2δ22−Emk2δ12.According to (19) and (20), we can get the distribution of the remaining resources Qk. In other words, a new normal distribution is expressed as follows:
(21)FQk=12πDQk∫−∞Qke−t−EQk2/2DQk.


## 3.2.4. Initial Pricing of TaVk

According to (21), the remaining resources covered by TaV k are expressed as follows:
(22)EQk=Enkμ2−Emkμ1.The initial pricing of TaVk [21] is
(23)Pk=λkPmid−Pmin+Pmin,EQk≥0,−λkPmax−Pmid+Pmid,EQk<0,(24)λk=2πarctanfkminEQk,where fkmin means the minimum resources obtained by TaV k, fkmin=dk/Tkdeadline. From the pricing function, we can see that when the surrounding remaining resources are greater than zero, the price will be raised by the lowest price; otherwise, the price will be raised by the middle price.After getting the best initial pricing, we develop a distributed resource allocation algorithm. The algorithm dynamically changes the price of the TaV to ensure the maximum utility of the SeV, and the TaV can obtain resources to meet its needs. The algorithm is introduced in detail in Algorithm1. Firstly, the TaV sends the business request (including the price); meanwhile, all vehicles within the coverage of the TaV will receive the request message. Then, the SeV that received the request message maximizes its utility to obtain the size of computing resources that can be provided (Steps 4-14 of Algorithm 1). Next, the SeV sends a response (resources that the SeV can be provided) to the TaV; meanwhile, the TaV receives the response and adds up resources provided by SeVs. Finally, if the sum of the total resources provided is greater than the maximum resource demand of the TaV, the price will be reduced; otherwise, the price will be increased if the total resources provided are less than the minimum resource demand of the TaV. Otherwise, the price is the optimal price, and the optimal resource allocation result of the SeV is obtained (Steps 15-30 of Algorithm 1).Algorithm 1: Distributed resource allocation algorithm.
1: Initialization: The cost priceccj of the SeV j and the maximum resource it can provide are Fjmax; the TaV i the required computing resource is fimin<fi≤fimax2: For t=0, TaVi to set the price pit, and send it to the vehicles within the coverage3:fort=1,2,3.⋯do4:fori=1,2,⋯,Mdo5:   forj=1,2,⋯,Ndo6:    According to∂V/∂fij=0, compute fij7:fork=1:ido8:a=a+fkj9:end for10:Ifa>Fjmaxthen11:fij=012:end if13end for14:end for15:If∑j=1Nfij≥fimaxthen16:   decrease the price,pit+1=pit−v17:else18:if∑j=1Nfij≤fiminthe19:    increase the price,pit+1=pit+v20:else21:pit+1=pit22:end if23:Ifpit+1==pitthen24:    break25:else26:    report the new pricepit+127:    back to 328:end if29:end if30:end for


## 4. Task Allocation of Vehicular Cloud System

This section is aimed at solving the problem of task allocation of the VC system. Because the second-derivative ofU for dij in equation (5) can be obtained ∂2U/∂dij2<0, the objective function of optimization problem P1 is the concave function of variable dij. Since the constraints C1, C2, C3, and C4 in P1 are all convex sets, the optimization problem P1 is a convex optimization problem. In the end, the optimal dij is obtained by Lagrange theory.The Lagrangian function of optimization problem P1 is defined as follows (without consideringdij≥0):
(25)Ldij,ϖ,σ,ψ=U+∑i=1M∑j=1NϖijTideadline−dijRij−κdijfij+∑i=1Mσidi−∑j=1Ndij+∑i=1M∑j=1NψijTijre−dijRij−κdijfij,where ϖ, σ, ψ are the Lagrangian multipliers.According to the original optimization problem P1, a Lagrangian dual problem can be obtained as follows:(26)P2:minϖij,δi,ψijmaxdijLdij,ϖ,δ,ψ.For the optimization problem P2, it can be decomposed into a maximum task assignment problem and a minimum Lagrangian factor update problem, which can then be solved through iteration. The maximized part of the optimization problem P2 is expressed as follows:(27)P21:maxdijLϖ,σ,ψ.Since the optimization problem P1 is a convex optimization problem, according to the KKT condition, the optimal solution of the optimization problem P21 is equal to the optimal solution of the optimization problem P1. By solving equation∂Lϖ,σ,ψ/∂dij=0 and considering constraint dij≥0, the optimal task assignment dij is obtained as follows:
(28)dij=0,dij≤0,αln2χ+1/Rij+k/fijϖij+ψij+δi−1,dij>0.The Lagrange multipliers updating problem of P2 is expressed as(29)P22:minϖij,σi,ψijLdij,ϖ,σ,ψ.It can be seen from the above analysis that P22 is also a convex problem, so the gradient descent method is used to update the Lagrangian multipliersϖij,σi,ψij, and the Lagrangian multipliers ϖij,σi,ψij are all nonnegative real numbers.We denoteϖijt,σit,ψijt as the Lagrangian multipliers of the tth iteration, and then, the Lagrange multipliers ϖijt+1,σit+1,ψijt+1 of the t+1th iteration can be obtained as follows:
(30)ϖijt+1=max0,ϖijt−τtTimax−dijRij−cijfij,(31)ψijt+1=max0,ψijt−τtTijre−dijRij−cijfij,(32)σit+1=max0,σit−τtdi−∑j=1Ndij,where τt=τ0/t is the tth update step length. In order to ensure the convergence of the algorithm, this update step length [22] is considered.The task allocation algorithm can be divided into the following four steps: (1) Initialize the Lagrange multipliers. (2) According to the given Lagrange multipliers, solve the optimization problem P21 through KKT conditions to obtain the optimal task allocation result; update the Lagrange multipliers with the method in formula (30)–(32). (3) Get the task allocation result by the convergence condition of Lagrange function. (4) Judge whether the task has been completely allocated; if it has been completely allocated, return the allocation result; otherwise, judge whether the remaining unallocated task can be executed locally. If possible, the rest of the tasks are executed locally and the task assignment results are returned. Otherwise, the task cannot be completed on time, and the task assignment will fail. In Algorithm 2, the task allocation algorithm will be described in detail.


## 5. Numerical Results

The numerical results given in this section show that the proposed algorithm improves the resource utilization and total task completion ratio in the VC system. We evaluate and compare the effects of different vehicle speed, vehicle density, task size, and number of TaVs on the performance of the proposed scheme and other baseline schemes. We will compare the proposed resource allocation scheme in this paper (PRAS) with two benchmark schemes, including (i) LCS (Lowest Cost Scheme): the server bids by the network conditions, and the buyer always chooses the server with the lowest unit price, and (ii) HRS (Highest Revenue Scheme): the buyer bids by resource requirements, and the server always provides services to the buyer with the highest unit bid. In addition, the proposed offloading scheme in this paper (POS) is compared with the benchmark scheme by three different comparison methods: (i) LPS (Local Processing Scheme); (ii) AOS (Average Offloading Scheme): TaVs distribute tasks to the surrounding SeVs equally; and (iii) UOS (Unified Offloading Scheme): TaVs consider its own computing resources and assign the task equally to the surrounding SeVs and itself.In this paper, the MATLAB simulation platform is used to verify the proposed algorithm. Vehicles are randomly distributed to a two-way lane with a length of 1000 m and a width of 50 m. Furthermore, the computation capacity and task size of the vehicle follow normal distribution. Relevant simulation parameters are given in Table1.Algorithm 2: Task assignment algorithm based on Lagrange theory.
Require:α, di, χEnsure:dij, ∀d1: Definet for counting iteration, initialize t = 0, define ε as convergence threshold2: Initializationϖij,σj,ψij3: According toϖij,σj,ψij and (28), compute dij4: According to (25), compute Ldij∗t,ϖt,σt,ψt , let Lt=Ldij∗t,ϖt,σt,ψt5: According to (30)(31)(32), compute ϖijt+1,σjt+1, ψijt+16: According to (25), compute Ldij∗t,ϖt,σt,ψt, let Lt=Ldij∗t,ϖt+1,σt+1,ψt+17:whileLt+1−Lt>εdo8:  According toϖijt+1,σjt+1,ψijt+1, compute dijt+19:Lt=Lt+110:dij∗t=dij∗t+111:  Repeat steps 5, 612:t=t+113:if∑j=1Ndij∗~=dithen14:di0∗=di−∑j=1Ndij∗15:ifTi0≤Timaxthen16:di0∗ and dij∗17:else18:di0∗=0 and dij∗=019:end if20:else21:di0∗=0 and dij∗22:end if23:end whileTable 1
Simulation parameter.
ParameterValuev80−120 km/hZ300 mR5 MbTmax1~3 sFjmaxN4∗1010,0.5∗1010 (CPU cycle/s)fiN2∗1010,1∗109 (CPU cycle/s)d3,7 (Mb)k [15]18000 cycles/bitM+N20−30


### 5.1. Effect of the Number of TaVs

Figure2(a) shows resource utilization for different algorithms when the number of TaVs varies from 10 to 20, where the resource utilization ratio is equal to the ratio of the resources used by TaVs to the total resources of SeVs in the system. It is observed from Figure 2(a) that the resource utilization monotonically increases with the number of TaVs, and the growth rate gradually decreases; in other words, increasing the number of TaVs from 10 to 14 makes more TaVs benefit from the resources of SeVs than that from 16 to 20. The reason is that the available resources are no longer enough to respond to the requests of new TaVs with limited computation resources. As a result, the resource utilization gradually increased slowly. Furthermore, it can also be observed that PRAS can obtain higher resource utilization than HRS and LCS. When the number of TaVs is more, it can better reflect the superiority of PRAS. This is because the number of TaVs increases, and the more TaVs compete for limited computing resources, the probability of successful acquisition of resources by TaVs is reduced. For the sake of obtaining better resource utilization, compared with HRS and LCS, PRAS further optimizes the network status and DiffServ of different tasks based on resource allocation. In other words, PRAS adopts a differentiated pricing strategy. Compared with HRS which only considers network condition and LCS which only considers its own condition, PRAS considers the condition of the TaV, including whether the TaV has urgent tasks and whether the network around the TaV is busy. Therefore, the total resource utilization rate of the network is improved. In addition, when the number of TaVs is less than 12, the HRS and PRAS have the same resource utilization as the computing resources are sufficient and both two algorithms can provide the resources required for TaVs.Figure 2
(a) Resource allocation versus the number of TaVs. (b) Task completion ratio versus the number of TaVs.
(a)(b)Figure2(b) depicts the task completion ratio of different algorithms where the number of TaVs varies from 10 to 20, where the task completion ratio is equal to the number of tasks successfully completed within the deadline over the total number of tasks in the system. It can be seen from Figure 2(b) that POS can achieve a relatively higher task completion ratio compared with the three baseline schemes. This is because UOS and AOS do not consider mobility of vehicles and task deadline constraints. However, the proposed scheme jointly optimizes mobility of vehicles and the deadline of the task, which is conducive to making full use of resources. Hence, more tasks can be offloaded and task completion is significantly increased. In addition, since LPS does not consider the choice of SeVs, the increase in the number of TaVs does not affect the task completion ratio of LPS.Figure3 shows the price for different task sizes of the TaV when the number of TaVs varies from 10 to 20. It is observed from Figure 3 that the price monotonically increases with the number of TaVs, and the price also monotonically increases with task size. The reason is that increasing the size of tasks and the number of TaVs will reduce the TaV surrounding idle resources. The price function of the TaV is a piecewise function of the surrounding remaining resources. When the remaining resources of the TaV are greater than zero, the price is increased based on the lowest price. When the remaining resources around the TaV are greater than zero, the price is increased based on the middle price.Figure 3
Price versus the number of TaVs.


### 5.2. Effect of Vehicle Density

Figure4 shows the resource utilization and task completion ratio of the VC system versus the vehicle density. Numerical results demonstrate that vehicle density is inversely related to resource utilization and positively related to the task completion ratio. This is because the number of SeVs increases with increasing vehicle density, and resource utilization decreases due to the constant number of TaVs. Moreover, with the increase in the number of SeVs, there will be more available resources around TaVs and more computation tasks can be offloaded to SeVs, which will lead to the improvement of the task completion ratio. On the contrary, when the vehicle density in the system is constant, the resource utilization increases and the task completion ratio decreases with the increase of the number of TaVs. As the number of TaVs increases, more TaVs compete for limited resources, which will lead to the increase in resource utilization. The reason is that when the number of TaVs increases to a certain extent, the resources of SeVs are fully utilized but still cannot meet resources required for the excessive growth of the number of TaVs. In the end, the size of total offloading is no longer changed and the task completion ratio is reduced.Figure 4
(a) Resource allocation versus vehicle density. (b) Task completion ratio versus vehicle density.
(a)(b)


### 5.3. Effect of TaV Speed

Here, we make comparison of TaV speed performance under different schemes. Figure5 shows offloading utility and task completion ratio for different algorithms when TaV speed varies from 80 km/h to 120 km/h. It can be concluded that the task completion ratio and offload utility of POS, UOS, AOS, and LPS all decrease with increasing speed from Figures 5(a) and 5(b). As the speed of TaVs increases, the contact time between TaVs and SeVs becomes shorter, and the size of offloading task data decreases. Therefore, the offloading utility and task completion ratio decrease. Then, by comparing POS with other schemes, it can be seen that the task completion ratio and offload utility of POS are optimal. This is because POS optimizes the mobility of vehicles, the deadlines of TaVs, local computing resources of TaVs, and the service differentiation of different types of tasks. The resource allocation is superior to other schemes, and task allocation is also more reasonable than other schemes. Hence, the task completion ratio and offloading utility of POS are superior to other solutions. In addition, with the decrease of the task size processed by SeVs, the task offloading time is shortened and the success rate of task offloading is increased accordingly. What is more, since the choice of SeVs is not considered, LPS is not sensitive to the increase of speed on the task completion ratio of LPS.Figure 5
(a) Offloading utility versus TaV speed. (b) Task completion ratio versus TaV speed.
(a)(b)


### 5.4. Effect of Task Size

Figure6(a) shows offloading utility versus the task size of TaVs. Numerical results demonstrate that task size is positively related to offloading utility. The numerical results show that when the task size is less than 4 Mb, the offloading utility of AOS is optimal and the offloading utility of POS is close to UOS. Since POS and UOS process a part of tasks locally, the size of offloading tasks is reduced, resulting in lower offloading utility than AOS. Moreover, it can be seen from Figure 6(a) that when the sizes of tasks are greater than 4 Mb, the offloading utility of POS is the highest. It can also be obtained that with the increase of task size of TaVs, the offloading utility of POS, HRS, and LCS first increases rapidly and then slowly increases. This is because the number of SeVs remains unchanged. When the task size of TaVs begins to increase, the offloading utility increases rapidly. However, with the increase of the size of the task to a certain extent, the resources of SeVs are fully utilized, which still cannot meet the resource requirements of the excessive increase in TaVs’ task size, so the growth trend of offloading utility gradually slows down.Figure 6
(a) Offloading utility versus task size. (b) Task completion ratio versus task size.
(a)(b)We also compare the task completion ratio in terms of the task size in Figure6(b). It is interesting to see that the task completion ratio decreases with the increase of the task size. The reason is that as the sizes of the tasks processed by each vehicle increases, the risk of task exceeding the deadline also increases due to the constant deadline. As a result, the task completion rate is reduced. In addition, it can be seen that the UOS and AOS methods do not take the task processing time beyond the deadline into account, which results in the task offloading success rate lower than the POS, and the task completion rate is lower than the POS. What is more, LPS is executed locally without computational offloading, so it takes more time than the offloading mode.


## 5.1. Effect of the Number of TaVs

Figure2(a) shows resource utilization for different algorithms when the number of TaVs varies from 10 to 20, where the resource utilization ratio is equal to the ratio of the resources used by TaVs to the total resources of SeVs in the system. It is observed from Figure 2(a) that the resource utilization monotonically increases with the number of TaVs, and the growth rate gradually decreases; in other words, increasing the number of TaVs from 10 to 14 makes more TaVs benefit from the resources of SeVs than that from 16 to 20. The reason is that the available resources are no longer enough to respond to the requests of new TaVs with limited computation resources. As a result, the resource utilization gradually increased slowly. Furthermore, it can also be observed that PRAS can obtain higher resource utilization than HRS and LCS. When the number of TaVs is more, it can better reflect the superiority of PRAS. This is because the number of TaVs increases, and the more TaVs compete for limited computing resources, the probability of successful acquisition of resources by TaVs is reduced. For the sake of obtaining better resource utilization, compared with HRS and LCS, PRAS further optimizes the network status and DiffServ of different tasks based on resource allocation. In other words, PRAS adopts a differentiated pricing strategy. Compared with HRS which only considers network condition and LCS which only considers its own condition, PRAS considers the condition of the TaV, including whether the TaV has urgent tasks and whether the network around the TaV is busy. Therefore, the total resource utilization rate of the network is improved. In addition, when the number of TaVs is less than 12, the HRS and PRAS have the same resource utilization as the computing resources are sufficient and both two algorithms can provide the resources required for TaVs.Figure 2
(a) Resource allocation versus the number of TaVs. (b) Task completion ratio versus the number of TaVs.
(a)(b)Figure2(b) depicts the task completion ratio of different algorithms where the number of TaVs varies from 10 to 20, where the task completion ratio is equal to the number of tasks successfully completed within the deadline over the total number of tasks in the system. It can be seen from Figure 2(b) that POS can achieve a relatively higher task completion ratio compared with the three baseline schemes. This is because UOS and AOS do not consider mobility of vehicles and task deadline constraints. However, the proposed scheme jointly optimizes mobility of vehicles and the deadline of the task, which is conducive to making full use of resources. Hence, more tasks can be offloaded and task completion is significantly increased. In addition, since LPS does not consider the choice of SeVs, the increase in the number of TaVs does not affect the task completion ratio of LPS.Figure3 shows the price for different task sizes of the TaV when the number of TaVs varies from 10 to 20. It is observed from Figure 3 that the price monotonically increases with the number of TaVs, and the price also monotonically increases with task size. The reason is that increasing the size of tasks and the number of TaVs will reduce the TaV surrounding idle resources. The price function of the TaV is a piecewise function of the surrounding remaining resources. When the remaining resources of the TaV are greater than zero, the price is increased based on the lowest price. When the remaining resources around the TaV are greater than zero, the price is increased based on the middle price.Figure 3
Price versus the number of TaVs.


## 5.2. Effect of Vehicle Density

Figure4 shows the resource utilization and task completion ratio of the VC system versus the vehicle density. Numerical results demonstrate that vehicle density is inversely related to resource utilization and positively related to the task completion ratio. This is because the number of SeVs increases with increasing vehicle density, and resource utilization decreases due to the constant number of TaVs. Moreover, with the increase in the number of SeVs, there will be more available resources around TaVs and more computation tasks can be offloaded to SeVs, which will lead to the improvement of the task completion ratio. On the contrary, when the vehicle density in the system is constant, the resource utilization increases and the task completion ratio decreases with the increase of the number of TaVs. As the number of TaVs increases, more TaVs compete for limited resources, which will lead to the increase in resource utilization. The reason is that when the number of TaVs increases to a certain extent, the resources of SeVs are fully utilized but still cannot meet resources required for the excessive growth of the number of TaVs. In the end, the size of total offloading is no longer changed and the task completion ratio is reduced.Figure 4
(a) Resource allocation versus vehicle density. (b) Task completion ratio versus vehicle density.
(a)(b)


## 5.3. Effect of TaV Speed

Here, we make comparison of TaV speed performance under different schemes. Figure5 shows offloading utility and task completion ratio for different algorithms when TaV speed varies from 80 km/h to 120 km/h. It can be concluded that the task completion ratio and offload utility of POS, UOS, AOS, and LPS all decrease with increasing speed from Figures 5(a) and 5(b). As the speed of TaVs increases, the contact time between TaVs and SeVs becomes shorter, and the size of offloading task data decreases. Therefore, the offloading utility and task completion ratio decrease. Then, by comparing POS with other schemes, it can be seen that the task completion ratio and offload utility of POS are optimal. This is because POS optimizes the mobility of vehicles, the deadlines of TaVs, local computing resources of TaVs, and the service differentiation of different types of tasks. The resource allocation is superior to other schemes, and task allocation is also more reasonable than other schemes. Hence, the task completion ratio and offloading utility of POS are superior to other solutions. In addition, with the decrease of the task size processed by SeVs, the task offloading time is shortened and the success rate of task offloading is increased accordingly. What is more, since the choice of SeVs is not considered, LPS is not sensitive to the increase of speed on the task completion ratio of LPS.Figure 5
(a) Offloading utility versus TaV speed. (b) Task completion ratio versus TaV speed.
(a)(b)


## 5.4. Effect of Task Size

Figure6(a) shows offloading utility versus the task size of TaVs. Numerical results demonstrate that task size is positively related to offloading utility. The numerical results show that when the task size is less than 4 Mb, the offloading utility of AOS is optimal and the offloading utility of POS is close to UOS. Since POS and UOS process a part of tasks locally, the size of offloading tasks is reduced, resulting in lower offloading utility than AOS. Moreover, it can be seen from Figure 6(a) that when the sizes of tasks are greater than 4 Mb, the offloading utility of POS is the highest. It can also be obtained that with the increase of task size of TaVs, the offloading utility of POS, HRS, and LCS first increases rapidly and then slowly increases. This is because the number of SeVs remains unchanged. When the task size of TaVs begins to increase, the offloading utility increases rapidly. However, with the increase of the size of the task to a certain extent, the resources of SeVs are fully utilized, which still cannot meet the resource requirements of the excessive increase in TaVs’ task size, so the growth trend of offloading utility gradually slows down.Figure 6
(a) Offloading utility versus task size. (b) Task completion ratio versus task size.
(a)(b)We also compare the task completion ratio in terms of the task size in Figure6(b). It is interesting to see that the task completion ratio decreases with the increase of the task size. The reason is that as the sizes of the tasks processed by each vehicle increases, the risk of task exceeding the deadline also increases due to the constant deadline. As a result, the task completion rate is reduced. In addition, it can be seen that the UOS and AOS methods do not take the task processing time beyond the deadline into account, which results in the task offloading success rate lower than the POS, and the task completion rate is lower than the POS. What is more, LPS is executed locally without computational offloading, so it takes more time than the offloading mode.


## 6. Conclusion

In this paper, we investigate the joint task offloading and resource allocation mechanism in the VC system and maximize the total offloading revenue of tasks under the constraints of task completion deadlines and rapid vehicle movement characteristics. Considering the different types of services required by tasks in VC, this paper proposes a resource allocation model based on differentiated services and designs the pricing function of a task. Its pricing relies on the size of the task, the deadline for the task, and the number of requests and responses received by the vehicle that generated the task in the previous time slot. Furthermore, considering the mobility of vehicles, the deadline of tasks, and the limited computing resources, the centralized Lagrange dual method is used to solve the task offloading problem of the VC system. The simulation results show that the optimization effect of DiffServ offloading strategy is significantly improved, and the resource utilization and task completion ratio are significantly increased.



---

*Source: 8823173-2020-11-02.xml*