# Computing Resource Allocation Strategy Based on Mobile Edge Computing in Internet of Vehicles Environment

Authors: Deng Gao
Journal: Mobile Information Systems
 (2022)

---

## Abstract

The rapid growth of the Internet of Vehicles applications leads to unreasonable resource allocation, task computing delay, and large energy consumption. To solve this problem, this paper proposes a computing resource allocation strategy based on mobile edge computing in the Internet of Vehicles environment. Firstly, we analyze the process of mobile edge computing network and resource allocation. Then, it is improved by introducing the Halton sequence into the traditional genetic algorithm, and the difference between populations is reduced by canceling the randomness to generate an initial population with smaller individual differences. Furthermore, by optimizing the parameter setting method of traditional genetic algorithm, the crossover probability and mutation probability that change dynamically with fitness value are given, which improves the accuracy of the algorithm. Finally, the simulation results show that under the premise of the same number of tasks, the average delay and total cost of the proposed strategy are also the smallest. When the number of tasks is 45, the average delay of the proposed method is 0.32 s and the total cost is 0.34, which are better than the comparison method. Simulation results show that the improved algorithm has more advantages in delay and overhead.


---

## Body

## 1. Introduction

Nowadays, with the rapid development of communication technology, the increasing number of smart devices increases the burden of network transmission and makes the data transmission delay more and more obvious [1, 2]. The proposal of mobile edge computing solves the computationally intensive computing tasks to a certain extent [3–5]. The proposal of the Internet of Vehicles (IoV) system realizes a wireless connection between the drive test unit and pedestrians. The in-vehicle business is composed of various computing tasks, and the calculation results generated by different computing tasks will be sent to in-vehicle terminals, which is the basic basis for ensuring the normal operation of vehicles [6–8]. In process of computing tasks, resource allocation plays an important role. A reasonable resource allocation strategy can accelerate the result generation of computing tasks and improve the security of vehicle-mounted terminals [9, 10].At present, a mobile edge computing server is usually configured in an IoV system to reduce the delay of vehicle-to-infrastructure and vehicle-to-vehicle services, and a reasonable resource allocation strategy is used to save the energy consumption of mobile terminals and the delay caused by computing tasks, so as to achieve vehicle safety [11–13]. Reference [14] aimed at the dynamic allocation of IoV resources, and the target problem was transformed into a semi-Markov decision model by introducing resource retention and a secondary allocation mechanism. However, this method did not solve the problem of resource usage and system optimization when vehicle terminal resources were limited. Reference [15] aimed at the resource block conflict in the resource allocation method of the IoV system, based on the characteristics of the driving direction of vehicles, the interference between vehicles in opposite directions is reduced by dividing resource pools. Besides, the collision probability of resource reselection is reduced by having each resource block carry location information. However, it is difficult for this method to obtain accurate channel state information in a high-speed moving vehicle environment. Aiming at the problem that the resource allocation method in the IoV system is not suitable for video semantics and other services, reference [16] gave a video semantic-driven resource allocation guidance model and a corresponding solution method with target detection as the objective function. They proposed a resource allocation algorithm based on reinforcement Q-learning by constructing a resource allocation optimization model. However, this method has only been studied for services such as video semantics, which has certain limitations. Reference [17] analyzed the optimal channel matching problem with the objective function of maximizing the utilization rate of spectrum resources, aiming at the problem of terminal equipment and insufficient capacity of the IoV system to meet the basic service quality of IoV communication. The problem was solved using KM (Kuhn Munkres) algorithm. But this method did not consider wireless delay, network delay, and computational delay. Reference [18] established a Markov decision process model with the objective function of maximizing total channel capacity and the successful delivery rate of load by considering the V2V link as a separate individual. The SAC reinforcement learning algorithm was used to solve the model, and the optimal allocation of V2V link spectrum resources was realized. However, the convergence rate of this method was slow. Reference [19] divided the tasks generated by vehicles in view of problems such as the differentiated resource allocation mechanism in the in-vehicle cloud system. The divided subtasks were downloaded to an on-board cloud system and executed collaboratively by different vehicles, thereby improving the offloading efficiency of tasks. On this basis, the DiffServ model was used to sort and process tasks according to task pricing, and the optimization of resource allocation was realized. But this method did not reduce the impact of resource mobility on vehicle cloud performance. Reference [20] aimed at the problem of limited Vehicle Fog Computing (VFC) resources in the IoV system, which cannot allow multiple vehicles to simultaneously offloading computing tasks from the cloud to the network edge and formulated a corresponding fog resource allocation strategy by using parked vehicles. The optimization of the resource allocation strategy was achieved by introducing reinforcement learning into the heuristic algorithm. However, this method increased task delay while reducing energy loss, and the success rate of the task needs to be improved [21–25].Based on the above-given analysis, aiming at the problems of unreasonable resource allocation, large task computing delay, and energy consumption brought about by the rapid growth of IoV applications, this paper proposes a computing resource allocation strategy based on mobile edge computing in the IoV environment. The network model and allocation strategy based on mobile edge computing are constructed, and the model is solved by improving the genetic algorithm. The proposed method is simulated and analyzed by simulation experiments. The experimental results show that the introduction of the Halton sequence into a genetic algorithm can reduce the differences between individuals and strengthen the global search ability of the algorithm. Moreover, dynamically and adaptively changing the crossover probability and mutation probability can solve the problem of the local optimal solution and improve algorithm accuracy. Compared with traditional computing resource allocation strategies, the innovation of the proposed method lies in the following statements:(1)
The delay and energy consumption cost of local processing and mobile edge computing server processing are comprehensively considered, and the total task cost and calculation method are quantified(2)
Halton sequence is introduced in process of generating the initial population by genetic algorithm, which reduces the differences between individuals in the population(3)
By giving the crossover probability and mutation probability that change dynamically with fitness value, the local optimization problem is solved and calculation accuracy is improved


## 2. System Model

The mobile edge computing network model based on the drive test unit in the IoV environment is shown in Figure1.Figure 1
Mobile edge computing network based on drive test unit in IoV environment.It is assumed that each drive test unit hasR independent computing execution units, and the arrival of mobile terminal request to uninstall the application follows the Poisson formula with an average rate of λ. The specific process is as follows:(1)
If a move request runs in the drive test unit, the end of the task will follow an exponential distribution with rateηa, and the average service time of this move request in the drive test unit is 1/ηa. In the model shown in Figure 1, the CPU that each task request is allowed to be assigned in the drive test unit is a fixed value Ca.(2)
If the system decides to complete tasks locally, the end of tasks will follow an exponential distribution with a rateηb, and the average service time of this movement request in the drive test unit is 1/ηb. At this time, each vehicle in Figure 1, the execution of mobile applications is supported with a fixed number of Cb CPUs.The specific process of resource allocation decision-making is shown in Figure2.Figure 2
Decision-making process for resource allocation.As shown in Figure2, when a new request arrives, the system decides whether to accept it or not based on the current state. If the request is acceptable, the system assigns a new service request to the drive test unit or offloads it locally. The ultimate goal is to decide how the task is offloaded, i.e., whether to accept mobile service requests. If the request is accepted, it is necessary to finalize how many resources the running mobile application should allocate to maximize system benefits.


## 3. Problem Definition

### 3.1. Local Processing Cost

Usingxu,yu to represent the location information of u vehicle and using xv,yv to represent the location information of v mobile edge computing server. For the local offloading request, when xu,v=0, the task is processed by the vehicle itself and the cost of the vehicle task is mainly composed of the following two parts.


#### 3.1.1. The Time It Takes for the Vehicle Itself to Complete Tasks

For local task processing, the processing delay of tasks is mainly generated by the time of theu vehicle itself to process tasks, so the processing delay of local tasks is shown in the following formula:(1)Du,vb=Su,v⋅QJub.Here,Du,vb represents the processing delay of the local task of the u vehicle. Su,v represents the data size of the task. Q represents the number of turns that the CPU rotates to process 1 bit data. Jub represents the computing power of the u car itself.


#### 3.1.2. the Energy Consumption Required by Vehicle to Complete Tasks

For the local task processing, the energy consumed by task processing is mainly generated by the process of theu vehicle itself processing tasks, so the processing energy consumption of local task is shown in the following formula:(2)Eu,vb=Su,v⋅Q⋅Ec.Here,Eu,vb represents the processing energy consumption of the local task of the u vehicle. Ec represents the energy consumed by the CPU to make one revolution.


### 3.2. Processing Cost of Mobile Edge Computing Servers

For the mobile edge computing server, whenxu,v≠0; that is, the u vehicle decides to offload some tasks to the v mobile edge computing server for processing. The entire task processing process includes three processes: offloading the task, moving edge computing server to process the task, and feeding back task result. For the u vehicle, the delay and energy consumption are also generated by these following three processes:(1)
Theu vehicle uploads some tasks and related data to the v mobile edge computing server, resulting in a delay.In process of task offloading, when theu vehicle decides to offload some tasks to the mobile edge computing server, the user needs to upload the relevant tasks and data to the mobile edge computing server. Therefore, the delay of task offloading can be obtained from the task size and transmission rate, and the specific process is shown in the following formula:(3)Du,va=xu,v⋅Su,vμu,vp.Here,Du,va represents the delay of task offloading to the v mobile edge computing server. xu,v represents the task offloading decision for the u vehicle. μu,vp represents the data transmission rate of uplink between the u vehicle and the v mobile edge computing server, and the data transmission rate can be calculated by the following formula:(4)μu,vp=Bu,vlog21+k.Here,Bu,v represents the link channel bandwidth allocated between the u vehicle and the v mobile edge computing server. k represents the signal-to-noise ratio, which can be calculated by the following formula:(5)k=PRPI+PN.Here,PR represents the received power, PI represents the interference power, and PN represents the noise power.In process of mobile edge computing server processing tasks, after receiving the task and data of theu vehicle, the mobile edge computing server will allocate certain computing and communication resources to process tasks. The time delay is also generated from this, as shown in the following formula:(6)Du,vc=xu,v⋅Su,v⋅QJvc.Here,Du,vc represents the delay in allocating computing and communication resources to process tasks. Jvc represents the computing resources allocated by the mobile edge computing server to the current task, and its value satisfies the constraints shown in the following formula:(7)∑v=1VJvc≤JC.Here,JC represents the total computing resources of the mobile edge computing server.After the mobile edge computing server processes the task, the task result is fed back to theu vehicle. Thus, the resulting delay is the time for the u vehicle to receive task results from the downlink, which can be expressed by the following formula:(8)Du,vd=λ⋅xu,v⋅Su,vμu,vd.Here,Du,vd represents the time delay for the u vehicle to receive task results from the downlink. λ represents the ratio of output data to input data, which can generally be set to 0.1. μu,vd represents the data transmission rate of downlink, and the transmission rate of uplink and the downlink can be considered to be the same for the u vehicle.It can be seen from formula (8) that the total delay of mobile edge computing server to complete tasks is shown in the following formula: (9)Du,vE=Du,va+Du,vc+Du,vd.(2)
Thev mobile edge computing server allocates part of communication and computing resources to process tasks and generates energy consumption for processing tasks. Since the energy consumption of the mobile edge computing server is not considered in the set vehicle edge network, only the energy consumed by the first vehicle to complete the task needs to be considered. The process of generating energy consumption is mainly composed of three parts: the energy consumption of task offloading of the u vehicle, the computing energy consumption of the u vehicle completing the local task, and the energy consumption of the u vehicle receiving result feedback.During the process of offloading tasks from theu vehicle, when the u vehicle decides to offload some tasks to the mobile edge computing server, the relevant data needs to be transmitted to the mobile edge computing server. The energy consumption generated by this process is shown in the following formula:(10)Eu,va=xu,v⋅Su,v⋅E0.Here,Eu,va represents the energy consumed by the transmission of related data to a mobile edge computing server. E0 represents the energy consumed to transmit 1 bit data.After theu vehicle uploads part of the tasks to the mobile edge computing server, the remaining part of the tasks needs to be executed locally, thus generating energy consumption. This part of energy consumption can be obtained from the remaining task size and the unit data processing energy consumption, and the specific process is shown in the following formula:(11)Eu,vc=1−xu,v⋅Su,v⋅Q⋅Ec.Here,Eu,vc represents the energy consumption generated by executing the remaining partial tasks locally. E0 represents the energy consumed to transmit 1 bit data.When a mobile edge computing server processes the task, it needs to feedback task results to theu vehicle and the u vehicle also needs to consume energy to receive task result. The specific process of solving this part of energy consumption is shown in the following formula:(12)Eu,vd=δ⋅xu,v⋅Su,v⋅E0.Here,Eu,vd represents the energy consumed by the u vehicle to receive the feedback task result. δ represents the path loss factor, which can generally be set to −4.It can be seen from formula (12) that the total energy consumption of the u vehicle to complete the task is generated by the above-given three processes, and the calculation method of total energy consumption can be obtained as shown in the following formula:(13)Eu,v=Eu,va+Eu,vc+Eu,vd.


### 3.3. Total Cost and Problem Definition

In the proposed mobile edge computing network based on the drive test unit in the IoV environment, the delay cost and energy consumption cost are comprehensively considered. Therefore, the total cost of the system can be defined as the weighted sum of total energy consumption and total delay, thus forming a new cost objective function as shown in the following formula:(14)Wu,v=β1⋅Du,v+β2⋅Eu,v.Here,β1 and β2 represent the weights of delay and energy consumption, respectively, and have β1+β2=1. The proposed network has higher requirements for delay, so it is set as β1=0.8, β2=0.2.For the delayDu,v of the u vehicle, it is necessary to comprehensively consider the processing time of the local task and the processing time of some tasks uploaded to the mobile edge computing server, as shown in the following formula:(15)Du,v=1−xu,vDu,vb+Du,vE.The purpose of considering delay and energy consumption is to minimize the total system cost by jointly optimizing the task offloading decisionxu,v of the u vehicle and the resource allocation strategy Bu,v,Jvc of the mobile edge computing server. Therefore, we can consider this joint optimization problem and propose the corresponding objective function as shown in the following formula:(16)minxu,v,Bu,v,Jvc∑uU∑vVβ1⋅Du,v+β2⋅Eu,v.The total cost of the system can be minimized by finding the optimal task offloadingxu,v and resource allocation strategy Bu,v,Jvc of mobile edge computing server, but this needs to consider the constraints of limited communication and computing resources. Considering the proposed constraints comprehensively, it is shown in the following formula:(17)xu,v∈0,1,∀u∈U,Du,v≤σmax,∀v∈V,0≤∑vVJvc≤JC,∀v∈V,0≤∑uUBu,v≤BS,∀u∈U.Here, the first constraint indicates that the value of offloading strategy is a value between 0 and 1. The second constraint indicates that the task must meet the delay requirement, andσmax indicates the maximum tolerated delay. The third constraint shows that the sum of computing resources allocated by all tasks cannot exceed the total computing resources of the mobile edge computing server. The fourth constraint guarantees that the sum of bandwidth allocated by all tasks cannot exceed the total channel bandwidth.


## 3.1. Local Processing Cost

Usingxu,yu to represent the location information of u vehicle and using xv,yv to represent the location information of v mobile edge computing server. For the local offloading request, when xu,v=0, the task is processed by the vehicle itself and the cost of the vehicle task is mainly composed of the following two parts.


### 3.1.1. The Time It Takes for the Vehicle Itself to Complete Tasks

For local task processing, the processing delay of tasks is mainly generated by the time of theu vehicle itself to process tasks, so the processing delay of local tasks is shown in the following formula:(1)Du,vb=Su,v⋅QJub.Here,Du,vb represents the processing delay of the local task of the u vehicle. Su,v represents the data size of the task. Q represents the number of turns that the CPU rotates to process 1 bit data. Jub represents the computing power of the u car itself.


### 3.1.2. the Energy Consumption Required by Vehicle to Complete Tasks

For the local task processing, the energy consumed by task processing is mainly generated by the process of theu vehicle itself processing tasks, so the processing energy consumption of local task is shown in the following formula:(2)Eu,vb=Su,v⋅Q⋅Ec.Here,Eu,vb represents the processing energy consumption of the local task of the u vehicle. Ec represents the energy consumed by the CPU to make one revolution.


## 3.1.1. The Time It Takes for the Vehicle Itself to Complete Tasks

For local task processing, the processing delay of tasks is mainly generated by the time of theu vehicle itself to process tasks, so the processing delay of local tasks is shown in the following formula:(1)Du,vb=Su,v⋅QJub.Here,Du,vb represents the processing delay of the local task of the u vehicle. Su,v represents the data size of the task. Q represents the number of turns that the CPU rotates to process 1 bit data. Jub represents the computing power of the u car itself.


## 3.1.2. the Energy Consumption Required by Vehicle to Complete Tasks

For the local task processing, the energy consumed by task processing is mainly generated by the process of theu vehicle itself processing tasks, so the processing energy consumption of local task is shown in the following formula:(2)Eu,vb=Su,v⋅Q⋅Ec.Here,Eu,vb represents the processing energy consumption of the local task of the u vehicle. Ec represents the energy consumed by the CPU to make one revolution.


## 3.2. Processing Cost of Mobile Edge Computing Servers

For the mobile edge computing server, whenxu,v≠0; that is, the u vehicle decides to offload some tasks to the v mobile edge computing server for processing. The entire task processing process includes three processes: offloading the task, moving edge computing server to process the task, and feeding back task result. For the u vehicle, the delay and energy consumption are also generated by these following three processes:(1)
Theu vehicle uploads some tasks and related data to the v mobile edge computing server, resulting in a delay.In process of task offloading, when theu vehicle decides to offload some tasks to the mobile edge computing server, the user needs to upload the relevant tasks and data to the mobile edge computing server. Therefore, the delay of task offloading can be obtained from the task size and transmission rate, and the specific process is shown in the following formula:(3)Du,va=xu,v⋅Su,vμu,vp.Here,Du,va represents the delay of task offloading to the v mobile edge computing server. xu,v represents the task offloading decision for the u vehicle. μu,vp represents the data transmission rate of uplink between the u vehicle and the v mobile edge computing server, and the data transmission rate can be calculated by the following formula:(4)μu,vp=Bu,vlog21+k.Here,Bu,v represents the link channel bandwidth allocated between the u vehicle and the v mobile edge computing server. k represents the signal-to-noise ratio, which can be calculated by the following formula:(5)k=PRPI+PN.Here,PR represents the received power, PI represents the interference power, and PN represents the noise power.In process of mobile edge computing server processing tasks, after receiving the task and data of theu vehicle, the mobile edge computing server will allocate certain computing and communication resources to process tasks. The time delay is also generated from this, as shown in the following formula:(6)Du,vc=xu,v⋅Su,v⋅QJvc.Here,Du,vc represents the delay in allocating computing and communication resources to process tasks. Jvc represents the computing resources allocated by the mobile edge computing server to the current task, and its value satisfies the constraints shown in the following formula:(7)∑v=1VJvc≤JC.Here,JC represents the total computing resources of the mobile edge computing server.After the mobile edge computing server processes the task, the task result is fed back to theu vehicle. Thus, the resulting delay is the time for the u vehicle to receive task results from the downlink, which can be expressed by the following formula:(8)Du,vd=λ⋅xu,v⋅Su,vμu,vd.Here,Du,vd represents the time delay for the u vehicle to receive task results from the downlink. λ represents the ratio of output data to input data, which can generally be set to 0.1. μu,vd represents the data transmission rate of downlink, and the transmission rate of uplink and the downlink can be considered to be the same for the u vehicle.It can be seen from formula (8) that the total delay of mobile edge computing server to complete tasks is shown in the following formula: (9)Du,vE=Du,va+Du,vc+Du,vd.(2)
Thev mobile edge computing server allocates part of communication and computing resources to process tasks and generates energy consumption for processing tasks. Since the energy consumption of the mobile edge computing server is not considered in the set vehicle edge network, only the energy consumed by the first vehicle to complete the task needs to be considered. The process of generating energy consumption is mainly composed of three parts: the energy consumption of task offloading of the u vehicle, the computing energy consumption of the u vehicle completing the local task, and the energy consumption of the u vehicle receiving result feedback.During the process of offloading tasks from theu vehicle, when the u vehicle decides to offload some tasks to the mobile edge computing server, the relevant data needs to be transmitted to the mobile edge computing server. The energy consumption generated by this process is shown in the following formula:(10)Eu,va=xu,v⋅Su,v⋅E0.Here,Eu,va represents the energy consumed by the transmission of related data to a mobile edge computing server. E0 represents the energy consumed to transmit 1 bit data.After theu vehicle uploads part of the tasks to the mobile edge computing server, the remaining part of the tasks needs to be executed locally, thus generating energy consumption. This part of energy consumption can be obtained from the remaining task size and the unit data processing energy consumption, and the specific process is shown in the following formula:(11)Eu,vc=1−xu,v⋅Su,v⋅Q⋅Ec.Here,Eu,vc represents the energy consumption generated by executing the remaining partial tasks locally. E0 represents the energy consumed to transmit 1 bit data.When a mobile edge computing server processes the task, it needs to feedback task results to theu vehicle and the u vehicle also needs to consume energy to receive task result. The specific process of solving this part of energy consumption is shown in the following formula:(12)Eu,vd=δ⋅xu,v⋅Su,v⋅E0.Here,Eu,vd represents the energy consumed by the u vehicle to receive the feedback task result. δ represents the path loss factor, which can generally be set to −4.It can be seen from formula (12) that the total energy consumption of the u vehicle to complete the task is generated by the above-given three processes, and the calculation method of total energy consumption can be obtained as shown in the following formula:(13)Eu,v=Eu,va+Eu,vc+Eu,vd.


## 3.3. Total Cost and Problem Definition

In the proposed mobile edge computing network based on the drive test unit in the IoV environment, the delay cost and energy consumption cost are comprehensively considered. Therefore, the total cost of the system can be defined as the weighted sum of total energy consumption and total delay, thus forming a new cost objective function as shown in the following formula:(14)Wu,v=β1⋅Du,v+β2⋅Eu,v.Here,β1 and β2 represent the weights of delay and energy consumption, respectively, and have β1+β2=1. The proposed network has higher requirements for delay, so it is set as β1=0.8, β2=0.2.For the delayDu,v of the u vehicle, it is necessary to comprehensively consider the processing time of the local task and the processing time of some tasks uploaded to the mobile edge computing server, as shown in the following formula:(15)Du,v=1−xu,vDu,vb+Du,vE.The purpose of considering delay and energy consumption is to minimize the total system cost by jointly optimizing the task offloading decisionxu,v of the u vehicle and the resource allocation strategy Bu,v,Jvc of the mobile edge computing server. Therefore, we can consider this joint optimization problem and propose the corresponding objective function as shown in the following formula:(16)minxu,v,Bu,v,Jvc∑uU∑vVβ1⋅Du,v+β2⋅Eu,v.The total cost of the system can be minimized by finding the optimal task offloadingxu,v and resource allocation strategy Bu,v,Jvc of mobile edge computing server, but this needs to consider the constraints of limited communication and computing resources. Considering the proposed constraints comprehensively, it is shown in the following formula:(17)xu,v∈0,1,∀u∈U,Du,v≤σmax,∀v∈V,0≤∑vVJvc≤JC,∀v∈V,0≤∑uUBu,v≤BS,∀u∈U.Here, the first constraint indicates that the value of offloading strategy is a value between 0 and 1. The second constraint indicates that the task must meet the delay requirement, andσmax indicates the maximum tolerated delay. The third constraint shows that the sum of computing resources allocated by all tasks cannot exceed the total computing resources of the mobile edge computing server. The fourth constraint guarantees that the sum of bandwidth allocated by all tasks cannot exceed the total channel bandwidth.


## 4. Design of Adaptive Improved Genetic Algorithm

### 4.1. Genetic Algorithm

A genetic algorithm is an intelligent algorithm that simulates natural selection and biological evolution in nature and is a computational model that simulates Darwin’s theory of evolution. According to Darwin’s theory of evolution, the evolution of biological species follows the principle of “natural selection, survival of fittest,” and there is fierce competition within and between species. Only adaptive individuals can survive. The genetic algorithm searches for the optimal solution by simulating the biological evolution process, which transforms the solving process of the problem into the selection, crossover, and mutation process of chromosomal genes. Only individuals with strong adaptability to the environment can retain it with a high probability.The genetic algorithm regards the feasible solution set space as a population, and each feasible solution corresponds to an individual. Through continuous selection, crossover, and mutation operations, a group of individuals more adapted to the environment is generated. After several iterations, individuals who do not adapt to the environment are gradually eliminated by the environment. The individual with the largest fitness function value is the optimal solution of the problem. The flow of the genetic algorithm is shown in Figure3.Figure 3
The process of genetic algorithm.


### 4.2. Genetic Algorithm Improvement

In process of solving the traditional standard genetic algorithm, the generation of the initial population of the algorithm and the setting of parameters such as genetic operators are relatively random. After many iterations, excellent individuals will occupy the entire population and it is difficult to generate new individuals, resulting in premature convergence of the algorithm and easy to fall into local optimum. At this time, the characteristics of the population remain basically unchanged, so it is considered to improve the traditional genetic algorithm to prevent the algorithm from falling into the local optimal solution.Genetic algorithms generate different populations through crossover and mutation operations, so it is considered to generate initial populations with less difference by introducing Halton sequences. Strengthening the global search ability of the algorithm as much as possible and improving the search accuracy, thereby preventing the algorithm from prematurely converging and falling into a local optimum.The first step of the genetic algorithm is to generate the initial population, which is to be able to obtain information of the target. This step is essential and very important in algorithm operation and often has a great impact on the results of algorithm solution. Generally, many individuals with uneven distribution are randomly generated by a computer when the population is initialized. However, the uniform distribution of individuals in the initial population has more optimization ability than the nonuniform distribution, and it is also more reasonable in algorithm search. Therefore, by introducing the Halton sequence, the individual differences between the populations become smaller, and the population differences are reduced by canceling the randomness.In the Halton sequence, the generated initial population can be represented by basej, where j is a prime number and j>2, and any integer N can be represented by base j, as shown in the following formula:(18)N=xkxk−1,…,x1x0j,N=xkjk+…+x1j+x0.Here,j represents the base, which can represent any prime number; j represents a sequence number, which exists and is unique, so that the formula holds. For different integers, the one-dimensional Halton sequence under the corresponding base j can be obtained as shown in the following formula:(19)HjN=λjNN=1,2,3,…,N.Halton sequence was introduced to randomly generate 100 points, and an initial population with less difference in initial numbers was generated. The individuals of this population are more evenly distributed on the number line, which greatly improves the quality of the initial population.


### 4.3. Solving Steps of Adaptive Genetic Algorithm

The following is an analysis of the problem-solving process using an adaptive genetic algorithm, which is improved on the basis of a traditional algorithm. By giving the crossover probability and mutation probability that change dynamically with the fitness value, the problem of the local optimal solution of the algorithm is solved and the accuracy of the algorithm is improved. The specific steps of the adaptive genetic algorithm are as follows.(1)
Chromosome Coding. For the proposed model, binary coding is adopted, and the coding of each chromosome is an offloading strategy X, and Xh is used to represent the value of h bit in strategy offloading strategy X, and the value of Xh is 0 or 1. In order to indicate that all computing tasks can be offloaded to servers, the number of coding bits H should satisfy the constraints shown in the following formula:(20)H≥log2V.The offloading strategy of theu computing task can be represented as uH,XuH+1,XuH+2,…,Xu+1H, and the number xu of offloaded mobile edge computing server can be represented by the following formula:(21)xu=∑h=uHu+1Hxh⋅2u+1H−h.The computing task strategy coding of no more than 8 mobile edge computing servers is shown in Figure4.(2)
Chromosome Initialization. The main purpose is to initialize the relevant parameters of the genetic algorithm, including the maximum number of iterations, chromosome length, mutation probability, crossover probability, population size, and reserved population. In the initial population with less difference generated by introducing the Halton sequence, the encoding of the class with the highest weight in a chromosome is set as the following formula(22). The purpose is to first offload the computing tasks of the highest weight class to the mobile edge computing server to which the vehicle-mounted terminal belongs.(22)∑h=uHu+1Hxh⋅2u+1H−h=Ru.If a total ofVc computing tasks are predefined, the codes of remaining V−Vc computing tasks are randomly generated to maintain the randomness of the population.(3)
Fitness Evaluation. The traditional genetic algorithm decides whether an individual inherits to the next generation according to the size of fitness value. Here, the reciprocal of user’s total cost is selected as the fitness function evaluation index of the quality of the chromosome individual, and the expression is shown in the following formula:(23)F=1∑m=1M1−rmCM1+rmCMe.(4)
Select an Operation. The roulette selection method based on fitness proportional selection is used to select some outstanding individuals from the parent individuals.(5)
Crossover and Mutation Operations. Here, single-point crossover and basic bit mutation operations are performed according to the crossover probability and mutation probability, thereby generating chromosomes with new genes. Among them, the crossover probability and mutation probability of dynamically changing according to the fitness value of an individual can be expressed by the following formulas (24) and (25):(24)pb=pbmax−pbmax−pbmins0−sasmax−sa,s≥sa,pbmax,s<sa.(25)pc=pcmax−pcmax−pcmins0−sasmax−sa,s≥sa,pcmaxs<sa.Figure 4
Coding of computing task strategy for mobile edge computing servers.In formulas (24) and (25), smax represents the maximum value of fitness. sa represents the mean value of fitness. s0 represents a feasible solution with crossover probability. pbmax represents the maximum value of crossover probability. pbmin represents the minimum value of crossover probability. pcmax represents the maximum value of variation probability. pcmin represents the minimum value of mutation probability.


## 4.1. Genetic Algorithm

A genetic algorithm is an intelligent algorithm that simulates natural selection and biological evolution in nature and is a computational model that simulates Darwin’s theory of evolution. According to Darwin’s theory of evolution, the evolution of biological species follows the principle of “natural selection, survival of fittest,” and there is fierce competition within and between species. Only adaptive individuals can survive. The genetic algorithm searches for the optimal solution by simulating the biological evolution process, which transforms the solving process of the problem into the selection, crossover, and mutation process of chromosomal genes. Only individuals with strong adaptability to the environment can retain it with a high probability.The genetic algorithm regards the feasible solution set space as a population, and each feasible solution corresponds to an individual. Through continuous selection, crossover, and mutation operations, a group of individuals more adapted to the environment is generated. After several iterations, individuals who do not adapt to the environment are gradually eliminated by the environment. The individual with the largest fitness function value is the optimal solution of the problem. The flow of the genetic algorithm is shown in Figure3.Figure 3
The process of genetic algorithm.


## 4.2. Genetic Algorithm Improvement

In process of solving the traditional standard genetic algorithm, the generation of the initial population of the algorithm and the setting of parameters such as genetic operators are relatively random. After many iterations, excellent individuals will occupy the entire population and it is difficult to generate new individuals, resulting in premature convergence of the algorithm and easy to fall into local optimum. At this time, the characteristics of the population remain basically unchanged, so it is considered to improve the traditional genetic algorithm to prevent the algorithm from falling into the local optimal solution.Genetic algorithms generate different populations through crossover and mutation operations, so it is considered to generate initial populations with less difference by introducing Halton sequences. Strengthening the global search ability of the algorithm as much as possible and improving the search accuracy, thereby preventing the algorithm from prematurely converging and falling into a local optimum.The first step of the genetic algorithm is to generate the initial population, which is to be able to obtain information of the target. This step is essential and very important in algorithm operation and often has a great impact on the results of algorithm solution. Generally, many individuals with uneven distribution are randomly generated by a computer when the population is initialized. However, the uniform distribution of individuals in the initial population has more optimization ability than the nonuniform distribution, and it is also more reasonable in algorithm search. Therefore, by introducing the Halton sequence, the individual differences between the populations become smaller, and the population differences are reduced by canceling the randomness.In the Halton sequence, the generated initial population can be represented by basej, where j is a prime number and j>2, and any integer N can be represented by base j, as shown in the following formula:(18)N=xkxk−1,…,x1x0j,N=xkjk+…+x1j+x0.Here,j represents the base, which can represent any prime number; j represents a sequence number, which exists and is unique, so that the formula holds. For different integers, the one-dimensional Halton sequence under the corresponding base j can be obtained as shown in the following formula:(19)HjN=λjNN=1,2,3,…,N.Halton sequence was introduced to randomly generate 100 points, and an initial population with less difference in initial numbers was generated. The individuals of this population are more evenly distributed on the number line, which greatly improves the quality of the initial population.


## 4.3. Solving Steps of Adaptive Genetic Algorithm

The following is an analysis of the problem-solving process using an adaptive genetic algorithm, which is improved on the basis of a traditional algorithm. By giving the crossover probability and mutation probability that change dynamically with the fitness value, the problem of the local optimal solution of the algorithm is solved and the accuracy of the algorithm is improved. The specific steps of the adaptive genetic algorithm are as follows.(1)
Chromosome Coding. For the proposed model, binary coding is adopted, and the coding of each chromosome is an offloading strategy X, and Xh is used to represent the value of h bit in strategy offloading strategy X, and the value of Xh is 0 or 1. In order to indicate that all computing tasks can be offloaded to servers, the number of coding bits H should satisfy the constraints shown in the following formula:(20)H≥log2V.The offloading strategy of theu computing task can be represented as uH,XuH+1,XuH+2,…,Xu+1H, and the number xu of offloaded mobile edge computing server can be represented by the following formula:(21)xu=∑h=uHu+1Hxh⋅2u+1H−h.The computing task strategy coding of no more than 8 mobile edge computing servers is shown in Figure4.(2)
Chromosome Initialization. The main purpose is to initialize the relevant parameters of the genetic algorithm, including the maximum number of iterations, chromosome length, mutation probability, crossover probability, population size, and reserved population. In the initial population with less difference generated by introducing the Halton sequence, the encoding of the class with the highest weight in a chromosome is set as the following formula(22). The purpose is to first offload the computing tasks of the highest weight class to the mobile edge computing server to which the vehicle-mounted terminal belongs.(22)∑h=uHu+1Hxh⋅2u+1H−h=Ru.If a total ofVc computing tasks are predefined, the codes of remaining V−Vc computing tasks are randomly generated to maintain the randomness of the population.(3)
Fitness Evaluation. The traditional genetic algorithm decides whether an individual inherits to the next generation according to the size of fitness value. Here, the reciprocal of user’s total cost is selected as the fitness function evaluation index of the quality of the chromosome individual, and the expression is shown in the following formula:(23)F=1∑m=1M1−rmCM1+rmCMe.(4)
Select an Operation. The roulette selection method based on fitness proportional selection is used to select some outstanding individuals from the parent individuals.(5)
Crossover and Mutation Operations. Here, single-point crossover and basic bit mutation operations are performed according to the crossover probability and mutation probability, thereby generating chromosomes with new genes. Among them, the crossover probability and mutation probability of dynamically changing according to the fitness value of an individual can be expressed by the following formulas (24) and (25):(24)pb=pbmax−pbmax−pbmins0−sasmax−sa,s≥sa,pbmax,s<sa.(25)pc=pcmax−pcmax−pcmins0−sasmax−sa,s≥sa,pcmaxs<sa.Figure 4
Coding of computing task strategy for mobile edge computing servers.In formulas (24) and (25), smax represents the maximum value of fitness. sa represents the mean value of fitness. s0 represents a feasible solution with crossover probability. pbmax represents the maximum value of crossover probability. pbmin represents the minimum value of crossover probability. pcmax represents the maximum value of variation probability. pcmin represents the minimum value of mutation probability.


## 5. Experiment and Analysis

### 5.1. Experimental Parameter Setting

The performance of the proposed scheme is verified by simulation experiments, and the experimental environment settings and experimental results are given, which proves the superiority of the proposed scheme compared with other schemes. Firstly, vehicle nodes and mobile edge computing server nodes are randomly assigned in a simulation area of 200 m × 200 m. Then, parameters such as the number of vehicles and mobile edge computing servers, communication resources, and computing resources in experiment are set. The simulation experiment of the proposed strategy is carried out on the MATLAB platform (MATLAB2016a). The relevant parameters of the experiment are shown in Table1.Table 1
Simulation experimental parameters.
ParameterValueTotal bandwidth3 × 106 HzNumber of vehicles9Number of mobile edge servers3CPU rate of mobile edge servers3 × 1015 cycles/sCPU rate of vehicles5 × 1012 cycles/sTask data size2,6,8 MBunit processing energy consumption1/8.2 J/cycleEnergy consumption of vehicles to receive and send data1.53 × 10−8 J/bitTolerable delay for tasks200,300,500 msReceived power0.5 WNoise power0 WInterference power6 WPopulation size200The maximum number of iterations100Generation gap0.96


### 5.2. Algorithm Performance Comparison Analysis

The convergence speed of the algorithm, the relationship between the average cost and amount of data, the relationship between the average delay and number of tasks, and the relationship between the total task cost and the total number of tasks are important evaluation indicators to measure the performance of the strategy. In the following, for the above-given four evaluation indicators, the resource allocation strategy based on mobile edge computing in the IoV environment proposed in this paper and the methods in reference [15], reference [16], and reference [19] are compared under the same conditions.Firstly, the maximum number of iterations to 100 is set and the convergence rates of different algorithms are compared and analyzed. The calculation results of different algorithms are shown in Figure5.Figure 5
Convergence of different methods.It can be seen from Figure5 that the proposed strategy has the fastest convergence speed compared to the other three methods, and it tends to converge when the number of iterations is 20. This is because the Halton sequence is introduced in process of generating the initial population, and the obtained initial population is less different, which improves the speed of the algorithm to find the global optimal solution.The performance comparison results of several algorithms are shown in Figures6–8.Figure 6
The relationship between the size of task data and the average cost of different methods.Figure 7
The relationship between the number of tasks and the average delay for different methods.Figure 8
The relationship between the total number of tasks and the total cost of tasks for different methods.As can be seen from Figures6–8, compared with the other three methods, the average overhead of the strategy proposed in this paper is the smallest in the case of the same task data size. And, as the amount of task data gradually increases, its average overhead grows the slowest. The average overhead of the proposed method is 0.28 when the task data size is 90, which is much smaller than 0.74, 0.67, and 0.58 of the other three methods. Under the premise of the same number of tasks, the average delay and total cost of the proposed strategy are also the smallest. And, as the number of tasks increases, the growth rate of average delay and total overhead is also the smallest. When the number of tasks is 45, the average delay of the proposed method is 0.32 s, and the total cost is 0.34. The experimental results show that the introduction of the Halton sequence into a genetic algorithm can reduce the differences between individuals and strengthen the global search ability of the algorithm. Moreover, dynamically and adaptively changing the crossover probability and mutation probability can solve the problem of the local optimal solution and improve algorithm accuracy.


## 5.1. Experimental Parameter Setting

The performance of the proposed scheme is verified by simulation experiments, and the experimental environment settings and experimental results are given, which proves the superiority of the proposed scheme compared with other schemes. Firstly, vehicle nodes and mobile edge computing server nodes are randomly assigned in a simulation area of 200 m × 200 m. Then, parameters such as the number of vehicles and mobile edge computing servers, communication resources, and computing resources in experiment are set. The simulation experiment of the proposed strategy is carried out on the MATLAB platform (MATLAB2016a). The relevant parameters of the experiment are shown in Table1.Table 1
Simulation experimental parameters.
ParameterValueTotal bandwidth3 × 106 HzNumber of vehicles9Number of mobile edge servers3CPU rate of mobile edge servers3 × 1015 cycles/sCPU rate of vehicles5 × 1012 cycles/sTask data size2,6,8 MBunit processing energy consumption1/8.2 J/cycleEnergy consumption of vehicles to receive and send data1.53 × 10−8 J/bitTolerable delay for tasks200,300,500 msReceived power0.5 WNoise power0 WInterference power6 WPopulation size200The maximum number of iterations100Generation gap0.96


## 5.2. Algorithm Performance Comparison Analysis

The convergence speed of the algorithm, the relationship between the average cost and amount of data, the relationship between the average delay and number of tasks, and the relationship between the total task cost and the total number of tasks are important evaluation indicators to measure the performance of the strategy. In the following, for the above-given four evaluation indicators, the resource allocation strategy based on mobile edge computing in the IoV environment proposed in this paper and the methods in reference [15], reference [16], and reference [19] are compared under the same conditions.Firstly, the maximum number of iterations to 100 is set and the convergence rates of different algorithms are compared and analyzed. The calculation results of different algorithms are shown in Figure5.Figure 5
Convergence of different methods.It can be seen from Figure5 that the proposed strategy has the fastest convergence speed compared to the other three methods, and it tends to converge when the number of iterations is 20. This is because the Halton sequence is introduced in process of generating the initial population, and the obtained initial population is less different, which improves the speed of the algorithm to find the global optimal solution.The performance comparison results of several algorithms are shown in Figures6–8.Figure 6
The relationship between the size of task data and the average cost of different methods.Figure 7
The relationship between the number of tasks and the average delay for different methods.Figure 8
The relationship between the total number of tasks and the total cost of tasks for different methods.As can be seen from Figures6–8, compared with the other three methods, the average overhead of the strategy proposed in this paper is the smallest in the case of the same task data size. And, as the amount of task data gradually increases, its average overhead grows the slowest. The average overhead of the proposed method is 0.28 when the task data size is 90, which is much smaller than 0.74, 0.67, and 0.58 of the other three methods. Under the premise of the same number of tasks, the average delay and total cost of the proposed strategy are also the smallest. And, as the number of tasks increases, the growth rate of average delay and total overhead is also the smallest. When the number of tasks is 45, the average delay of the proposed method is 0.32 s, and the total cost is 0.34. The experimental results show that the introduction of the Halton sequence into a genetic algorithm can reduce the differences between individuals and strengthen the global search ability of the algorithm. Moreover, dynamically and adaptively changing the crossover probability and mutation probability can solve the problem of the local optimal solution and improve algorithm accuracy.


## 6. Conclusion

Aiming at the problems of unreasonable resource allocation, large task computing delay, and energy consumption brought about by the rapid growth of IoV applications, this paper proposes a computing resource allocation strategy based on mobile edge computing in the IoV environment. The basic idea of this paper is as follows: (1) the problems that need to be solved in the current IoV environment and their quantitative calculation methods are analyzed. (2) The mobile edge computing network and resource allocation decision-making framework in the IoV environment are designed. (3) The applicability of genetic algorithm in research problem is improved by making corresponding improvements. The simulation results show that the performance of the proposed method is better than that of the comparison method.Future work will further study the applicability and improvement methods of the proposed algorithm in complex vehicle behaviors such as vehicle acceleration, deceleration, overtaking, and lane change. In addition, the adaptive genetic algorithm designed in this paper still has some shortcomings in computational accuracy. In future research, specific problems are analyzed to improve the population structure and further improve the quality and efficiency of the solution.



---

*Source: 5781366-2022-06-22.xml*