A UAV path planning method based on equilibrium optimization algorithm
Through the balanced optimization algorithm and grid map modeling, combined with the fitness function to optimize the UAV path, the problem of insufficient optimality of UAV path planning in large-scale environments in the existing technology is solved, and the UAV path planning in complex terrain is realized. collision-free optimal path planning.
Patent Information
- Application Number
- CN202310547560.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2043-05-16
AI Technical Summary
Existing UAV path planning methods are difficult to generate optimal collision-free paths in larger-scale environments, and their optimality is insufficient.
The balanced optimization algorithm is used to optimize the UAV flight path. Through grid map modeling and heuristic search algorithm, combined with the fitness function to optimize the path, the optimal flight path is generated by considering the energy consumption of flight distance and turning angle.
Generating collision-free optimal paths in complex terrain environments overcomes terrain restrictions and improves path point accuracy and flight efficiency.
Smart Images

Figure CN116610143B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of unmanned aerial vehicle path planning, and in particular relates to a unmanned aerial vehicle path planning method based on a balanced optimization algorithm. Background Art
[0002] With the advent of the information age, drones are playing an increasingly important role in both civil and military applications. In civil applications, drones can be used for environmental monitoring, such as agricultural and animal husbandry research, crop and yield forecasting, land use surveys and resource planning, as well as crop monitoring, forest fire monitoring, etc. In the military, unmanned combat aircraft are a prerequisite for modern air combat, and they can replace pilots in complex and dangerous flight missions. Therefore, how to plan a collision-free path from the starting point to the end point becomes very important.
[0003] According to the different perception of the environment by the drone, the drone path planning is divided into global and local path planning. Global planning methods include visibility graph method, grid method, free space method, neural network method, etc. Among them, the grid method is used to model the terrain, which needs to be combined with other intelligent algorithms to plan the optimal path.
[0004] Although the use of intelligent computing methods to plan the path of drones is effective, there are still many problems, such as insufficient optimality and the inability to provide a better path in scenarios with larger environmental scales. Summary of the invention
[0005] In order to solve the above problems, the present invention proposes a UAV path planning method based on a balanced optimization algorithm. The planned path is optimized by the balanced optimization algorithm to improve the accuracy of path point optimization. The present invention can overcome terrain restrictions and enable the UAV to plan a collision-free optimal path in a larger-scale environment.
[0006] The technical solution of the present invention is as follows:
[0007] A UAV path planning method based on a balanced optimization algorithm comprises the following steps:
[0008] Step 1: Obtain the height data of the real environment and construct a grid map;
[0009] Step 2: Determine the starting and ending coordinates of the UAV's flight path and initialize the UAV's flight path;
[0010] Step 3: Use the equilibrium optimization algorithm to optimize the initial path, and use the optimal output individual obtained by the equilibrium optimization algorithm as the optimal flight path of the UAV.
[0011] Furthermore, in step 1, firstly, a satellite map of the mountain in the UAV flight area is collected by using a satellite to obtain the height data of the real environment, the height data of the UAV flight environment is used as the height data of the real environment, and the real environment is modeled using a grid method to obtain a grid map;
[0012] The process of grid modeling is as follows: first, create a three-dimensional space coordinate system with the vertex O in the lower left corner as the coordinate origin; in this space coordinate, the X-axis is the direction of increasing longitude, the Y-axis is the direction of increasing latitude, and the Z-axis is the direction perpendicular to the sea level; then divide the X-axis into m parts, the Y-axis into n parts, and the Z-axis into k parts; each discrete point in the coordinate system is used as a waypoint passed by the drone during flight; finally, read in the altitude data, and divide the grid in the map into accessible and inaccessible states. The grid points that meet the altitude requirements are accessible, and the other grid points are inaccessible.
[0013] Furthermore, the specific process of step 2 is as follows:
[0014] Step 2.1, determine the starting point S(X S ,Y S ,Z S ) and the end point T(X T ,Y T ,Z T );
[0015] Step 2.2, with the X-axis as the reference, find every point on the YOZ plane that meets the flight requirements; since the X-axis is divided into m parts, there are m-1 planes parallel to the YOZ between the starting point and the end point, so a total of m+1 planes parallel to the YOZ are obtained; the starting point S is on the first YOZ plane, and the end point T is on the last YOZ plane;
[0016] Step 2.3, starting from the next plane of the starting point S, find each target point of the UAV flight path; specifically: take S as the center point, find a point that meets the height requirement among the 24 adjacent points on the next plane, and simultaneously discard the points that exceed the spatial range;
[0017] Step 2.4: Calculate the heuristic value Q of each point that meets the height requirement according to the following formula: i ;
[0018]
[0019] Where i represents the i-th waypoint that meets the altitude requirement; Y pre and Z pre They represent the Y-axis and Z-axis values of the waypoint on the YOZ plane when X=0, respectively. now , Y now and Z nowRespectively represent the values of the three coordinate axes of the waypoint on the YOZ plane when X=1; then, add the heuristic values of the waypoints that meet the height requirements to obtain the total heuristic value SUM; calculate the QZ value of each waypoint that meets the requirements, Then randomly generate a number ra between (0,1) and find the first one that satisfies ra <QZ i The waypoint is taken as the final waypoint on the YOZ plane when X=1;
[0020] Step 2.5, use the same method to find the waypoints on the YOZ plane when X=2,3...m-1; finally, connect all the waypoints between the starting point and the end point to find a path path (S,...,T) that meets the requirements.
[0021] Furthermore, the specific process of step 3 is as follows:
[0022] Step 3.1, generate 20 initial paths {path1, path2, ..., path20} according to the process described in step 2.3, step 2.4 and step 2.5, determine whether there is a waypoint beyond the spatial range on each path, if so, select a qualified waypoint in the plane of the waypoint according to step 2.3 and step 2.4;
[0023] Step 3.2, initialize the number of iterations to 0;
[0024] Step 3.3, calculate the fitness values of all paths, and find the top four paths with the best fitness values;
[0025] The fitness function of the drone's flight path includes two items, one is the cost of the flight distance, and the other is the energy consumption of the turning angle; the calculation formula is as follows:
[0026]
[0027] Where J represents the total flight cost of the drone, α and β represent weights, D(i) represents the flight distance between two planes in the grid map; θ i represents the angle between the line connecting the ith waypoint and the previous waypoint and the horizontal plane; N represents the total number of waypoints;
[0028] Step 3.4: Execute the memory storage process; the specific process is:
[0029] When the number of iterations is 0, back up the current 20 initial paths and their fitness values;
[0030] When the number of iterations is not equal to 0, determine whether there is a path among the 20 paths of the previous iteration whose fitness value is less than the fitness value of the path under the current number of iterations. If so, replace the current path and its fitness value with the path and fitness value of the previous iteration; then back up all the paths and fitness values under the current number of iterations;
[0031] Step 3.5, find the average path and the balanced pool of the four paths;
[0032] First, add the coordinate values of the X-axis, Y-axis, and Z-axis of each waypoint on the YOZ plane in the 20 paths, and calculate the average value of the X-axis, Y-axis, and Z-axis of each waypoint to determine whether the average value of each waypoint meets the height requirement. If not, generate a waypoint that meets the requirements according to steps 2.3 and 2.4, connect each waypoint that meets the requirements, and obtain an average path path_ave; the paths in the balancing pool include the first four paths with the best fitness values and an average path;
[0033] Step 3.6, calculate the value of the random number t; the random number t is a number that changes with the number of iterations, and the specific calculation formula is as follows:
[0034]
[0035] Among them, iter represents the current number of iterations, Max_iter represents the preset maximum number of iterations, and a2 is a constant;
[0036] Step 3.7, for each of the 20 initial paths, perform iterative update according to the following steps, and increase the number of iterations by 1 each time, and continuously update the paths; the paths updated in the first iteration are the 20 initialized paths, and the paths updated in each subsequent iteration are the 20 paths updated in the previous iteration; during the iteration process, continuously determine whether the new number of iterations is less than the preset number of iterations. If it is less than the preset number of iterations, re-execute steps 3.3-3.7 to update the 20 paths; otherwise, the iteration ends when the preset number of iterations is reached, and an optimal output individual will be obtained after the current iteration ends, which corresponds to the optimal path required in the end.
[0037] Furthermore, in step 3.7, the process of iterative updating of each path is as follows:
[0038] Step 3.7.1, calculate λ, where λ represents a randomly generated matrix of 1 row and 2M columns, each dimension of which is a random number between (0,1), the dimension of λ is 2M, and M represents the number of divided YOZ planes;
[0039] Step 3.7.2, calculate r, which is a matrix with 1 row and 2M columns. The generation method of r is the same as λ;
[0040] Step 3.7.3, randomly select a path path_r from the balancing pool in step 3.5;
[0041] Step 3.7.4, calculate the value of F, which is an exponential term used to balance the exploration and development process during path updating; F is a matrix with 1 row and 2M columns, and the value of each dimension is between (-2, 2);
[0042] F = a1sign(r-0.5)(e -λt -1) (4);
[0043] Wherein, a1 is a constant, and in the present invention, the value is 2; sign represents a sign function;
[0044] Step 3.7.5, generate two random numbers r1 and r2 between (0,1);
[0045] Step 3.7.6, calculate the value of GCP, GCP is defined as the power generation rate control parameter, which is used to represent the contribution to particle update;
[0046]
[0047] Among them, GP is a constant;
[0048] Step 3.7.7, calculate the value of G0, which is an initial value and an intermediate parameter used to calculate the size of G;
[0049]
[0050] in, is the j-th path of the iter-th generation;
[0051] Step 3.7.8, calculate the value of G, where G represents the generation rate;
[0052] G = G0F (7);
[0053] Step 3.7.9, update the path according to the following formula,
[0054]
[0055] in, It represents the jth path updated when the number of iterations is iter+1, and V is a constant.
[0056] Beneficial technical effects brought by the present invention:
[0057] The balanced optimization algorithm adopted in the present invention optimizes the flight path of the UAV. While ensuring the collision-free flight of the UAV, it takes into account the energy consumption of the flight angle, thereby optimizing the flight path of the UAV. The invention can overcome the limitations of the terrain in the flight environment and can optimize the flight path of the UAV in complex environments such as mountains. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a flow chart of the UAV path planning method based on the balanced optimization algorithm of the present invention;
[0059] Figure 2 is a schematic diagram of a three-dimensional space coordinate system in the present invention;
[0060] Figure 3 A grid map of the UAV flight constructed in the three-dimensional path planning space of the present invention;
[0061] Figure 4 A schematic diagram of a path initialized in the three-dimensional path planning space of the present invention;
[0062] Figure 5 A comparison diagram of the final flight routes planned using the balanced optimization algorithm and the ant colony algorithm in the three-dimensional path planning space of the present invention;
[0063] Figure 6 The figure is a comparison chart of the change curves of the fitness value with the number of iterations when the balanced optimization algorithm and the ant colony algorithm are used to plan the flight route in the present invention; wherein (a) and (b) correspond to the change curves of the fitness value calculated using the balanced optimization algorithm and the ant colony optimization algorithm, respectively. DETAILED DESCRIPTION
[0064] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0065] like Figure 1 As shown, a UAV path planning method based on a balanced optimization algorithm includes the following steps:
[0066] Step 1: Get the height data of the real environment and build a grid map. The specific process is as follows:
[0067] First, satellites are used to collect mountain satellite maps of the UAV flight area to obtain the height data of the real environment. The height data of the UAV flight environment is used as the height data of the real environment, and the real environment is modeled using the grid method to obtain a grid map. The grid map is the discretized map of the UAV flight area. This modeling method can discretize continuous space.
[0068] The present invention is constructed as Figure 2The grid map shown in the figure first creates a three-dimensional space coordinate system with the vertex O in the lower left corner as the coordinate origin. In this space coordinate, the X-axis is the direction of increasing longitude, the Y-axis is the direction of increasing latitude, and the Z-axis is the direction perpendicular to the sea level. Then divide the X-axis into m parts, the Y-axis into n parts, and the Z-axis into k parts. In the present invention, m=20, n=20, k=10. Each discrete point in the coordinate system serves as a waypoint passed by the drone during flight. Finally, the altitude data is read in, and the grid in the map is divided into accessible and inaccessible states. The grid points that meet the altitude requirements are accessible, and the other grid points are inaccessible. By using the grid method to make a map, the real environment is modeled as a discrete environment in the coordinate system, and the continuous space is discretized to construct a grid map of the drone flight, such as Figure 3 shown.
[0069] Step 2: Determine the coordinate values of the starting point and end point of the UAV flight path and initialize the flight path of the UAV. The starting point and end point of the UAV flight path are given manually, and the optimal path is found for different needs. The waypoints on the path are all discrete points in the grid map, and each waypoint satisfies that its height is greater than the height of each point in the grid map. Connect the points that meet the requirements to get the flight path from the starting point to the end point. The specific process is as follows:
[0070] Step 2.1, determine the starting point S(X S ,Y S ,Z S ) and the end point T(X T ,Y T ,Z T ). Find a path from the starting point to the end point.
[0071] Step 2.2, using the X axis as the reference, find every point on the YOZ plane that meets the flight requirements. Since the X axis is divided into m parts, there are m-1 planes parallel to the YOZ between the starting point and the end point. Therefore, in this step, a total of m+1 planes parallel to the YOZ are obtained. The starting point S is on the first YOZ plane, and the end point T is on the last YOZ plane.
[0072] Step 2.3, starting from the next plane of the starting point S, find the target points of the drone's flight path; specifically: take S as the center point and find the points around it that meet the conditions on the next plane. Figure 2 The ABCD plane in the figure is used as the next plane for the drone to fly from the starting point S. At this time, on the YOZ plane with X=1, the plane with S1(X S +1,Y S ,Z S) is the center point, and the points that meet the height requirements are found from the 24 adjacent points, and the points that exceed the spatial range are discarded simultaneously. The value of S1 on the X axis is 1, and the values on the Y and Z axes are the same as S.
[0073] Step 2.4: Calculate the heuristic value Q of each point that meets the height requirement according to the following formula: i .
[0074]
[0075] Where i represents the i-th waypoint that meets the altitude requirement. pre and Z pre They represent the Y-axis and Z-axis values of the waypoint on the YOZ plane when X=0, respectively. now , Y now and Z now They represent the values of the three coordinate axes of the waypoint on the YOZ plane when X=1. Then, the heuristic values of the waypoints that meet the height requirements are added together to get the total heuristic value SUM. The QZ value of each waypoint that meets the requirements is calculated. Then randomly generate a number ra between (0,1) and find the first one that satisfies ra <QZ i The waypoint is taken as the final waypoint on the YOZ plane when X=1.
[0076] Step 2.5, use the same method to find the waypoints on the YOZ plane when X = 2, 3...m-1. Finally, connect all the waypoints between the starting point and the end point to find a path (S,...,T) that meets the requirements. Figure 4 As shown, the present invention initializes 20 flight paths.
[0077] Step 3: Use the equilibrium optimization algorithm to optimize the initial path, and use the optimal output individual obtained by the equilibrium optimization algorithm as the optimal flight path of the drone. The equilibrium optimization algorithm is a meta-heuristic algorithm that searches for the optimal solution through its exploration and development process, and finally obtains an optimal flight route by optimizing the fitness function that meets the height requirements and corner energy consumption. The specific process is as follows:
[0078] Step 3.1. Generate 20 initial paths {path1, path2, ..., path20} according to the process described in steps 2.3, 2.4 and 2.5. Determine whether there are waypoints beyond the spatial range on each path. If so, select a qualified waypoint in the plane of the waypoint according to steps 2.3 and 2.4.
[0079] Step 3.2: Initialize the number of iterations to 0.
[0080] Step 3.3: Calculate the fitness values of all paths and find the top four paths with the best fitness values.
[0081] The fitness function of the drone's flight path includes two items: one is the cost of the flight distance, and the other is the energy consumption of the turning angle. The calculation formula is as follows:
[0082]
[0083] Where J represents the total flight cost of the drone, α and β represent weights, D(i) represents the flight distance between two planes in the grid map; θ i It represents the angle between the line connecting the ith waypoint and the previous waypoint and the horizontal plane; N represents the total number of waypoints.
[0084] Step 3.4: Execute the memory storage process. The specific process is:
[0085] When the number of iterations is 0, back up the current 20 initial paths and their fitness values;
[0086] When the number of iterations is not equal to 0, determine whether there is a path in the 20 paths of the previous iteration whose fitness value is less than the fitness value of the path at the current iteration. If so, replace the current path and its fitness value with the path and fitness value of the previous iteration. Then back up all the paths and fitness values at the current iteration.
[0087] Step 3.5, find the average path and the balanced pool of the four paths.
[0088] First, add the coordinate values of the X-axis, Y-axis, and Z-axis of each waypoint on the YOZ plane in the 20 paths, and calculate the average value of the X-axis, Y-axis, and Z-axis of each waypoint to determine whether the average value of each waypoint meets the height requirement. If not, generate a waypoint that meets the requirements according to steps 2.3 and 2.4, connect each waypoint that meets the requirements, and obtain an average path path_ave. The paths in the balanced pool include the first four paths with the best fitness values and an average path. The paths in the balanced pool are used to assist in updating the 20 initial paths.
[0089] Step 3.6, calculate the value of the random number t. The random number t is a number that changes with the number of iterations. The specific calculation formula is as follows:
[0090]
[0091] Among them, iter represents the current number of iterations, Max_iter represents the preset maximum number of iterations, and a2 is a constant, which is 1 in the present invention.
[0092] Step 3.7: For each of the 20 initial paths, perform iterative updates according to the following steps. The number of iterations is increased by 1 each time, and the paths are continuously updated. The paths updated in the first iteration are the 20 initialized paths, and the paths updated in each subsequent iteration are the 20 paths updated in the previous iteration. During the iteration process, it is constantly determined whether the new number of iterations is less than the preset number of iterations. If it is less than the preset number of iterations, re-execute steps 3.3-3.7 to update the 20 paths; otherwise, the iteration ends when the preset number of iterations is reached. After the current iteration ends, an optimal output individual will be obtained, which corresponds to the optimal path required in the end.
[0093] The process of iterative update of each path is as follows:
[0094] Step 3.7.1, calculate λ, where λ represents a randomly generated matrix of 1 row and 2M columns, each dimension of which is a random number between (0, 1), and the dimension of λ is 2M. In the present invention, M=21, indicating 21 YOZ planes;
[0095] Step 3.7.2, calculate r, which is a matrix with 1 row and 2M columns. The generation method of r is the same as λ;
[0096] Step 3.7.3, randomly select a path path_r from the balancing pool in step 3.5;
[0097] Step 3.7.4, calculate the value of F, which is an exponential term used to balance the exploration and development process when updating the path; F is a matrix with 1 row and 2M columns, and the value of each dimension is between (-2, 2).
[0098] F = a1sign(r-0.5)(e -λt -1) (4);
[0099] Wherein, a1 is a constant, and its value is 2 in the present invention; sign represents a sign function.
[0100] Step 3.7.5, generate two random numbers r1 and r2 between (0,1);
[0101] Step 3.7.6, calculate the value of GCP, GCP is defined as the power generation rate control parameter, which is used to represent the contribution to particle update;
[0102]
[0103] Wherein, GP is a constant, and its value is 0.5 in the present invention.
[0104] Step 3.7.7, calculate the value of G0, which is an initial value and an intermediate parameter used to calculate the size of G;
[0105]
[0106] in, is the j-th path of the iter-th generation;
[0107] Step 3.7.8, calculate the value of G, G represents the generation rate, its function is to adjust the direction of the update path;
[0108] G = G0F (7);
[0109] Step 3.7.9, update the path according to the following formula,
[0110]
[0111] in, It represents the jth path updated when the number of iterations is iter+1, V is a constant, and its value is 1 in the present invention.
[0112] In order to demonstrate the feasibility and superiority of the present invention, the following examples are given.
[0113] The path planned by the balanced optimization algorithm is compared with the algorithm using the ant colony optimization to highlight the superiority of the present invention. The starting point is set to S(0,10,4), the end point is set to T(21,10,5), and the planned path is as follows Figure 5 The route marked with asterisks is the flight path planned by the equilibrium optimization algorithm, and the route marked with circles is the flight path planned by the ant colony algorithm. Their fitness values are 115.37 and 123.21 respectively. The number of iterations of the two algorithms is set to 120, and the fitness values change with the number of iterations as shown in the figure. Figure 6 . Figure 6 (a) and Figure 6 (b) The fitness value change curves calculated using the equilibrium optimization algorithm and the ant colony optimization algorithm respectively. Figure 6 It can be seen that the flight path planned using the balanced optimization algorithm has a smaller fitness value, which indicates that the path has a shorter flight distance and lower corner energy consumption.
[0114] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A UAV path planning method based on a balanced optimization algorithm, characterized in that: The steps include: Step 1: Obtain the height data of the real environment and construct a grid map; Step 2: Determine the starting and ending coordinates of the UAV's flight path and initialize the UAV's flight path; Step 3: Use the equilibrium optimization algorithm to optimize the initial path, and use the optimal output individual obtained by the equilibrium optimization algorithm as the optimal flight path of the UAV; In the step 1, firstly, a satellite is used to collect a mountain satellite map of the drone flight area to obtain height data of the real environment, the height data of the drone flight environment is used as the height data of the real environment, and the real environment is modeled using a grid method to obtain a grid map; The process of grid modeling is as follows: first, create a three-dimensional space coordinate system, with the vertex O in the lower left corner as the coordinate origin; in this space coordinate, the X axis is the direction of increasing longitude, the Y axis is the direction of increasing latitude, and the Z axis is the direction perpendicular to the sea level; then divide the X axis into m parts, the Y axis into n parts, and the Z axis into k parts; each discrete point in the coordinate system is used as a waypoint passed by the drone during flight; finally, read in the altitude data, and divide the grid in the map into accessible and inaccessible states. The grid points that meet the altitude requirements are accessible, and the other grid points are inaccessible; The specific process of step 2 is as follows: Step 2.1, determine the starting point S(X S ,Y S ,Z S ) and the end point T(X T ,Y T ,Z T ); Step 2.2, with the X-axis as the reference, find every point on the YOZ plane that meets the flight requirements; since the X-axis is divided into m parts, there are m-1 planes parallel to the YOZ between the starting point and the end point, so a total of m+1 planes parallel to the YOZ are obtained; the starting point S is on the first YOZ plane, and the end point T is on the last YOZ plane; Step 2.3, starting from the next plane of the starting point S, find each target point of the UAV flight path; specifically: take S as the center point, find a point that meets the height requirement among the 24 adjacent points on the next plane, and simultaneously discard the points that exceed the spatial range; Step 2.4: Calculate the heuristic value Q of each point that meets the height requirement according to the following formula: i ; Where i represents the i-th waypoint that meets the altitude requirement; Y pre and Z pre They represent the Y-axis and Z-axis values of the waypoint on the YOZ plane when X=0, respectively. now , Y now and Z now Respectively represent the values of the three coordinate axes of the waypoint on the YOZ plane when X=1; then, add the heuristic values of the waypoints that meet the height requirements to obtain the total heuristic value SUM; calculate the QZ value of each waypoint that meets the requirements, Then randomly generate a number ra between (0,1) and find the first one that satisfies ra <QZ i The waypoint is taken as the final waypoint on the YOZ plane when X=1; Step 2.5, use the same method to find the waypoints on the YOZ plane when X=2,3...m-1; finally, connect all the waypoints between the starting point and the end point to find a path path (S,...,T) that meets the requirements; The specific process of step 3 is as follows: Step 3.1, generate 20 initial paths {path1, path2, ..., path20} according to the process described in step 2.3, step 2.4 and step 2.5, determine whether there is a waypoint beyond the spatial range on each path, if so, select a qualified waypoint in the plane of the waypoint according to step 2.3 and step 2.4; Step 3.2, initialize the number of iterations to 0; Step 3.3, calculate the fitness values of all paths, and find the top four paths with the best fitness values; The fitness function of the drone's flight path includes two items, one is the cost of the flight distance, and the other is the energy consumption of the turning angle; the calculation formula is as follows: Where J represents the total flight cost of the drone, α and β represent weights, D(i) represents the flight distance between two planes in the grid map; θ i represents the angle between the line connecting the ith waypoint and the previous waypoint and the horizontal plane; N represents the total number of waypoints; Step 3.4: Execute the memory storage process; the specific process is: When the number of iterations is 0, back up the current 20 initial paths and their fitness values; When the number of iterations is not equal to 0, determine whether there is a path among the 20 paths of the previous iteration whose fitness value is less than the fitness value of the path under the current number of iterations. If so, replace the current path and its fitness value with the path and fitness value of the previous iteration; then back up all the paths and fitness values under the current number of iterations; Step 3.5, find the average path and the balanced pool of the four paths; First, add the coordinate values of the X-axis, Y-axis, and Z-axis of each waypoint on the YOZ plane in the 20 paths, and calculate the average value of the X-axis, Y-axis, and Z-axis of each waypoint to determine whether the average value of each waypoint meets the height requirement. If not, generate a waypoint that meets the requirements according to steps 2.3 and 2.4, connect each waypoint that meets the requirements, and obtain an average path path_ave; the paths in the balancing pool include the first four paths with the best fitness values and an average path; Step 3.6, calculate the value of the random number t; the random number t is a number that changes with the number of iterations, and the specific calculation formula is as follows: Among them, iter represents the current number of iterations, Max_iter represents the preset maximum number of iterations, and a2 is a constant; Step 3.7, iteratively update each of the 20 initial paths according to the following steps, and increase the number of iterations by 1 each time, and continuously update the paths; the paths updated in the first iteration are the 20 initialized paths, and the paths updated in each subsequent iteration are the 20 paths updated in the previous iteration; during the iteration process, it is continuously determined whether the new number of iterations is less than the preset number of iterations. If it is less than the preset number of iterations, re-execute steps 3.3 to 3.7 to update the 20 paths; otherwise, the iteration ends when the preset number of iterations is reached, and an optimal output individual will be obtained after the current iteration ends, and this individual corresponds to the optimal path required in the end; In step 3.7, the process of iterative updating of each path is as follows: Step 3.7.1, calculate λ, where λ represents a randomly generated matrix of 1 row and 2M columns, each dimension of which is a random number between (0,1), the dimension of λ is 2M, and M represents the number of divided YOZ planes; Step 3.7.2, calculate r, which is a matrix with 1 row and 2M columns. The generation method of r is the same as λ; Step 3.7.3, randomly select a path path_r from the balancing pool in step 3.5; Step 3.7.4, calculate the value of F, which is an exponential term used to balance the exploration and development process during path update; F is a matrix with 1 row and 2M columns, and the value of each dimension is between (-2, 2); F=a1sign(r-0.5)(e -λt -1) (4); Among them, a1 is a constant; sign represents the sign function; Step 3.7.5, generate two random numbers r1 and r2 between (0,1); Step 3.7.6, calculate the value of GCP, GCP is defined as the power generation rate control parameter, which is used to represent the contribution to particle update; Among them, GP is a constant; Step 3.7.7, calculate the value of G0, which is an initial value and an intermediate parameter used to calculate the size of G; in, is the j-th path of the iter-th generation; Step 3.7.8, calculate the value of G, where G represents the generation rate; G = G0F (7); Step 3.7.9, update the path according to the following formula, in, It represents the jth path updated when the iteration number is iter+1, and V is a constant.
