Abstract
As a special form of multiaccess edge computing (MEC), vehicular edge computing (VEC) plays an important role in emergency logistics by providing real-time and low-latency services for vehicles. The solution of the joint task offloading and resource allocation problem (JTORA) is the key to improving VEC efficiency. This study formulates a special model according to the multistage characteristics of the computational task in vehicular edge computing networks (VECNs) for emergency logistics. First, the JTORA problem is decomposed into three computational steps, each of which includes a task offload (TO) problem and a resource allocation (RA) problem. Then, a hybrid solution is proposed which uses a simulated annealing process to optimize the genetic algorithm (GA) and cooperate with the particle swarm optimization (PSO) algorithm, called the genetic simulated annealing and particle swarm optimization (GSA-PSO) algorithm. Furthermore, a simulation experiment is designed and the effectiveness of the GSA-PSO is verified.
1. Introduction
Data from the International Disaster Database showed that the average annual number of natural disaster events over the last decade was almost double that of the 1980s [1]. In emergency incidents, whether the emergency logistics can timely ensure the supply of emergency materials will directly affect the emergency response efficiency [2]. Therefore, Internet of Things (IoT) technology has been widely used in emergency logistics operations, effectively promoting the improvement of emergency logistics efficiency, among which Internet of Vehicles (IoV) technology is a typical representative.
Under the continuous promotion of IoT technology and wireless communication technology, the level of vehicle intelligence has been continuously improved [3]. The requirement of computational capability for the smart vehicle has been constantly increasing, thus cloud computing is introduced into the IoV, using cloud computing servers to provide centralized data storage and computing services for vehicles [4]. The features and economic benefits of cloud computing have been widely recognized [5]; however, the disadvantages still exist. Cloud servers are often centrally deployed in remote areas, and IoT makes the amount of data that needs to be processed increase faster, making it harder for the cloud computing paradigm to meet the low-latency requirement of smart applications, especially in VEC tasks [6]. To compensate for the shortage of cloud computing in latency, VEC was proposed, which improves the quality of information services by setting computing nodes such as roadside units (RSUs) near the vehicle [7].
VEC is a new type of computing paradigm that introduced MEC into vehicular networks [8]. In VECNs, vehicles can make use of MEC servers or other vehicles to compute, greatly improving the quality of service and reducing service latency [9]. The algorithm to offload the computational task and the allocation method of resources play a key role in the efficiency of VECNs [10]. Several excellent works have been proposed to tackle the problem. Aiming at optimizing the time delay in the unloading process, some researchers use queuing theory, game theory, particle swarm optimization, deep learning algorithm, and other methods to build a computational task offload model [11–14]. Other studies focus on reducing energy consumption or the dual optimization of energy consumption and time delay [15–19]. The reliability and use of computing resources have received the attention from many researchers [8, 20–22]. Research on the JTORA problem is used to treat computing tasks as a whole, but this is not the case in emergency logistics. The computational tasks typically performed by the VEC in emergency logistics are to deal with data from multisensors on the vehicle, and the tasks consist of multiple steps. Generally, the process is divided into three steps: data preprocessing, feature extraction, and data fusion. The computational complexity and the size of the data for each step are different. Therefore, the task unloading and resource allocation scheme should be designed according to the differences in each step, thus achieving the expected optimization effect.
This paper makes targeted research on the JTORA problem in VECNs for emergency logistics. We designed a joint optimization method that comprehensively considers the computational complexity and computational amount of each computational step to maximize task assignment gains, which is measured by a weighted sum of time consumption and the number of devices occupied in the task.
The rest of the paper is organized as follows. The model of the system and the problem is formulated in Section 2. Section 3 describes a method, which we call the hybrid solution of GSA and PSO and introduces the basic idea and steps of the algorithm. The simulation experiment is designed in Section 4, and the results are analyzed. Finally, Section 5 gives a summary of our work and makes suggestions on the application of the method.
2. Model Formulation
We consider a VECNs system for emergency logistics with multivehicle and multiedge devices as illustrated in Figure 1, in which each vehicle is equipped with a computing terminal and many sensors. The computing terminals and edge devices (RSUs) are regarded as information agents (IAs) with certain computing and communication capabilities. Any two IAs in the network can be connected, but the communication speed is different. The sensing information of the sensors can be handed over to any IA for processing, but it must be transmitted through the computing terminal of the vehicle, on which the sensor is deployed. We denote the IA set in the VEC system as X = {X(1), X(2), X(3), …, X(E)}, where E represents the total number of IA. The computational task is initiated from a vehicle in the fleet and needs to process simultaneous information from several sensors in the vehicle. We denote the set of sensing information as S = {S(1), S(2), S(3), …, S(N)}, where N represents the number of sensors.

2.1. System Model
The procedure of the computational task is shown in Figure 2. It consists of three steps: data preprocessing, feature extraction, and data fusion, which are different in computational complexity. In addition, the size of the data changes at each step of the process. For ease of reference, the key notations used in the article are summarized in Table 1.

The computational task is generated from a vehicle, and sensing information is sent to IA to process. The IA should complete the task or hand it over to other IAs. The computational task with a large amount of data and low computational complexity may be handed over to an IA with a good communication channel but weak computing power, and vice versa. Each IA can undertake multiple missions at the same step of the task. Multiple IAs cooperate through the division of the computational task, thus improving the overall performance of the VECNs system.
2.2. Problem Formulation
In the computation of the VECNs for emergency logistics, the response speed is the primary factor that must be considered. Secondly, to effectively deal with emergencies in complex environments, the task should occupy as little equipment as possible to ensure that enough computing resources can be reserved to deal with multiple emergencies that may occur concurrently.
We assume that S(i) is initiated from X(e1) and handed over to information agents X(e2), X(e3), and X(e4). The transmission of information is subject to both sending and receiving capabilities, so it is necessary to use the smaller one as the calculation basis. At the same time, it should be considered that if the data are processed by the IA itself, the transmission time is 0. The computational time consumed can be obtained by multiplying the data size by the computational complexity and then dividing it by the calculation capacity. Based on the above-given assumptions, we can analyze the computational procedure one by one.
Take the data preprocessing step as an example, for each S(i), the data size is Q(i)∙RI(i, 1) and the computational complexity index is CI(i, 1). The sending capacity assigned to S(i) is SC(e1)∙SCR(i, e1,1), and the receiving capacity assigned to S(i) is RC(e2)∙RCR(i, e2, 1). The time consumed for transmitting TT(i, 1) and time consumed for computing TC (i, 1) in the first step can be calculated by the following formula:
The total time consumed in the data preprocessing step can be calculated as
Equation (3) is a restriction condition. The time consumption of the other two steps is calculated in the same way as mentioned above. The objective function of the JTORA problem is
α and β are the weight coefficient of the time consumed and the number of IA used in the task, respectively. The problem can be divided into subproblems: the task offloading (TO) problem is to decide which information agent should the sensing information be delivered for processing, and the resource allocation (RA) problem is to decide the number of resources the information agent should allocate to perform the task.
3. Proposed Methods
The TO problem is a complex knapsack problem (KP), which is a classical combinatorial optimization problem [23]. In the literature, algorithms based on dynamic programming and randomized algorithms based on evolutionary strategies are regarded as the main methods of solving KP [24]. As a typical evolutionary algorithm, the genetic algorithm (GA) has achieved considerable success in solving the knapsack problem [25].
The RA problem is a continuous nonlinear problem. PSO has been widely applied in solving such problems due to the advantages of simple rules, few parameter sets, and fast convergence speed [26, 27].
Aivaliotis-Apostolopoulos and Loukidis proposed a hybrid algorithm that nests particle swarm optimization operations in the genetic algorithm, which is named the swarming genetic algorithm (SGA) [28]. Examined by continuous optimization problems and discrete (traveling salesman) problems, the SGA has overall significantly better performance than PSO, GA, and two existing hybrid algorithms in terms of accuracy.
However, SGA has greater randomness in the selection of schemes and has a strong dependence on the initial solution population. Therefore, we propose the genetic simulated annealing (GSA) algorithm, which uses the simulated annealing process to control the execution of the genetic algorithm, to avoid the reduction of algorithm efficiency caused by the initial population. Then, we fuse the GSA and PSO algorithms to solve the JTORA problem and name the algorithm a hybrid solution of the GSA and PSO algorithms (GSA-PSO), as shown in Figure 3.

In GSA-PSO, GA is used to generate and optimize the task-offloading scheme; PSO is used to calculate the optimal resource allocation based on the task-offloading scheme. The simulated annealing process is used to control GA execution to avoid the influence of a weak initial population on the calculation process. The solution steps of GSA-PSO are as follows: Step 1: generate the initial population at random. Each seed of the population represents a task-offloading scheme and contains 2N + 1 random numbers, which are greater than 0 and less than or equal to E. For example, if N is 3 and E is 7, a scheme composed of [1, 2, 3, 4, 5, 6, 7], means that S(1), S(2), and S(3) are, respectively, assigned to X(1), X(2), and X(3) at the data preprocessing step and are, respectively, assigned to X(4), X(5), and X(6) at the feature extraction step and are assigned to X(7) at the data fusion step. Step 2: pass the initial population to PSO and calculate the best SCR, RCR, and CCR value to optimize resource allocation. Step 3: check the end condition. If the number of iterations reaches, the computation should stop; otherwise, it should go to Step 4. Step 4: calculate the fitness index using equation (4). Step 5: check the fitness index. If the fitness index of this generation is better than before, the computation should go to Step 7, else it should go to Step 6. Step 6: check the annealing coefficient. If the annealing coefficient is greater than zero, the computation should subtract 1 from the annealing coefficient and go to Step 7, else it should reinitialize the population, reset the annealing coefficient, calculate the resource allocation, and fitness, then go to Step 7. This step is to ensure that if the fitness index is continuously declining after several generations of evolution, the population should be reinitialized. Step 7: execute the crossover and mutation process of the population according to the rules of GA to produce a new population, then go to Step 2.
4. Experimental Results and Analysis
To verify the performance of the GSA-PSO algorithm, a simulation experiment is designed in the Matlab simulation environment with multiple groups of experimental data.
4.1. VECNs System Composed of 6 Vehicles and 1 Roadside Unit
We consider a VECNs system composed of 6 vehicles and 1 roadside unit and calculate the solution scheme of the JTORA problem with GSA-PSO and SGA, respectively. Finally, the results are compared and analyzed. Various indicators are shown in Table 2.
The values of RI, CI, SC, RC, and CC are given by experimental data. The iteration times of the two methods are set to 100, the number of seeds per generation is set to 100, the annealing coefficient is set to 10, α,β is set to 1, and other relevant parameters of the GA and PSO algorithms adopt the same settings. The two methods are used, respectively, to solve the same JTORA problem. The effectiveness of the two methods is compared by recording the optimal value of each iteration.
Figures 4(a) and 4(b) are the results of the GSA-PSO and SGA simulations, respectively. In Figure 4, the abscissa represents an index value of the number of iterations, and the ordinate represents the optimal value. It can be seen that both results are better than the randomly generated scheme, by comparing the initial scheme with the optimal scheme. Furthermore, we can see that the initial population is regenerated through the simulated annealing process in the GSA-PSO algorithm, and the result (19.45) is better than the result of SGA (20.18). The final optimal scheme of the algorithm GSA-PSO is [1, 1, 3, 3, 3, 1, 4], and SGA is [3, 4, 1, 7, 4, 4, 7].

(a)

(b)
4.2. VECNs System Composed of 10 Vehicles and 3 Roadside Units
To test the influence of IA quantity on the quality of service, we consider a VECNs system composed of 10 vehicles and 3 roadside units. Various indicators are shown in Table 3.
The iteration times of the two methods are set to 200, the number of seeds per generation is set to 200, the annealing coefficient is set to 30, and other parameters remain unchanged.
Figures 5(a) and 5(b) are the results of the GSA-PSO and SGA simulations, respectively. The result of GSA-PSO (17.99) is better than the result of SGA (19.59). The final optimal scheme of algorithm GSA-PSO is [13, 12, 1, 12, 9, 13, 7], and SGA is [1, 3, 1, 3, 2, 1, 13]. By comparing the results with those in Figure 4, we can also conclude that the performance of the VECNs system can be improved by increasing the number of IAs. This conclusion is consistent with universal logic and also shows the effectiveness of our algorithm.

(a)

(b)
We further tested more IA cases with the same parameters. Each time an IA, whose CC, SC, and RC are 200, is added to the VECNs, the results are shown in Figure 6. In Figure 6, the abscissa represents an index value of the number of IAs and the ordinate represents the optimal value.

It can be seen that when the number of RSUs is higher than the number of sensing information, the performance of the VECNs system which uses the SGA is significantly improved, but for GSA-PSO, the performance has not been improved. However, in an emergency, the number of RSUs is often not that large.
4.3. VECNs System Composed of High-Performance IAs
To test the influence of IA performance on the quality of service, we consider two VECNs systems, which are the same as we used in Section 4.1, but one improves the computing capability (CC) of each IA by 10%, and the other improves the network communication capability (SC and RC) of each IA by 10%.
Figure 7(a) is the simulation results of the VECNs system, whose computing capability (CC) of each IA is improved by 10%. Figure 7(b) is the simulation results of the VECNs system, whose network communication capability (SC, RC) of each IA is improved by 10%. It can be seen that the performance of the VECNs system can be improved by improving the performance of IAs.

(a)

(b)
5. Conclusions
In this paper, the JTORA problem is decomposed into three computational steps according to the computational tasks that the VEC typically performs in emergency logistics. A GSA-PSO algorithm is proposed, considering the computational complexity and the size of the data for each computational step. The performance of the algorithm is evaluated by a simulation experiment and the results proved its effectiveness. By comparing several groups of experimental results, we can also conclude that the performance of the VECNs system can be improved in two ways. One is to increase the number of IAs, but the effect decreases when the number of RSUs is higher than the number of sensing information needed. The other is to improve the capability of IAs, which contains computing and network communication capabilities.
Data Availability
The data used to support the study are included in the paper.
Conflicts of Interest
The authors declare that there are no conflicts of interest regarding the publication of this paper.
Acknowledgments
This research was funded by the Chongqing Graduate Scientific Research Innovation Project, China (Grant no. CYB22297).