Abstract
Aiming at the problems of high computing energy consumption and long time in traditional UAV-assisted edge computing research work, a computing resource allocation strategy using biological evolutionary algorithms in UAV-assisted mobile edge computing is proposed by introducing UAV swarms and genetic algorithms. Firstly, it analyzes the communication model for uplink transmission, the calculation model for local computing tasks, and UAV to perform computing tasks. Secondly, the objective function and overall model of system are constructed by comprehensively considering multiple constraints. Then, improved genetic algorithm is introduced into the model. On the basis of data encoding, crossover, mutation, and termination operations, the optimization performance of algorithm is greatly improved by multiple iterations of fitness function. Finally, the energy consumption of proposed algorithm and other two algorithms under the same number of iterations are compared and analyzed by simulation experiments. The experimental results show that the optimal solution, average, and variance of proposed algorithm for energy consumption are 52.354, 50.326, and 0.224, respectively, and its performance is better than other two comparison algorithms.
1. Introduction
Communication technology and Unmanned Aerial Vehicle (UAV) technology, as an important technological foundation of human information age, have developed rapidly in recent years. With the continuous advancement of related technologies, UAV technology has gradually developed from military only to military, civilian, and commercial use, and it has been widely used in various fields of society [1–3]. Following the development and widespread popularity of mobile terminal devices has provided a broad stage for a variety of intelligent applications. But at the same time, it also brings many problems that cannot be ignored, such as limited computing resources and limited battery capacity [4,5]. Therefore, studying reasonable calculation methods to reduce network congestion and transmission delay in the application of mobile devices is the focus of current industry research [6,7].
In response to related issues, the most forward-looking and research-oriented algorithm is mobile edge computing. It can marginalize cloud computing and information technology services in the process of providing auxiliary computing [8]. In addition, combined with the characteristics of high flexibility and mobility of UAVs, related problems can be better solved [9,10]. Reference [11] studied the problem of maximizing computing efficiency in mobile edge computing networks powered by wireless power in partial and binary computing offloading modes. It maximized the calculation efficiency under the maximum-minimum fairness criterion through joint optimization of energy harvesting time, local calculation frequency, offloading time, and power. However, this method did not consider frequency division multiple access and cannot realize D2D communication of different users on orthogonal frequency bands. Reference [12] used drones as computing servers to help user devices calculate its tasks or act as a repeater for further offloading computing tasks to the access point. They proposed a UAV-assisted mobile edge computing architecture, which minimizes the weighted total energy consumption under given multiple constraints. However, this method did not consider the problem of safe interruption when the energy of user devices was limited. Reference [13] studied the weighted sum energy minimization problem under the security offload rate constraint, the calculation delay constraint, and the security interruption probability constraint. They also considered the actual passive eavesdropping scenarios and used confidentiality interruption probability to measure the confidentiality performance of computing offloading and characterized the best confidentiality offloading rate and power allocation. However, this method did not consider the balance between task delay and network energy consumption. Reference [14] proposed a UAV-assisted nonorthogonal multiple access network, which used UAVs and base stations to provide corresponding services for ground users. They realized UAV trajectory optimization through alternate user scheduling and obtain the optimal nonorthogonal multiple access precoding vector by two schemes with different constraints and maximize the total calculation rate on this basis. However, this method did not propose a corresponding solution to the highly coupled nonconvex weighting problem. Reference [15] proposed a mobile edge-assisted computing method and a relay scheme, which defined the cost function of trade-off between energy consumption and delay time through research. Combined with the minimization of cost function relative to the actual constraints, a closed-form solution was derived, which improved the throughput of uncompressed data in mobile peer-to-peer communication. However, this method did not provide an optimal solution to the nonconvex problem formed. Reference [16] gives computing power to the moving drone and provides computing offloading opportunities for mobile users with limited local processing power. It studied mobile cloud computing system based on drones and realized the quality of service requirements for offloading mobile applications on the basis of minimizing total energy consumption of mobile. However, the effective utilization of resources in the process of UAV relay providing services to mobile users in this method is low. In the multi-UAV-assisted mobile edge computing system, in [17] based on the partial computing offload mode, joint optimization of user association, CPU cycle frequency, power and spectrum resource allocation, and UAV trajectory scheduling maximizing computing efficiency problem was studied. They also proposed an iterative optimization algorithm with a double loop structure to find the optimal solution for the problem of nonconvexity and coupling between variables. However, this method did not significantly improve the communication delay problem.
Based on the above analysis, aiming at the problems of high computing energy consumption and long time in traditional UAV-assisted edge computing research work, a computing resource allocation strategy using biological evolutionary algorithm in UAV-assisted mobile edge computing is proposed. The basic idea is as follows: ① First, build a multi-UAV-assisted mobile edge computing system overall model and corresponding objective function by establishing communication model and calculation model. ② Optimize the computing resource allocation by introducing improved genetic algorithm to improve the optimization performance of algorithm. Compared with traditional computing resource allocation strategies, the innovation of proposed method lies in the following:(1)The proposed computing resource allocation strategy studies the communication model of uplink transmission, the computing model of computing task time, and energy consumption and builds the system model and objective function on this basis(2)The overall model and objective function of system are constructed, and the optimization performance of algorithm is improved by introducing an improved genetic algorithm
2. System Model and Optimization Goal
2.1. System Model
The overall model of system uses mobile edge computing system including u user devices and UAVs, and user devices are randomly allocated in a specified area, where , , and the overall model of system is shown in Figure 1.

As shown in Figure 1, each user device of system model needs to use a binary offloading strategy to perform its own computationally intensive tasks. The expression for computationally intensive tasks is shown in
In formula (1), represents the total number of cycles experienced after task is completed. represents the amount of data offloaded after task is completed. represents constraints, including time constraints and user service quality constraints.
Completing the offloading task of calculation requires three steps: data transmission, calculation execution, and result return. The focus is on the two parts of data transmission and calculation execution, and the result return part does not need to be calculated [18].
2.2. Communication Model
The following is an analysis of communication model in uplink transmission process, assuming that the offloading decision of user devices is , where and . The meaning of offloading decision is as follows: when , it means that u user devices perform calculation locally; when M1, it means that the u user devices offload the calculation to UAVs. The offloading decision is that satisfies the relationship shown in the following:
It can be seen from formula (2) that each offload task of user devices can only perform calculations on one UAV.
User devices can be divided into two forms: fixed and mobile. The position of a fixed form of devices is fixed during use. However, the position of a mobile device changes during use. Due to the extremely fast data transmission speed, the position of mobile form devices during the data transmission process can also be regarded as fixed [19]. At this time, if the u user devices satisfy , then u user devices will offload the calculation to UAVs. The transmission rate can be expressed by the following formula:
In formula (3), represents the bandwidth of signal transmission channel. represents the transmit power of signal. represents the noise power of UAV. represents the gain coefficient of signal transmission channel, which can be calculated by the following formula:
In formula (4), represents the small-scale fading component. represents the flight height of UAV from the ground. In the calculation process, it is considered that all UAVs have the same flight height from the ground. represents the horizontal distance between u user devices and UAVs.
2.3. Calculation Model
The following is an analysis of time and energy consumption of local computing tasks and UAV computing tasks in the calculation process. First, analyze the calculation model of local computing task.
It is assumed that the local computing capability of each user devices is the same as , and the total number of cycles experienced after the completion of computing task is . Then the time required for the u user devices to complete the local calculation can be expressed by the following formula:
According to formula (5) power required for u user devices to complete the local calculation can be obtained, as shown in the following formula:
In formula (6), is a coefficient, and its value is usually set to 3. is the effective switched capacitance, and its value is general.
Then, we analyze the calculation model of UAV to perform computing tasks.
When offloading decision , user devices will offload the calculation to UAV for execution. At this time, it is necessary to clarify whether user devices are within the coverage of UAV, and the judgment basis for judging whether u user devices is within the coverage of UAVs is shown in the following formula:
In formula (7), represents the communication angle of UAVs. can be calculated with the following formula:
In formula (8), represents the coordinate position of u user devices. represents the plane coordinate position of UAVs at the height of from the ground.
According to equation (7), if user devices are within the coverage of UAV, then continue to analyze the calculation model of UAV to perform computing tasks. Set the data transmission time as and task execution time as ; then according to the proposed communication model, the total time spent by u user devices to execute tasks on UAVs can be obtained, as shown in the following:
In equation (9), the calculation methods for data transmission time and task execution time are as shown in
In formula (10), represents the computing resource allocated by UAVs to u user devices. All user devices should meet the constraint conditions shown in equation (11) in terms of time.
In formula (11), t is the total time.
At the same time, since the overall resources of UAV are limited, should meet the constraints shown in following:
It can be known from equation (12) that the resources allocated to user devices by each UAV must be less than the total amount of resources of UAV.
The energy consumed by the suspension and calculation of UAV is very small and can be ignored [18]. Based on this premise, the energy consumption of u user devices offloaded to UAVs can be calculated, and the result is shown in the following formula:
In formula (13), represents the transmit power of signal. represents the amount of data offloaded after task is completed. represents the transmission rate of signal.
2.4. Optimization Goal
The following is to analyze and optimize the objective function of system model. For the overall system model proposed above, the corresponding objective function is given as shown in the following:
In formula (14), represents the position matrix of UAV. represents the offloading matrix of task. represents the allocation matrix of UAV resources.
The constraint conditions are shown in the following:
In formula (15), the constraint condition (1) indicates that all tasks can only be executed locally or offloaded to UAV for execution. Constraint (2) means that if tasks are offloaded to UAV for execution, then each task can only be offloaded to a certain UAV for execution. Constraint (3) represents the delay constraint of user devices. Constraint (4) means that the resources allocated to user devices by each UAV must be less than the total amount of resources of UAV. Constraint condition (5) represents UAV coverage range constraint.
3. Computing Allocation Strategy Based on Improved Genetic Algorithm
Due to the many constraints of objective function, the difficulty of solving the optimal computing offloading strategy is greatly increased, and it is difficult to calculate the optimal solution in polynomial time. Therefore, an improved genetic algorithm is introduced to find the optimal solution of task offloading strategy. The basic principle of genetic algorithm is biological evolution process based on natural selection and genetics mechanism. It is usually used to solve nonlinear, global, and more complex combinatorial optimization problems, and it is a high-performance computing model [20]. The main idea is to simulate the natural selection concept of survival of fittest in nature. By converting the problem-solving process into a process similar to the crossover and mutation of chromosomal genes in biological evolution, on this basis, iterative calculations are used to gradually approximate and obtain the optimal solution.
3.1. Coding and Initial Population
The traditional genetic algorithm does not directly process the parameters of solution space but first encodes parameters and then continues to process [21]. The encoding operation is to convert parameters in the solution space into individuals or chromosomes in the space. These individuals or chromosomes are arranged according to a specific structure of genes, and the process of parameter conversion is the process of encoding. After the parameters are encoded, crossover, mutation, and genetic operations can be carried out more conveniently.
In general, encoding methods include gray code encoding, binary encoding, and symbol encoding. From the analysis of communication model in Section 2.1, it can be known that the user’s offloading decision is only 0 and 1, which can be regarded as binary variables. Thus, the choice of binary encoding can greatly reduce the complexity when choosing the encoding method. When encoding, first set the initial population set as , , where represents the k individual or chromosome and satisfies . represents the total number of user devices in network, and binary digits are used to construct the k individual or chromosome: , . On this basis, the specific steps of population initialization algorithm used to generate initial population set can be obtained, as shown in the following:(1)First, let and randomly generate a random number that obeys a uniform distribution in the range of [0, 1] as the probability of randomly generating a gene u in the k individual or chromosome. This random number is denoted as .(2)Let .(3)Judge whether is less than or equal to 0.5.(4)If is less than or equal to 0.5, then ; otherwise, .(5)Execute operation, and return to step (3) until is established, and then jump out of loop.(6)Execute operation, and return to step (2), until is established, the end.
3.2. Fitness Function
The main function of fitness function is to evaluate the performance of an individual or chromosome, and its principle basis is the degree of fitness of individual in the natural environment [22]. The fitness function can be used to distinguish the pros and cons of different individuals or chromosomes. If the value of fitness function is larger, it means that the individual or chromosome is more adaptable in the natural environment, and it is easier to be retained in genetic evolution, and the corresponding genetic decision-making performance is better.
According to the objective function shown in equation (14), the reciprocal of total energy consumption of all user devices is used as the fitness function, as shown in the following equation:
In formula (16), represents the total energy consumed by user devices. The and subtables indicate the execution locations of i and j tasks. and represent the total energy consumed to perform the i and j tasks, respectively. represents the total energy consumed in the process of receiving data.
According to the fitness function shown in formula (16), the pros and cons of different individuals or chromosomes can be evaluated and distinguished. It can be seen from formula (16) that the smaller the total energy consumption of a certain body or chromosome, the larger the fitness function value, and the easier it is to be retained in genetic evolution. Taking the fitness function value as the basic basis can determine the probability of different individuals or chromosomes appearing in the next generation. On this basis, some individuals or chromosomes are selected from the parents according to roulette selection method to form a group of offspring.
3.3. Genetic Operation
3.3.1. Cross Operation
The main principle of crossover operation is that some genes in a certain body or chromosome in the parent are exchanged according to a specific rule and produce offspring [23].
For example, in single-point crossover, the crossover process is to randomly select a point as crossover point in a certain body or chromosome in the parent. Besides, based on the crossover point, the genes on the left and right sides of crossover point in the parent or chromosome are exchanged, and two new chromosomes are generated. The principle process is shown in Figure 2.

3.3.2. Mutation Operation
The main principle of mutation operation process is based on a specific mutation probability, by replacing part of gene of an individual or chromosome in the parent with other genes. The purpose is to generate new individuals and maintain the diversity of entire population to a greater extent, thereby enhancing the overall local search capability of genetic algorithm to a certain extent [24].
In general, variation can be divided into multiple variations such as basic position variation, uniform variation, boundary variation, and Gaussian approximation variation. In order to be consistent with the encoding method, the binary-based basic bit mutation method is selected here. The basic principle of mutation process is shown in Figure 3.

3.4. Genetic Termination Condition
After genetic crossover and mutation operations, a new offspring population can be obtained according to the parent population. On this basis, the minimum energy consumption objective function is solved according to the proposed multiple constraints, and the performance of newly generated offspring population is evaluated. Within the specified maximum number of iterations, as long as the number of iteration calculations does not exceed the set maximum number of iterations, then continue and repeat the crossover and mutation operations in genetic algorithm until the termination condition of objective function solution of genetic algorithm is met. If the number of iterative calculations reaches the set maximum number of iterations or fitness function of best fitness individual in the successive generations of offspring populations is still not significantly improved. Then it is considered that the termination condition for solving objective function is reached and the iterative calculation is stopped.
4. Experiment and Analysis
4.1. Simulation Setting
The simulation experiment platform uses MATLAB mathematical software, version 2019a. The computer hardware conditions used in the simulation are as follows: CPU is i7-7200U; running memory size is 4G. During the simulation experiment, overall horizontal area of the experiment was set as a square area with an area of 100 m × 100 m. The user devices are randomly distributed in the test area, and specific parameters of simulation experiment are shown in Table 1.
4.2. Simulation Analysis
Different parameter settings have different effects on the performance of genetic algorithm, such as the number of iterations. Too many iterations will increase the amount of calculation and prolong calculation time of algorithm. Too few iterations will cause the algorithm to fail to converge, and the optimal solution cannot be obtained. In order to make algorithm obtain the best performance, firstly, the overall performance of proposed algorithm is simulated and analyzed according to the number of genetic iterations. The relationship between the number of iterations and the total energy cost of algorithm is shown in Figure 4.

It can be seen from Figure 4 that the total energy cost of algorithm is different under different iteration times, and the smaller the number of iterations, the greater the total energy cost of algorithm. With the gradual increase in the number of iterations, the total energy cost of algorithm also gradually decreases. When the number of iterations reaches about 35 times, the total energy cost of algorithm no longer changes. This is because when the number of iterations is too small, it will stop the iterative calculation if the algorithm fails to converge, and the optimal solution cannot be found. Thus, the energy cost of algorithm will be greater. After 35 iterations, the algorithm has found the optimal solution, and increasing the number of iterations will not improve the performance of algorithm.
The task completion time of resource allocation strategy, the energy consumption required to calculate the specific location of UAVs, the influence of number of UAVs on the energy consumption of algorithm, and the influence of number of user devices on the energy consumption of algorithm are all important evaluation indicators to measure the strategy performance. The following is a comparative analysis of algorithm proposed in this paper and algorithms in [12] and [17] under the same conditions for the above four evaluation indicators.
Firstly, calculate the task completion time for different algorithm resource allocation strategies. The average task completion time of different algorithms under different number of tasks is shown in Figure 5.

It can be seen from Figure 5 that, in the case of different number of tasks, the algorithm proposed in this paper has the smallest average time for task completion compared with the algorithms in [12] and [17]. And as the number of tasks increases, the growth rate of average task completion time is relatively small. This is because the computing resource allocation strategy proposed in this paper can better prioritize the migration of tasks to any UAVs with the fastest response time. Although [12] combined UAV and edge computing methods and proposed an overall architecture, it did not optimize the solution process of objective function, and the solution process took more time. Reference [17] used an iterative optimization algorithm to study the overall calculation efficiency maximization. However, the calculation models of time consumption and energy consumption of local tasks and UAV tasks were not analyzed and improved in detail, and time and energy consumption were not saved to the best.
The following is an analysis of energy consumption of tasks performed by different resource allocation strategies. When the number of UAVs is the same, the energy consumption of different strategies when different numbers of user devices are adopted is shown in Figure 6.

It can be seen from Figure 6 that, under the premise of using the same number of UAVs, the energy consumption of three algorithms will increase as the number of users increases. This is because an increase in the number of users means an increase in the number of tasks, and more energy will be consumed to perform more tasks. At the same time, it can be seen that the algorithm proposed in this paper consumes the least energy in the case of different numbers of users. And as the number of user devices increases, the growth rate of its energy consumption is also the lowest.
When the number of user devices is the same, the energy consumption of different strategies when different numbers of UAVs are adopted is shown in Figure 7.

It can be seen from Figure 7 that, under the premise of using the same number of user devices, the energy consumption of three algorithms will decrease as the number of UAVs increases. At the same time, it can be seen that the algorithm proposed in this paper consumes the least energy when using different numbers of UAVs. Besides, as the number of UAVs increases, the average rate of change in their energy consumption is also the largest.
The following is an analysis of three algorithms to calculate energy consumption of a specific UAV location under the same conditions. The energy consumed by using different algorithms to calculate UAV position is shown in Table 2.
In Table 2, Average represents the optimal solution of algorithm under the same number of iterations, Optimal represents the average value of all solutions under the same number of iterations, and Variance represents the variance of solution under the same number of iterations. It can be seen that, compared with the other two algorithms, the optimal solution and average value of algorithm under the same number of iterations are relatively small, 52.354 and 50.326, respectively. The variance value of its energy consumption is 0.224. This shows that the algorithm proposed in this paper has the best performance.
The allocation strategy proposed in this paper can always consume less energy than the other two algorithms when the number of user devices or the number of UAVs changes. This is because the improved genetic algorithm is introduced into the model, and the optimization performance of fitness function is improved by operations such as coding, crossover, and genetics and further reduces the energy consumption of computing resource allocation strategy. As the number of user devices or the number of UAVs changes, genetic operations and iterative calculations will be performed again, and the optimal resource allocation will always be maintained. The calculation model is analyzed in detail, which makes up for the defect that the objective function solving process is not optimized in [12] and the energy consumption cannot be saved to the best in [17].
5. Conclusion
Aiming at the problem of traditional UAV-assisted edge computing, this paper proposes a computing resource allocation strategy using biological evolutionary algorithms in UAV-assisted mobile edge computing. Analyze the constraints of proposed objective function in many aspects, which improves the overall computing performance of system model to a certain extent. The simulation analysis of proposed algorithm is carried out by simulation experiments, and experimental results show that, compared with traditional algorithms, the average time and energy consumption of proposed algorithm are the smallest. In addition, its average task completion time increases with the increase in the number of tasks, and the increase rate of energy consumption with the increase in number of user devices is the smallest. The optimal solution of energy consumption under the same number of iterations, the average value, and variance are the smallest, and the overall performance of algorithm is the highest. Although the proposed method has achieved some results, the flight altitude of UAV is often not fixed in the actual scene. In the future, the performance of the proposed algorithm in task calculation time and energy consumption in the case of random flight altitude of UAV will be deeply studied.
Data Availability
The data used to support the findings of this study are included within the article.
Conflicts of Interest
The authors declare that there are no conflicts of interest regarding the publication of this paper.
Acknowledgments
This work was supported by the Jiangsu Key Laboratory of loT Application Technology (Wuxi Taihu University) and the Natural Science Research Project of Colleges and Universities in Jiangsu Province (no. 18KJB413009).