Task allocation and route planning of multiple UAVs in a marine environment based on an improved particle swarm optimization algorithm

Unmanned aerial vehicles (UAVs) are considered a promising example of an automatic emergency task in a dynamic marine environment. However, the maritime communication performance between UAVs and offshore platforms has become a severe challenge. Due to the complex marine environment, the task allocation and route planning efficiency of multiple UAVs in an intelligent ocean are not satisfactory. To address these challenges, this paper proposes an intelligent marine task allocation and route planning scheme for multiple UAVs based on improved particle swarm optimization combined with a genetic algorithm (GA-PSO). Based on the simulation of an intelligent marine control system, the traditional particle swarm optimization (PSO) algorithm is improved by introducing partial matching crossover and secondary transposition mutation. The improved GA-PSO is used to solve the random task allocation problem of multiple UAVs and the two-dimensional route planning of a single UAV. The simulation results show that compared with the traditional scheme, the proposed scheme can significantly improve the task allocation efficiency, and the navigation path planned by the proposed scheme is also optimal.

The task planning problem of multiple UAVs can be divided into two parts, the task allocation problem and route planning problem, which are interrelated and different from each other. The task allocation problem is equivalent to the combinatorial optimization decision problem for multiple UAVs. It is a combination scheme designed to meet UAV performance and the constraints. The purpose is to make a UAV consume the least resources or obtain the maximum benefits with the shortest total path. The route planning problem involves planning a flight route from the starting point to the endpoint in the constrained task space and making the fitness function optimal. In order to solve the task planning problem, many scholars have conducted a considerable amount of research. The common task allocation methods include optimization algorithms (e.g., the Hungarian algorithm [5], branch definition method, graph theory, etc.), heuristic algorithms (e.g., clustering algorithms, ant colony algorithms (ACOs) [6], particle swarm optimization algorithms (PSOs) [7], genetic algorithms (GAs) [8], artificial bee colonies, etc.) and distributed algorithms (e.g., the decentralized Markov decision process, the contract net auction algorithm [9], etc.). Common route planning methods include traditional algorithms (e.g., the Voronoi diagram method, the artificial potential field method [10], etc.), heuristic algorithms (the Dijkstra algorithm, the Floyd algorithm, the A* algorithm [11], etc.), and intelligent bionic algorithms.
Currently, the inland application of UAV task planning is relatively mature. However, in the face of a complex and broad marine environment, UAV task planning still faces many challenges. First, due to the vastness of the marine environment, the complexity of the constraints, and the difficulty of modeling, an appropriate representation method for environmental modeling is needed. In this way, the environmental information of task planning can be accurately and reasonably expressed. Second, many task planning algorithms have limitations. Therefore, various algorithms should be effectively combined according to specific problems to improve the optimization effect. Furthermore, many research target models are too idealized to change according to the actual application. They are also not easy to adapt and lack universality. The main contributions of this paper are as follows: (1) An intelligent marine control system composed of UAVs and offshore platforms, including a system model, task allocation model, and route planning model, is established.
(2) Partial matching crossover and second transposition mutation, which improve the iterative speed and the performance of the optimal solution, are introduced to improve the traditional PSO algorithm.
(3) The task allocation and route planning problems of multiple UAVs with random targets and constraints have been solved. A large number of simulation experiments show the task allocation efficiency of marine UAVs and anti-interference ability.

Related work
To establish a suitable intelligent marine system model, many scholars at home and abroad have established a variety of marine systems in different scenarios. A probability graph fusion method of consensus theory and state predictors has been proposed to establish the communication model between UAVs [12]. In addition, a stochastic dynamic coastal environment model based on a Poisson distribution has been established to capture the environmental impact of coral reefs around the coastline [13]. However, the method of using UAVs to absorb solar energy as a communication relay node has higher requirements on the marine environment since the communication quality will be affected in the long-term due to a lack of sunshine and dark days. Under the assumption that the target probability map of the marine area is known, the marine system model is not suitable for the complex and changeable marine environment. The intelligent marine system proposed in this paper is set within the coverage of offshore base stations, and the motion model of UAVs satisfies a Gauss Markov process. The communication network is established between the offshore platform and the cloud platform through wireless transmission, and the communication link is randomly assigned to a UAV. In UAV task planning research, the allocation of communication resources will directly affect the performance of the entire system, especially in future space-groundsea integrated networks [14][15][16]. Many scholars have improved the traditional algorithm aiming to improve the task allocation efficiency, optimize the planning route and expand the application scenarios [17]. Among the topics, UAV mission planning is relatively mature regarding reconnaissance and striking, urban detection, disaster relief, forest fire monitoring, agricultural remote sensing, and other fields. To solve the multitarget urban tracking route planning problem of multiple UAVs, a novel algorithm combining the basic grey wolf optimizer (GWO) and Gaussian estimation of distribution (GED) strategy and adjusting the search direction by adjusting the weighted method has been proposed [18]. Different algorithms for task allocation and enhancing the effectiveness of data perception have been proposed to minimize the incentive costs while ensuring the quality of sensing data [19]. IIn order to solve the new problems of the application of multiple UAVs in the rapid assessment of earthquake disaster areas, an efficient simulated annealing hybrid particle swarm optimization algorithm, which generates high-quality solutions for rapid assessment task allocation problems, has been proposed [20]. In addition, an iterative greedy heuristic algorithm based on iterative solution destruction and reconstruction processes has been proposed to solve the logistics routing problem of truck UAV teams [21]. method based on the improved Voronoi diagram algorithm to find the best path connecting all pressure areas and their injection points has been proposed to complete the agricultural investment task without revisiting [22].
Moreover, due to the limited power endurance of UAVs, UAV systems in marine environments must consider network energy consumption [23,24]. First, the network energy efficiency can be improved through the optimization of network resources [25,26]. Second, solar energy can be used to improve the coverage of UAVs in the marine environment. A method of absorbing and converting solar energy through a solar UAV, which can act as the communication relay node of a marine fleet, has been proposed to improve marine communication coverage [27].
However, research on UAV task planning in the complex, wide, and communicationlimited marine field is relatively limited. In order to establish a task management architecture in a restricted marine environment, a new algorithm combining an unsupervised learning strategy and an improved K-means algorithm has been proposed [28]. The algorithm first assigns different tasks to multiple UAV systems and then implements selforganizing mapping to address the execution problem based on each assigned task. In order to solve the multitask allocation problem of a multiple unmanned surface vehicle system, an improved self-organizing mapping algorithm has been proposed [29]. The algorithm can allocate all tasks in the task area and obtain the set of task nodes that each UAV needs to access. In order to study the underwater target search and tracking task, an improved particle swarm optimization algorithm has been proposed [30]. The algorithm can perform the integrated tasks of unmanned aerial vehicles, unmanned ground vehicles, and automatic underwater vehicles. In order to solve the route planning problem of multiple UAVs in marine target search, an improved route planning algorithm based on the K-means algorithm and GA has been proposed [31]. In order to search for the best ship route, an algorithm combining the PSO algorithm and tangent graph method has been proposed [32]. In order to search for safe and efficient routes in the complex environment of wind farm water areas and ensure ship navigation safety, a hybrid route planning method based on the A* algorithm and reinforcement learning algorithm has been proposed [33].
All the above studies first selected a relatively specific application scenario of marine or water environments. Furthermore, the problem model is established under the condition of meeting the environmental constraints. Then, the model is improved on the basis of the traditional algorithm. Finally, the scheme is verified to improve the task planning efficiency. The goal of this paper is to establish an intelligent marine UAV task planning system. It is hoped that in the complex and changeable marine environment, according to the randomly generated task points, demand, threat area, and other characteristics, the system can quickly plan the task and design routes. Furthermore, regarding the system, the structure is relatively simple, the calculation costs are low, and the anti-interference ability is as strong as possible. Therefore, this paper makes many improvements in environment modeling, constraint setting, algorithm structure simplification, and model universality.

Methods
The UAV task planning model is divided into three parts: the system model, task allocation model, and route planning model. The system model includes a UAV model, mobile model, and communication model. The symbols used in this paper are summarized in Table 1.

UAV model
As shown in Fig. 1, we establish an intelligent ocean control system composed of multiple offshore platforms and multiple UAVs. As the base station in the intelligent ocean system, the offshore platform allocates network resources (bandwidth and channel) to UAV and assigns tasks (such as environmental monitoring, material distribution, etc.) to UAV. The communication between the platform and the UAV is established through the wireless link.
Offshore platforms are represented by set O, r oi represents the coverage radius of offshore platform O i , and ρ i represents the maximum density of UAVs within the coverage of offshore platform O i . When ρ imin ≤ ρ i ≤ ρ imax is satisfied, the number of UAVs that can be covered by offshore platforms O i is  Then, the total number of UAVs in the system can be expressed as N u :

Mobile model
We limit the motion of UAVs in the two-dimensional plane of an intelligent ocean system. A UAV can be regarded as a type of network communication node when it moves over the sea or communicates with a platform. We use coordinates Q k (x i , y i ) to represent the specific location of the UAV. The trajectory of the UAV is described as several track points in the flight period of the UAV, and then the motion process of the UAV can be modeled as a Gauss Markov process. The next movement of the UAV is related to the velocity and direction of the current movement. s t k and r t k represent the speed and direction of the UAV u k at time t, respectively. They can be calculated by the following formulas: where α and β are random variables following a Gaussian distribution, and ( ∈ [0, 1]) is the randomness in the Gaussian Markov process. When = 0 , the track points of the UAV are completely random.When = 1 , the UAV moves at a constant speed and direction. s k and r k represent the average velocity and direction of the UAV, respectively.

Communication model
The wireless links that can be generated by offshore platforms are limited, and the set H i is used to represent the covered wireless link sets of offshore platforms o i . The offshore platform allocates tasks to UAVs by establishing communication links. Due to the mutual interference between UAVs covered by the same offshore platform, the signal-tonoise ratio of UAV u k can be calculated as: where p k and p j are the transmission power of UAVs u k and u j , respectively. d k,i and µ k,i are the distance and path loss index from UAV u k to offshore platform o i , respectively. σ is additive Gaussian white noise.

Task allocation model
To understand more ocean information and conduct rescue and disaster relief, UAVs need to perform daily monitoring tasks and emergency tasks. Based on this, the task allocation of UAVs in the coverage area of offshore communication base stations includes not only the number of tasks allocated to UAVs but also the execution sequence of each task, which can be summarized as a vehicle routing problem (VRP) [34][35][36]. This section only considers the task allocation order of UAVs in the mission area and does not consider the specific flight path of UAVs between each task point, so that the UAVs can meet the requirements and constraints of the task point, and, at the same time, the total flight straight path is the shortest.
The target function of the VRP problem can be expressed as: Formula (6) shows that under the current path, the minimum length of the sum of the flight path of each UAV and the total path that will reach the next task point to the destination. When the value of the fitness function is small, the task allocation result is better.

Route planning model
Before UAV route planning, environment modeling is needed to convert all types of physical information into a digital model, which is convenient for computer processing. In this paper, the UAVs in the offshore environment used to conduct routine marine investigation tasks and emergency tasks are the research examples. Considering the environmental threat area and the performance constraints of UAVs, an optimal flight route from the start to the end is planned.
There are threats such as reefs, birds, marine currents, and wind shear in the offshore environment, which can be represented by ellipses in a two-dimensional environment. Once a UAV enters these areas, it will crash, which means that the damage probability of a UAV in this area is 1. This is represented by the following set: Therefore, the threat zone can be expressed as (a, b, r), where (x i , y i ) are the coordinates of the UAV, (a, b) are the coordinates of the center point of the threat area, and r is the radius of the threat area.
The standard used to measure the merits and disadvantages of UAV tracks is a the fitness function. Considering the environmental threat, constraints, and the length of the UAV range, Formula (8) defines is the fitness function of UAV route planning: where ϕ k is the signal-to-noise ratio of the UAV on offshore platform o k , which can be calculated by Formula (5). J 1i , J 2i , and J 3i are the return values of the three constraint conditions in the route of segment i, and a value of 1 means that the constraint condition is satisfied; otherwise, the value is 0. G 0 is the collision factor of the threat area. If a point intersecting the threat area is detected in each route, it is determined that the route collides with the threat area, and G 0 = 0.1 . If not, then G 0 = 0. Formula (8) shows that when the constraint conditions are met, the communication interference of UAVs by the offshore platform is the minimum, and the route does not collide with the threat area. The fitness function with the shortest range should be as large as possible.

Traditional PSO
The first step of the traditional PSO algorithm is to initialize the particle swarm. Then, the fitness of the particles is calculated. The global optimal solution and local optimal solution are updated according to the fitness. Finally, the velocity and position of the next generation of particles are calculated by updating the velocity and position formula until the maximum number of iterations is reached. The updating formula of the velocity and position of particle i is where v k i is the component of the velocity vector of particle i in iteration k. y k i is component of the position vector of particle i in iteration k. a 1 and a 1 are acceleration constants, which are responsible for adjusting the maximum speed of particle learning. r 1 and r 2 are random functions with values ranging from 0 to 1. w is the inertia weight (nonnegative), reflecting the influence of the individual particle history at present.
In Formula (10), the first part represents the previous velocity of the particle. The second part is the "cognition" part, which represents the distance between the current position of particle i and its historical optimal position, which is equivalent to the local optimal solution. The third part is the "society" part, which represents the distance between the current position of particle i and the optimal position of the population, which is equivalent to the global optimal solution. The final motion direction of particles is affected by the above three parts, as shown in Fig. 2. Fig. 2 Schematic diagram of particle motion direction Compared with the traditional algorithm, PSO has a memory function. The update process is affected by the local optimal solution and the global optimal solution instead of blind random selection, which greatly improves the search efficiency. Furthermore, fewer parameters need to be adjusted, and the structure is simple and easy to implement. However, because of these advantages, the PSO algorithm loses diversity of the search space. Furthermore, it easily produces premature convergence, has poor local searchability, and easily falls into the local optimal solution.

Improved PSO algorithm
In view of the above shortcomings, many domestic and foreign researchers have proposed some improvement methods. These improved methods can be divided into two categories. One category improves the inertia weight, contraction factor, velocity, and position update process of particles on their own. The other category combines the PSO algorithm with another algorithm that can compensate for its shortcomings so as to improve the performance of the algorithm. In this paper, an improved particle swarm optimization combined with a genetic algorithm (GA-PSO) is proposed. By introducing crossover and variation, the velocity and position updating formula of PSO are improved to increase the diversity of the search space and avoid falling into the local optimal solution.

Local optimal solution
Partially matched crossover (PMX) refers to two invalid chromosomes or duplicate individual genes after randomly selecting two crossover points in individual chromosomes for partial gene exchange. In order to repair the chromosomes, the matching relationship of each chromosome is established in the cross-region, and the matching relationship is applied to the duplicate genes outside the cross-region to eliminate the conflict. Because PMX can ensure that the genes in each chromosome only appear once, we choose this crossover strategy to solve the traveling salesman problem (TSP) and VRP.
As shown in Fig. 3, PMX crossover mainly consists of the following steps: (1) Two intersections are randomly selected, and the sequences between the two intersections are the exchanged segments.
(2) The new parent sequence is obtained by exchanging the positions of the exchanged segments.
(3) Conflict detection is performed on sequences. According to the exchange segment of the two-parent sequences, the two-child sequences with mapping relationships can be obtained. The traversal repeat points in the offspring sequence outside the exchange segment are exchanged one by one according to the mapping relationship of the exchanged segments until there is no conflict.
(4) The final offspring sequence is obtained. In this paper, each particle represents a task planning path, so the parent sequence is the particles before the crossover operation, and the points that compose the sequence are the task points. Finally, the target function values of the new particle sequence and the parent sequence are compared. If the target function after crossover is small, the cross-particle sequence is stored in the local optimal solution, and the corresponding target function value is updated.

Global optimal solution
The crossover process of the global optimal solution is the same as that of the local optimal solution. The final new particle sequence is compared with the target function value of the parent sequence. If the target function value after crossover is smaller, the crossed particle sequence is stored in the global optimal solution, and the corresponding target function value is updated. The global optimal solution is updated according to the minimum value of the local optimal solution.

The particle itself
According to Formula (9), each particle will generate a pair of random numbers in the process of an iteration. Transposition mutation is equivalent to exchanging the order of task points in a path corresponding to two random numbers. This occurs as shown in Fig. 4.
Finally, the target function values of the new particle sequence and the parent sequence are compared. If the mutated target function value is smaller, the mutated particle sequence is stored in the local optimal solution, and the corresponding target function value is updated.

Algorithm implementation for the task allocation problem
UAVs need to meet some constraints in task allocation. In the intelligent marine system studied in this paper, the constraints can be divided into the task point constraints, the task order constraints, and the constraints of the UAV itself. The details are as follows: Formulas (11) and (12) indicate that each task point can only be accessed by one UAV once. x ki,j is the decision variable. When UAV u k arrives at task point c i from task point c i , the value is 1. Otherwise, the value is 0.
Formula (13) indicates that the UAV starts from the warehouse and finally needs to return to the warehouse. Formula (14) represents the node balance constraint, and the total number of UAVs starting from the task point must be consistent with the total number of UAVs arriving at the task point.
Formulas (15) and (16) represent the material loading constraint and travel constraint of each UAV, respectively. The material requirement q i of task point i must be less than the maximum material loading q − i of UAV u k . The flight distance from task point c i to task point c j must be less than the maximum travel l k of UAV u k .
Formula (17) indicates that the time for the UAV to go to the task point must be within the task time window. The time window t ωi,j is an interval, and only when the task is completed in this interval can it be regarded as an effective task.
Formula (18) indicates that the material loading capacity q k , maximum range l k and time window t ωi,j from task point c i to task point c j of UAV u k are all positive numbers. Algorithm 1 describes the constraint process in the UAV task allocation problem. The input part sets the maximum material loading capacity, flight speed, and maximum range of UAVs. The number, location, material demand, and time window of task points are set randomly. Then, initialization and memory preallocation are conducted. Then, (11)   when proceeding to the next task point from the current position, it is necessary to judge whether the constraint conditions are satisfied in turn according to the above formulas (11)(12)(13)(14)(15)(16)(17)(18). If all of the constraint conditions are met, the implementation will continue. If the constraints are not met, the UAV returns to the warehouse and a new UAV is arranged to perform the task. After all task points are completed, all UAVs return to the warehouse.
Algorithm 2 describes the UAV task allocation problem based on improved GA-PSO. First, the UAV, task point, warehouse, and particle are input and set initially, and the memory is preallocated. Then, the optimal solution of the target function of each generation of particles is compared. The PMX operation is performed on the local optimal solution and the global optimal solution, and the secondary transposition mutation is performed on the particle itself, which is compared and updated with the current position. This continues until the maximum number of iterations is reached.

Algorithm implementation for the route planning problem
There are many self-constraints in the actual route planning of UAVs, such as the maximum travel distance, the minimum inertial distance, and the maximum horizontal deflection angle.

Maximum travel distance
Suppose the maximum travel distance of UAV u k is l kmax . If the entire travel route is composed of n flight points, the entire travel route can be divided into n − 1 segments, the flight of segment i can be expressed as l ki , and the total travel route L k can meet the following requirements:

Minimum inertial distance
The minimum inertial distance refers to the shortest flight distance that a UAV needs to maintain the original direction due to the inertial effect when it suddenly changes direction. If the minimum inertial distance of UAV u k is l kmin , the minimum inertial distance constraint is:

Maximum horizontal deflection angle
The maximum horizontal deflection constraint means that the UAV cannot complete large-angle turning in the horizontal direction, and can only turn in a certain angle range. If the horizontal projection of segment i of UAV u k is e ki = (x i − x i−1 , y i − y i−1 ) , and the maximum horizontal deflection angle is θ kmax , then the maximum horizontal deflection angle constraint is: Algorithm 3 describes the constraint process in a UAV two-dimensional route planning problem. First, the maximum range, minimum inertial distance, and maximum horizontal deflection angle of the UAV are input and set. The positions of the threat area, starting point, and target point are set randomly. The memory is preallocated, a route is randomly generated, and the number of flights of the route is counted. Then, it is necessary to judge whether each flight meets Formulas (20)(21). If this occurs, it is necessary to calculate the total travel distance and judge whether Formula (19) is satisfied. If this is not satisfied for any UAV, it will jump out. If both conditions are met, the travel is recorded, and the constraint parameters and threat factors are returned. Algorithm 4 describes the process of two-dimensional route planning of UAVs based on improved GA-PSO. First, the initial settings of the UAV, threat area, target point, starting point, link, communication environment, and particle are input and initially set. Memory is preallocated. It is necessary to calculate the speed and direction of UAVs and calculate the signal-to-noise ratio of UAVs in the marine communication environment. Then, we need to compare the optimal solution of the fitness function for each generation of particles. The PMX operation is performed on the local optimal solution and the global optimal solution. The second transposition mutation of the particle itself is conducted and compared with the current position to determine updates. This process repeats until the maximum number of iterations is reached. Yan

Results and discussion
In order to verify the effectiveness of the improved PSO algorithm proposed in this paper in UAV task allocation and route planning, MATLAB R2016a software is used to simulate and verify on a notebook with 3.0 GHz dominant frequency and 16 GB memory.

Task allocation
The improved GA-PSO is compared with the SA, the GA, and the ACO in the same environment; and three groups of experiments are set to verify the performance of the algorithm. The parameter settings of each group of experiments are shown in Table 2.
The coordinates, material demand, and time windows of task points are generated randomly.
The simulation results of the first group are shown in Fig. 5, and the details of the optimal solution are shown in Table 3. Figure 5a shows the initial distribution of 10 random task points in the two-dimensional plane and the location of the warehouse. The dots represent the task points, and the five-pointed star represents the warehouse. (b), (c), (d), and (e) in Fig. 5 are the optimal solutions of GA-PSO, the SA, the GA, and ACO after 50 independent runs, respectively. The figures show that the optimal solution of GA-PSO, which requires the cooperation of three UAVs, is consistent with those of the SA and GA. Figure 5f shows the solutions of the target function in 200 iterations of the four algorithms. The figure shows that GA-PSO has the fastest iteration speed to find the optimal solution, followed by the GA and SA; and ACO has poor performance and a slow iteration speed. Table 3 compares the optimal solutions of the four functions in terms of the task allocation path, total path length, total time, and average material loading rate. The results show that the optimal solutions of the SA, the GA, and GA-PSO are consistent. The task execution paths of the six UAVs are 3-9-4, 6-7-2-1-10, and 5-8. The total path length is 55.7 km, the total time is 331.9 min, and the average material loading rate is 90%. ACO has the longest total path and time, and the average material loading rates are the same.
The simulation results of the second group are shown in Fig. 6, and the details of the optimal solution are shown in Table 4. The task allocation area 10*10 km 10*10 km 10*10 km  Figure 6a shows the initial distribution of 20 random task points in the two-dimensional plane and the location of the warehouse. (b), (c), (d), and (e) in Fig. 6 are the optimal solutions of GA-PSO, the SA, the GA, and ACO, respectively, after 50 independent runs. The figure shows that GA-PSO and the GA need 6 UAVs to cooperate, and the SA and ACO need 7 UAVs to cooperate. Figure 6f shows the solutions of the target function in 200 iterations of the four algorithms. The figure shows that GA-PSO has the smallest target function to find the optimal solution, the SA has the fastest iteration speed, and ACO has the worst optimal solution and the slowest iteration speed.
The results in Table 4 show that GA-PSO has the smallest optimal solution. The task execution paths of the six UAVs are 13-2-7-10-8, 4-16-15, 5-20, 3-1-12-17, 6-9-18 and 14-11-19. The total path length is 110.1 km, the total time is 640.5 min, and the average material loading rate is 98.3%. The results show that the optimal solution of the SA is better than that of the GA and that of ACO is the worst.
The simulation results of the third group are shown in Fig. 7, and the details of the optimal solution are shown in Table 5. Figure 7a shows the initial distribution of 30 random task points in the twodimensional plane and the location of the warehouse.  are the optimal solutions of GA-PSO, the SA, the GA, and ACO, respectively, after 50 independent operations. The figures show that the four algorithms need 10 UAVs to cooperate. Figure 7f shows the solutions of the target function in 300 iterations of the four algorithms. The figure shows that GA-PSO has the smallest target function to find the optimal solution, the SA has the fastest iteration speed, the GA and ACO have the slowest iteration speeds, and ACO has the worst optimal solution. The results in Table 4 show that GA-PSO has the smallest optimal solution. The task execution paths of 10 UAVs are 18-5, 22-8-20-1, 13-2-25, 17-28-5, 27-30, 14-23-10, 29-24-9, 26-3-11-21, 12-6 and 19-4-16-7, respectively. The total path length is 173.9km, the total time is 1219.4 min, and the average material loading rate is 89.5%. The optimal solutions of SA and GA are better than ACO.
From the above three groups of experiments, it can be concluded that GA-PSO has a certain effect on the UAV task allocation process. Under the constraints, it can quickly and effectively find the optimal allocation scheme and save time and materials.

Route planning
GA-PSO is compared with the SA, the GA, and ACO in the same environment; and two groups of experiments are set to verify the performance of the algorithm. In the following experiments, the threat types in the two-dimensional plane include reefs, wind shear areas, and birds. The parameter settings of each group of experiments are shown in Table 6, and the center coordinates, target points, and radius of three or five threat areas were randomly generated. The simulation results of the first group are shown in Fig. 8, and the shortest travel is shown in Table 7. Figure 8a shows the initial distribution of the three threat areas in the two-dimensional plane and the positions of the starting and target points. (b), (c), (d), and (e) in Fig. 8 are the optimal solutions of GA-PSO, the SA, the GA, and ACO after 50 independent runs, respectively. The figures show that GA-PSO, the SA, and the GA need 6 flights from the starting point to the target point, ACO needs 5 flights, and all methods can effectively avoid the threat area. Figure 8f shows the solutions of the fitness Fig. 7 The results of the third group of the experimental optimal solutions of task allocation Table 5 Details of the optimal solutions of the third experiment function in 200 iterations of the four algorithms. The figure shows that the fitness function of GA-PSO to find the optimal solution is the largest. The iteration speed of the GA is the fastest, but there are mutation cases. The iteration speed of ACO is the slowest, and the fitness function of the SA is the smallest. The simulation results of the second group are shown in Fig. 9, and the shortest travel is shown in Table 7. Figure 9a shows the initial distribution of the five threat areas in the two-dimensional plane and the positions of the starting and target points. (b), (c), (d), and (e) in Fig. 9 are the optimal solutions of GA-PSO, the SA, the GA, and ACO after 50 independent runs, respectively. The figures show that GA-PSO, the GA, and ACO need 4 Table 6 The parameter settings of route planning Parameter Group 1 Group 2 The starting point (0,0) (0,0) The UAV flight area 7*10 km 7*10 km The weight coefficient 0.9 0.9 The learning factor 2 2 The number of threat areas flights from the starting point to the target point, the SA needs 5 flights, and all methods can effectively avoid the threat area. Figure 9f shows the solutions of the fitness function in 200 iterations of the three algorithms. The figure shows that the fitness function of GA-PSO to find the optimal solution is the largest, and the iteration speed is faster. The iteration speed of the GA is the fastest, but there are mutation cases. The fitness function of the SA is the smallest, and the iteration speed of ACO is the slowest. Table 7 shows the shortest total travel of the four algorithms in the two groups of experiments. The table shows that the GA-PSO in this paper has shorter total travel distances in the two experiments, which are 10.61 km and 8.53 km, respectively. Although ACO has the shortest total travel distances of 10.23 km in the first group, its path is close to the edge of the threat area, which is not conducive to UAV flight in practice. The results of the above two groups of random experiments can prove that the improved GA-PSO has high efficiency and a certain anti-jamming effect in the two-dimensional plane route planning of UAVs.