# Adaptive Resource Allocation of Vehicles under Dynamic Environment

Authors: Lei Du; Ru Huo; Chuang Sun; Shuo Wang; Jie Guo; Tao Huang
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

With the rapid development of the Internet of Vehicles (IoV), the capabilities and intelligence of vehicles are rapidly increasing, which will have the potential to support a large number of services for the users of vehicles. However, taking into account the mobility of the vehicle, how to combine the computing resources from nearby vehicles with high mobility and RSUs to provide services collaboratively is a crucial problem. In this paper, we propose an adaptive allocation scheme of computing resources to allocate the resources more reasonably. First, the vehicular mobility model is built to predict the trajectory of vehicles. Second, the sub-networks to execute the V2V communication are constructed according to the prediction of trajectory. Third, the allocation of computing resources from nearby vehicles and RSUs is formulated as an optimization problem and the intelligent optimization algorithm is employed to deal with it. The relative experiments are conducted to verify the effectiveness of the proposed method.


---

## Body

## 1. Introduction

With the rapid development of urban transportation, the quantity of vehicles has increased dramatically and the road conditions are becoming increasingly complicated. To address with these challenges, the Internet of Vehicles (IoV) and related technologies emerge. The IoV is a network that interconnects pedestrians, cars, and parts of urban infrastructure with the support of advanced information technologies [1] [2]. It uses various sensors, software, in-built hardware, and types of connection to enable reliable and continuous communication. As a part of a smart city, IoV strives to make transportation more autonomous, safe, fast, and efficient, reducing resource waste and detrimental impacts on the environment [3] [4]. Simultaneously, the IoV can provide users with many mobile computing services, such as driving assistance applications, and AR/VR applications. Providing computing services need a large number of computing resources, and some applications have high real-time requirements. However, the computing resources of the vehicle itself are limited, and it is difficult to meet the computing requirements.In the IoV, roadside units (RSU) are usually deployed with edge servers, which possess rich computing and storage resources [5]. Some scholars have proposed many related task offloading strategies and methods on the IoV [6–9]. The main principle is to offload tasks to the RSUs equipped with edge servers. However, due to the heterogeneity of vehicles and onboard tasks, there is usually an unbalanced load among vehicles. Therefore, some vehicles may have surplus computing and storage resources. Making use of communication technologies such as wireless networks, the onboard tasks which waiting to be executed could be offloaded to the edge side RSU and neighboring vehicles with idle computing resources. In this way, the computing resources in RSU and neighboring vehicles are allocated, and the utilization of edge system resources and the quality of computing service are improved. The architecture of vehicular edge computing (VEC) is proposed to address with communication problem in IoV [10]. The vehicle-to-vehicle (V2V) is utilized for communications among vehicles. The vehicle-to-infrastructure (V2I) is utilized for communications between vehicles and RSUs. The wired link is utilized for communications among RSUs. The computing architecture can provide users with low-latency, low-energy, and high-reliability computing services by integrating and utilizing computing resources on neighboring vehicles and RSUs.However, there are still some technical problems in the IoV. First, the high-speed mobility of vehicles will cause real-time changes in the location of the vehicle, which results in a complex and changeable communication environment. For example, the high mobility of vehicles will cause frequent switching of V2I or V2V communications. In addition, when data is transmitted via V2I or V2V, the high mobility of the vehicle will cause the link to be unstable and cause data loss. In addition, the unbalanced geographical distribution of vehicles and their high-speed mobility also bring great challenges for resource allocation of edge systems. Second, users will generate a lot of data or application requests. Due to different request types and requirements, the computing and storage resources of edge devices are different, and communication and network resources are different. Therefore, to improve resource utilization and quality of service (QoS), effective edge resource allocation is required.Combining the above two considerations, in this paper, we propose a cooperative adaptive scheme of resource allocation, in which the task vehicles and multiple service providers (including service vehicles and RSUs) jointly execute the onboard tasks. The vehicles which require services in this paper are called task vehicle, and the vehicles with idle computing resources are called service vehicle. Firstly, the mobility of the vehicles on the road is modeled and the trajectory of the vehicles is predicted. Secondly, constructing the resource subnetworks consist of vehicles based on the predicted trajectory. The resource subnetworks include resource-rich service vehicles near the task vehicles. Finally, the task vehicles connected to the RSU comprehensively consider the computing power and maximum service time of each service vehicle and decide the tasks assigned to each service vehicle or RSU to minimize the task execution time. Here, the maximum service time of each service vehicle and RSU depends on the relative movement of the task vehicles and the service providers. We must ensure that the task vehicles and each service provider are always within communication range of each other.The key contributions of this paper are summarized as follows:(i)
We consider modeling the mobility of vehicles with LSTM and social pooling. The vehicular mobility model (VMM) is constructed by analyzing the historical data of target vehicle driving and the interdependence of all vehicle motions in the road section, and it can predict the behavior and trajectory of the vehicles more dynamically and reasonably(ii)
According to the mobility of vehicles and division of road sections, we propose the construction of subnetworks which consists of computing resources from vehicles. The constructed subnetworks can effectively employ the idle resources in the vehicles(iii)
Taking into account the mobility of vehicles and joint allocation of computing resources in the vehicles and the RSUs, we propose an adaptive allocation scheme of computing resources (AASCR) from multiple service providers. The average response time of the tasks and the resource utilization rate of vehicles are regarded as two indicators, and the multiobjective optimization algorithm is employed to address with the allocation of computing resources. The experimental results show that the proposed scheme has reduced the average response time of the task and improved the resource utilization rate comprehensively compared with other approachesThe rest of this paper is organized as follows. In Section2, some related works on the tasks offloading and computing resources allocation in the IoV are presented. In Section 3, the proposed scheme of resources allocation is introduced in detail. In Section 4, the relative experiments are conducted to demonstrate the performance of the proposed approach. Section 5 presents the conclusion of this paper.


## 2. Related Work

Nowadays, the VEC can significantly reduce task latency, enabling latency-sensitive applications to run in real time [11]. Lots of scholars had proposed meaningful works on the tasks offloading and allocation of computing resources. VEC models widely employed to provide computing services are mainly divided into two types, one is the VEC model for offloading tasks via V2I, and the other is the VEC model for offloading tasks composed of V2I and V2V.Regarding the VEC model of offloading tasks via V2I, Zhou et al. [6] studied the problem of multiuser computing offloading on a single edge server, intending to shorten the completion time of virtual reality (VR) applications on the IoV. They divided the VR task into two subtasks so that the vehicle and the mobile edge computing (MEC) server can perform task calculations together. On this basis, they proposed an algorithm to jointly optimize the offload ratio, communication resources, and computing resource allocation. Du et al. [7] considered the cost of vehicles and edge servers. They formulated a bilateral optimization problem to minimize the cost of offloading both parties. On the vehicle side, the unloading decision and the local central processing unit (CPU) frequency are jointly optimized. On the edge server side, wireless resource allocation and service provision are considered at the same time. Different from the abovementioned research on a single edge server, Liu et al. [8] considered a scenario with multiple edge servers. They studied the problem of multivehicle computing and unloading in this scenario, to reduce the computing overhead of vehicles. Taking into account the coupling of vehicle unloading decisions, they employed game theory methods to make the best unloading decisions for the vehicle and select the appropriate channel. Zhang et al. [9] proposed a hierarchical cloud-based offloading framework in which multiple MEC servers can share a backup server to make up for their lack of computing resources. Then, the Stackelberg game method is used to obtain the optimal offloading strategy to maximize the revenue of the MEC server under the task delay constraint. Hou et al. [12] proposed the tasks offloading model based on the software defined network (SDN) and edge assistance, by integrating the computing resources of mobile edge computing nodes and fixed edge computing nodes to support computing-intensive and delay-sensitive applications.Regarding the VEC model for offloading tasks composed of V2I and V2V, Hung et al. [13] studied how to ensure low-latency communication in a V2V network with a V2I network as the underlying network. To solve this problem, based on the observation of vehicle data queues, this paper proposed an algorithm that focuses on the effective operation and resource redistribution of network associations, thereby avoiding the exchange of a large amount of control information and signaling, and reducing its delay. Truong et al. [14] combined fog computing and SDN and proposed a new vehicle self-organizing network. The network combines the excellent properties of SDN in terms of flexibility, expansion, and programming, the ability of SDN to learn global information, and the low-latency service of fog computing, thereby enhancing V2V and V2I communications and optimizing resource utilization rate and reduce service delay. Tang et al. [15] proposed a three-tier architecture based on mobile devices, vehicles, and RSUs for scheduling tasks from mobile devices. The goal is to use the computing resources of vehicles and RSUs to reduce task delay as much as possible. At the same time, this paper proposed a task scheduling algorithm based on greedy thinking, to optimize the total response time of tasks under the constraints of connection duration, computing resources, and budget. Raza et al. [16] proposed a mobile-aware partial task migration algorithm to reduce the total response time of the task. Ye et al. [17] proposed a hybrid fog computing architecture based on fog computing radio access network and vehicle fog computing to improve flexibility and data processing capabilities. This paper proposed an optimization algorithm based on deep learning to reduce task delay. Ma et al. [18] integrated the parked vehicles on and off the street into a parking cluster and proposed an algorithm for joint edge server selection and resource allocation to improve task migration performance. Huang et al. [19] proposed a task migration and resource allocation strategy that combines task types and vehicle speed perception to reduce vehicle energy consumption and task processing delay.Summarizing the above references, although many scholars have done a lot of work on vehicular task offloading and allocation of computing resources, there are still many disadvantages. First, during the process of tasks offloading and executing, the vehicles cannot stay still. Due to the movement of the vehicles, the task vehicles will be out of the communication ranges of RSUs and services vehicles. To maintain the stability of the service, the task vehicles are supposed to be within the communication range during the movement. Therefore, we consider modeling the mobility of vehicles to forecast traffic flow briefly. The mobility of vehicles is regarded as a crucial basis to allocate computing resources. Second, driving and moving vehicles will trigger the temporal and spatial migration of traffic flow and IoV services, thereby changing the adaptation relationship between traffic conditions and computing resources. Due to the high dynamic characteristics of the vehicle itself, the adaptation relationship between the IoV service and the allocation of computing resources becomes extremely complicated. Therefore, we proposed an adaptive allocation scheme to flexible and efficient schedule computing resources according to traffic flow and services requires. The limited computing resources can be dynamically matched with various services to support the corresponding service requirements.


### 2.1. Adaptive Allocation Scheme of Computing Resources

In this section, we will propose an adaptive allocation scheme of computing resources (AASCR) from multiple service providers. The scheme is introduced in six subsections, which are the structure of AASCR, vehicular mobility model, vehicular task model, communication system model, computation system model, and adaptive allocation scheme of computing resources.


### 2.2. Architecture Design of AASCR

In this paper, the scenario we consider is a straight section of urban road. As depicted in Figure1, the road in the scenario can be divided into multiple sections S=s1,s2,⋯,sm. S represents a set of sections, where sii=1,2,⋯,m represents one of the road sections, and m represents the quantity of road sections. The U=u1,u2,⋯,um represents the set of RSUs, where uii=1,2,⋯,m represents one of the RSUs. Every section si is within the coverage of RSU ui. Each RSU ui is equipped with an edge server and provides services for vehicles. The RSUs are interconnected through the Internet with wired links. Therefore, RSUs can communicate with each other through the infrastructure-to-infrastructure (I2I). When the vehicle is within the coverage of the RSU, the vehicle communicates with the RSU through the V2I via long-term evolution (LTE) protocol. Meanwhile, vehicles communicate with each other via V2V, which is implemented through the 802.11p protocol. We employ V=V1_1,V12,⋯,Vmn to represent the set of vehicles on the road, where Vii=1,2,⋯,m represents the set of vehicles on the section si, and Vijj=1,2,⋯,n represents the set of vehicles in the subnetworks of vehicular resources. Each subnetwork is a resources pool that executes V2V tasks, which is constructed based on the mobility of vehicles on the road section. Here, n is the quantity of subareas. We set vkk=1,2,⋯,o to represent each vehicle in the V, where o is the quantity of vehicles. In this scenario, V2V communication links are established among the vehicles in the subnetwork. At the same time, each vehicle establishes a V2I communication link with the corresponding RSUs on the road section to realize the communication between the vehicle and the RSU. It should be noted that vehicles between different subnetworks do not establish a V2V communication link. Therefore, vehicles between different subnetworks cannot directly communicate with each other.Figure 1
The architecture design of AASCR.There are main parameters and corresponding values in the AASCR listed in Table1.Table 1
List of crucial notations in AASCR.
ParameterValueSThe set of sections on the roadsiThe road sectionimThe quantity of road sectionUThe set of RSUsuiThe RSUiVThe set of vehicles on the roadViThe set of vehicles on the sectionsiVi_jThe set of vehicles on the subnetwork in sectionsivki_jThe vehicle in the subareaVi_joThe quantity of vehiclesThe vehicles in the same subnetwork will maintain the communication link until they travel to the next road section. In addition, when the task from the task vehicle is transferred to the RSUui, the task vehicles move out of the communication coverage area of the RSU ui during the execution of the tasks, and the result of the task will be forwarded by the RSU ui to the current RSU ui+1. Then, the current RSU ui+1 will send the result of the task to the task vehicle.


### 2.3. Vehicular Mobility Model

In AASCR, different vehicles are participating in the traffic, and their moving directions, angles, and speeds are distinct. To maintain the stability of V2V communication and better build subnetworks of resources, we propose the vehicular mobility model (VMM) to model and analyze the mobility of vehicles and predict the trajectory of the vehicles. Dividing the subnetworks according to the predicted trajectory will make task offloading more reasonable, thereby improving the efficiency and performance of the system.As shown in Figure2, a stationary reference coordinate is utilized to represent the position information of the vehicles in AASCR. The x-axis is the direction of road movement, and the y-axis is the position of the different lanes on the road. This allows our model to be independent of how the vehicle trajectory is acquired, especially in the case of onboard sensors for autonomous vehicles. This also makes the model independent of road curvature and can be applied anywhere on the highway as long as the vehicle-mounted lane estimation algorithm is available. The blue dotted lines in Figure 2(a) represent the trajectory of vehicles on the road. The red lines in Figure 2(b) represent the prediction of trajectory when the vehicle moves. The width of each lane is 3.5 m, and the length of each road section is 200 m.Figure 2
Mobility of the vehicles.
(a)
Trajectory of vehicles on the road(b)
Prediction of vehicular trajectoryWe set the historical trajectory of the vehicles as the input for the VMM. The historical trajectory of the vehicles on the road are represented inA=at−h,⋯,at−1,at, where at=x0t,y0t,x1t,y1t,⋯,xlt,ylt is the x and y coordinates of the vehicle being predicted and all the vehicles on the road, and h is the number of frames on the vehicular historical trajectory, and l is the quantity of vehicles on the road. The output of VMM is a probability distribution as B=bt+1,bt+2,⋯,bt+g, where bt+1=x0t+1,y0t+1 is the predicted coordinates of the vehicle, and g is the number of frames on the predicted trajectory. The conditional distribution in VMM is PB∣A, and it is depicted in
(1)PBA=∑iPΘBopi,APopiA,where Θ=Θt+1,Θt+2,⋯,Θt+g are the parameters of the binary Gaussian distribution for each time step in the future, corresponding to the mean and variance of the future position, and opii=1,2,⋯,nop represent the operations of vehicles on the road. We consider one kind of lateral operation and three kinds of longitudinal operations as conveyed in Figure 2(b). Lateral operation is the vehicle moves forward. Longitudinal operations include left and right lane changes and lane maintenance.The LSTM encoder is employed to learn the mobility of the vehicles. For each moment, the most recenth frames of the trajectory histories are inputted into the LSTM encoder to predict the target vehicle and all the nearby vehicles around it. In addition, although the LSTM encoder captures the mobility of the vehicles, it cannot capture the interdependence of all vehicle motions in the scene. Therefore, in order to solve this problem, we adopted social pooling [20] to pool the LSTM states of all predicted vehicles around the target vehicle into a social tensor. This is achieved by defining a spatial grid around the predicted target and filling the grid with LSTM states according to the spatial configuration of the vehicles in the scene. There is the structure of VMM in Figure 3.Figure 3
The structure of VMM.In Figure3, firstly, the LSTM encoder is used to learn the mobility of the vehicles; then, the social tensor is employed as the input of the model and coupled with the LSTM state of the predicted vehicle to improve the accuracy of future operation prediction. The model can now access the motion state of surrounding vehicles and their spatial configuration. Lastly, the LSTM-based decoder is used to generate the prediction distribution of the future motion of the next frame. We solve the inherent multimodality problem of driver operation by predicting the distribution for each of the above three kinds of operations and the probability of each operation. Using VMM, we can clearly predict the trajectory of the vehicle and construct more reasonable subnetworks.As the distances among vehicles or distances between vehicles and RSUs, we assume two devices have the coordinate, respectively, areco1=x1,y1 and co2=x2,y2. The distance Dis between co1 and co2 is obtained by
(2)Dis=x1−x22+y1−y22.There are main parameters and corresponding values in the VMM listed in Table2.Table 2
List of crucial notations in VMM.
ParameterValueAThe historical trajectory of the vehiclesatThex and y coordinates of the vehicleshThe number of frames on the vehicular historical trajectoryBThe output of VMMbt+1The predicted coordinates of the vehiclegThe number of frames on the predicted trajectoryPB∣AThe conditional distribution in VMMΘThe parameters of the binary Gaussian distributionopiThe operations of vehicles on the roadn_opThe quantity of operationsDisThe distances among vehicles or distances between vehicles and RSUsIn AASCR, some task vehicles will generate some onboard calculation tasks in certain periods. We denote these generated calculation tasks asR=r1,r2,⋯,rp, where ri represents one of the tasks and p is the quantity of tasks in certain periods. For each ri, we employ ri=rdi,cdi,ti,tvi,li,lri to represent the specific information about the onboard task, where rdi represent the size of raw data to execute the ri, which is the size of the data when task uploading, and cdi represents the size of result data about the task, which is the size of the data when results are downloaded, and ti represents the arrival time of ri. The tvi represents the task vehicle, and li represents the provider of computing resources, which could be RSU or service vehicle. The execution of ri need the computing resources from li, where tvi∈V and li∈U∪V. The lri will be set as 0 when the task is executed in RSU. Otherwise, it will be set as 1 if the task is executed in the service vehicle. In this paper, the computing resources of the vehicle are limited. Therefore, we set that a service vehicle can only handle one task.


### 2.4. Communication Model

In AASCR, the channel model of V2I and V2V communication is based on orthogonal frequency division multiplexing (OFDM). For V2I communication, each RSU can evenly divide the bandwidth into equal sizes, thereby realizing the simultaneous service of multiple vehicles. For V2V communication, one service vehicle can only serve one task vehicle at a time period. So, its bandwidth cannot be divided. In addition, we assume that there is no channel interference between different subnetworks. TheBwr is set as the channel bandwidth of V2I communication, and the Bwv is the channel bandwidth of V2V communication. Therefore, the channel bandwidth Bw of ri offloading is depicted in
(3)Bw=Bwr,lri=0,Bwv,lri=1.About the channel loss, we employclti,tvi,li represent the channel loss between tvi and li at the time t. The distance at the time t between tvi and li can be indicated as Disti,tvi,li. For V2V, the channel loss can be approximately equal to the determined path loss [21]. Therefore, clti,tvi,li can be obtained via
(4)clti,tvi,li=103.4+24.2log10Disti,tvi,li,lri=0,XDisti,tvi,li−α,lri=1.where X represents the path loss coefficient and α is the path loss exponent. We assume that the transmission power of each vehicle is the same and fixed. According to the Shannon theorem, at time ti, the uplink transmission rate tsrup of the tvi offload tasks to li can be obtained by
(5)tsruptvi,li,E=Bw∙log21+P∙clti,tvi,liN+∑P∙clti,e,li,where E represents the set of devices connected to li through the same wireless channel at the time ti and e∈E−tvi. N represents the white Gaussian noise.So, the time delayDiup of task ri upload is calculated via
(6)Diup=rditsruptvi,li,E.According to formulas (6) and (11), time point tif when the results of the task return from li to vehicle tvi is expressed as
(7)tif=ti+Diup+DiE.Therefore, the downlink transmission rate during the result of task return is depicted by(8)tsrdntvi,li,F=Bw∙log21+P∙cltif,tvi,liN+∑P∙cltif,tvi,f,where F represents the set of devices connected to tvi through the same wireless channel at the time tif, and f∈F−li. N represents the white Gaussian noise.So, the time delayDidn of task ri result download is calculated via
(9)Didn=rditsrdntvi,li,FThe communication delayDiud of ri, including the communication delay of offloading tasks and downloading calculation results, which can be defined in
(10)Diud=Diup+Didn.


### 2.5. Computation Model

In AASCR, there are three ways to perform tasks, tasks are executed locally, tasks are offloaded to the service vehicles in subnetwork, and tasks are offloaded to the RSUs. We set the computing power of vehicles as homogeneous.C represents the number of CPU cycles required for addressing with a bit of data. So, the CPU clock cycle required for the task is set as C∙rdi, and fr and fv, respectively, denote the CPU frequency of the edge server equipped in RSU and vehicle. Therefore, the computing delay DiE of ri can be formulated in
(11)DiE=C∙rdifr,lri=0,C∙rdifv,lri=1.


### 2.6. Adaptive Allocation Scheme

In AASCR, we assume that the tasks generated in each task vehicle are indivisible. The vehicle can perform at most one task at the same time. To evaluate the performance of the scheme regarding the allocation of computing resources, we consider the construction of subnetworks. The algorithm of subnetwork construction is as follows. Firstly, the VMM is prebuilt and trained with the track histories of the vehicles on the road. Secondly, during the construction of the subnetworks, the current and just past tracks of the vehicles are employed to predict the vehicle trajectories for a period of time in the future. Thirdly, the resource subnetworks are divided according to the predicted results and the location of the vehicle for a period of time in the future. The subnetworks are constructed reasonably through the algorithm and employed for resource allocation of task vehicles on the corresponding road section.Algorithm 1: The construction of subnetworks.
Input:vk: the vehicle in V on the road;A: the track histories.cck=xkt,ykt: the current coordinate of vk.pck=xkt+1,ykt+1: the predictive coordinate of vk.o: the quantity of vehicles;cri_j=sxi_j~exi_j,eyi_j~syi_j:The coordinate range of subareasi_j.Output: the subnetwork setVi_j of vehicles1:   Build the VMM;2:   Input track historiesA of V;3:   fori=1 to epoch do4:     Neural network training;5:    end for6:    fork=1 to o do7:      ifcck∈cri_j do8:Vi_j=Vi_j∪vk;9:      end if10:      Predicting the trajectory ofvk;11:      ifpck∈cri+1_j+1 do12:Vi+1_j+1=Vi+1_j+1∪vk;13:      end if14:   end for15:   returnVi_j.We can formulate the allocation scheme of computing resources as an optimization problem. According to the communication delay and computing delay, the average response time of the task is obtained via formula (12). The smaller response time indicates better performance of the method. So, the average response time can be regarded as one of the objective functions waiting for optimization.
(12)T_r=1p∑i=1pDiud+DiE.To further evaluate the performance of the allocation scheme, we designed another evaluation index. The resource utilization rate of vehicles is a crucial point for the allocation scheme, and it can reflect performance in terms of load. The resource utilization rate of vehicles is defined in(13)Ru=tvnV,where t_v are the tasks that execute with computing resources in vehicles and n_V is the quantity of vehicles on the road.So, the formulated problem can be depicted in(14)minT_r,maxR_u,e.t.lri∈0,1,li∈Vij\tvi∪ui.When a task arrives, the task is first offloaded to the nearest and resource-rich vehicle subnetworks, thereby minimizing the average response timeT_r of the task. The communication delay between vehicles is far smaller than that between vehicles and RSU. Therefore, in order to reduce the average response time of the task, we tend to transfer the task to the nearest and resource-rich vehicle subnetworks. The allocation scheme of computing resources is formulated in Algorithm 2 as follows. The optimization algorithm employed in this paper is NSGA-II. The Rt⊆R represent the set of tasks that arrive at the time t. The RSU has its own covered road information, which includes the position of the vehicle on the road and the state of the computing resources in the vehicle. The Lt represent the set of providers for computing resources, which could be RSU or service vehicle.Algorithm 2: The allocation scheme of computing resources.
Input:Rt: the set of tasks which arrive at the time t;Vj_k: the subnetwork set of vehicles;iter: maximum number of iterations;Output: the setLt of providers for computing resources.1:  initialLt=∅;2:  forri in Rt do3:    forVj_k in V do4:       iftvi∈Vj_k do5:        initiala=0;6:        initial populationpop;7:        whilea<iter do8:pop1=Crossover&mutationpop;9:          CalculateT_rand R_u;10:F=Fast‐nondominated‐sort(pop1);11:pop2=Crowding‐distanceF;12:pop=pop2;13:a=a+1;14:        end while15:       end if16:Lt=Lt∪pop;17:  end for18:  end for19:  returnLt.


## 2.1. Adaptive Allocation Scheme of Computing Resources

In this section, we will propose an adaptive allocation scheme of computing resources (AASCR) from multiple service providers. The scheme is introduced in six subsections, which are the structure of AASCR, vehicular mobility model, vehicular task model, communication system model, computation system model, and adaptive allocation scheme of computing resources.


## 2.2. Architecture Design of AASCR

In this paper, the scenario we consider is a straight section of urban road. As depicted in Figure1, the road in the scenario can be divided into multiple sections S=s1,s2,⋯,sm. S represents a set of sections, where sii=1,2,⋯,m represents one of the road sections, and m represents the quantity of road sections. The U=u1,u2,⋯,um represents the set of RSUs, where uii=1,2,⋯,m represents one of the RSUs. Every section si is within the coverage of RSU ui. Each RSU ui is equipped with an edge server and provides services for vehicles. The RSUs are interconnected through the Internet with wired links. Therefore, RSUs can communicate with each other through the infrastructure-to-infrastructure (I2I). When the vehicle is within the coverage of the RSU, the vehicle communicates with the RSU through the V2I via long-term evolution (LTE) protocol. Meanwhile, vehicles communicate with each other via V2V, which is implemented through the 802.11p protocol. We employ V=V1_1,V12,⋯,Vmn to represent the set of vehicles on the road, where Vii=1,2,⋯,m represents the set of vehicles on the section si, and Vijj=1,2,⋯,n represents the set of vehicles in the subnetworks of vehicular resources. Each subnetwork is a resources pool that executes V2V tasks, which is constructed based on the mobility of vehicles on the road section. Here, n is the quantity of subareas. We set vkk=1,2,⋯,o to represent each vehicle in the V, where o is the quantity of vehicles. In this scenario, V2V communication links are established among the vehicles in the subnetwork. At the same time, each vehicle establishes a V2I communication link with the corresponding RSUs on the road section to realize the communication between the vehicle and the RSU. It should be noted that vehicles between different subnetworks do not establish a V2V communication link. Therefore, vehicles between different subnetworks cannot directly communicate with each other.Figure 1
The architecture design of AASCR.There are main parameters and corresponding values in the AASCR listed in Table1.Table 1
List of crucial notations in AASCR.
ParameterValueSThe set of sections on the roadsiThe road sectionimThe quantity of road sectionUThe set of RSUsuiThe RSUiVThe set of vehicles on the roadViThe set of vehicles on the sectionsiVi_jThe set of vehicles on the subnetwork in sectionsivki_jThe vehicle in the subareaVi_joThe quantity of vehiclesThe vehicles in the same subnetwork will maintain the communication link until they travel to the next road section. In addition, when the task from the task vehicle is transferred to the RSUui, the task vehicles move out of the communication coverage area of the RSU ui during the execution of the tasks, and the result of the task will be forwarded by the RSU ui to the current RSU ui+1. Then, the current RSU ui+1 will send the result of the task to the task vehicle.


## 2.3. Vehicular Mobility Model

In AASCR, different vehicles are participating in the traffic, and their moving directions, angles, and speeds are distinct. To maintain the stability of V2V communication and better build subnetworks of resources, we propose the vehicular mobility model (VMM) to model and analyze the mobility of vehicles and predict the trajectory of the vehicles. Dividing the subnetworks according to the predicted trajectory will make task offloading more reasonable, thereby improving the efficiency and performance of the system.As shown in Figure2, a stationary reference coordinate is utilized to represent the position information of the vehicles in AASCR. The x-axis is the direction of road movement, and the y-axis is the position of the different lanes on the road. This allows our model to be independent of how the vehicle trajectory is acquired, especially in the case of onboard sensors for autonomous vehicles. This also makes the model independent of road curvature and can be applied anywhere on the highway as long as the vehicle-mounted lane estimation algorithm is available. The blue dotted lines in Figure 2(a) represent the trajectory of vehicles on the road. The red lines in Figure 2(b) represent the prediction of trajectory when the vehicle moves. The width of each lane is 3.5 m, and the length of each road section is 200 m.Figure 2
Mobility of the vehicles.
(a)
Trajectory of vehicles on the road(b)
Prediction of vehicular trajectoryWe set the historical trajectory of the vehicles as the input for the VMM. The historical trajectory of the vehicles on the road are represented inA=at−h,⋯,at−1,at, where at=x0t,y0t,x1t,y1t,⋯,xlt,ylt is the x and y coordinates of the vehicle being predicted and all the vehicles on the road, and h is the number of frames on the vehicular historical trajectory, and l is the quantity of vehicles on the road. The output of VMM is a probability distribution as B=bt+1,bt+2,⋯,bt+g, where bt+1=x0t+1,y0t+1 is the predicted coordinates of the vehicle, and g is the number of frames on the predicted trajectory. The conditional distribution in VMM is PB∣A, and it is depicted in
(1)PBA=∑iPΘBopi,APopiA,where Θ=Θt+1,Θt+2,⋯,Θt+g are the parameters of the binary Gaussian distribution for each time step in the future, corresponding to the mean and variance of the future position, and opii=1,2,⋯,nop represent the operations of vehicles on the road. We consider one kind of lateral operation and three kinds of longitudinal operations as conveyed in Figure 2(b). Lateral operation is the vehicle moves forward. Longitudinal operations include left and right lane changes and lane maintenance.The LSTM encoder is employed to learn the mobility of the vehicles. For each moment, the most recenth frames of the trajectory histories are inputted into the LSTM encoder to predict the target vehicle and all the nearby vehicles around it. In addition, although the LSTM encoder captures the mobility of the vehicles, it cannot capture the interdependence of all vehicle motions in the scene. Therefore, in order to solve this problem, we adopted social pooling [20] to pool the LSTM states of all predicted vehicles around the target vehicle into a social tensor. This is achieved by defining a spatial grid around the predicted target and filling the grid with LSTM states according to the spatial configuration of the vehicles in the scene. There is the structure of VMM in Figure 3.Figure 3
The structure of VMM.In Figure3, firstly, the LSTM encoder is used to learn the mobility of the vehicles; then, the social tensor is employed as the input of the model and coupled with the LSTM state of the predicted vehicle to improve the accuracy of future operation prediction. The model can now access the motion state of surrounding vehicles and their spatial configuration. Lastly, the LSTM-based decoder is used to generate the prediction distribution of the future motion of the next frame. We solve the inherent multimodality problem of driver operation by predicting the distribution for each of the above three kinds of operations and the probability of each operation. Using VMM, we can clearly predict the trajectory of the vehicle and construct more reasonable subnetworks.As the distances among vehicles or distances between vehicles and RSUs, we assume two devices have the coordinate, respectively, areco1=x1,y1 and co2=x2,y2. The distance Dis between co1 and co2 is obtained by
(2)Dis=x1−x22+y1−y22.There are main parameters and corresponding values in the VMM listed in Table2.Table 2
List of crucial notations in VMM.
ParameterValueAThe historical trajectory of the vehiclesatThex and y coordinates of the vehicleshThe number of frames on the vehicular historical trajectoryBThe output of VMMbt+1The predicted coordinates of the vehiclegThe number of frames on the predicted trajectoryPB∣AThe conditional distribution in VMMΘThe parameters of the binary Gaussian distributionopiThe operations of vehicles on the roadn_opThe quantity of operationsDisThe distances among vehicles or distances between vehicles and RSUsIn AASCR, some task vehicles will generate some onboard calculation tasks in certain periods. We denote these generated calculation tasks asR=r1,r2,⋯,rp, where ri represents one of the tasks and p is the quantity of tasks in certain periods. For each ri, we employ ri=rdi,cdi,ti,tvi,li,lri to represent the specific information about the onboard task, where rdi represent the size of raw data to execute the ri, which is the size of the data when task uploading, and cdi represents the size of result data about the task, which is the size of the data when results are downloaded, and ti represents the arrival time of ri. The tvi represents the task vehicle, and li represents the provider of computing resources, which could be RSU or service vehicle. The execution of ri need the computing resources from li, where tvi∈V and li∈U∪V. The lri will be set as 0 when the task is executed in RSU. Otherwise, it will be set as 1 if the task is executed in the service vehicle. In this paper, the computing resources of the vehicle are limited. Therefore, we set that a service vehicle can only handle one task.


## 2.4. Communication Model

In AASCR, the channel model of V2I and V2V communication is based on orthogonal frequency division multiplexing (OFDM). For V2I communication, each RSU can evenly divide the bandwidth into equal sizes, thereby realizing the simultaneous service of multiple vehicles. For V2V communication, one service vehicle can only serve one task vehicle at a time period. So, its bandwidth cannot be divided. In addition, we assume that there is no channel interference between different subnetworks. TheBwr is set as the channel bandwidth of V2I communication, and the Bwv is the channel bandwidth of V2V communication. Therefore, the channel bandwidth Bw of ri offloading is depicted in
(3)Bw=Bwr,lri=0,Bwv,lri=1.About the channel loss, we employclti,tvi,li represent the channel loss between tvi and li at the time t. The distance at the time t between tvi and li can be indicated as Disti,tvi,li. For V2V, the channel loss can be approximately equal to the determined path loss [21]. Therefore, clti,tvi,li can be obtained via
(4)clti,tvi,li=103.4+24.2log10Disti,tvi,li,lri=0,XDisti,tvi,li−α,lri=1.where X represents the path loss coefficient and α is the path loss exponent. We assume that the transmission power of each vehicle is the same and fixed. According to the Shannon theorem, at time ti, the uplink transmission rate tsrup of the tvi offload tasks to li can be obtained by
(5)tsruptvi,li,E=Bw∙log21+P∙clti,tvi,liN+∑P∙clti,e,li,where E represents the set of devices connected to li through the same wireless channel at the time ti and e∈E−tvi. N represents the white Gaussian noise.So, the time delayDiup of task ri upload is calculated via
(6)Diup=rditsruptvi,li,E.According to formulas (6) and (11), time point tif when the results of the task return from li to vehicle tvi is expressed as
(7)tif=ti+Diup+DiE.Therefore, the downlink transmission rate during the result of task return is depicted by(8)tsrdntvi,li,F=Bw∙log21+P∙cltif,tvi,liN+∑P∙cltif,tvi,f,where F represents the set of devices connected to tvi through the same wireless channel at the time tif, and f∈F−li. N represents the white Gaussian noise.So, the time delayDidn of task ri result download is calculated via
(9)Didn=rditsrdntvi,li,FThe communication delayDiud of ri, including the communication delay of offloading tasks and downloading calculation results, which can be defined in
(10)Diud=Diup+Didn.


## 2.5. Computation Model

In AASCR, there are three ways to perform tasks, tasks are executed locally, tasks are offloaded to the service vehicles in subnetwork, and tasks are offloaded to the RSUs. We set the computing power of vehicles as homogeneous.C represents the number of CPU cycles required for addressing with a bit of data. So, the CPU clock cycle required for the task is set as C∙rdi, and fr and fv, respectively, denote the CPU frequency of the edge server equipped in RSU and vehicle. Therefore, the computing delay DiE of ri can be formulated in
(11)DiE=C∙rdifr,lri=0,C∙rdifv,lri=1.


## 2.6. Adaptive Allocation Scheme

In AASCR, we assume that the tasks generated in each task vehicle are indivisible. The vehicle can perform at most one task at the same time. To evaluate the performance of the scheme regarding the allocation of computing resources, we consider the construction of subnetworks. The algorithm of subnetwork construction is as follows. Firstly, the VMM is prebuilt and trained with the track histories of the vehicles on the road. Secondly, during the construction of the subnetworks, the current and just past tracks of the vehicles are employed to predict the vehicle trajectories for a period of time in the future. Thirdly, the resource subnetworks are divided according to the predicted results and the location of the vehicle for a period of time in the future. The subnetworks are constructed reasonably through the algorithm and employed for resource allocation of task vehicles on the corresponding road section.Algorithm 1: The construction of subnetworks.
Input:vk: the vehicle in V on the road;A: the track histories.cck=xkt,ykt: the current coordinate of vk.pck=xkt+1,ykt+1: the predictive coordinate of vk.o: the quantity of vehicles;cri_j=sxi_j~exi_j,eyi_j~syi_j:The coordinate range of subareasi_j.Output: the subnetwork setVi_j of vehicles1:   Build the VMM;2:   Input track historiesA of V;3:   fori=1 to epoch do4:     Neural network training;5:    end for6:    fork=1 to o do7:      ifcck∈cri_j do8:Vi_j=Vi_j∪vk;9:      end if10:      Predicting the trajectory ofvk;11:      ifpck∈cri+1_j+1 do12:Vi+1_j+1=Vi+1_j+1∪vk;13:      end if14:   end for15:   returnVi_j.We can formulate the allocation scheme of computing resources as an optimization problem. According to the communication delay and computing delay, the average response time of the task is obtained via formula (12). The smaller response time indicates better performance of the method. So, the average response time can be regarded as one of the objective functions waiting for optimization.
(12)T_r=1p∑i=1pDiud+DiE.To further evaluate the performance of the allocation scheme, we designed another evaluation index. The resource utilization rate of vehicles is a crucial point for the allocation scheme, and it can reflect performance in terms of load. The resource utilization rate of vehicles is defined in(13)Ru=tvnV,where t_v are the tasks that execute with computing resources in vehicles and n_V is the quantity of vehicles on the road.So, the formulated problem can be depicted in(14)minT_r,maxR_u,e.t.lri∈0,1,li∈Vij\tvi∪ui.When a task arrives, the task is first offloaded to the nearest and resource-rich vehicle subnetworks, thereby minimizing the average response timeT_r of the task. The communication delay between vehicles is far smaller than that between vehicles and RSU. Therefore, in order to reduce the average response time of the task, we tend to transfer the task to the nearest and resource-rich vehicle subnetworks. The allocation scheme of computing resources is formulated in Algorithm 2 as follows. The optimization algorithm employed in this paper is NSGA-II. The Rt⊆R represent the set of tasks that arrive at the time t. The RSU has its own covered road information, which includes the position of the vehicle on the road and the state of the computing resources in the vehicle. The Lt represent the set of providers for computing resources, which could be RSU or service vehicle.Algorithm 2: The allocation scheme of computing resources.
Input:Rt: the set of tasks which arrive at the time t;Vj_k: the subnetwork set of vehicles;iter: maximum number of iterations;Output: the setLt of providers for computing resources.1:  initialLt=∅;2:  forri in Rt do3:    forVj_k in V do4:       iftvi∈Vj_k do5:        initiala=0;6:        initial populationpop;7:        whilea<iter do8:pop1=Crossover&mutationpop;9:          CalculateT_rand R_u;10:F=Fast‐nondominated‐sort(pop1);11:pop2=Crowding‐distanceF;12:pop=pop2;13:a=a+1;14:        end while15:       end if16:Lt=Lt∪pop;17:  end for18:  end for19:  returnLt.


## 3. Results and Discussion

In this section, the simulation of urban mobility (SUMO) is employed to simulate the realistic scenario for evaluating the VMM, AASCR, and the corresponding algorithms. The more detailed introduction is as follows.


### 3.1. Datasets and Experimental Parameters

The publicly available NGSIM US-101 is utilized as the training dataset for VMM. Each dataset consists of trajectories of real freeway traffic captured at 10 Hz over a time span of 45 minutes. Each dataset consists of 15 min segments of mild and congested traffic conditions. We use SUMO and VMM to simulate the prediction of vehicle trajectory. The status information of vehicles is generated through SUMO. Then the construction of resource subnetworks is also carried out under this simulation software. The notations of the simulation are depicted in Table3. The datasets of evaluation from [22] are shown in Table 4.Table 3
List of simulation notations.
ParametersValueBwr30 MHzBwv10 MHzfr4 GHzfv2 GHzP0.1 WN10-13 WX-21.06 dBmα1.68Length of the road section200 mTime segment size50 sTable 4
The parameters of evaluation.
DatasetsData 1Data 2Data 3Data 4Data 5C∙rdi (cycles)2004006008001000rdi (KB)2004006008001000cdi (KB)4080120160200


### 3.2. The Performance Comparison of Different Schemes

In this paper, the performance of our proposed scheme AASCR is compared with three different methods. The first is IDM which is the vehicular network model only with V2I communication. The second is OWV which is the vehicular network model only with V2V communication. The last one is DVNM [23] which combines the V2I and V2V communication.The proportion of task vehicles is represented asprop_tv in formula (15), which is the proportion of vehicles that require services in all vehicles in a road section at the time t.
(15)proptv=ntvnVi,where n_tv is the number of tasks in si. n_Vi is the number of vehicles in si. The density of vehicles is defined as follows. If 20≤n_Vi≤25, the density is low. If 60≤n_Vi≤65, the density is high.To compare the performance of IDM, OWV, DVNM, and AASCR in terms of the average response time of tasks, we conduct the relative experiments on different kinds of datasets for low vehicle density andprop_tv=0.5. In Figure 4, we can see that the average response time of tasks for AASCR is always less than IDM, OWV, and DVNM for all kinds of datasets. Simultaneously, with the increase of data size for each task, the average response time of AASCR is growing slower than that of IDM, OWV, and DVNM. Therefore, the performance of computing resources allocation on AASCR is better than IDM, OWV, and DVNM.Figure 4
The average response time for different datasets.To further compare the performance of IDM, OWV, DVNM, and AASCR in terms of the average response time of tasks, we conduct the relative experiments on the different proportions of task vehicles and vehicle densities with the dataset of Data 2.In Figure5, it depicts the performance for IDM, OWV, DVNM, and AASCR in terms of the average response time of tasks on different vehicle densities. When the proportion of task vehicles is greater than 90%, IDM, DVNM, and AASCR tend to increase linearly, and OWV tends to decrease continuously. In Figure 5(a), the average response time of tasks for AASCR is always less than IDM and DVNM in low vehicle density for all proportions of task vehicles. In addition, AASCR outperforms OWV in terms of the average response time of tasks, when the proportion of task vehicles is less than 70%. Besides, the average response time of tasks on OVM is less than that of other schemes when the proportion of task vehicles is more than 70%. This is because only the computation resources in vehicles are utilized in OVM, and the number of vehicles is less than the number of tasks when the proportion of task vehicles is greater than 40%. Therefore, there are not enough computation resources in OVM for completing all tasks. As a result, a large number of tasks can not be completed. Therefore, we can conclude that our scheme outperforms OVM in terms of the average response time of tasks. In Figure 5(b), the performance for IDM, OWV, DVNM, and AASCR in terms of the average response time of tasks on high vehicle density. Same as in (a), the average response time of tasks for AASCR is always less than IDM and DVNM in low vehicle density for all proportions of task vehicles. Otherwise, AASCR outperforms OWV in terms of the average response time of tasks when the proportion of task vehicles is less than 60%. Besides, the average response time of tasks on OVM is less than that of other schemes when the proportion of task vehicles is more than 70%. Because of the unsuccessful tasks of OWV, we can conclude that our scheme outperforms OVM in terms of the average response time of tasks.Figure 5
The average response time for the proportion of task vehicles with different vehicle densities.
(a)
Low vehicle density(b)
High vehicle densityFor the proportion of successful tasks which is represented asprop_st in formula (16), which is the proportion of tasks successfully executed at the time t. We set n_st as the quantity of tasks which are lost or uncompleted and n_tv as the number of tasks in si.
(16)propst=nstntv.To compare the performance of IDM, OWV, DVNM, and AASCR in terms of the proportion of successful tasks, we conduct the relative experiments on the different proportions of task vehicles and vehicle densities with the dataset of Data 2.In Figure6, it depicts the performance for IDM, OWV, DVNM, and AASCR in terms of the proportion of successful tasks on different vehicle densities. When the proportion of task vehicles is greater than 90%, IDM, DVNM, and AASCR tend to stabilize, and OWV tends to decrease continuously. In Figures 6(a) and 6(b), the proportion of successful tasks for OVM is getting lower and lower. This is due to the increase in the proportion of task vehicles; there are not enough computation resources in OVM for completing all tasks. In Figure 6(a), we can see that the AASCR is better than other methods when the proportion of task vehicles is greater than 25%. In Figure 6(b), we can see that the IDM is relatively better than other schemes. This is due to the IDM being the vehicular network model only with V2I communication, the computing resources are provided by RSUs and we assume that RSUs have enough resources to execute tasks. Therefore, as the quantity of task vehicles increases, the proportion of successful tasks will remain relatively high. However, other methods consider the computing resources possessed by the vehicles, so the increase in vehicle density will affect the proportion of successful tasks. It can be seen from Figure 6(b) that our scheme AASCR is very close to the results of IDM and even exceeds IDM in some proportion of task vehicles. Therefore, our scheme AASCR has a good performance in terms of the proportion of successful tasks compared to other methods.Figure 6
The proportion of successful tasks for the proportion of task vehicles with different vehicle densities.
(a)
Low vehicle density(b)
High vehicle densityTo compare the performance for IDM, OWV, DVNM, and AASCR in terms of resource utilization rate, we conduct the relative experiments on the different proportions of task vehicles and low vehicle density with dataset Data 2.In Figure7, the OWV, DVNM, and AASCR outperform IDM in terms of the resource utilization rate of vehicles for all cases. When the proportion of task vehicles is greater than 90%, the results of all methods tend to stabilize. In addition, the value for OVM is 100% when the proportion of task vehicles. This is because OVM only utilizes the computation resources in vehicles. Therefore, the OVM performs better than other models in terms of the resource utilization rate of vehicles. In summary, OWV, DVNM, and AASCR make full advantage of the computation resources in vehicles in comparison with IDM. The results of AASCR are better than DVNM on the resource utilization rate of vehicles.Figure 7
The resource utilization rate of vehicles in different proportions of task vehicles.In conclusion, the AASCR outperforms IDM, OWV, and DVNM in terms of the average response time of tasks on different datasets, and the AASCR outperforms IDM and DVNM in terms of the average response time of tasks on different vehicle densities. The AASCR also outperforms DVNM in the proportion of successful tasks, and it has higher resource utilization rate of vehicles compared with IDM and DVNM. The OWV has the lower average response time than other schemes when the proportion of task vehicles is greater than 70%, and it also has better performance than other schemes on the resource utilization rate of vehicles. However, the proportion of successful tasks of OWV is much less than other schemes. Therefore, with trading off and comprehensively considering various evaluation indicators, we can see that our scheme has better performance than others.


## 3.1. Datasets and Experimental Parameters

The publicly available NGSIM US-101 is utilized as the training dataset for VMM. Each dataset consists of trajectories of real freeway traffic captured at 10 Hz over a time span of 45 minutes. Each dataset consists of 15 min segments of mild and congested traffic conditions. We use SUMO and VMM to simulate the prediction of vehicle trajectory. The status information of vehicles is generated through SUMO. Then the construction of resource subnetworks is also carried out under this simulation software. The notations of the simulation are depicted in Table3. The datasets of evaluation from [22] are shown in Table 4.Table 3
List of simulation notations.
ParametersValueBwr30 MHzBwv10 MHzfr4 GHzfv2 GHzP0.1 WN10-13 WX-21.06 dBmα1.68Length of the road section200 mTime segment size50 sTable 4
The parameters of evaluation.
DatasetsData 1Data 2Data 3Data 4Data 5C∙rdi (cycles)2004006008001000rdi (KB)2004006008001000cdi (KB)4080120160200


## 3.2. The Performance Comparison of Different Schemes

In this paper, the performance of our proposed scheme AASCR is compared with three different methods. The first is IDM which is the vehicular network model only with V2I communication. The second is OWV which is the vehicular network model only with V2V communication. The last one is DVNM [23] which combines the V2I and V2V communication.The proportion of task vehicles is represented asprop_tv in formula (15), which is the proportion of vehicles that require services in all vehicles in a road section at the time t.
(15)proptv=ntvnVi,where n_tv is the number of tasks in si. n_Vi is the number of vehicles in si. The density of vehicles is defined as follows. If 20≤n_Vi≤25, the density is low. If 60≤n_Vi≤65, the density is high.To compare the performance of IDM, OWV, DVNM, and AASCR in terms of the average response time of tasks, we conduct the relative experiments on different kinds of datasets for low vehicle density andprop_tv=0.5. In Figure 4, we can see that the average response time of tasks for AASCR is always less than IDM, OWV, and DVNM for all kinds of datasets. Simultaneously, with the increase of data size for each task, the average response time of AASCR is growing slower than that of IDM, OWV, and DVNM. Therefore, the performance of computing resources allocation on AASCR is better than IDM, OWV, and DVNM.Figure 4
The average response time for different datasets.To further compare the performance of IDM, OWV, DVNM, and AASCR in terms of the average response time of tasks, we conduct the relative experiments on the different proportions of task vehicles and vehicle densities with the dataset of Data 2.In Figure5, it depicts the performance for IDM, OWV, DVNM, and AASCR in terms of the average response time of tasks on different vehicle densities. When the proportion of task vehicles is greater than 90%, IDM, DVNM, and AASCR tend to increase linearly, and OWV tends to decrease continuously. In Figure 5(a), the average response time of tasks for AASCR is always less than IDM and DVNM in low vehicle density for all proportions of task vehicles. In addition, AASCR outperforms OWV in terms of the average response time of tasks, when the proportion of task vehicles is less than 70%. Besides, the average response time of tasks on OVM is less than that of other schemes when the proportion of task vehicles is more than 70%. This is because only the computation resources in vehicles are utilized in OVM, and the number of vehicles is less than the number of tasks when the proportion of task vehicles is greater than 40%. Therefore, there are not enough computation resources in OVM for completing all tasks. As a result, a large number of tasks can not be completed. Therefore, we can conclude that our scheme outperforms OVM in terms of the average response time of tasks. In Figure 5(b), the performance for IDM, OWV, DVNM, and AASCR in terms of the average response time of tasks on high vehicle density. Same as in (a), the average response time of tasks for AASCR is always less than IDM and DVNM in low vehicle density for all proportions of task vehicles. Otherwise, AASCR outperforms OWV in terms of the average response time of tasks when the proportion of task vehicles is less than 60%. Besides, the average response time of tasks on OVM is less than that of other schemes when the proportion of task vehicles is more than 70%. Because of the unsuccessful tasks of OWV, we can conclude that our scheme outperforms OVM in terms of the average response time of tasks.Figure 5
The average response time for the proportion of task vehicles with different vehicle densities.
(a)
Low vehicle density(b)
High vehicle densityFor the proportion of successful tasks which is represented asprop_st in formula (16), which is the proportion of tasks successfully executed at the time t. We set n_st as the quantity of tasks which are lost or uncompleted and n_tv as the number of tasks in si.
(16)propst=nstntv.To compare the performance of IDM, OWV, DVNM, and AASCR in terms of the proportion of successful tasks, we conduct the relative experiments on the different proportions of task vehicles and vehicle densities with the dataset of Data 2.In Figure6, it depicts the performance for IDM, OWV, DVNM, and AASCR in terms of the proportion of successful tasks on different vehicle densities. When the proportion of task vehicles is greater than 90%, IDM, DVNM, and AASCR tend to stabilize, and OWV tends to decrease continuously. In Figures 6(a) and 6(b), the proportion of successful tasks for OVM is getting lower and lower. This is due to the increase in the proportion of task vehicles; there are not enough computation resources in OVM for completing all tasks. In Figure 6(a), we can see that the AASCR is better than other methods when the proportion of task vehicles is greater than 25%. In Figure 6(b), we can see that the IDM is relatively better than other schemes. This is due to the IDM being the vehicular network model only with V2I communication, the computing resources are provided by RSUs and we assume that RSUs have enough resources to execute tasks. Therefore, as the quantity of task vehicles increases, the proportion of successful tasks will remain relatively high. However, other methods consider the computing resources possessed by the vehicles, so the increase in vehicle density will affect the proportion of successful tasks. It can be seen from Figure 6(b) that our scheme AASCR is very close to the results of IDM and even exceeds IDM in some proportion of task vehicles. Therefore, our scheme AASCR has a good performance in terms of the proportion of successful tasks compared to other methods.Figure 6
The proportion of successful tasks for the proportion of task vehicles with different vehicle densities.
(a)
Low vehicle density(b)
High vehicle densityTo compare the performance for IDM, OWV, DVNM, and AASCR in terms of resource utilization rate, we conduct the relative experiments on the different proportions of task vehicles and low vehicle density with dataset Data 2.In Figure7, the OWV, DVNM, and AASCR outperform IDM in terms of the resource utilization rate of vehicles for all cases. When the proportion of task vehicles is greater than 90%, the results of all methods tend to stabilize. In addition, the value for OVM is 100% when the proportion of task vehicles. This is because OVM only utilizes the computation resources in vehicles. Therefore, the OVM performs better than other models in terms of the resource utilization rate of vehicles. In summary, OWV, DVNM, and AASCR make full advantage of the computation resources in vehicles in comparison with IDM. The results of AASCR are better than DVNM on the resource utilization rate of vehicles.Figure 7
The resource utilization rate of vehicles in different proportions of task vehicles.In conclusion, the AASCR outperforms IDM, OWV, and DVNM in terms of the average response time of tasks on different datasets, and the AASCR outperforms IDM and DVNM in terms of the average response time of tasks on different vehicle densities. The AASCR also outperforms DVNM in the proportion of successful tasks, and it has higher resource utilization rate of vehicles compared with IDM and DVNM. The OWV has the lower average response time than other schemes when the proportion of task vehicles is greater than 70%, and it also has better performance than other schemes on the resource utilization rate of vehicles. However, the proportion of successful tasks of OWV is much less than other schemes. Therefore, with trading off and comprehensively considering various evaluation indicators, we can see that our scheme has better performance than others.


## 4. Conclusions

In this paper, we focused on the allocation problem of computing resources in IoV and proposed an efficient scheme AASCR to address with computing resources from multiple service providers. The AASCR can effectively schedule computing resources under a dynamic environment. With the proposed VMM, the behavior and trajectory of vehicles are effectively analyzed and predicted, and the subnetworks of computing resources from vehicles are constructed reasonably. Considering the average response time of the vehicular task and the resource utilization rate of vehicles, the multiobjective optimization algorithm leads to a better scheme of resource allocation and enables to improve resource utilization while reducing latency. We conducted experiments in consideration of various factors and analyzed the results for a better trade-off. Based on the comprehensive analysis, our scheme outperforms recent relative schemes and has better performance.In the future, we will consider the allocation of computing resources under more complex road conditions, the task segmentation, and the switching of resource equipment under the IoV.



---

*Source: 8255733-2022-05-04.xml*