Unmanned aerial vehicle flight path planning method based on improved bacterial foraging algorithm

By improving the bacterial foraging algorithm and optimizing the algorithm structure and parameters, the problem of insufficient convergence speed and global optimization capabilities in the drone track planning is solved, and more efficient track planning is achieved to ensure the safe flight of the drone in complex environments.

CN120252722APending Publication Date: 2025-07-04XI'AN PETROLEUM UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510360907.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The existing drone track planning algorithms have shortcomings in convergence speed, global optimization capabilities and local optimization accuracy, and it is difficult to meet the needs of efficient track planning in complex environments.

Method used

Improve the bacterial foraging algorithm, improve convergence speed and stability by optimizing the algorithm structure and parameters, enhance global optimization capabilities, adopt migration, trend, aggregation and replication operations, and combine the track planning objective function to finally plan the optimal track.

Benefits of technology

It significantly improves the convergence speed and optimization accuracy of drone track planning, enhances global optimization capabilities, and can more efficiently solve the track planning problems in complex environments, ensuring the efficient execution of flight missions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120252722A_ABST
    Figure CN120252722A_ABST
Patent Text Reader

Abstract

The invention provides an unmanned aerial vehicle flight path planning method based on an improved bacterial foraging algorithm, and belongs to the technical field of unmanned aerial vehicle flight path planning. Comprising the following steps: reading coordinate data, and completing modeling of a digital terrain elevation map; initializing parameters of the improved bacterial foraging algorithm; iteration is carried out on the algorithm, and a minimum objective function value is solved; and completing iteration according to the number of iterations to obtain an optimal navigation point sequence, and planning an optimal track. Aiming at the problems of low convergence speed, easy falling into local optimum and the like in a traditional flight path planning algorithm, the method improves the convergence speed of the algorithm, the precision of an optimal solution and the capability of searching for the optimal solution by improving the behavior mechanism of a bacterial foraging algorithm, can quickly and safely realize flight path planning of the unmanned aerial vehicle, and has a wide application prospect. And efficient execution of a flight task can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of UAV path planning, and specifically relates to a UAV path planning method based on an improved bacterial foraging algorithm. Background Technique

[0002] With the rapid development of Unmanned Aerial Vehicle (UAV) technology, its applications in military, logistics, agriculture, environmental monitoring and other fields are becoming increasingly widespread. In these applications, UAV path planning is a key link, and its core goal is to determine an optimal path from the starting point to the target point while satisfying diverse constraint conditions such as obstacle avoidance, energy conservation, and time limits. Efficient path planning can not only significantly improve the task execution efficiency, but also greatly reduce the operation cost and risk of UAVs.

[0003] Path planning is a key link in the autonomous flight mission of UAVs. It comprehensively considers factors such as terrain environment, obstacle threats, and UAV flight performance, and plans a feasible path from the starting point to the end point, which is of great significance for realizing the autonomous flight of UAVs. In recent years, scholars at home and abroad have conducted a large number of studies on path planning algorithms. Currently, commonly used algorithms include traditional algorithms (such as Dijkstra algorithm, A* algorithm, artificial potential field method, rapidly exploring random tree, etc.) and modern intelligent algorithms (such as ant colony algorithm, genetic algorithm, etc.). However, these algorithms have their own advantages and disadvantages. For example, the A* algorithm performs well in finding the shortest path in a static map, but its efficiency will drop significantly when the number of nodes increases; the artificial potential field method is suitable for local path planning, but it is easy to fall into local optimal solutions; the ant colony algorithm has strong global search ability, but its convergence speed is slow and it is also easy to fall into local optima; the genetic algorithm has flexible path search, but its implementation is complex and the convergence efficiency is low. These problems limit the further development and application of UAV path planning technology.

[0004] Based on the above problems, the present invention proposes a UAV path planning method based on an improved bacterial foraging algorithm to solve the problems proposed in the above background technique. Summary of the Invention

[0005] The present invention aims to provide a UAV path planning method based on an improved bacterial foraging algorithm. Based on the traditional bacterial foraging algorithm, by optimizing the algorithm structure and parameters, the convergence speed and stability of the algorithm are significantly improved, and at the same time, the global optimization ability and optimization accuracy are enhanced. Through these improvements, the present invention can more efficiently solve the UAV path planning problem.

[0006] To achieve the above technical objectives, the technical solutions adopted by the present invention are as follows:

[0007] A UAV trajectory planning method based on an improved bacterial foraging algorithm, the UAV trajectory planning method comprising the following steps:

[0008] S1. Read coordinate data, complete the modeling of the digital terrain elevation map, and set the coordinates of the starting point S and the ending point T;

[0009] S2. Initialize the parameters of the improved bacterial foraging algorithm, including the number of migration behaviors N ed 、the number of chemotaxis behaviors N c 、the maximum number of one-way movement steps N in chemotaxis behavior s 、the number of reproduction behaviors N re 、the migration probability P ed 、the search step size C(i) of the step length of forward swimming, the number of bacteria populations S, the gravitational depth d attractant 、the gravitational width w attractant 、the repulsive depth h repellant 、the repulsive width w repellant 、the search dimension d, the local learning factor C1, the global learning factor C2, the number of iterations MAX, the weight coefficients w1, w2, w3, and the number of navigation points n;

[0010] S3. Iterate the algorithm, and the bacteria continuously perform migration, chemotaxis, aggregation, and reproduction operations. Use the improved bacterial foraging algorithm to solve the minimum value of the trajectory planning objective function, and obtain n navigation points from the starting point to the ending point;

[0011] S4. When the iteration ends, complete the iteration according to the number of iterations, obtain the optimal navigation point sequence, and plan the optimal trajectory.

[0012] Further, in step S1, the generation formula for the digital terrain elevation map modeling is as follows:

[0013] {Vi = (xi, yi, zi), i = 1, 2,..., N}

[0014] In the formula, (xi, yi) is the plane coordinate, zi is the corresponding elevation data, N is the total number of data points in the DEM, and a three-dimensional model is established by using the method based on elevation data according to the elevation data corresponding to each point on the plane.

[0015] Further, in step S3, the generation formula for the migration operation is as follows:

[0016]

[0017] Among them, J max is the maximum value of the fitness values of all current bacteria; J i is the fitness value of the current bacterium i; J min is the minimum fitness value of all current bacteria; P edis the set fixed migration probability;

[0018] The generation formula for the chemotaxis operation is as follows:

[0019]

[0020] where rand() is a random number from 0 to 1, C max =(MAX d -MIN d ) / 4, MAX d is the maximum value of the range for finding the optimal solution to the problem in the d-th dimension, and MIN d is the minimum value of the range for finding the optimal solution to the problem in the d-th dimension; j, k, and l are the current chemotaxis, reproduction, and migration times respectively; J i is the fitness value of the current bacterium i; J max is the maximum value of the fitness values of all current bacteria;

[0021] The generation formula for the aggregation operation is as follows:

[0022]

[0023] In the formula: d attractant is the gravitational depth; is the m-th component of bacterium i; w attractant is the gravitational width; θ i is the m-th component of all other bacteria; h repellant is the repulsive height; P(j, k, l) is the position information of the bacteria in the population, which is obtained by the bacteria after the j-th, k-th, and l-th chemotaxis, reproduction, and migration operations; w repellant is the repulsive width:

[0024] The generation formula for the reproduction operation is as follows:

[0025]

[0026] In the formula, J(i, j, kk, l) represents the fitness value of the bacterium after completing the j-th, k-th, and l-th chemotaxis, reproduction, and migration operations. The algorithm sorts the bacteria according to and eliminates half of the bacteria with higher fitness values, and replicates the other half of the bacteria with lower fitness values.

[0027] Furthermore, in step S3, the improved bacterial foraging algorithm specifically includes:

[0028] Step1: Initialize parameters: N ed (the number of times the bacteria perform migration behavior), N c (the number of times the bacteria perform chemotaxis behavior), N s(The maximum number of one-way movements in the chemotactic behavior of bacteria), N re (The number of replication behaviors of bacteria), P ed (The migration probability of bacteria), C(i) (the step size of forward swimming), S (the size of the bacterial population), d attractant (Gravitational depth), W attractant is the gravitational width (gravitational width), h repellant (Repulsive height), w repellant (Repulsive width);

[0029] Step2: Bacterium i performs migration (l = l + 1), replication (k = k + 1), chemotaxis (j = j + 1), and aggregation (m = m + 1) operations, calculates the fitness function value J(ij, k, l). Then, the bacterium rotates and moves, calculates the new fitness function value J(i, j + 1, k, l), compares these two fitness values, and saves the smaller one as J end ;

[0030] Step3: Repeat the above steps for bacterium i + 1. During the process of continuously performing chemotaxis operations in a loop, continuously calculate and update the fitness function value, and record the minimum value as J end , and this process continues until the number of bacteria i reaches the preset population size S;

[0031] Step4: Sort the fitness values J of S bacteria end in ascending order. The algorithm selects the latter S / 2 bacteria with higher fitness values after sorting for replication, and at the same time eliminates the former S / 2 bacteria with lower fitness values. This process is repeated until the number of replications reaches the set value N re as the termination condition;

[0032] Step5: After several generations of replication of the bacterial population, each bacterium will redistribute according to the dynamic probability P ed , and P ed is not a fixed value. The algorithm will repeat this operation until the preset termination condition is reached. During this process, the bacteria continuously migrate in the solution space. When the number of migrations reaches the set upper limit N ed , the search process ends, and the optimal solution to the problem is finally obtained.

[0033] Furthermore, in step S3, the trajectory planning objective function is as follows:

[0034] minf(x) = w1 × minf1(x) + w2 × minf2(x) + w3 × min f3(x)

[0035] f(x) is the trajectory planning objective function, w1, w2, and w3 are weight coefficients, and f1(x), f2(x), and f3(x) are three constraint condition functions;

[0036] f1(x): The shortest path constraint, and its calculation formula is as follows:

[0037]

[0038] That is, to find the shortest total path length from the starting navigation point to the ending point. Among them, dx, dy, and dz respectively represent the distance differences between the current navigation point and the previous navigation point in the x, y, and z directions;

[0039] f2(x): The flight altitude constraint, and its calculation formula is as follows:

[0040]

[0041] In the formula, z i represents the altitude of the i-th navigation point, represents the average altitude of all navigation points, z min represents the lower limit of the flight altitude, z max represents the upper limit of the flight altitude;

[0042] f3(x): The turning angle constraint, and its calculation formula is as follows:

[0043]

[0044] That is, calculate the turning angle between the UAV waypoints and impose constraints. Among them, a i and a i+1 respectively represent the vectors between two adjacent waypoints.

[0044] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0045] Based on the improved bacterial foraging algorithm, the present invention proposes a UAV path planning method. By analyzing the basic bacterial foraging algorithm, the deficiencies and improvement ideas of the algorithm are proposed. Based on this, the three key operation links of chemotaxis, swarming, and migration of the basic bacterial foraging algorithm are improved, which can improve the convergence speed and stability, optimize the accuracy, and strengthen the global optimization ability on the basis of the original bacterial foraging algorithm, and more effectively handle the UAV path planning problem. Brief Description of the Drawings

[0046] Figure 1 Shows the path planning flowchart.

[0047] Figure 2 Shows the improved bacterial foraging algorithm flowchart.

[0048] Figure 3 Shows the real topographic map.

[0049] Figure 4Shows a digital terrain elevation map.

[0050] Figure 5 Shows the track planning simulation trajectory map.

[0051] Figure 6 Shows the track planning simulation trajectory projection map of starting point 1 and starting point 2. (a) is the track planning simulation trajectory projection map from starting point 1 to the end point, and (b) is the track planning simulation trajectory projection map from starting point 2 to the end point.

[0052] Figure 7 Shows the objective function change curve map of starting point 1 and starting point 2. (a) is the objective function change curve map from starting point 1 to the end point, and (b) is the objective function change curve map from starting point 2 to the end point. Detailed implementation mode

[0053] The technical solution of the present invention will be further described in detail below in conjunction with the drawings and embodiments, but the present invention is not limited to the following embodiments.

[0054] As Figure 1 shown, the present invention discloses a UAV track planning method based on an improved bacterial foraging algorithm, and the specific steps are as follows:

[0055] Step 1: Read the coordinate data, complete the modeling of the digital terrain elevation map, and set the coordinates of the starting point S and the end point T. The generation formula for the digital terrain elevation map modeling is as follows:

[0056] {Vi = (xi, yi, zi), i = 1, 2,..., N}

[0057] In the formula, (xi, yi) is the plane coordinate, zi is the corresponding elevation data, N is the total number of data points in the DEM, and a three-dimensional model is established by using the method based on elevation data according to the elevation data corresponding to each point on the plane.

[0058] Step 2: Initialize the parameters of the improved bacterial foraging algorithm, including the number of migration behaviors N ed , the number of chemotaxis behaviors N c , the maximum number of one-way movement steps N in chemotaxis s , the number of reproduction behaviors N re , the migration probability P ed , the search step size C(i) of the forward swimming step length, the number of bacteria populations S, the gravitational depth d attractant , the gravitational width W attractant , the repulsive depth h repellant , the repulsive width w repellant , the search dimension d, the local learning factor C1, the global learning factor C2, the number of iterations MAX, the weight coefficients w1, w2, w3, and the number of navigation points n.

[0059] Step 3: Algorithm iteration. The bacteria continuously perform migration, chemotaxis, aggregation, and replication operations. The improved bacterial foraging algorithm is used to solve the minimum value of the trajectory planning objective function, and n navigation points from the starting point to the ending point are obtained. The generation formula for the migration operation is as follows:

[0060]

[0061] where J max is the maximum value of the fitness values of all current bacteria; J i is the fitness value of the current bacterium i; J min is the minimum fitness value of all current bacteria; P ed is the set fixed migration probability;

[0062] The generation formula for the chemotaxis operation is as follows:

[0063]

[0064] where rand() is a random number from 0 to 1, C max= (MAX d -MIN d ) / 4, MAX d is the maximum value of the range for finding the optimal solution to the problem in the d-th dimension, MIN d is the minimum value of the range for finding the optimal solution to the problem in the d-th dimension; j, k, l are the current chemotaxis, replication, and migration times respectively; J i is the fitness value of the current bacterium i; J max is the maximum value of the fitness values of all current bacteria;

[0065] The generation formula for the aggregation operation is as follows:

[0066]

[0067] In the formula: d attractant is the gravitational depth; is the m-th component of bacterium i; w attractant is the gravitational width; θ i is the m-th component of all other bacteria; h repellant is the repulsive height; P(j, k, l) is the position information of the bacteria in the population, which is obtained by the bacteria after the j-th, k-th, and l-th chemotaxis, replication, and migration operations; w repellant is the repulsive width;

[0068] The generation formula for the replication operation is as follows:

[0069]

[0070] Wherein, J(i, j, k, l) represents the fitness value of the bacteria after completing the j-th, k-th, and l-th chemotaxis, reproduction, and migration operations. The algorithm sorts the bacteria according to and eliminates the bacteria with higher fitness values, while replicating the other half of the bacteria with lower fitness values.

[0071] The improved bacterial foraging algorithm includes the following sub-steps, and the flowchart of the improved bacterial foraging algorithm is as Figure 2 shown:

[0072] Step1: Initialize parameters: N ed (the number of times the bacteria perform migration behavior), N c (the number of times the bacteria perform chemotaxis behavior), N s (the maximum number of single-step movements during the chemotaxis behavior of the bacteria), N re (the number of times the bacteria perform reproduction behavior), P ed (the migration probability of the bacteria), C(i) (the step size of forward swimming), S (the size of the bacterial population), d attractant (the gravitational depth), w attraetant is the gravitational width (gravitational width), h repellant (the repulsive height), w repellant (the repulsive width);

[0073] Step2: Bacteria i performs migration (l = l + 1), reproduction (k = k + 1), chemotaxis (j = j + 1), and aggregation (m = m + 1) operations, and calculates the fitness function value J(i, j, k, l). Then, the bacteria rotate and move, calculates the new fitness function value J(i, j + 1, k, l), compares these two fitness values, and saves the smaller one as J end ;

[0074] Step3: Repeat the above steps for bacteria i + 1. During the process of continuously performing chemotaxis operations in a loop, continuously calculate and update the fitness function value, and record the minimum value as J end , and this process continues until the number of bacteria i reaches the preset population size S;

[0075] Step4: Sort the fitness values J end of S bacteria in ascending order. The algorithm selects the latter S / 2 bacteria with higher fitness values after sorting for replication, and at the same time eliminates the first S / 2 bacteria with lower fitness values. This process is repeated until the replication times reach the set value N re is used as the termination condition;

[0076] Step5: After several generations of replication of the bacterial population, each bacterium will redistribute according to the dynamic probability P ed , P edIt is not a fixed value. The algorithm repeats this operation until a preset termination condition is reached. During this process, the bacteria continuously migrate in the solution space. When the number of migrations reaches the set upper limit Ned, the search process ends, and the optimal solution to the problem is finally obtained.

[0077] The objective function of the trajectory planning is as follows:

[0078] min f(x) = w1 × min f1(x) + w2 × min f2(x) + w3 × min f3(x)

[0079] f(x) is the objective function of the trajectory planning, w1, w2, and w3 are weight coefficients, and f1(x), f2(x), and f3(x) are three constraint condition functions;

[0080] f1(x): Shortest trajectory constraint, and the calculation formula is as follows:

[0081]

[0082] That is, to find the shortest total trajectory length from the starting navigation point to the ending point. Among them, dx, dy, and dz respectively represent the distance differences between the current navigation point and the previous navigation point in the x, y, and z directions;

[0083] f2(x): Flight altitude constraint, and the calculation formula is as follows:

[0084]

[0085] In the formula, z i represents the altitude of the i-th navigation point, represents the average altitude of all navigation points. z min represents the lower limit of the flight altitude, and z max represents the upper limit of the flight altitude;

[0086] f3(x): Turning angle constraint, and the calculation formula is as follows:

[0087]

[0088] That is, calculate the turning angle between the UAV waypoints and apply constraints. Among them, a i and a i+1 respectively represent the vectors between two adjacent waypoints.

[0089] Step 4: The iteration ends. Complete the iteration according to the number of iterations to obtain the optimal sequence of navigation points and plan the optimal trajectory.

[0090] To verify the effectiveness of the improved bacterial foraging algorithm, the present invention employs four test functions with three variables, namely Schaffer, Rastrigrin, Griewank, and Rosenbrock. The settings of these variables correspond to the three-dimensional space of the trajectory planning structure in the present invention. The specific names, function expressions, search ranges, and theoretical optimal solutions of each test function are shown in Table 1.

[0091] Table 1 Selection of Test Functions

[0092]

[0093] The parameter configurations of the basic bacterial foraging algorithm and the improved bacterial foraging algorithm are shown in Table 2. Among them, C1 (local learning factor) and C2 (global learning factor) are parameters unique to the improved bacterial foraging algorithm.

[0094] Table 2 Parameter Settings

[0095]

[0096] The improved bacterial foraging algorithm (IBFO) and the basic bacterial foraging algorithm (BFO) are both run 30 times, and the optimal solution, worst solution, average solution, average number of iterations, and average running time are selected for comparison. The algorithm test results are shown in Table 3.

[0097] Table 3 Algorithm Test Results

[0098]

[0099] As can be seen from Table 3, compared with BFO, IBFO shows better optimal solutions, worst solutions, and average solutions in the four test functions. The optimal solution and the worst solution approach 0, indicating that IBFO is more excellent in convergence accuracy and global search ability. The average solution approaching 0 reflects better stability of IBFO. In addition, the average number of iterations and running time of IBFO are shorter, indicating lower time complexity and higher solution efficiency.

[0100] To verify the feasibility and effectiveness of the improved bacterial foraging algorithm in trajectory planning, the present invention conducts trajectory planning and obstacle avoidance simulation for logistics UAVs for regional cargo transportation and unmanned reconnaissance aircraft capable of taking off and landing on the plateau, obtains the results and conducts comparative analysis.

[0101] For large UAVs, obstacle avoidance simulation in the plateau environment is carried out, and the real terrain with a latitude range from 31°22′42.28″ to 31°30′02.56″ and a longitude range from 102°52′23.26″ to 102°59′52.05″ is selected, as Figure 3 shown.

[0102] Next, digital elevation model (DEM) databases are used to obtain terrain elevation data, which are uniformly discretized into a 139×139 coordinate grid at a scale of 1:100,000 to simulate the mountainous terrain that the UAV must fly over. Considering the weather threat areas and no-fly zones in actual flights, these areas are simulated as cylindrical obstacles in the simulation space. When planning the flight path, the UAV needs to bypass these obstacles. The algorithm realizes obstacle avoidance through two stages: First, ensure that all flight path points are not inside the cylindrical obstacles; second, ensure that the line connecting adjacent flight path points does not intersect any cylindrical obstacle.

[0103] In this paper, two weather threat areas and one no-fly zone are set. The two weather threat areas are red cylinders with plane coordinates (70, 70) and (80, 30) respectively, and the radius of both is 10. The no-fly zone is a blue cylinder with a plane coordinate of (100, 100) and a radius of 7. Due to the discretized coordinate space, there is no unit. The final digital terrain elevation map is as Figure 4 shown.

[0104] The simulation results of the obstacle avoidance of the large UAV flight path planning are as Figure 5 shown. Two starting points are set in the simulation. Starting point 1 is a red circle with coordinates (20, 20, 4.245), and starting point 2 is a red triangle with coordinates (40, 20, 4.245). The end point is a black * shape with coordinates (90, 70, 2.7). The height unit in the coordinates is kkmm, and there is no unit for the horizontal and vertical coordinates. Three algorithms are used in the simulation to realize the UAV flight path planning, namely the improved bacterial foraging algorithm, the particle swarm algorithm, and the basic bacterial foraging algorithm. The colors of the obtained flight paths are blue, green, and red respectively. The flight paths planned by each algorithm are clearly shown in the figure.

[0105] For better and more intuitive comparison, the flight paths are projected onto the latitude coordinates. The simulation results of the obstacle avoidance of the two groups of flight paths from starting point 1 to the end point and from starting point 2 to the end point are respectively as Figure 6 shown. Through the simulation results, it can be clearly seen that the flight path planned by the IBFO algorithm is the shortest and the flight is the steadiest.

[0106] At the same time, the changes of the two groups of objective functions with the number of iterations from starting point 1 to the end point and from starting point 2 to the end point are respectively as Figure 7 shown. The simulation results show that the objective function value planned by the IBFO algorithm is smaller than that of the PSO, and is close to that of the BFO, but the convergence speed of the IBFO is the fastest.

[0107] The lengths of each flight path, the mean square deviations of the heights, the final values of the objective functions, and the running times of the algorithms are shown in Table 4. Analyzing the data of the two groups from different starting points to the end point in the table, it can be seen that compared with the BFO algorithm and the PSO algorithm, the flight path planned by the IBFO algorithm is shorter, and the mean square deviation of the height and the objective function are smaller. In addition,Figure 7 It shows that the objective function has basically converged when the iteration reaches 40 times. Therefore, the maximum iteration number parameter is set to 40, and the running time (unit: second) of each algorithm is tested. The results are shown in the last column of Table 4. The data shows that the IBFO algorithm has the shortest running time. In summary, the flight path planned by the IBFO algorithm is superior in performance.

[0108] Table 4 Results of flight path planning parameters

[0109]

[0110] Those of ordinary skill in the art can understand that the above are only preferred examples of the invention and are not used to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, for those skilled in the art, they can still modify the technical solutions recorded in the foregoing examples or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, etc. made within the spirit and principle of the invention shall be included within the protection scope of the invention.

Claims

1. An unmanned aerial vehicle trajectory planning method based on an improved bacterial foraging algorithm, characterized in that The UAV flight path planning method includes the following steps: S1. Read coordinate data, complete the modeling of the digital terrain elevation map, and set the coordinates of the starting point S and the ending point T; S2. Initialize the parameters of the improved bacterial foraging algorithm, including the number of migration behaviors N ed , the number of chemotactic behaviors N c , the maximum number of single - direction movements N in chemotactic behavior s , the number of reproduction behaviors N re , the migration probability P ed , the search step size C(i) of the step length of forward swimming, the number of bacteria populations S, the gravitational depth d attractant , the gravitational width W attractant , the repulsive depth h repellant , the repulsive width W repellant , the search dimension d, the local learning factor C1, the global learning factor C2, the number of iterations MAX, the weight coefficients w1, w2, w3, and the number of navigation points n; S3. Algorithm iteration. The bacteria continuously perform migration, chemotaxis, aggregation, and reproduction operations. The improved bacterial foraging algorithm is used to solve the minimum value of the flight path planning objective function, and n navigation points from the starting point to the ending point are obtained; S4. The iteration ends. According to the number of iterations, the iteration is completed to obtain the optimal navigation point sequence and plan the optimal flight path.

2. The method for unmanned aerial vehicle trajectory planning based on an improved bacterial foraging algorithm according to claim 1, wherein: In step S1, the generation formula for the digital terrain elevation map modeling is as follows: {Vi = (xi, yi, zi), i = 1, 2,..., N} In the formula, (xi, yi) are the plane coordinates, zi is the corresponding elevation data, N is the total number of data points in the DEM, and a three-dimensional model is established based on the elevation data method according to the elevation data corresponding to each point on the plane.

3. The UAV trajectory planning method based on an improved bacterial foraging algorithm according to claim 1, characterized in that: In step S3, the generation formula for the migration operation is as follows: Among them, J max is the maximum value of the fitness of all current bacteria; J i is the fitness of the current bacterium i; J min is the minimum fitness of all current bacteria; P ed is the set fixed migration probability; The generation formula for the chemotaxis operation is as follows: where rand() is a random number from 0 to 1, and C max =(MAX d -MIN d ) / 4, MAX d is the maximum value of the range for finding the optimal solution to the problem in the d-th dimension, and MIN d is the minimum value of the range for finding the optimal solution to the problem in the d-th dimension; j, k, and l are the current tendency, replication, and migration times respectively; J i is the fitness value of the current bacterium i; J max is the maximum value of the fitness values of all current bacteria; The generation formula for the aggregation operation is as follows: where: d attractant is the gravitational depth; is the m-th component of bacterium i; w attractant is the gravitational width; θ i is the m-th component of all other bacteria; h repellant is the repulsive height; P(j, k, l) is the position information of the bacteria in the population, which is obtained by the bacteria after the j-th, k-th, and l-th chemotaxis, reproduction, and migration operations; w repellant is the repulsive width; The generation formula for the reproduction operation is as follows: Where J(i, j, k, l) represents the fitness value of bacteria after completing the j-th, k-th, and l-th chemotaxis, reproduction, and migration operations, and the algorithm sorts the bacteria according to and eliminates the bacteria with higher fitness values and replicates the other half of the bacteria with lower fitness values.

4. A UAV trajectory planning method based on an improved bacterial foraging algorithm according to claim 1, characterized in that: In step S3, the improved bacterial foraging algorithm specifically includes: Step1: Initialize parameters: N ed (Number of times bacteria perform migration behavior), N c (Number of times bacteria perform chemotactic behavior), N s (Maximum number of single - direction steps in bacteria's chemotactic behavior), N re (Number of times bacteria perform replication behavior), P ed (Migration probability of bacteria), C(i) (step size of forward swimming), S (size of bacteria population), d attractant (Gravitational depth), w attractant is the gravitational width (gravitational width), h repellant (Repulsive height), w repellant (Repulsive width); Step 2: Bacterium i performs migration (l = l + 1), replication (k = k + 1), chemotaxis (j = j + 1), and aggregation (m = m + 1) operations, calculates the fitness function value J(i, j, k, l). Then, the bacterium rotates and moves, calculates the new fitness function value J(i, j + 1, k, l), compares these two fitness values, and saves the smaller one as J end ; Step 3: Repeat the above steps for bacterium i + 1. During the process of repeatedly performing the trend operation in a loop, continuously calculate and update the fitness function value, and record the minimum value as J end , and this process continues until the number of bacteria i reaches the preset population size S; Step4: The fitness values J of S bacteria end are sorted in ascending order. The algorithm selects the latter S / 2 bacteria with higher fitness values after sorting for replication, and at the same time eliminates the former S / 2 bacteria with lower fitness values. This process is repeated until the replication times reach the set value N re as the termination condition; Step5: After several generations of replication, each bacterium will redistribute according to the dynamic probability P ed and P ed is not a fixed value. The algorithm will repeat this operation until the preset termination condition is reached. During this process, the bacteria continuously migrate in the solution space. When the number of migrations reaches the set upper limit Ned, the search process ends, and the optimal solution to the problem is finally obtained.

5. A method for UAV trajectory planning based on an improved bacterial foraging algorithm according to claim 1, characterized in that: In step S3, the flight path planning objective function is as follows: min f(x) = w1 × min f1(x) + w2 × min f2(x) + w3 × min f3(x) f(x) is the flight path planning objective function, w1, w2, and w3 are weight coefficients, and f1(x), f2(x), and f3(x) are three constraint condition functions; f1(x): Flight path shortest constraint, and the calculation formula is as follows: That is, to find the shortest total flight path length from the starting navigation point to the ending point. Among them, dx, dy, and dz respectively represent the distance differences of the current navigation point and the previous navigation point in the x, y, and z directions; f2(x): Flight altitude constraint, and the calculation formula is as follows: z min <z i <z max where z i represents the height of the i-th navigation point, represents the average height of all navigation points, z min represents the lower limit of the flight altitude, z max represents the upper limit of the flight altitude; f3(x): Turning angle constraint, and the calculation formula is as follows: a i = [x i+1 - x i , y i+1 - y i , z i+1 - z i T ​ That is, calculate the turning angles between the waypoints of the UAV and apply constraints, where a i and a i+1 respectively represent the vectors between two adjacent waypoints.