Junchao Yang
email: yangjc@ctbu.edu.cn

Feng Lin
email: lin-feng@cqupt.edu.cn

Senior Member, IEEE Chinmay Chakraborty
email: cchakrabarty@bitmesra.ac.in

Member, IEEE Keping Yu
email: keping.yu@ieee.org

Member, IEEE Zhiwei Guo
email: zwguo@ctbu.edu.cn

Member, IEEE Anh-Tu Nguyen
email: tnguyen@uphf.fr

Fellow, IEEE Joel J P C Rodrigues
email: joeljr@ieee.org

A Parallel Intelligence-driven Resource Scheduling Scheme for Digital Twins-based Intelligent Vehicular Systems

Keywords: Parallel intelligence, digital twins, intelligent vehicular networks, resource scheduling, computation offloading

Real-time digital twin technology can enhance traffic safety of intelligent vehicular system and provide scientific strategies for intelligent traffic management. At the same time, real-time digital twin depends on strong computation from vehicle side to cloud side. Aiming at the problem of delay caused by the dual dependency of timing and data between computation tasks, and the problem of unbalanced load of mobile edge computing servers, a parallel intelligence-driven resource scheduling scheme for computation tasks with dual dependencies of timing and data in the intelligent vehicular systems (IVS) is proposed. First, the delay and energy consumption models of each computing platform are formulated by considering the dual dependence of sub-tasks. Then, based on the bidding idea of the auction algorithm, the allocation model of computing resources and communication resources is defined, and the load balance model of the mobile edge computing (MEC) server cluster is formulated according to the load status of each MEC server. Secondly, joint optimization problem for offloading, resource allocation, and load balance is formulated. Finally, an adaptive particle swarm with genetic algorithm is proposed to solve the optimization problem. The simulation results show that the proposed scheme can reduce the total cost of the system while satisfying the maximum tolerable delay, and effectively improve the load balance of the edge server cluster.

I. INTRODUCTION

T HE growing number of automobiles raised tremendous pressure on the transportation system in recent decades. Issues like traffic accidents, environmental pollution and energy wastage due to inadequate gasoline combustion due to traffic congestion need to be solved urgently [START_REF] Cao | Sustainable and transferable traffic sign recognition for intelligent transportation systems[END_REF]. Internet of Vehicles(IoV) is a key technology to realize Intelligent Traffic System (ITS) based on in-vehicle network, intervehicle network and mobile Internet [START_REF] Guo | Deep information fusion-driven poi scheduling for mobile social networks[END_REF], [START_REF] Li | Optimized content caching and user association for edge computing in densely deployed heterogeneous networks[END_REF]. The continuous development of IoV in recent years and the commercialization of 5G networks have led to the emergence of IoV services, such as image-assisted navigation, augmented reality driving, identity recognition, natural language processing, image/audio/video processing and other computation intensive and latency-sensitive applications. Usually these applications require a large amount of computation resources, storage resources and energy consumption, but the computation capacity of the vehicle's terminal device is difficult to meet the maximum tolerable latency of those applications [START_REF] Zhou | Spatiotemporal feature encoding for traffic accident detection in vanet environment[END_REF], as well as the energy consumption of the vehicle is limited. This will affect the quality of experience (Quality of Experience, QoE) of vehicle users for in-vehicle applications, as well as the safety of vehicle driving [START_REF] Zhang | Graph neural network-driven traffic forecasting for the connected internet of vehicles[END_REF]. Therefore, such computationintensive and latency-sensitive tasks pose a great challenge to the development of IoV [START_REF] Guo | Deep collaborative intelligence-driven traffic forecasting in green internet of vehicles[END_REF].

Computation tasks in IoV can be classified into latencysensitive and non-latency-sensitive tasks based on their latency characteristics [START_REF] Xia | Distributed offloading for cooperative intelligent transportation under heterogeneous networks[END_REF]- [START_REF] Zhu | Efficient offloading for minimizing task computation delay of noma-based multiaccess edge computing[END_REF]. For latency-sensitive tasks, such as autonomous driving, AR/VR applications, and online games with high latency requirements, while such applications are related to driving safety and require a large amount of computation power, while the vehicle itself has limited computation power and energy. Therefore, computation offloading is required to meet the maximum tolerable latency of the tasks. The non-latency-sensitive applications, such as music and video downloads do not have high requirements of latency, and exceeding a certain latency does not have a significant impact on the user experience. Computation tasks can be divided into decomposable and indecomposable computation tasks according to their computation characteristics [START_REF] Lu | An intelligent deterministic scheduling method for ultra-low latency communication in edge enabled industrial internet of things[END_REF]. Most of the computation tasks are decomposable tasks, so the computation tasks can be split into multiple sub-tasks for distributed computation offloading, which can be computed in parallel on multiple computing platforms and also reduce the computation pressure of computing platform. However, after the task is divided into multiple sub-tasks, there is a dependency relationship between the sub-tasks, i.e the result of the former sub-task is the input of the latter one, so the latter sub-task must wait for the completion of the former sub-task, which will also bring additional latency of the computation task [START_REF] Zhao | A collaborative v2x data correction method for road safety[END_REF].

In order to cope with the limitation of computing power of vehicles, Mobile Cloud Computing (MCC) technology was introduced into the IoV, MCC extends the computing power of cloud computing to vehicles and uses cloud computing applications to process and serve computation intensive applications [START_REF] Zhang | Task offloading in vehicular edge computing networks: A load-balancing solution[END_REF]. This MCC solution is to transfer all or some of the computation intensive tasks that cannot be satisfied by the computation power of the vehicles to a remote cloud server over a cellular network, and then feedback the computation results to the vehicle [START_REF] Wang | Federated offloading scheme to minimize latency in mec-enabled vehicular networks[END_REF]. For example, in the work [START_REF] Sun | Bl-iea: A bit-level image encryption algorithm for cognitive services in intelligent transportation systems[END_REF], [START_REF] Peng | Integrating terrestrial and satellite multibeam systems toward 6g: Techniques and challenges for interference mitigation[END_REF], a cloud migration decision algorithm for computation intensive tasks is proposed to overcome the problem of limited computation resources of mobile devices, which determines whether to compute at the remote cloud server or at the mobile device based on the size of the task, and the results show that the computation latency of computation intensive tasks can be effectively reduced by utilizing the MCC technology. Although mobile cloud computing can provide powerful computing power for vehicles and solve the problem of insufficient computing resources for vehicles, the remote cloud servers are usually far away from vehicles because of the distance [START_REF] Yan | Optimal task offloading and resource allocation in mobile-edge computing with inter-user task dependency[END_REF], [START_REF] Cao | Resource allocation in 5g iov architecture based on SDN and fog-cloud computing[END_REF]. Moreover, for computation tasks with relatively large amount of data size, such as autonomous driving, image and speech processing applications, it may lead to high transmission latency, which is unacceptable for those applications [START_REF] Liwang | Allocation of computation-intensive graph jobs over vehicular clouds in iov[END_REF]. Secondly, a large number of vehicles offload computation tasks to remote cloud computing centers, which can put a huge pressure on the backbone network and may lead to network blockage or even paralysis [START_REF] Zhao | A collaborative v2x data correction method for road safety[END_REF],hence, MCC is not an ideal solution for computation task offloading in IoV.

In order to further reduce the transmission latency of computation tasks, mobile edge computing (MEC) is introduced into the vehicular network [START_REF] Du | Computation offloading and resource allocation in vehicular networks based on dual-side cost minimization[END_REF]- [START_REF] Zhu | Joint optimal allocation of wireless resource and MEC computation capability in vehicular network[END_REF]. MEC mainly deploys servers at the edge of road, such as on Road Side Unit (RSU), Base Station (BS), etc. Thus, computation resources and storage resources are pushed to the edge of the road so that computation services can be provided near the vehicles, thus reducing the transmission latency of computation tasks and the return latency of computation results [START_REF] Zhou | Joint device association, resource allocation and computation offloading in ultra-dense multi-device and multi-task iot networks[END_REF]. Compared with MCC, MEC not only reduces the transmission latency of computation tasks and the pressure on the backbone network, but also has the feature of flexible deployment, but the computation capacity of MEC is still insufficient to cope when there are too many vehicles needs to offload computation tasks. Therefore, the work [START_REF] Ning | Joint computation offloading, power allocation, and channel assignment for 5g-enabled traffic management systems[END_REF] proposed MCC cooperated with MEC for offloading computation tasks, by offloading part of the computation tasks to the MEC server for computation through V2I, and by offloading the computation tasks to the MCC server through V2N, part of the computation can also be performed at the vehicle, thus effectively overcoming the problems of large transmission and return latencys and network blockage caused by offloading to the MCC, and avoiding the problem of insufficient computation resources at the MEC when too many task of are offloaded.

In work [START_REF] Dab | Joint optimization of offloading and resource allocation scheme for mobile edge computing[END_REF], the computation task is offloaded to the adjacent vehicles to assist the computation, and the dependent sub-task is modeled as a task scheduling problem. With the goal of minimizing the latency, Min-min, Max-min and HEFT algorithms are used to solve the task scheduling problem. The work [START_REF] Chang | Dynamic resource allocation and computation offloading for iot fog computing system[END_REF] considered the situation of single MEC server with multiple users, offloaded the task to MEC or local computation, and proposed a binary search method to obtain the optimal offloading strategy with the goal of minimizing the weighted sum of latency and energy consumption. The work [START_REF] Ren | Joint channel allocation and resource management for stochastic computation offloading in MEC[END_REF] presented a computation offloading strategy based on Particle Swarm Optimization ( PSO ). The computation task is offloaded to the local and MEC for computation. The latency and energy consumption are balanced, and the load balance of MEC server is considered. The work [START_REF] Fang | Joint task offloading, D2D pairing, and resource allocation in device-enhanced MEC: A potential game approach[END_REF] proposed a joint computation offloading strategy and the optimization objective was to minimize the latency. The work [START_REF] Gong | Computation offloading-based task scheduling in the vehicular communication environment for computation-intensive vehicular tasks[END_REF] used the joint offloading method, and proposed a model-free method based on reinforcement learning to minimize the latency under the constraint of energy consumption and task dependency. The objective of work [START_REF] Chai | Task execution cost minimization-based joint computation offloading and resource allocation for cellular D2D MEC systems[END_REF]is to minimize the weighted sum of latency and energy consumption. The computation task is offloaded to the local, MEC server and remote cloud for computation. The task-dependent migration scheme is considered and an improved Genetic Algorithm ( GA ) is used to solve the offloading decision [START_REF] Guo | Fiwi-enhanced vehicular edge computing networks: Collaborative task offloading[END_REF].

In the aforementioned research, few studies jointly considered offloading strategy, resource allocation, load balance of MEC server cluster in the optimization objective, which leads the computing resources have not been fully utilized [START_REF] Zhang | Task offloading in vehicular edge computing networks: A load-balancing solution[END_REF], [START_REF] Zhang | Computing resource allocation scheme of IOV using deep reinforcement learning in edge computing environment[END_REF]- [START_REF] Scott-Hayward | A PSO approach to resource allocation in wireless networks[END_REF]. In addition, the timing and data dual dependent tasks in IoV is not well studied [START_REF] Liwang | Allocation of computation-intensive graph jobs over vehicular clouds in iov[END_REF]. Motivated by this, this paper proposes a joint computation offloading and resource allocation algorithm based on dual dependent tasks. This algorithm first considers the dependent tasks of multiple vehicles offloading to multiple computing platforms (i.e, local vehicle, MEC server , idle vehicle,cloud server ) at the same time, and the latency and energy consumption models of each computing platform is formulated. Then, based on the bidding idea of auction algorithm, the allocation model of computing resources and communication resources is defined. According to the load state MEC server, the load balance model of MEC server cluster is formulated. Secondly, the optimization objective of offloading, resource allocation and load balance of MEC server is jointly constructed as Mixed-Integer Nonlinear Programming (MINLP) problem. Finally, combined with the characteristics of fast convergence of particle swarm optimization and strong global search of genetic algorithm and an adaptive hybrid particle swarm with genetic algorithm is proposed to solve the optimization problem.

II. INTELLIGENT VEHICULAR SYSTEMS MODEL A. Network Model

The intelligent vehicular system model of this paper is shown in Fig. 1. In this paper, we consider deploying the Fig. 1: Intelligent Vehicular Systems Model MEC server on the RSU, without losing generality, and define the MEC server set that provides the computation offloading service within the coverage of BS as M = {mec 1 , mec 2 , ..., mec n , ..., mec m }, The vehicle set that needs to be offloaded for the computation task is V = {v 1 , v 2 , ..., v i , ..., v k }, and each vehicle has a computation intensive task S i ,The set of computation intensive tasks is S = {S 1 , S 2 , ..., S i , ..., S k } Where S i is a separable task, including several sub-tasks with temporal and data dependence. Assuming that each offloaded vehicle has a corresponding idle vehicle to provide computation offload, each MEC server mec n has a separate computing resource F n and storage resource W n . In this paper, Dispatch Server (DS) is set up at BS. Its function is to make a unified offloading strategy for all offloading vehicles covered by BS, and to manage and coordinate the resource allocation of all MEC servers within its scope, as well as the bandwidth resource allocation of BS. The decision-making process of computation offloading is regarded as semi-dynamic. Within a scheduling cycle T (namely several hundred milliseconds), the vehicle set V and the computation intensive task set S remain unchanged, however V and S may change in different scheduling cycles. Optical fiber links are adopted between RSU and RSU, RSU and BS, BS and cloud servers, respectively. PC5 communication is used between vehicles, vehicles and RSU, respectively. And cellular network communication is used between vehicles and BS.

In order to avoid the interference between cellular links and PC5 links, this paper assumes that the system allocates different bandwidth resources to cellular links and PC5 links. The total bandwidth available for BS is B 1 , and each PC5 link can be allocated to an orthogonal channel with bandwidth B 2 . The uplink and downlink of the vehicle are Rayleigh channels.

The uplink / downlink data transmission rates of vehicle v i and BS are defined as R 1 i and R i b , respectively :

R 1 i = λ i B 1 log 2 1 + P u i h 1 N 1 (1)
R i b = λ i B 1 log 2 1 + P u b h 1 N 1 ( 2
)
where λ i represents the BS bandwidth allocation factor of task S i of vehicle v i , P u i represents the transmitting power of vehicle v i , P u b represents the transmitting power of BS, h 1 represents the channel gain of the transmission link between vehicle v i and BS, and N 1 represents the Gaussian white noise power of the transmission link between vehicle and BS.

Vehicle v i and MEC, idle vehicle uplink data transmission rate R 2 i :

R 2 i = B 2 log 2 1 + P u i h 2 N 2 (3)
The downlink data transmission rates of v i , MEC and idle vehicles are R i m , R i a :

R i m = B 2 log 2 1 + P u m h 2 N 2 (4)
R i a = B 2 log 2 1 + P u a h 2 N 2 (5)
where P u m and P u a represent the transmission power of MEC server and idle assistance vehicle respectively; h 2 represents the channel gain of transmission link between vehicle and MEC and idle assistance vehicle; N 2 represents the Gaussian white noise power of transmission link between vehicle and MEC and idle assistance vehicle.

This paper considers the computation tasks can be processed in the local vehicle, or offloaded to MEC server, idle vehicle and cloud server for computation, and then the computation results are returned. The offloading of cloud server needs to be transmitted to BS through cellular network, and then to cloud server through optical fiber. Therefore, it results large communication latency of task transmission. The communication latency of MEC server offloading is relatively low, however the computation ability is limited. The characteristics of idle vehicle offloading are low communication latency and weak computing ability. Therefore, according to the characteristics of each computing platform, as well as the timing and data dependence of sub-tasks, a reasonable offloading strategy can effectively reduce the total system cost.

B. Task Dependent model

In this paper, the computation-intensive task set S of multiple vehicles is mainly studied. The computation-intensive task S i of offloading vehicle V i is represented as S i = {i, T max i , I i ,Sm i ,J}, where i represents the number of computation task S i of vehicle V i , T max i represents the maximum tolerance latency of task S i , and I i represents the amount of data of task S i . Sm i represents the number of sub-task Sm i = s 1 i , s 2 i , s 3 i ...., s j i , ..., s J i that can be independently calculated, and J represents the number of sub-tasks that task S i is segmented . sub-tasks have dual dependence on timing and data, sub-tasks rely on the execution results of other subtasks, and then can successfully perform this task. As shown in Fig. 2, the dependency between sub-tasks is represented by Directed Acyclic Graph ( DAG ), where the nodes of DAG represent the sub-tasks that can be independently calculated, each edge of the graph represents the dependency between sub-tasks, and the weight represents the amount of data transmitted between sub-tasks.

In this paper, each sub-task of the offloading computation task S i of vehicle V i is modeled as a ten-tuple

s j i = {j, I j i , O j i , U j i ,E j i , Z j i , L j i , Y j i ,K j i ,Q j i }.
where j represents the number of sub-tasks, and I j i represents the data volume of sub-task s j i . O j i = δ • I j i is the output result data volume, and δ is the output data volume coefficient, indicating the relationship between the output data volume and the input data volume. U j i ∈ {0, 1, 2, 3} represents the location of the sub-task s j i to be offloaded, which represents the local computation, offloaded to the MEC server, to the idle vehicle and the remote cloud server, respectively. Z j i represents the number of the MEC server corresponding to the U j i =1, in other cases Z j i =0. L j i denotes the transmission latency of subtask s j i from offloading vehicle v i to computing position U j i , and Y j i denotes the sum of the computation latency and the computation result O j i of sub-task s j i at computing position U j i to the next computing position K j i . K j i denotes the set of computing positions of follow-up sub-tasks of s j i . For example, the follow-up sub-tasks of s 3 i in Fig. 2 are s 4 i , s 5 i and s 6 i , so

K 3 i ={U 4 i , U 5 i , U 6 i }, Q 3 i ={Z 4 i , Z 5
i , Z 6 i } and Q j i represent the index of MEC server when the follow-up sub-task is offloaded to MEC. E j i represents the total energy consumption of sub-task s j i from offloading vehicle v i to calculating result O j i within the computation position set K j i . For example, the dependent task in Fig. 2 ends with sub-task s 10 i , so the K 10 i = {0} of s 10 i , that is, the result of the computation task is finally returned to the vehicle V i .

III. COMPUTATION MODEL BASED ON DUAL DEPENDENT

TASKS

As shown in Fig. 3, the relationship between the offloading of the computation sub-task s j i and the transmission of the computation result O j i between the local vehicle, the idle assistance vehicle, the MEC server and the remote cloud server is shown. For example, when vehicle v i offload s j i to MEC server, it is divided into two cases : the local MEC server where the vehicle is associated and other MEC servers under DS, so as to consider whether there is a transmission latency between MEC servers. Offloading s j i to the cloud server requires transport through BS and then transmitting to the cloud server. Similarly, it is also necessary to consider whether there is a transmission latency between the MEC servers and the transmission latency between the MEC server and the BS when the computation result O j i is returned to the computation position of the follow-up sub-task. And in the following we will give the latency and energy consumption model under different situations.

A. Local vehicle computing model

When U j i = 0, it means that sub-task s j i is executed in local vehicle v i , and vehicle v i is represented by a five-tuple

V i = {d i , G v , F i , P i , P u i }.
where d i represents the number of MEC server where vehicle v i is located. G v is the number of CPU cycles required for the local computation of 1 bit data for vehicles, i.e, cycle / bit. F i is the local computing power of vehicle v i , that is, the number of CPU cycles per second. P i is the device power when the task is executed locally in vehicle V. If sub-task s j i is locally executed, and transmission latency L j i = 0. The computation latency of sub-task s j i offloading to local is t lc ij :

t lc ij = I j i G v F i (6)
In this study, it is considered that the vehicle can communicate with idle vehicles, MEC servers and BSs at the same time.

t Omrelay ij = min d i -Z j i , 1 • O j i R m f ( 7
)
where t Omrelay ij denotes the transmission latency of the calculation result O j i of sub-task s j i over the fiber link between MEC servers, and R m f represents the data transmission rate of the optical fiber link between the MEC servers.

t Ocrelay ij = O j i R c f ( 8
)
where t Ocrelay ij is the transmission latency of the calculation result O j i of sub-task s j i over the fiber link between BS and the cloud server, and R c f is the transmission rate of the optical fiber link between BS and cloud server.

In this paper, we define the following function to model the latency and energy consumption during the task offloading. When k j i =U j i , ξ=0, it shows that the computation results need to be back-transmitted is the current position, so there is no back-transmitting computation results and no back-transmitting latency. When k j i ̸ = U j i , ξ= 1, the computation results of sub-task s j i need to be transmitted to the next computation position, so there is a return latency.

ξ= min |k j i -U j i |, 1 (9)
Since the data transmission with idle vehicles may require the relay of other vehicles, the relay latency between vehicles and idle vehicles is t aw . δ(t) is the impulse function, Under the condition of k j i ̸ = U j i , such as when k j i = 1, min(δ(k j i -1), 1) = min(∞, 1) = 1 ; when k j i ̸ = 1, min(δ(k j i -1), 1) = min(0, 1) = 0, indicating that the computation position of the follow-up sub-task is MEC server, only the computation result O j i is transmitted to the MEC server latency, the other latency is 0.

Γ 1 = min(δ(k j i -1), 1) (10)
Γ 2 = min(δ(k j i -2), 1) (11)
Γ 3 = min(δ(k j i -3), 1) (12)
So the computation result O j i of the sub-task s j i is transmitted from the local vehicle to the latency of the computation position set K j i of the rear drive sub-task, and the maximum latency should be taken, that is, t lr ij :

t lr ij = max k j i ∈K j i    ξ •   Γ 1 • O j i R 2 i + t Omrelay ij +Γ 2 • O j i R 2 i + t aw +Γ 3 • O j i R 1 i + t Ocrelay ij      (13) When d i = Z j
i , the MEC server that represents the vehicle v i to unload is the current MEC server. Therefore,

|d i -Z j i |= 0, min |d i -Z j i |, 1 =0
, so there is no transmission latency between MEC servers, so t Omrelay ij = 0. When d i ̸ = Z j i , it indicates that the MEC server to be e lr ij =

k j i ∈K j i          ξ •      Γ 1 • O j i R 2 i • P u i + t Omrelay ij • P u m +Γ 2 • O j i R 2 i + t aw • P u i +Γ 3 • O j i R 1 i • P u i + t Ocrelay ij • P u b               (14
) where e lr ij represents the energy consumption of the computation result from the local vehicle to the computation position of all follow-up sub-tasks.

The total energy consumption of sub-task s j i offloaded to local computations e local ij if formulated as:

e local ij = t lc ij • P i + e lr ij (15)

B. MEC server computation model

When U j i = 1, and Z j i = n, the sub-task s j i is performed on the mec n server, which is represented by a sixtuple M E n = {n,G m ,F n ,W n , P m ,P u m }. where n represents the number of MEC server, G m is the number of CPU cycles required by MEC server to process 1 bit data, unit cycle / bit. F n is the computing resource cycle / s for the mec n server. P m is the device power when the task is executed on the MEC server, and P u m is the transmit power of the MEC server.

Transmission latency of sub-task s j i from offloading vehicle v i to MEC server t ms ij :

t ms ij = t vm ij + t Imrelay ij = I j i R 2 i + min d i -Z j i , 1 • I j i R m f ( 16
)
where t vm ij represents the latency of sub-task s j i transmitting to the MEC server where the vehicle is located, and t Imrelay ij represents the transmission latency of the optical fiber link between the sub-task s j i and the MEC server. The computation latency of sub-task s j i on MEC server t mc ij :

t mc ij = I j i • G m F i n ( 17
)
where F i n denotes the computing resource allocated to vehicle v i by MEC server, unit cycle / s. The latency of the computation result O j i of the sub-task s j i from the MEC server to the computation position set K j i of the follow-up sub-task is t mr ij :

t mr ij = max k j i ∈K j i ,q j i ∈Q j i              ξ •      Γ 1 • O j i R i m + t Omrelay ij +Γ 2 • O j i R i m + t Omrelay ij +Γ 3 • t Obrelay ij + O j i R c f      +Θ • t Omrelay ij              (18) t Obrelay ij = O j i R b f (19) Θ = min (|δ(k j i -1) • (q j i -d i )|, 1) (20)
Since the idle assistance vehicle is connected to the MEC server through the PC5 link, the return latency when the computation result O j i is transmitted from the MEC server to the idle vehicle is i of the sub-task s j i from the MEC server through the optical fiber to the BS, and R b f is the transmission rate of the optical fiber link between the MEC server and the BS. Θ • t Omrelay ij indicates that when the current computing location is MEC server, it may not be the same MEC server, and may have a transmission latency between MEC servers.

O j i R i m + t Omrelay
The sum of computation latency and computation result O j i of sub-task s j i on MEC server to follow-up sub-task computation position set s j i is written as: t mc ij + t mr ij . The energy consumption of the computation results transmitted from the current MEC server to all the position of follow-up sub-tasks e mr ij is defined.

e mr ij = k j i ∈K j i              ξ •      Γ 1 • O j i R i m + t Omrelay ij • P u m +Γ 2 • O j i R i m + t Omrelay ij • P u m +Γ 3 • t Obrelay ij • P u m + O j i R c f • P u b      +Θ • t Omrelay ij • P u m              (21)
The total energy consumption of sub-task s j i offloading to MEC e mec ij can be defined as:

e mec ij = t vm ij • P u i + t Imreleay ij • P u m + t mc ij • P m + e mr ij (22)

C. Computation model of idle vehicle

When U j i = 2, the sub-task s j i performs in idle assistance vehicles, which are represented by a quad A = {G a ,F a ,P a ,P u a }. where G a is the number of CPU cycles, unit cycles / bit, required to idle vehicles in processing 1 bit data. F a is idle vehicle computing capacity, unit cycle / s. P a is the equipment power when the task is idle to assist the vehicle, and P u a is the transmitting power of the idle to assist the vehicle. sub-task s j i from offloading vehicle v i to idle vehicle transmission latency t as ij :

t as ij = t va ij + t aw = I j i R 2 i + t aw ( 23
)
where t va ij represents the latency of data transmission from sub-task s j i to idle assistance vehicles, and t aw is the relay latency between vehicles and idle vehicles.

The computation latency of sub-task s j i in idle vehicle t ac ij :

t ac ij = I j i • G a F a (24)
The result O j i of the sub-task s j i is transmitted from the idle vehicle to the follow-up sub-task computation location set K j i with time latency t ar ij :

t ar ij = max k j i ∈K j i          ξ •      Γ 1 • O j i R i a + t aw +Γ 2 • O j i R 2 i + t Omrelay ij +Γ 3 • O j i R 1 i + t Ocrelay ij               (25)
Fig. 4: An example of critical paths of computation tasks

The computation latency of sub-task s j i in idle assistance vehicle and the latency sum of the computation result O j i returning to the computation position set

K j i of follow-up sub- task is t ac ij + t ar ij
The energy consumption of the computation process from idle vehicles to all follow-up sub-task locations e ar ij is defined as:

e ar ij = k j i ∈K j i          ξ •      Γ 1 • O j i R i a + t aw • P u a +Γ 2 • O j i R 2 i • P u a + t Omrelay ij • P u m +Γ 3 • O j i R 1 i • P u a + t Ocrelay ij • P u b               (26
) Total energy consumption of sub-task s j i offloaded to idle Vehicle e assit i is formulated as:

e assit ij = t as ij • P u i +t ac ij • P a + e ar ij (27)

D. Cloud Server Computing Model

When U j i = 3, sub-task s j i is performed on the cloud server, which is represented by a quad C= {G c ,F c ,P c ,P u c }. where G c is the number of CPU cycles required by the cloud server to process 1 bit data, unit cycle / bit. F c is the computing power of cloud server, unit cycle / s. P c is the device power when the task is executed on the cloud server, and P u c is the transmitting power of the cloud server.

The transmission latency of sub-task s j i from offloading vehicle v i to cloud server t cs i is formulated as:

t cs ij = t vb ij + t Icrelay ij = I j i R 1 i + I j i R c f ( 28
)
where t vb ij represents the latency of data transmission from sub-task s j i to BS, t Icrelay ij represents the transmission latency of optical fiber link between sub-task s j i and cloud server, and R c f is the transmission rate of optical fiber link between cloud server and BS.

The computing latency of sub-task s j i in cloud server is t cc ij :

t cc ij = I j i • G c F c (29)
The computation result O j i of the sub-task s j i is transmitted from the cloud server to the latency t cr ij of the computation position set K j i of the follow-up task:

t cr ij = max k j i ∈K j i          ξ •      Γ 1 • O j i R c f + O j i R i b +Γ 2 • O j i R c f + O j i R b f +Γ 3 • O j i R c f + O j i R i b               (30)
The sum of computing latency and computing result O j i of sub-task s j i in cloud server back to the computing position set

K j i of follow-up task is t cc ij + t cr ij
The energy consumption of the computation process from idle vehicles to all follow-up sub-task locations e cr ij is defined as:

e cr ij = k j i ∈K j i          ξ •      Γ 1 • O j i R c f • P u c + O j i R i b • P u b +Γ 2 • O j i R c f • P u c + O j i R b f • P u b +Γ 3 • O j i R c f • P u c + O j i R i b • P u b               (31)
Total energy consumption of sub-task s j i offloading to cloud servers e cloud ij is formulated as:

e cloud ij = t cs ij • P u i +t cc ij • P c + e cr ij (32)

E. Total system cost formulation

Since we consider the dual dependence of timing and data between sub-tasks. In this study, the vehicle is assumed to be a multi-antenna offloading mode, so the total latency is not a simple sum of sub-task latency. Therefore, considering the total time latency of the task S i , this paper uses the Critical Path Method ( CPM ), which is the longest path in this paper. All paths are obtained by the breadth-first traversal algorithm of DAG graph. For example, there are seven paths to complete the dependency task as shown in Fig. 4.

Assuming that the path set of task S i of vehicle v i is P ath i = {path 1 i ,path 2 i , ..., path p i }, there are a total of p paths. The total latency of task S i path path p i of vehicle v i is T p i :

T p i = T send i + j=1∧j∈P ath p i Y j i = max   J j=1,U j i =1 L j i , J j=1,U j i =2 L j i , J j=1,U j i =3 L j i   + j=1∧j∈P ath p i Y j i ( 33
)
Where T send i represents the maximum latency of simultaneous transmission task S i completion. Since all tasks that are not calculated locally need to be offloaded, the latency in this part should be the maximum latency in the MEC, idle assistance vehicles and cloud servers. And the dependencies between tasks must wait until the precursor task is finished and the results are passed to the next sub-task to start execution, so the computation latency and the backhaul latency on the path p i should be additive. The total offloading latency of vehicle v i task S i is T i , and the total energy consumption is E i . The latency sum of all computation intensive task set S of vehicle set V , namely, the total system latency is T , and the total energy consumption is E:

T = k i=1 max T 1 i ,T 2 i , ..., T p i (34) E = k i=1 J j=1 E j i (35)
The total system cost is H:

H = βT + (1 -β)E (36)
Where β ∈ (0, 1) is the latency coefficient, (1 -β) is the energy consumption coefficient. β=0.8 in this paper.

IV. RESOURCE ALLOCATION AND LOAD BALANCE MODEL FOR MEC SERVER A. MEC Server Resource Allocation Model

The scheduling server calculates the amount of tasks that each vehicle offloads to each MEC server, and the amount of offloading of the cloud server. According to the bidding idea of auction algorithm, the computation resources and BS bandwidth are allocated to each offloading vehicle.Vehicle v i with computation task S i for MEC server computing resources bidding for F b i n :

F i n =F b i n • F n =       a 1 • J j=1∧Z j i =n I j i k i=1 J j=1∧Z j i =n I j i + a 2 • min(δ(d i -n), 1)       • F n (37)
Where a 1 =0.75, a 2 =0.25. a 1 represents the weight of the computation resource request, and a 2 represents the priority weight of the vehicle. When d i =n, min(δ(d i -n), 1) = min(∞, 1) = 1; when d i ̸ = n, min(δ(d i -n), 1) = min(0, 1) = 0. Because when vehicle v i is under the mec n server, the priority of vehicle v i will be higher, which can reduce the return latency of computation results.

Vehicle v i with computation task S i bids for BS bandwidth resources, where BS bandwidth allocation factor λ i :

B i = λ i • B 1 = J j=1∧U j i =3 I j i k i=1 J j=1∧U j i =3 I j i • B 1 (38)
IEEE ITS, VTS, RA and CE Societies

IEEE Transactions on Intelligent Vehicles

Because the more vehicles offloaded to the cloud server, the more bandwidth resources should be allocated, which can reduce the transmission latency and the result backhaul latency.

The allocation of storage resources for mec n server by task S of vehicle v i is W i n :

W i n = J j=0∧Z j i =n I j i + O j i ( 39
)
Because all sub-tasks of task S i offloaded to the mec n server must be stored first, and the computation results of subtasks also need to be stored to be transmitted to the follow-up sub-task.

B. MEC Server Load Balance Model

In the vehicle networking environment, due to the mobility of vehicles, the distribution of offloading vehicles under the MEC server is uneven, resulting in unbalanced load of the MEC server. It not only makes the resources not fully utilized, but also leads to poor QoE. Therefore, it is necessary to consider load balance of MEC servers when offloading strategies and resource allocation are made.

When balancing the load of the MEC server, it is first necessary to determine the load of the mec n server. In this paper, the computing resources F n and storage resources F n of the MEC server are needed. Therefore, the determination of the load of the MEC server in this paper is mainly considered from two aspects : computing resources and storage resources.

The load state of mec n server is expressed as

γ n = (γ cpu n , γ mem n
), where γ cpu n represents the current computing resource usage of mec n server, and γ mem n represents the current memory usage of mec n server.

mec n server CPU usage is G cpu n , memory usage is G mem n :

G cpu n = γ cpu n F n , G mem n = γ mem n W n (40)
Therefore, the load of mec n server is G n :

G n = α 1 • G cpu n + α 2 • G mem n ( 41
)
where α 1 +α 2 =1 and α 1 represent the degree of attention to the use of computing resources, and α 2 represents the degree of attention to the use of memory resources. This study pays the same attention to computing resources and storage resources, so α 1 =α 2 = 0.5.

Under the scheduling server, MEC server set is M = {mec 1 , mec 2 , ..., mec n , ..., mec m }, then the load set of MEC server cluster is

G M = {G 1 , G 2 , ..., G n , ..., G m }.
In this paper, the standard deviation ω of MEC server cluster load is used to represent the load balance of cluster:

ω= 1 m • m n=1 G n - 1 m • m n=1 G n 2 (42)
The smaller ω indicates the higher load balance of MEC server cluster, and the larger ω indicates the lower load balance of MEC server cluster.

C. Problem Formulation

In the scheduling cycle ∆t, the whole process of offloading system is : Firstly, k offloading vehicles upload the relevant information of their computing-intensive tasks, such as the dependency matrix of sub-tasks, the size of sub-tasks, etc. After receiving the offloading request of the vehicle, DS considers multi-platform offloading based on the uploaded information. The resource status of m MEC servers in DS range is comprehensively analyzed to minimize the cost ( weighted sum of latency and energy consumption ) and load balance of the whole system. The offloading, MEC server resource allocation and BS bandwidth resource allocation are jointly optimized.

Finally, the offloading strategy results are returned to the offloading vehicles, BS and MEC. Each vehicle completes the computation of offloading according to the strategy results. BS and MEC allocate bandwidth and computation resources respectively. Under the premise of meeting the dependence of each vehicle's computation intensive task S i , as well as the IEEE ITS, VTS, RA and CE Societies IEEE Transactions on Intelligent Vehicles maximum tolerance of latency and resource constraints, the goal is to minimize the total cost and load balance of the joint offloading system. Therefore, the task offloading and resource allocation of the system are modeled as:

min K,U,Z,F,W,B [µ • H + (1 -µ) • ω] s.t.C1 : J j=1 I j i = I i C2 : T i ≤ T max i , ∀i ∈ [1, k] C3 : 0 ≤ F i n ≤ F n , 0 ≤ k i=1 F i n ≤ F n , ∀i ∈ [1, k], ∀n ∈ [1, m] C4 : 0 < λ i < 1, 0 < k i=1 λ i • B 1 ≤ B 1 , ∀i ∈ [1, k] C5 : 0 ≤ k i=1   J j=1,U j i =1∧Z j i =n (I j i + O j i )   ≤ W n , ∀n ∈ [1, m] C6 : U j i ∈ {0, 1, 2, 3}, Z j i , Q j i ∈ {1, 2, ..., m}, K j i ∈ {0, 1, 2, 3}, ∀i ∈ [1, k], ∀j ∈ [1, J]
(43) Where µ represents the weight of the total cost of the system in the objective function, and (1-µ) represents the weight of the load balance in the objective function. K = [K 1 , K 2 , ..., K i , ..., K k ] is the task-dependent topological matrix of all vehicles, and the i element in K corresponds to the topological vector K i of the computing task S i of vehicle v i . U = [U 1 , U 2 , ..., U i , ..., U k ] is the offloading matrix of all vehicle computation tasks. The ith element in

U i = [U 1
i , U 2 i , ..., U j i , ..., U J i ] corresponds to the offloading strategy vector U of the computation task S i of vehicle v i , that is, the offloading position corresponding to the K i neutron task. Z = [Z 1 , Z 2 , ..., Z i , ..., Z k ] represents the number of the MEC server when the offloading location is MEC.

Z i = [Z 1
i , Z 2 i , ..., Z j i , ..., Z J i ], when Z j i = 0, indicates not offloading to the MEC server. F = [F 1 , F 2 , ..., F n , ..., F m ] and W = [W 1 , W 2 , ..., W n , ..., W m ] are the computation resource allocation matrix and storage resource allocation matrix for all MEC servers, respectively. The nth row in F corresponds to the computation resource allocation vector

F n = [F 1 n , F 2 n , ..., F i n , ..., F k n ]
for the mec n server, and the nth row in W corresponds to the storage resource allocation vector

W n = [W 1 n , W 2 n , ..., W i n , ..., W k n ]
for the MEC server. B is the bandwidth resource allocation vector of BS, and the elements in the vector represent the bandwidth allocation coefficient B = [λ 1 , λ 2 , ..., λ i , ..., λ k ] T for each vehicle.

In the constraint condition, C1 denotes the amount of data that vehicle v i cuts S i into multiple dependent sub-tasks I j i equals to that of task S i ; C2 denotes that the latency T i of the computation-intensive task S i that completes vehicle v i cannot exceed the maximum tolerance latency T max i of task S i ; C3 means that the mec n server allocated to the vehicle v i computing resources F i n , can not exceed the mec n server ' s total computing resources F n , and the mec n server allocated to all offloaded vehicle computing resources and can not exceed the mec n server ' s total computing resources F n ; C4 indicates that the BS bandwidth allocation factor λ i of vehicle v i should be greater than 0 and less than 1, and the sum of BS allocation bands of all vehicle v i is less than the total BS bandwidth B 1 . C5 represents the sum of the data amount of sub-tasks and computation results offloaded by all vehicles to the mec n server, which cannot exceed the total storage resource W n of the mec n server ; C6 represents the range of discrete variables.

V. ALGORITHM DESIGN FOR THE PROBLEM SOLUTION

It can be seen that the objective function has discrete integer variables such as U j i and Z j i , and continuous variables such as F i n and λ i . Therefore, the optimization problem is a MINLP problem. At present, many studies use intelligent optimization algorithms to solve MINLP problems. PSO algorithm has memory and good convergence, but the particle is a single direction of information transmission, easy to fall into local optimum. Two-way transmission of information between chromosomes in GA algorithm has good global optimization effect, but slow convergence. Aiming at the objective function of this paper, the PSO and GA algorithm are improved, and an adaptive particle swarm genetic hybrid algorithm is proposed, which not only makes the algorithm have fast convergence ability, but also has better global search ability. In order to ensure that all the precursor tasks execute before it when the task is executed, this paper uses the DAG topology sorting algorithm to solve it. Different topological sorting will also lead to different results, so it is necessary to obtain all topological sorting results. The climbing search algorithm is used to local search for different sorting results to obtain the optimal results. The specific algorithm flow chart is described in Fig. 5.

A. Initialization of Particle and Genetic Population

According to the objective function, it is necessary to solve the K, U, Z, F, W, B six matrices. Therefore, this paper improves the coding method of PSO algorithm and GA algorithm, and uses a multi-matrix coding method. The example of multi-matrix coding is shown in Fig. 6. The particle population and the genetic population are composed of six large matrices KZ, U Z, ZZ, F Z, W Z, BZ, where N is the population size and k is the number of vehicles. To obtain the coding of the i particle/chromosome, only the corresponding lines (i-1) * k+1 to i * k of each matrix need to be taken out and operated correspondingly.

Topological matrix KZ initialization is randomly selected from all topological of vehicle tasks. The random number of offloading strategy matrix U and MEC index matrix Z is initialized with in (0,1], and then mapped to integers, when the number of MEC server n = 3, the mapping relationship is shown as Eq.48 and Eq.49 , respectively.

U j i =          0, 0 < U j i ≤ 0.25 1, 0.26 < U j i ≤ 0.5 2, 0.51 < U j i ≤ 0.75 3, 0.76 < U j i ≤ 1 (44)
Z j i =      1, 0 < Z j i ≤ (1/3) 2, (1/3) < Z j i ≤ (2/3) 3, (2/3) < Z j i ≤ 1 . ( 45
)
The whole evolution process is mainly for the computation of offloading strategy matrix U and MEC numbering matrix Z, because after the offloading strategy is determined, the offloading MEC server can be selected according to the offloading results, and the resource allocation is carried out, so as the MEC server load balance.

B. Constructing the Fitness Function

The objective optimization model is to minimize the system cost and load balance with constraints. Using particle swarm genetic hybrid algorithm, the constraint problem needs to be transformed into a non-constrained problem, and the penalty function is only one of the commonly used methods in the optimization algorithm. This paper uses adaptive penalty function to constraint the objective function.

In the objective function, C1 and C6 constraints are processed in coding, and C3, C4 and C5 are bound to meet when allocating resources in bidding. Therefore, only punishment is needed for C2 constraints, so the fitness function can be obtained as follows:

f it = µ • H + (1 -µ) • w • Ψ + c(ρ) • ( k i=1 max(0, T i -T max i )) (46) c(ρ) = e α(1-ρ) -1 (47) ρ= f ok f sum (48)
Where the Ψ value is set as 1000, since the load balance is low, it is necessary to improve its proportion in the fitness function. c(ρ) is the penalty coefficient, and ρ is the proportion of feasible solutions. ρ is inversely proportional to c(ρ), and the larger ρ is, the more feasible solution is, and c(ρ) should be reduced. When c(ρ)=0, it means that there is no feasible solution of the current population, and when c(ρ)=1, it means that the current population is all feasible. Because in the initial iteration, the number of feasible solutions in the population is low, and the penalty coefficient should be higher to guide the search into the feasible region.

C. Operations of particle swarm optimization and genetic algorithm 1) Particle velocity and position update: Large inertia weight makes particles have better global search ability, and small inertia weight is conducive to local search. Fixed inertia weight will fall into local optimization. Therefore, adaptive inertia weight is adopted in this paper, which can make particles move to the optimal position. Where w min and w max are the initial minimum and maximum inertia coefficients, f x i is the fitness value of the first particle in the t iteration, f x avg is the average fitness value of all particles in the t iteration, and f x min is the minimum fitness value of all particles in the t iteration. The inertia weight decreases with the number of iterations, so that it has better global search ability in the early stage and better local search ability in the later stage.

w t = w min + (w max -w min ) • f t i -f t min f t avg -f t min , f t i ≤ f t avg w max , f t i > f t avg (49)
Particle velocity and position update strategy is according to the following equations :

v i (t) =w t • v i (t) + c 1 • rand • [p i (t) -x i (t)] + c 2 • rand • [p g (t) -x i (t)] (50)
x i (t + 1) = x i (t) + v i (t) (51)
Where C1 and C2 are learning factors, p i (t) and p g (t) are individual history optimal position and population global optimal position respectively.

2) Select crossover and mutation operations: In the GA algorithm, the crossover probability is too low, which affects the richness of the population in the iteration process, leading to slow convergence, but too large crossover probability will affect the inheritance of good individuals. Small mutation probability is not easy to produce new individuals, affecting population diversity, mutation probability will fall into local optimum. Therefore, this paper adopts the adaptive crossover probability and mutation probability. When the fitness value of the population is dispersed, it indicates that the population is rich, so the crossover probability and mutation probability should be reduced. On the contrary, when the fitness value of the population is relatively concentrated, it indicates that the richness of the population is not enough, so the crossover probability and mutation probability should increase.

Adaptive cross probability P c :

P c =      k 1 • arcsin favg fmax π/2 , arcsin favg fmax < π/6 k 1 • (1 - arcsin favg fmax π/2
), arcsin favg fmax ≥ π/6 (52)

Adaptive mutation probability P m :

P m =      k 2 • (1 - arcsin favg fmax π/2
), arcsin

favg fmax < π/6 k 2 • arcsin favg fmax π/2
, arcsin favg fmax ≥ π/6 (53) Where f avg is the average fitness of the current population, f max is the maximum fitness of the current population, k 1 and k 2 are constants in the range of ( 0,1 ]. Partial-Mapped Crossover ( PMX ) and monarch scheme are combined to select and cross operation. Firstly, the population is arranged in ascending order according to the fitness value, and the optimal individual is crossed with other even-numbered individuals. Two new individuals are generated each time. Secondly, after the crossover, the newly generated individuals are mutated to generate sub-groups, and then their fitness values are calculated. After that, they are merged with the parent group, and are arranged in ascending order according to the fitness values. The former N individuals are taken as new groups for the next operation.

VI. SIMULATION AND RESULTS ANALYSIS A. Simulation parameter setting

In this section, in order to verify the effectiveness of the algorithm in this paper. In the initial simulation, we consider a cellular network deployed within a circular area with a radius r = 1 Km, where the vehicles are randomly distributed in this cellular network area. MEC server are deployed within a RSU, which provide storage and computation resource. For simplicity, we only consider a BS with n=3 MEC servers, i.e., 3 RSUs, the number of vehicles k is initially set to 12, and the corresponding bandwidth and computing power settings are shown in Table 1. For the computational task, we consider the dot product operation, which is the most commonly used in deep learning, and randomly loop the dot product according to the amount of operations to generate the corresponding computational task. For comparison with other algorithm. Random algorithm, PSAO algorithm proposed in work [START_REF] Scott-Hayward | A PSO approach to resource allocation in wireless networks[END_REF] and JODTS Fig. 7: Convergence performance of different algorithms Fig. 8: The impact of tasks data size on the total cost of the system with different algorithms algorithm proposed in work [START_REF] Zhao | A collaborative v2x data correction method for road safety[END_REF] are simulated and compared, The detail of compared algorithms is described as following:

Random algorithm : the dependent tasks are randomly offloaded to the local, MEC server, idle vehicle and cloud server for computation.

PSAO algorithm : Based on the offloading strategy of improved particle swarm algorithm, the computation task is offloaded to the local and the MEC server is calculated.

JODTS algorithm : Based on the offloading strategy of improved genetic algorithm, the computation task is offloaded to the local, MEC server and cloud server for computation.

B. Analysis of simulation results

Fig. 7 shows the convergence performance of different algorithms. It can be seen that the convergence speed of this algorithm is the fastest, and it converges about 120 iterations. The convergence degree of PSAO is in the middle, and it converges about 140 iterations. The slowest convergence is JODTS algorithm, which converges about 210 iterations. In Fig. 9: The influence of the number of vehicles on the load balance Fig. 10: The output data volume factor influence on the total system cost terms of global optimization, the algorithm in this paper is good, followed by JODTS algorithm, and PSAO algorithm is the worst. Because particle swarm algorithm is one-way to transmit information, genetic algorithm is two-way, so particle swarm algorithm convergence faster than genetic algorithm, but it is easy to fall into local optimum, so the particle swarm optimization ability is not strong genetic algorithm. This algorithm combines the characteristics of the two algorithms, and adds hill-climbing search strategy for local quadratic search, so the global optimization ability and convergence performance of this paper are improved.

Fig. 8 shows that when the number of vehicles under DS and the number of MEC servers are fixed, the impact of computing tasks on the total cost of the system. It can be seen from the figure that with the increase of computation tasks, the total system cost of the four algorithms also increase. and 87.62% of JODTS algorithm. And when the amount of computing tasks is more than 12, the increase is significantly increased, because when the amount of computing tasks is too large, resulting in data transmission and backhaul overhead, and MEC computing overhead increased significantly. It can be seen from the figure that the average latency of each vehicle in this algorithm is less than the maximum latency of the computation task, indicating that this algorithm can minimize the total system cost while meeting the maximum tolerance latency. Fig. 9 shows the influence of the number of vehicles on the load balance when the number of MEC servers, the number of computation tasks and the number of sub-tasks are fixed under DS. It can be seen from the figure that the proposed algorithm has the smallest load balance and the smallest increase compared with the other three algorithms, indicating that the proposed algorithm can effectively balance the load of MEC server under DS. Due to the uneven distribution of vehicle mobility, the load balance of Random algorithm is the largest and fluctuates. It can be seen from Fig. 10 that when the number of vehicles, the number of MEC servers and the amount of computing tasks under DS are fixed, the total system cost increases as the output data volume factor δ increases. Compared with the other three algorithms, the proposed algorithm has the smallest total system cost. It can be seen that the output data volume has little effect on the total cost of the system, because the output data volume is relatively small, and the optical fiber is used between MEC servers, between MEC and BS, and between BS and cloud servers in this paper, so the bandwidth is large, so the output data volume has little effect on the total cost of the system. Fig. 11 shows the impact of the number of sub-tasks of vehicle tasks on the total cost of the system when the number of vehicles, the number of MEC servers and the amount of computation tasks are fixed under DS. It can be seen from the diagram that the total system cost of the four algorithms increase with the increase of the number of vehicle sub-tasks, Fig. 11: The impact of the number of sub-tasks of vehicle tasks on the total cost of the system and the increase is obvious when the number of sub-tasks exceeds 19. The reason is that when the number of sub-tasks increases, the dependencies between tasks become complex, which increases a lot of transmission overhead. And when the number of sub-tasks exceeds a certain number, the follow-up sub-task may wait for the completion of the previous sub-task computation, resulting in waiting latency. Compared with other algorithms, the algorithm in this paper has the smallest total system cost and the smallest increase, which can effectively deal with the dependence between sub-tasks.

The impact of two different coefficients on the value of the objective function is given in Fig. 12. From the figure, we can find the effect of β for the system delay and the total system cost weight µ on the value of the objective function, and 1-β is defined as the energy consumption coefficient. It can be set according to the demand of computation intensive tasks and the state of vehicles. 1 -µ is defined as the weight of load Fig. 13: The impact of the number of idle vehicles on the total cost of the system Finally, we evaluated the impact of idle vehicles on the total system cost for different algorithms, as shown in Fig. 13. From the figure, we can see that the total system cost with different algorithms decreases as the number of idle vehicles in the system increases, and our proposed algorithm maintains a low system cost for different idle vehicles in the system, which is due to the fact that our algorithm adopts an optimal computation task offloading strategy considering the timing and data dependencies of computational tasks.

VII. CONCLUSION

In this paper, in order to solve the problem of dependent latency caused by the dual dependence of timing and data between sub-tasks, the uneven distribution of vehicle mobility causes the load imbalance of MEC server, and in order to reduce latency and energy consumption. This paper proposes a joint computation offloading and resource allocation algorithm based on dual-dependent tasks. Considering that multiple vehicle dependent tasks are offloaded to multiple computing platforms at the same time, an adaptive hybrid particle swarm with genetic algorithm is proposed to jointly optimize offloading strategy, resource allocation and load balance. Through the simulation latency, it is verified that the proposed algorithm can reduce the total system cost while meeting the maximum latency, and effectively improve the load balance of the edge server cluster.

Page 13 of 25 IEEE

 25 ITS, VTS, RA and CE Societies IEEE Transactions on Intelligent Vehicles

Fig. 2 :

 2 Fig. 2: Dependency Model of computation tasks

Page 14 of 25 IEEE

 25 ITS, VTS, RA and CE Societies IEEE Transactions on Intelligent Vehicles

Fig. 3 :

 3 Fig. 3: Computation tasks offloading scenarios in IVS

ij . t

 t Obrelay ij represents the Page 16 of 25 IEEE ITS, VTS, RA and CE Societies IEEE Transactions on Intelligent Vehicles latency of the computation result O j

Fig. 5 :

 5 Fig. 5: The flow chart of proposed algorithm

Fig. 6 :

 6 Fig. 6: Multi-matrix coding for problem solving

Page 24 of 25 IEEE

 25 ITS, VTS, RA and CE Societies IEEE Transactions on Intelligent Vehicles

Fig. 12 :

 12 Fig. 12: The impact of the coefficients β and µ on the objective function values

TABLE I :

 I Parameters of simulation Parameters Value Number of vehicles to be offloaded under BS k 4 ∼ 14 Number of MEC servers under BS n 3 Channel gain h 1 , h 2 0.8 × 10 -4 , 1.2 × 10 -4 Channel gain of vehicle with MEC/ idle vehicle h 2 1.3× 10 -4 Bandwidth between the car and BS B 1 8.4× 10 4 Hz Bandwidth between vehicle and MEC/ idle vehicle B 2

		4.8× 10 4 Hz
	Transmitting power P u i , P u m , P u a , P u b , P u c Computation power F i ,Fn,Fa,Fc	1.89,3.5,1.89,20,40 w 3× 10 5 , 8.9× 10 6 ,3× 10 5 ,5.6× 10 6 cycles/s
	Noise power N 1 , N 2	6 × 10 -14 ,5 × 10 -14 w
	Task computation Complexity Gv , Gm,Ga,Gc	20∼40 cycles/bit
	Maximum allowable latency of the task T max i Transmitting power P i , Pm,Pa,Pc	100∼300ms 5.31, 15,5.31,35 w
	Coefficient of latency weight β, µ, α 1 , α 2	0.8, 0.5, 0.7, 0.3
	Coefficient of output data δ	0.015∼ 0.04
	Relay latency between vehicles and idle vehicles taw	6∼8 ms
	Transmission rate of Optical link R c f ,R b f	20, 10 Mbps
	Particle swarm size N	600
	Learning factor c 1 , c 2	2, 1.8
	Maximum/ Minimum Velocity V min , Vmax	-0.18,0.18
	k 1 , k 2	0.53,0.42
	Maximum/ Minimum X min ,Xmax	0, 1
	Maximum iteration	300

This work was supported in part by the Chongqing Municipal projects under grant KJCX2020035, CSTB2022BSXM-JCX0117 and cstc2020jcyj-msxmX0339, in part by National Natural Science Foundation of China under grant 62106029, and in part by Chongqing Technology and Business University projects under grant 2156004 and 212017.

If r ≤ P m 10 :

ChildU , ChildZ=rand(1,1) * (Xmax -Xmin) + Xmin; 12 :

ChildU , ChildZ map back to integers 13 :

end if 14 :

After transforming ChildU , ChildZ back into matrices and obtaining the corresponding F , W , B matrices 15 :

end For 16 :

end For 17 : Search the topological paths of the topological matrix with climbing search strategy 18 : Calculate the fitness 19 : Update New Matrix K 20 : Merging parent and sub-populations after crossover and mutation 21 : Sort the merged populations in ascending order according to fitness values 22 : Select the top N individuals as the new populations