Computational Resources Allocation and Vehicular Application Ofﬂoading in VEC Networks

: With the advances in wireless communications and the Internet of Things (IoT), various vehicular applications such as image-aided navigation and autonomous driving are emerging. These vehicular applications require a signiﬁcant number of computation resources and a lower processing delay. However, these resource-limited and power-constrained vehicles may not meet the requirements of processing these vehicular applications. By ofﬂoading these vehicular applications to the edge cloud, vehicular edge computing (VEC) is deemed a novel paradigm for improving vehicular performance. However, how to optimize the allocation of computation resources of both vehicles and VEC servers to reduce the energy and delay is a challenging issue when deploying the VEC systems. In this article, we try to address this issue and propose a vehicular application ofﬂoading and computational resources allocation strategy. We formulate an optimization problem and present an efﬁcient ofﬂoading scheme for vehicular applications. Extensive simulation results are offered to analyze the performances of the proposed scheme. In comparison with the benchmark schemes, the proposed scheme can outperform them in terms of computation cost.


Introduction
In recent years, due to the developments of the communication protocols [1] as well as the advancements in the Internet of Things (IoT) and intelligent transportation system (ITS) [2], varieties of applications such as autonomous driving and image-aided navigation are emerging [3]. These applications covering the aspects of driving safety and information entertainment demand a lot of computation resources and have strict requirements for processing time. Vehicles are equipped with computing resources and sensors to handle the generated data of these applications [4]. However, due to the limited physical spaces, the local resources that are provided by the vehicles can not satisfy the Quality of Service (QoS) requirements of the vehicle applications [3,5].
To address the above issue, vehicular edge computing (VEC) is deemed a novel paradigm and technology in the 5G networks [3,6,7]. Vehicular cloud computing (VCC) was introduced to provide computing resources for vehicles to reduce power consumption and improve service performance. However, one challenge that the VCC has to face is the high latency, which makes the VCC unsuitable for the delay-sensitive vehicle applications [8]. In VEC networks, the computational resources are deployed at the roadside units, which are much closer to the vehicles. Therefore, VEC can migrate the computing resources to the network edge, which reduces the transmission delay and relieves the computing pressure on vehicles [3]. Vehicle applications can benefit a lot from the advantages of VEC. Thus, a safe and efficient transportation system can be provided [9].
Due to the development of intelligent transportation systems, the study of resource allocation and vehicular application offloading in the VEC networks has attracted a significant amount of attention, such as [3,6,7,9]. Nevertheless, jointly allocating the computing resources of both vehicles and edge servers is not thoroughly investigated in the current works.
In this paper, a joint study of allocating computing resources of vehicles and a VEC server for vehicular application offloading in VEC networks is investigated. Each vehicle user can decide its vehicular application offloading strategy by judging the computation cost caused in the local vehicles and that of the VEC server. The objective is to minimize the computation cost of all vehicles, which is calculated by the processing time of vehicular applications and the consumed energy of vehicles. The studied problem is formulated as a mixed-integer nonlinear programming (MINP) optimization problem, which is known as an NP-hard problem and is not convex. We design an efficient algorithm that can optimally solve the formulated problem.
In summary, we have the following contributions.
• We study vehicular application offloading in a VEC network system by jointly allocating computational resources of vehicles and the VEC servers. We try to minimize the consumed energy and time cost of executing the vehicle applications. We formulated the studied problem as an optimization problem. • By analyzing the structure of the problem, we know that it is MINP and well-known as non-convex, which is NP-hard. The objective problem is solved by decomposing it into three subproblems. The optimal solution for each subproblem is obtained. • Extensive simulation results are provided to prove that the proposed offloading strategy achieves better performances than the three benchmark algorithms.
The remaining study of this work is structured as follows. An overview of the vehicular application offloading and computational resources allocation in VEC networks is presented in Section 2. The system model and problem formulation are given in Section 3. The solution approach to the formulated problem is presented in Section 4. Simulation results are shown in Section 5. Section 6 concludes this work and provides some prospective aspects of research.

Related Work
Extensive research has been conducted on resource allocation and vehicular application offloading in VEC networks and its counterpart vehicular fog computing (VFC) networks in recent years. Some works assumed that the allocated resources are fixed when studying vehicular application offloading. Hou et al. proposed the infrastructure of VFC and studied the communication and computational resource utilization of each vehicle to provide communication and computation services [10]. In [11], Zhou et al. studied service provisioning for workload offloading in VEC networks. The workload offloading problem was formulated to minimize the overall energy consumption of all vehicle users while considering the total energy consumption and latency. An ADMM-based solution method was proposed to solve the workload offloading problem. In [5], Zhao et al. proposed a computation offloading framework in an SDN-enabled VEC system assisted by UAV to minimize the system costs. A sequential game was applied to solve the multi-player computing offloading problem. In [3], Wang et al. studied resource competition among vehicles for computation offloading in VEC networks. They proposed a multi-user noncooperative game to maximize the utility of each vehicle. To overcome the limitation of performance gain caused by the overhead when vehicles process their tasks on the same edge server, Dai et al. studied the integration of load balancing and task offloading in the VEC networks [6]. They formulated a MINP problem to maximize the system utility. In [12], Zhu et al. studied service latency and quality loss trade-off in VFC by optimizing task allocation. In [13], Du et al. studied the application offloading of vehicular terminals in VEC networks, which was formulated as a dual-side optimization problem to minimize the costs of VTs and the MEC server simultaneously. In [4], Sun et al. studied task replica-tion in a VEC system, where tasks of vehicles can offload their tasks to multiple vehicles, such that the offloading delay can be minimized. However, this work did not analyze computing resource allocation. In [14], Kang et al. studied data sharing security in the VEC networks by utilizing blockchain technologies. Motivated by [14], the authors proposed a consortium blockchain for securing computing resource sharing among vehicles. An incentive mechanism based on the contract was designed to motivate the vehicles to share their computing resources. In [15], Wang et al. studied computation task offloading in a VEC system where vehicles offload tasks by using the computing resources of the available neighboring VEC clusters. Their aim is to minimize the system energy consumption while the task delay constraint is satisfied. An imitation learning algorithm was proposed to schedule the tasks of vehicles. In [16], Shine et al. studied optimizing delay and energy consumption considering the design of federated learning and the computation offloading process. Their problem formulation is solved by proposing an evolutionary genetic-based algorithm. However, in the above two works, the computing resources of VEC servers are assumed to be fixed.
Some works studied the allocation of computational resources of VEC servers and vehicular application offloading. In [17], NG et al. studied resource allocation of VEC servers for coded distributed computing (CDC) task offloading in VEC. They proposed a double auction mechanism for allocating computing resources of edge servers in order to complete the CDC tasks. In [18], Ning et al. presented an intelligent offloading framework for VEC systems, where the vehicular applications and resource allocation strategy problem formulation were given, and an algorithm based on a two-sided matching scheme and DRL was developed to obtain the solution with the aim of maximizing the vehicles' quality of experience. In [9], Khayyat et al. studied computational offloading and resource allocation in multi-vehicle edge-cloud networks to minimize the entire system costs in terms of energy and time. They proposed a deep-learning-based algorithm to solve the NP-Hard problem. In [19], Wang et al. investigated the transmission power and computation resources of a vehicle for vehicular application offloading in a single-user VEC system. Due to the complexity of the studied problem, a low-complexity algorithm was proposed to solve it. In [20], Tan and Hu studied the joint allocation of communication, caching and the computation resource problem in VEC networks considering the vehicles' mobility. A deep reinforcement learning (DRL) framework was proposed to address the formulated problem. In [21], Zhou et al. studied computation resource allocation for optimizing the task assignment in VFC networks. They proposed a contract-matching method to minimize the network delay. In [22], Li et al. studied bandwidth and computation resources allocation of edge servers in order to reduce the offloading delay. In [23], the authors proposed an offloading scheme to complete delay and computation intensive tasks in VEC networks. They jointly considered link reliability and the allocation of available computation resources of vehicles. In [24], Wu and Yan studied multi-user computation offloading in vehicle-aware MEC networks. They considered computing resources and bandwidth distribution and proposed an algorithm based on deep reinforcement learning to minimize the system energy consumption and delay. In [25], Cui et al. proposed an intelligent resource allocation strategy based on RL. They combined the allocation of communication and computation resources so that the low latency and the reliability can be addressed. In this work [26], Li et al. studied a resource allocation scheme considering bandwidth allocation to minimize the total costs of energy and time. However, these works did not jointly analyze the computing resources of vehicles and VEC servers. In the work of [27], computation resource allocation and crowd sensing data offloading in the VEC systems are studied for system latency minimization without considering the energy consumption. In reference [28], Li et al. studied the computation resource allocation of both devices and the edge server. They aimed to solve the minimization problem of the energy consumption for all the devices.
For the existing works mentioned above, they either considered the allocation of the resources of vehicles or the edge server but did not jointly consider the allocation of the computation resources of both the vehicles and the edge server. Although, in [29], Wang et al. studied computation resource allocation of the MEC server, and the objective of this work is different from ours. In this paper, computation resource allocation of the vehicles and the VEC server for vehicular application offloading are investigated. Energy consumption and time cost are taken into account.

System Model and Problem Formulation
In this section, we first overview the system model and then show the formulated optimization problem. Consider a vehicular VEC system, which is composed of an VEC server and the number of N vehicles, as illustrated in Figure 1. The VEC server provides computational resources to process the generated data from the vehicular applications of these vehicles. We suppose that each vehicle has a vehicular application to be processed. The VEC server is deployed at a roadside unit (RSU), through which each vehicle's application can be transmitted and processed by the edge server. All vehicles are assumed to be within the range of the RSU. The application of vehicle i is denoted by Q i = (L i , I i ) [30], where L i denotes the application's data size in bits, and I i is the computing intensity, which means the required computing CPU cycles to finish computing one bit of the data. Let the binary value o i denote the application offloading strategy of the vehicle i. If the vehicle i processes its application by way of offloading using edge cloud resources,

Remark 1.
It should be pointed out that we considered the case that all vehicles arrive at the range of the RSU simultaneously. However, the vehicles may arrive at the range of the RSU sequentially. In this case, the computation resources will be reallocated sequentially. This case corresponds to the scenario in which computation resources are allocated according to the number of vehicles.
It should also be noted that the vehicles may take vehicle-to-everything (V2X) communication, which allows the vehicular applications of some vehicles to be processed by using the computation resources of other vehicles. In this case, the offloading strategies are almost independent of the number of vehicles and the computation capacity of the VEC server. For ease of analysis, we only considered the scenario of offloading applications to the VEC server.

Local Execution
In local execution, each vehicle will use its own computing resources to complete its application. For the vehicle i, the time cost and the energy cost for this vehicular application completion are expressed respectively as: where f i is the allocated computational resource of vehicle i in the CPU cycle numbers per second, and P i denotes the consumed power per second. The power consumed by vehicle i is denoted by where k i depends on the vehicle i s chip architecture, and its value can be 10 −26 [13]. The computing cost for the local execution is denoted as where γ i,t and γ i,e ∈ [0, 1] represent the values of the weighting factors of time and energy costs for vehicle i, respectively. If γ i,t > γ i,e , vehicle i places a higher value on the execution time of vehicular application. Otherwise, if γ i,t < γ i,e , vehicle i pays more attention to the energy cost.

VEC Server Execution
In the VEC server execution, each vehicle will offload its vehicular application to the edge cloud. When the data of the vehicular applications are offloaded to the VEC server via wireless communications, extra time for transmitting these data and energy costs will be required. For the vehicle i, its data transmission rate in the uplink channel is where B i is the bandwidth allocation, p i denotes the transmission power, h i is the channel gain denoted as d −2 i , where d i is the distance between the vehicle i and the RSU, and σ 2 0 denotes the Gaussian noise. Therefore, the time cost and energy cost for transmitting vehicle applications are respectively denoted as, When the vehicular application of vehicle i is completed by using the computational resources of the VEC server, the time cost is where F i denotes the computational resources allocated to vehicle i. The computation costs for the VEC server execution are denoted as For convenience analysis, a summary of the notations is shown in Table 1.

Problem Formulation
The resource allocation for the vehicular application offloading problem is formulated with the objective of minimizing the time and energy costs of all vehicles.
Denote C i as the computing cost for executing the vehicular application of vehicle i, which is given as Therefore, the optimization problem for time and energy cost minimization of all vehicles is expressed as, where the first constraint means that the computing resource of vehicle i should not exceed the maximum value f i,m , the second one is the constraint of computation resources allocated to vehicle i, and o i is the vehicular application offloading strategy of vehicle i.

Remark 2.
As the vehicular application offloading strategy is a binary value, the allocated computing resources of the vehicles and the VEC server are continuous values in the formulated problem. Therefore, Problem 1 is an MINP problem and non-convex, and it is hard to obtain the solution. In traditional methods, the optimal solutions to the MINP problems can be reached by applying the Dinkelbach, Branch-and-Bound, and Alternating Direction Method of Multipliers (ADMM). However, the time complexity is considered to be prohibitive [31]. In work [32], Yu et al. solved the formulated MINP problem by making use of the traditional methods, and their performances were compared. In the next section, an efficient method to solve Problem P is proposed.

Methodology
As the formulated problem in the previous section is not a standard convex optimization problem, an efficient methodology is introduced to solve it in this section. Firstly, a lemma is shown, whose proof has been provided in [33]. Our proposed solution approach is given by referring to this lemma. Lemma 1. We always have sup x,y This lemma shows that a function could be minimized by firstly optimizing some variables and optimizing the left ones later.
By referring to Lemma 1, the solution to the formulated problem, Problem 1, can be obtained by sequentially optimizing f i , F i and o i . In other words, we can firstly optimize the computing resources of vehicles, and the VEC servers, assuming that the offloading strategies of vehicles are given. Therefore, Problem 1 can be decomposed into the following subproblems: (1) Local execution problem; (2) VEC server execution problem; (3) Vehicular application offloading strategy problem.

Local Execution Problem
From Problem 1, when o i = 0, vehicles will complete their application executions by using their own computing resources. Therefore, the local execution problem is, According to the second-order derivative of Equation (13), it is easily verified that C i,l is positive in the domain of f i , which means that C i,l is convex in its domain. The first derivative of C i,l ( f i ) with respect to f i , From Equation (15), the optimal solution is It can be readily observed that C i,l ( f i ) is a monotonously increasing function when f i > f * i and a monotonously increasing function when f i < f * i . From this conclusion, the solution to the local execution problem P2 can be expressed as Consequently, the minimum computing costs in the local execution problem can be denoted as

VEC Server Execution Problem
Based on Problem 1, when o i = 1, the vehicles will execute the vehicular applications by using the computing resources in the VEC server. Therefore, the VEC server execution problem is, From the objective function of Problem 3, we can obviously observe that it monotonously decreases with f i . Therefore, the optimal solution of this function with respect to f i is f i,m .
As the domain of the objective function is convex, and from we have the conclusion that C i,e is a convex function [33]. We can formulate the following Lagrangian function where u ≥ 0 denotes the Lagrange multiplier.
We can obtain the following dual problem of Problem 3 as From we know that u > 0, and Substituting Equation (25) into Equation (23), the Lagrangian multiplier value is Substituting Equation (26) into Equation (25), the optimal computational resource allocation of the VEC server is Substituting Equation (27) into Equation (9), the optimal computation costs of the VEC server execution can be obtained and expressed as

Offloading Problem
An efficient computing resource allocation for the vehicular application offloading algorithm in the VEC system is put forward, which is illustrated in Algorithm 1. Vehicles determine to process vehicular applications by applying the computational resources that the VEC server provides if and only if the computation costs of the edge server execution are less than the computation costs of the local execution. Vehicle i determines the vehicular application offloading strategy by making a comparison of the computation costs caused by the local execution model and the VEC server execution model, When the minimum computation costs for all vehicles are obtained, the system computation costs are denoted as The computation resource allocation for vehicular application offloading strategy of each vehicle is summarized in Algorithm 1.

Experimental Evaluation
The performance gain from the proposed vehicular offloading strategy is quantified by using the numerical experimental results. In addition, the performances are confirmed by comparing our offloading scheme with the following two baseline schemes: Local Scheme: In this scheme, all vehicles complete vehicular applications by using their computational resources.
VEC Scheme: In this scheme, all vehicles complete vehicular applications by applying the computational resources of the VEC server.

Simulation Settings
We assume that there are N = 5 vehicles and one VEC server in a VEC network system. The computation capacity of the VEC server is F = 10 GHz, and the computation capacity of each vehicle is 1 GHz. Each vehicle has a vehicular application that needs to be executed. These vehicular applications can be the traffic efficiency applications, which focus on planning the route for vehicles or sharing the information of geographical location and road conditions, and the infotainment applications, which provide the location of car rental services or video streaming services. For the vehicular application i, its data size L i is chosen from the range [0.2, 1] Mbits, computing intensity is set as 1000 cycles per bit, transmission power p i is set as 0.2 W and bandwidth B i is set as 0.36 WHz. The Gaussian noise is set as 10 −13 W. The distance between the vehicles and the RSU ranges from 0 to 1000 m. The default parameter values are shown in Table 2. We set these values by mainly referring to [15,25,34]. These values have been verified in real-world datasets.

Impacts of the Values of Weighting Factor
The impacts of the values of weighting factors on the offloading strategies and the time cost and energy of vehicular applications are analyzed. We set the vehicle number as 5, the capacity of the VEC server as 5 GHz, and γ i,t as 0.2, 0.5, and 0.8, respectively. The experimental results are shown in Figure 2a-c. Figure 2a plots the impacts of values of weighting factors on the offloading strategies of vehicle users. In Figure 2a, when γ i,t = 0.2, it can be observed that vehicle users 2, 3, 4, and 5 execute their vehicular applications in the VEC server while vehicle user 1 executes its vehicular application locally. One reason is because of the fact that the data size of the vehicular application of vehicle user 1 is smaller than other vehicle users. Another reason is that vehicle users consider execution time the main factor in this situation. In Figure 2a, when γ i,t = 0.5, it can be found that only vehicle user 5 executes its vehicular application in the VEC server. Especially when γ i,t = 0.8, we find that all vehicle users execute their vehicular applications locally.
In Figure 2b, it is easily found that the time cost decreases with the values of the weighting factor γ i,t increasing. Conversely, it is seen from Figure 2c that the energy cost increases as the value of the weighting factor increases. By comparing Figures 2b and 2c, we see that the weighting factor plays a vital role in the costs of time and energy.

Impacts on the Capacity of the VEC Server
The impacts of the capacity of the VEC server on the offloading strategies, the time and energy cost, and the computation cost are analyzed, respectively. We set the vehicle number as 5, varied the capacity of the VEC server from 4 to 8 GHz, and show the simulation results in Figures 3-6. Figure 3a-c plots the impacts of the capacity of the VEC server on the offloading strategies that vehicles use, considering different values of the weighting factor. We set the vehicle number as 5 and varied the capacity of the VEC server from 4 to 8 GHz. In Figure 3a, it is observed that all vehicle users will offload their vehicular applications in case the capacity of the VEC server increases. In particular, for the vehicular applications of the vehicle users whose data sizes are larger than others, they are executed in the VEC server when γ i,t = 0.2. However, in Figure 3b, when γ i,t = 0.5, only some vehicle users will take the offloading strategies. In Figure 3c, when γ i,t = 0.8, all vehicle users will execute their vehicular applications in the local model. This is because the local execution time is smaller than the time cost in the offloading and execution.        Figure 4a,b depicts the impacts of the capacity of the VEC server on the time cost considering different values of the weighting factor. We set the vehicle number as 5 and varied the capacity of the VEC server from 4 to 8 GHz. In the two figures, we see that the time cost of each vehicle user decreases as the capacity of the VEC server increases when γ i,t = 0.2. However, when γ i,t = 0.5, the time cost of each vehicle user is not necessarily decreased. This is because some vehicle users execute their vehicular applications locally, and the local time cost is more minor compared to the time cost in the VEC server. Figure 5a,b depicts the impacts of the capacity of the VEC server on the energy cost considering different values of the weighting factor. In Figure 5a, we see that the energy cost of each vehicle user will decrease with the increase in the capacity of the VEC server when γ i,t = 0.2. However, when γ i,t = 0.5, the energy of some vehicle users, such as the 2, 3, 4, and 5, will increase. This is because some of these vehicle users execute their vehicular applications locally while others offload.   Figure 6a,b illustrates the impacts of the capacity of the VEC server on the computation cost considering different values of the weighting factor. In Figure 4, we obtain the observation that the computation cost of all vehicle users decreases under the VEC Scheme and the Proposed Scheme with the increase in the capacity of the VEC server. However, the computation cost of the VEC Scheme does not change versus the increase in the capacity of the VEC server. When γ i,t = 0.2, the computation cost of the VEC Scheme is much higher than the computation cost of the VEC Scheme. From the two figures, we have the evident observation that the Proposed Scheme can outperform the two baseline schemes.

Discussions
In this paper, we only considered the Vehicle-to-RSU (V2R) case, namely, offloading vehicular applications to the VEC server. However, we can also consider the case of Vehicleto-Vehicle (V2V) [35][36][37], which allows applications to be processed by other vehicles. Vehicle networks can apply the two communication models to support a series of vehicular applications, which mainly include the following categories [36,38]: Autonomous/Cooperative Driving: This kind of vehicular application mainly adopts the V2V communication model and has a much higher requirement for latency, typically less than 10 ms.
Traffic Safety: This kind of application is to provide traffic safety services for the vehicle, such as the pre-sense crash warning, which requires 50 ms of round-trip latency.
Traffic Efficiency: The traffic efficiency applications mainly focus on planning the route for vehicles and sharing information on geographical location and road conditions. Such vehicular applications generally do not have strict requirements for tolerable latency, ranging from 100 to 500 ms.
Infotainment: The infotainment applications can offer the location of car rental services or video streaming services. These types of vehicular applications have the lowest requirements for tolerable latency compared with the other categories of vehicular applications.
According to the experimental results and analysis in Chapter 5 and the categories of the vehicular applications, the proposed model of this paper can be applied to traffic efficiency applications and infotainment applications. For the traffic safety applications and traffic efficiency applications, as they have extreme requirements for latency, the operator of the VEC system has to enlarge its cloud capacity to provide more computation resources.
Our study can be further investigated from the following aspects. First, the queueing model can be applied to analyze the performances of the VEC system [39]. Second, the Software Defined Networking (SDN) technology can be applied to the VEC system [2,5]. Third, the safety issue of the VEC systems needs to be further explored [40]. In addition, the digital twin [41], unmanned aerial vehicle (UAV) [42] and reconfigurable intelligent surfaces (RISs) [43] can be integrated into the VEC system. Other solution methods to the MINP problems, such as the dandelion algorithm (DA) [44] and Bat algorithm [45], can also be adopted to solve the formulated problem.

Conclusions
This paper has presented an investigation of computational resource allocation and vehicular application offloading in a VEC network system. In a specific manner, we analyzed the computational resource allocation of the VEC server and the vehicles to minimize the computation cost in terms of time and energy costs. We formulated an optimization problem by considering both the time and energy cost of vehicles. As the objective function for the optimization problem is not convex, the formulated problem is known as a MINP problem, which is NP-hard. To solve this problem, we decomposed it into three sub-problems, and the solution to each one was obtained. We have analyzed the impacts of different parameters, such as the values of the coefficient factors and the capacity of the VEC server on the time and energy costs as well as the computation cost. The simulation results have revealed that the proposed offloading scheme has the benefits of efficient allocation of computation resources and vehicular application processing in the VEC network system. The experimental results highlighted the fact that the values of coefficient factors and the capacity of the VEC server have a dramatic impact on the offloading strategies of vehicle users. In comparison to the two baseline schemes, the proposed scheme reveals its superiority in the cost of time and energy. Moreover, the computation cost can be significantly reduced.
Funding: This work is supported in part by a funding project for the cultivation of outstanding talents in Colleges and Universities (gxyqZD2021135), the Natural Science Foundation of Anhui Provincial Education Department (KJ2020A0733), scientific research of high level talents of Bengbu University (BBXY2020KYQD02), and High Level Scientific Research and Cultivation Project of Benbu University (2021pyxm05).

Data Availability Statement:
The data of this paper can be available from the corresponding author.
Acknowledgments: The authors of this paper would like to thank the academic editor and the anonymous reviewers for their precious comments, which contributed a lot to improving the quality of this paper.

Conflicts of Interest:
The authors declare that they have no conflict of interest.

Abbreviations
The following abbreviations are used in this paper: VEC vehicular edge computing MEC mobile edge computing IoT Internet of Things MINP mixed-integer nonlinear programming