Abstract

As fixed edge computing systems can hardly meet the demand of mobile users for massive data processing, a computational resource allocation strategy using the genetic algorithm in UAV-assisted edge computing environment is proposed. First, a UAV-assisted mobile edge computing (MEC) system is designed to help users execute computation tasks through the UAV or relaying to the ground base station. Then, a communication model and a computation model are constructed to minimize the total system energy consumption by jointly optimizing the UAV offloading ratio, user scheduling variables, and UAV trajectory. Finally, the minimization of total system energy consumption is modeled as a nonconvex optimization problem and solved by introducing an improved genetic algorithm, so as to achieve a rational allocation of computational resources. Based on the experimental platform, the simulation of the proposed method is carried out. The results show that the total energy consumption is 650 J when the execution time is 110 s and the execution time is 17.5 s when the number of users is 50, which are both better than other comparison methods.

1. Introduction

In recent years, as cloud computing are gradually moving to the edge of the network, mobile edge computing (MEC) has emerged and developed rapidly, which mainly utilizes the spare computing capacity and storage of the edge network to execute computation-intensive and delay-sensitive tasks [1, 2]. Currently, scholars are actively trying to integrate MEC-related technologies with a wireless communication theory to better address long propagation delays, and the deployment of mobile base stations on unmanned aerial vehicle (UAV) is a possible solution to extend the coverage of wireless systems to the areas with limited available infrastructure for wireless access points [3].

UAV is a non-manned vehicle operated by remote control, with advantages of good maneuverability and small size, which is easy to carry and transport. Meanwhile, with great stability during low altitude flight, UAV can better acquire images obscured by clouds and other objects, which cannot be captured by the satellite light-sensing remote controller and other aerospace photography [4]. Due to its high maneuverability and flexibility, UAV plays an increasingly prominent role in the communication system and is widely used in aerial surveillance, imaging, and traffic [5]. To maintain the safe operation of UAVs through real-time command/control and to enable new applications with artificial intelligence, it is becoming more important to enhance the communication and computing capabilities of UAVs [6, 7].

However, UAVs are limited by size, load capacity, and power consumption, which make the communication, computing capacity, and endurance time all suffer from a large impact. In order to settle this limitation, it is of great practical significance to design resource allocation strategies and optimal control methods for UAV trajectories to make the best use of limited energy of UAV, so as to better provide high-capacity, high-speed, and low-delay services for wireless communication edge computing systems [8].

At present, there have been some studies at home and abroad for computational resource allocation strategies in edge computing environment. According to [9], the mixed integer and nonconvex optimization problem was decoupled into two sub-problems of task offloading decision and resource optimization, which were jointly optimized by using a designed iterative algorithm. The experimental results showed that the optimization performance is comparable to that of the exhaustive search. However, this algorithm takes a longer time for optimization and the efficiency needs to be improved. The authors of [10] proposed a dynamic multi-win game model based on incomplete information to solve the task offloading and edge resource allocation problems for multiple terminal users. Further optimization is needed for multiobjective task offloading and resource allocation in complex network situations. The authors of [11] proposed a computing resource allocation scheme for MEC scenarios based on DRL networks. The cost of task offloading still needs to be optimized. In order to investigate the relationship between the cost of computation tasks and time and energy consumption, a computation offloading strategy was proposed, which reduces the execution cost by collaboratively allocating computational resources between mobile devices and edge servers [12].

With the continuous development of machine learning and UAV communication technologies, deep learning and UAV assistance have been gradually applied in computational resource allocation. Authors in Ref. [13] proposed a multiobjective optimization algorithm based on the MOACO algorithm combined with reinforcement learning, which effectively improves the quality of service in edge computing by establishing an effective cognitive agent model to evaluate the resource allocation. However, with more iteration, the time efficiency needs to be improved. In the study [14], a multiagent reinforcement learning framework based on independent learners was proposed to achieve computation offloading and resource allocation for multiple private users in IoT edge computing networks. Authors in Ref. [15] introduced agents into task offloading and proposed a new framework for agent-enabled task offloading in UAV-aided MEC to help users, UAV, and edge clouds perform computation task offloading. UAV can improve wireless communication coverage to a certain extent, but the computation offloading strategy still needs further optimization.

Based on the above analysis, a computational resource allocation strategy using the genetic algorithm in the UAV-assisted edge computing environment is proposed to address the problem that the computing capacity of existing mobile devices (computers, cell phones) cannot fully meet the users’ demand for communication quality. Based on the UAV-assisted edge computing system, a minimization model of total system energy consumption with jointly optimized UAV offloading ratio, user scheduling variables, and UAV trajectory is constructed. The minimization problem is solved using an improved genetic algorithm to achieve a reasonable allocation of computational resources.

2. System Model and Optimization Objective

2.1. System Model

As shown in Figure 1, (a) UAV-assisted MEC system consists of a cellular-connected UAV and multiple ground-requesting users.

Both UAV and ground users have communication circuits and computing processors and are powered by batteries with a certain capacity. It is worth noting that different users have different computing capacitates. The ground base station is deployed with multiple built-in MEC servers with high computing capacity, which can be regarded as an access point [16, 17]. In this scenario, the user has delay-sensitive computation tasks that require UAV to assists in computation. The UAV is deployed with MEC servers to help users to execute the task on itself or relay to the ground base station for execution.

2.2. Communication Model

In the system model, users are fixed on the ground and the position can be denoted as , , where and are the horizontal coordinates of the user. UAV keeps flying at the same altitude and its position at th timeslot can be expressed as , .

It is assumed that the wireless channel between the UAV and users is a Line of Sight (LOS) channel. Therefore, the channel power gain between the UAV and users can be expressed as follows:where is the channel power gain within unit distance () and is the horizontal distance between the UAV and the user at th timeslot,. is the Euclidean norm.

2.3. Computation Model
2.3.1. Local Execution

When users execute the task locally, the execution time can be calculated as follows:where is the scheduling variable of user . is the offloading ratio of user at th time slot. denotes the bit size of the computation task of user at th timeslot. denotes the CPU frequency required when user executes a task of 1 bit. denotes the local computing capacity of user .

Then, the energy consumption for local execution can be written as follows:where is a coefficient that depends on the chip architecture.

2.3.2. UAV-Assisted Computation

For UAV-assisted computation, it can be divided into two parts: the transmission process and the assisted computation. Thus, the UAV transmission time delay can be calculated as follows:where is the transmission rate between user and the UAV at th time slot. Then, the transmission energy consumption can be written as follows:where is the rated transmission power of the UAV.

For the UAV-assisted computation, in each timeslot, the UAV serves multiple ground users, the execution time of UAV serving user at th timeslot for the assisted computation can be calculated as follows:where is the computing capacity of the UAV when serving user . Hence, the energy consumption for the UAV-assisted computation can be formulated as follows:where is a coefficient related to the chip architecture of UAV.

2.4. Optimization Objective

According to the aforementioned UAV-assisted computation model, the corresponding optimization problem is designed. It is assumed that user local execution and UAV-assisted computation are performed simultaneously, and the UAV needs to perform the computation and return the results at the same time slot. Because the size of the returned results is much smaller than that of the UAV-assisted computation task, the energy consumption for returning results can be neglected [18, 19]. The objective is to minimize the total system energy consumption by jointly optimizing the UAV offloading ratio, the user scheduling variables and the UAV trajectory. Thus, the optimization problem can be formulated as follows:where is the energy consumption of the UAV during its flight. is the maximum flight speed of the UAV. is the length of each timeslot. is the flight speed of the UAV. Equation (9) shows the constraint of the UAV trajectory. Equation (10) defines the constraint of the offloading ratio. Equation (11) represents the user scheduling variables. Equation (12) ensures the communication quality during offloading. Equation (13) represents the constraint of user local execution delay. Equation (14) represents the constraint of user transmission delay and UAV-assisted computation delay.

3. Computational Resource Allocation Strategy Using Improved Genetic Algorithm

Genetic algorithm is a relatively mature algorithm that searches for the global optimal solution by simulating the process of biological evolution in nature. Its parallelism is suitable for distributed edge computing. Moreover, the genetic algorithm has good global search capability, so that an appropriate solution set for resource allocation can be obtained by using the genetic algorithm with multiobjective optimization.

Therefore, this paper introduces an improved genetic algorithm, which can not only improve the search efficiency but also obtain the further optimization objective by establishing a dynamic adjustment model of crossover rate and mutation rate, while reflecting the advantages of distributed execution of tasks. In the following sections, the implementation of resource scheduling of the proposed model is addressed based on the genetic algorithm.

3.1. Basic Genetic Algorithm

The basic genetic algorithm was proposed by J. H. Holland of the University of Michigan, USA, which is the basis for other genetic algorithms. Moreover, other improved genetic algorithms are developed by adding new mechanisms. The flow chart of basic genetic algorithm is shown in Figure 2.

The basic genetic algorithm generates optimal individuals by simulating the selection, crossover, and mutation operations in biological genetic and evolutionary processes and finds the optimal solution through an adaptive search process [20, 21].

3.2. Improved Genetic Algorithm
3.2.1. Encoding and Population Initialization

The proposed method adopts binary encoding where a chromosome corresponds to a solution of the optimization problem. The defined chromosomes are encoded using real numbers. Therefore, it is necessary to convert the genes in the chromosome to be represented in binary. Moreover, the genes in the chromosome are all real numbers, which can be converted into a four-bit binary number and then be replaced in the corresponding genes. Moreover, this is the encoding method used in the improved genetic algorithm [22, 23]. For example, a chromosome sequence is (3, 5, 8) when encoded in real numbers, then the chromosome sequence is converted into (0011, 0101, 1000) after binary encoding.

However, the objective function value is calculated mainly based on real numbers, which requires reconverting the binary-coded chromosome sequence into a real-coded chromosome sequence [24]. Moreover, after crossover and mutation operations, the value of genes converted to real numbers may exceed the range of edge node numbers, so a remainder approach is used [25, 26]. For example, the total number of edge nodes is defined to be 7 and thus the binary code is {1101}, which will be converted to a decimal number of 13. The remainder of 13 divided by 7 is 6, then the corresponding edge node number of this binary code is 6.

Set the population size as , the task sequence as , the length as , and the number of edge nodes in the random network topology graph as . Each chromosome is composed of a random combination of binary numbers whose length is , and every four binary numbers will be converted into a decimal number, which represents the number of edge nodes.

3.2.2. Fitness Function

The fitness function is the key to evaluate the direction of population evolution in task scheduling of terminal users in edge computing. In order to ensure that the fitness function can remain meaningful when the value of optimization objective is equal to 0, it is defined as follows:

3.2.3. Genetic Operations

The selection operation is performed by a roulette wheel. Assuming that the size of the population is and the fitness value of an individual is , and is the probability of an individual being selected, the probability can be calculated as follows:

The crossover operator is used to generate new individuals by swapping the positions of chromosome genes of the parent individuals. The traditional single-point crossover method is used, in which a crossover point is set between any two adjacent genes in each chromosome sequence , then a crossover point is arbitrarily selected in the first genes, and all genes after that crossover point are replaced with each other [27].

In the mutation operation, each chromosome sequence uses a basic position mutation, where one gene is arbitrarily selected in number of genes and replaced by a random number between 1 to . Thus, a new chromosome is generated and the diversity of the population can be ensured.

3.3. Steps of Task Scheduling

The steps of the improved genetic algorithm are as follows.(1)Population initialization. The user submits a terminal request and randomly sets the initial population based on the request. Set the iteration counter , and indicates the th generation of population.(2)Calculate the fitness value. The fitness value of an individual is calculated according to the fitness function in the improved genetic algorithm.(3)Judge the termination condition. When the number of evolutionary generations reaches the specified number of iterations , the result should be given and an edge computation task scheduling strategy is found; otherwise, go to step (4).(4)Selection operation. The selection operation of the populations is performed using the roulette wheel.(5)Crossover operation. According to the crossover method in the designed improved genetic algorithm, two individuals are randomly selected among the individuals produced by the selection operation and are performed based on the crossover rate, so as to generate new individuals.(6)Mutation operation. According to the mutation method in the improved genetic algorithm, new individuals are generated by crossover operation and the selected individuals among the new individuals are operated according to the mutation rate to generate new individuals.(7)Compare the fitness value. If the fitness value of the mutated individuals is smaller than that of parent individuals, they will be replaced by the parent generation. If it is greater than or equal to the fitness value of the parent generation, the parent generation will be replaced. Then, a new generation of individuals is generated.(8)Update the iteration counter. Set the iteration counter as , then go to step (2).

4. Experiment and Analysis

The UAV trajectory and the performance of the proposed improved genetic algorithm are demonstrated by numerical simulations. The system simulation parameters are set as shown in Table 1.

The parameters of the improved genetic algorithm are set as follows. The number of iterations is 00, the crossover rate is 0.75, the mutation rate is 0.01, and the initial population size is 25.

4.1. UAV Trajectory

The UAV trajectory optimized by the improved genetic algorithm during different task execution time is shown in Figure 3, where the red circles indicate the positions of ground users.

From Figure 3, it can be seen that when T = 30 s, the UAV flies along the closed-loop trajectory and the flight range is small, the UAV is far from users when offloading data, and the communication quality is poor. With the increase of , and when T = 60 s and T = 120 s, the distance between the UAV and users decreases and the flight range expands, thus the communication quality improves. When is large enough, the UAV continues to fly along the closed-loop trajectory and serves one user in several timeslots. In addition, it can be found that the UAV has a larger flight range and is closer to users when is larger, and the communication quality is better.

4.2. Convergence Performance of Algorithms under Different Computation Tasks

In order to demonstrate the convergence of the improved genetic algorithm, it is compared with the traditional genetic algorithm, and the results are illustrated in Figure 4.

It is depicted from Figure 4 that the proposed improved genetic algorithm executes more tasks within the same number of iterations, and when the number of iterations exceeds 70, the amount of computation tasks tends to converge to 3450 M bit. Because it is optimized in encoding and genetic operations, the amount of computation increases. However, the process is slightly more complicated, resulting in longer processing time, and the number of iterations that tend to be stable is about 10 times higher than that of the original genetic algorithm. On the whole, the proposed algorithm can achieve effective convergence performance.

4.3. Relationship between Total System Energy Consumption with Task Execution Time

To demonstrate the performance of the total energy consumption of the proposed method, it is compared with those of the [9, 13, 15], and the results are shown in Figure 5.

As can be seen in Figure 5, with the increase of task execution time, the total energy consumption of the system also increases. Meanwhile, the proposed UAV-assisted computational resource allocation method requires lower energy consumption and has better performance than the other three methods. Moreover, the total energy consumption required by the proposed method is always the least while the task execution time is increasing. The total energy consumption is 650 J when the execution time is 110 s. As the proposed method executes the computation task with the assistance of UAV and optimizes the UAV trajectory using the improved genetic algorithm, it can dynamically and timely adjust the computation tasks so as to reduce the energy consumption. Reference [9] introduces mixed integer and nonconvex optimization to obtain task offloading decision and resource optimization. However, the optimization method is traditional, the obtained resource allocation strategy is not reasonable enough, and the total energy consumption of the system is higher than 1600 J. Reference [13] combines MOACO algorithm and reinforcement learning for multiobjective resource allocation, which can effectively improve the quality of users’ computing services, but the computational process is complex and the energy consumption is high. Similarly, [15] introduces UAV agents to assist in the offloading of computation tasks. However, it lacks an effective optimization algorithm to schedule its trajectory, so the energy consumption during UAV flight is high and its total system energy consumption is 62.5% higher than the proposed method.

4.4. Performance Comparison with Other Methods

In addition, to further validate the advantage of the proposed method in term of execution time, it is compared with [9, 13, 15], and the results are depicted in Figure 6.

It can be seen from Figure 6 that the task execution time increases continuously with more users, but the proposed method has the slowest increase and an obvious advantage in terms of execution time. The execution time is 17.5 s when the number of users is 50. The proposed method uses an improved genetic algorithm to optimize the UAV trajectory, it reduces energy consumption by lessening the blind flight time of the UAV and it offloads the tasks nearby to further reduce the transmission time. Compared with the proposed method, [15] lacks an effective algorithm to optimize the UAV trajectory, resulting in a longer flight time and a higher overall execution time, which is similar to that of [13]. Thus, the maximum execution time is more than 25 s. The optimization method in [9] is simple and easy to implement, and the execution time is shorter when the number of users is small. However, when the number of users increases, it is unable to handle the huge amount of data, resulting in the significant rise of the execution time.

5. Conclusion

With the explosive growth of IoT devices, cloud computing can no longer meet the demand of some time-sensitive computation tasks. For this reason, a computational resource allocation strategy using the genetic algorithm in the UAV-assisted edge computing environment is proposed. With the advantages of high mobility, low cost, and easy carrying, the UAV is introduced in the edge computing environment to assist in task offloading. The flexible scheduling of the UAV enables efficient allocation of user tasks and reduces execution time. In order to optimize the flight trajectory of the UAV, the problem of minimizing the total energy consumption of the system is solved by applying an improved genetic algorithm. Then, the optimal flight scheme can be obtained, that is, the optimal resource allocation strategy, which greatly reduces the system energy consumption and improves the transmission efficiency. The results based on the UAV simulation platform show as follows:(1)By real number encoding, selection, crossover, and mutation operations, the performance of the genetic algorithm in finding the optimal solution is effectively improved, and the data size of computational tasks can reach 3450 M bit when the number of iterations exceeds 70.(2)The introduction of the UAV allows dynamic response to users’ computational demands and improves the efficiency of the computation offloading. When the number of users is 50, the execution time is 17.5 s, and at the same time, when the execution time is 110 s, the total energy consumption is 650 J, which effectively reduces the system energy consumption.

The UAV-assisted MEC system only considers the scenarios where UAV is connected with users or the ground. When the UAV only has limited computing capacity, the case that UAV collects users’ data and offloads tasks to the ground base station for assisted computing is also worth studying.

Data Availability

The data used to support the findings of this study are included within the article.

Conflicts of Interest

The authors declare that they have no conflicts of interest regarding the publication of this paper.