Improved sparrow search method for three-dimensional unmanned aerial vehicle path planning

An improved sparrow search algorithm, incorporating sine and cosine strategies and Lévy flight strategies, solves the path planning problem of traditional sparrow search algorithms in complex 3D environments, generating efficient, safe, and smooth UAV tracks, and enabling efficient autonomous navigation of UAVs in complex environments.

CN121325924APending Publication Date: 2026-01-13CIVIL AVIATION FLIGHT UNIV OF CHINA
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511597896.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Traditional sparrow search algorithms suffer from slow convergence, parameter sensitivity, and susceptibility to local optima in path planning in complex 3D environments, making it difficult to effectively solve the optimal path design for UAVs under various constraints such as mountainous terrain, obstacles, and no-fly zones.

Method used

An improved sparrow search algorithm is introduced by incorporating sine and cosine strategies and Lévy flight strategies. By dynamically adjusting the discoverer's position update, it balances global exploration and local obstacle avoidance capabilities. Furthermore, it embeds the Lévy flight mechanism into the follower's position update to enhance the depth of local exploration. By combining a composite objective function of path length, threat penalty, flight safety altitude, and trajectory smoothness, it ensures the feasibility and safety of the path.

Benefits of technology

The algorithm's convergence speed and solution stability have been improved, resulting in shorter, safer, and smoother paths that meet the actual flight dynamics requirements of UAVs. It effectively avoids threats from terrain and no-fly zones, providing an efficient and reliable solution for autonomous navigation of UAVs in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121325924A_ABST
    Figure CN121325924A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of unmanned aerial vehicle navigation and control, in particular to an improved sparrow searching method for three-dimensional unmanned aerial vehicle path planning. According to the method, a three-dimensional mountain terrain model is constructed through a Gaussian function superposition method, obstacles and no-fly zones are defined by adopting a cylindrical geometric model, and obstacle avoidance constraints, take-off and landing safety constraints and flight height constraints are set; a comprehensive cost function with path length, threat penalty, flight safety height and path smoothness as sub-targets is constructed, an improved sparrow search algorithm is introduced, and a sine and cosine strategy is adopted in discoverer position updating to dynamically balance horizontal exploration and vertical obstacle avoidance. A Levy flight mechanism is introduced in follower position updating so as to enhance the capability of local development and jumping out of local optimum; the method comprises the steps of population initialization, role division, iterative optimization, collision detection and an elitist retention strategy. According to the method, a safe and smooth three-dimensional flight path with the optimal comprehensive cost is output, and the method is suitable for an actual unmanned aerial vehicle navigation task.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of unmanned aerial vehicle navigation and control, and particularly relates to an improved sparrow search method for three-dimensional unmanned aerial vehicle path planning. BACKGROUND

[0002] An unmanned aerial vehicle (UAV) is a powered, controllable, and reusable unmanned aircraft that can carry various task equipment and perform various tasks. With the rapid development of low-altitude economy and the gradual opening of low-altitude airspace, unmanned aerial vehicles are increasingly widely used in fields such as logistics distribution, environmental monitoring, disaster rescue, rural agriculture, and engineering design. Unmanned aerial vehicle path planning is the premise and key to autonomous, safe, and efficient flight of unmanned aerial vehicles, especially in complex three-dimensional environments, where various constraints such as mountain terrain, obstacles, no-fly zones, safe altitudes, smoothness, and flight distances need to be considered to achieve optimal path design from the starting point to the end point.

[0003] Optimal path planning algorithms can be divided into traditional algorithms, evolutionary algorithms, and swarm intelligence optimization algorithms. However, traditional algorithms and evolutionary algorithms have difficulty effectively solving high-dimensional, nonlinear, and large-scale practical problems. In recent years, swarm intelligence optimization algorithms, inspired by the behavior of individual organisms and group behavior in nature, are new heuristic algorithms that have been widely applied in fields such as unmanned aerial vehicle path planning due to their excellent global search ability, strong adaptability to complex problems, and fast programming implementation. Sparrow search algorithm (SSA) is a new swarm intelligence algorithm that simulates the foraging and early warning behavior of sparrow groups in nature, achieving a good balance between global search and local search. However, in practical engineering applications, there are still problems such as slow convergence speed, parameter sensitivity, and easy trapping into local optimum. Many domestic and foreign scholars have proposed a series of effective improvement strategies, such as chaos disturbance mechanism, Cauchy mutation and reverse learning, refraction reverse learning, information sharing combined with grey wolf algorithm, dynamic step reverse learning, and hybrid updating combined with ant colony algorithm, providing new ideas for the improvement of SSA algorithm. Unmanned aerial vehicle path planning is a complex global optimization problem that needs to consider various constraints such as mountain terrain, obstacles, no-fly zones, safe altitudes, smoothness, and flight distances, making it a typical engineering practice problem for testing improved optimization algorithms.

[0004] To address these issues, the present invention proposes an improved Sparrow Search Algorithm (ISSA) that integrates sine and cosine strategies and Lévy flight strategies in complex 3D flight path planning problems. While maintaining perturbation prevention of local optima, it emphasizes dynamic fine-grained control of the search step size and cross-regional exploration capabilities to improve the efficiency and robustness of the algorithm, and effectively solve the flight path planning problem of UAVs in complex 3D environments. Summary of the Invention

[0005] The purpose of this invention is to address the problems existing in the background technology by proposing an improved sparrow search method for path planning of three-dimensional UAVs.

[0006] The technical solution of this invention: an improved sparrow search method for path planning of three-dimensional unmanned aerial vehicles, comprising the following specific implementation steps: S1. A three-dimensional mountain terrain model is generated using the Gaussian function superposition method, and obstacles and no-fly zones in the environment are defined using a cylindrical geometric model. Obstacle avoidance constraints, take-off and landing safety constraints, and flight altitude constraints are set. A comprehensive cost function with path length, threat penalty, flight safety altitude, and path smoothness as sub-objectives is constructed, and it is transformed into an objective function to be optimized by weighted summation. S2. Set the algorithm running parameters, including population size, maximum number of iterations, ratio of discoverers to vigilants, and warning threshold. At the same time, set the dynamic weights of the sine and cosine strategies and the stability index of Lévy flight. Randomly generate the initial path population under the premise of satisfying all environmental constraints. S3. Calculate the fitness value of each path in the population based on the comprehensive cost function, sort all individuals according to the fitness value, and classify the top 20% of individuals as discoverers, the bottom 10% of individuals as vigilants, and the rest as followers. S4. Perform iterative optimization and update the positions of the three types of roles respectively: the position of the discoverer introduces a sine and cosine strategy to dynamically balance horizontal exploration and vertical obstacle avoidance based on the warning value; the position of the follower introduces a Lévy flight mechanism to enhance the ability to explore locally and escape local optima through a strategy of alternating long and short step lengths; the position of the vigilant is updated using the original sparrow search algorithm rules. S5. Perform collision detection on all paths in the new generation population to ensure that obstacle avoidance constraints, no-fly zone constraints and flight altitude constraints are met. Eliminate and correct infeasible solutions, and at the same time adopt an elite retention strategy to retain the best individuals from the previous generation to the current generation. S6. Check if the current iteration count has reached the preset maximum iteration count. If not, return to step S3 to continue iterating. If it has reached the maximum iteration count, terminate the optimization process. S7. Output the current global optimal individual as the three-dimensional flight path.

[0007] Preferably, the step S1 of generating a three-dimensional mountain terrain model using the Gaussian function superposition method specifically includes: generating a 1000×1000×500 grid of three-dimensional terrain using the Gaussian function superposition method, with the terrain height function being: ; And calculate the simulated mountain terrain height H(x,y): ; Where Z represents the theoretical height of the Gaussian function superposition method; (x,y) represents the horizontal and vertical coordinates of the mountain.

[0008] Preferably, step S1, which uses a cylindrical geometric model to define obstacles and no-fly zones in the environment, specifically includes: setting n obstacles, each defined by center coordinates, radius, and height parameters; and setting m no-fly zones, each defined by center coordinates, radius, and height range parameters.

[0009] Preferably, in step S1, the obstacle avoidance constraint requires that the path point must not enter the obstacle cylinder or a specific height range of the no-fly zone; Takeoff and landing safety constraints require the establishment of spherical safety zones around the start and end points; Flight altitude constraints require waypoint altitudes to be between the minimum safe altitude and the maximum flight altitude.

[0010] Preferably, the comprehensive cost function in step S1 is a weighted sum of four sub-costs: path length, threat penalty, flight safety altitude, and path smoothness. The weighting coefficients are 0.4, 0.2, 0.2, and 0.2, respectively. The path length sub-cost is calculated as the sum of the Euclidean distances between all consecutive waypoints; The threat penalty sub-cost is applied based on the distance from the waypoint to the nearest obstacle; Flight safety altitude sub-cost design uses a piecewise function to penalize altitude deviation; The path smoothness sub-cost is composed of a weighted average of the horizontal curvature cost and the vertical curvature cost.

[0011] Preferably, the algorithm running parameters in step S2 include a population size of 100, a maximum number of iterations of 2000, a discoverer ratio of 20%, a vigilant ratio of 10%, and a warning threshold of 0.8. The dynamic weight 'a' of the sine and cosine strategies decreases linearly from 0.9 to 0.4. The stability index β for Lévy flight is set to 1.5.

[0012] Preferably, the discoverer's position update in step S4 adopts a sine / cosine strategy, and the position update formula is: ; in, Let represent the position of the i-th discoverer-type sparrow individual in the j-th dimension at the t-th iteration, where i = 1, 2, ..., n, j = 1, 2, ..., d, n is the number of individuals in the sparrow population, and d is the dimension of the objective variable; 'a' represents the local exploration weight in the discoverer update strategy at the t-th iteration; r1 and r2 are random numbers. , ; R² represents the optimal position among all sparrows at the t-th iteration; R² represents the current path warning value; ST is the safety threshold. Follower position updates employ the Lévy flight mechanism, incorporating a Lévy stochastic step size into the position update formula: ; ; ; in, This represents the worst position among all sparrows at the t-th iteration. Let represent the optimal position among all discoverer sparrow individuals in the (t+1)th iteration; Q represents the perturbation factor that follows a standard normal distribution; Indicates element-wise product; λ represents the step size of Lévy flight and is a d-dimensional vector; r4 represents a standard normal random number with a mean of 0 and a variance of 1; r3 represents a standard normal distribution with a mean of 0 and a variance of σ; λ is the key stability index of Lévy flight. For gamma function, ; This represents a random number generator that is uniformly distributed in the interval [0,1). The position update of the vigilant follows the original sparrow search algorithm formula.

[0013] Preferably, the collision detection in step S5 includes reapplying obstacle avoidance constraints, no-fly zone constraints, and flight altitude constraints to check path feasibility; The elite retention strategy unconditionally retains the best individuals from the previous generation into the current generation and replaces the worst individuals.

[0014] Preferably, the three-dimensional flight path output in step S7 consists of a series of three-dimensional coordinate points, which are used as the preset flight trajectory of the UAV for actual flight missions.

[0015] Compared with the prior art, the above-mentioned technical solution of the present invention has the following beneficial technical effects: This invention designs an improved sparrow search method for 3D UAV path planning. By introducing a sine / cosine strategy to dynamically adjust the finder's position update process, it effectively balances the algorithm's global exploration capability in the horizontal direction with its local obstacle avoidance performance in the vertical direction, thus enabling more efficient search for feasible paths in complex mountainous and obstacle-filled environments. Simultaneously, a Lévy flight mechanism is embedded in the follower position update, utilizing its alternating long and short step size characteristics to significantly enhance the algorithm's local exploration depth and ability to escape local optima in complex solution spaces, effectively avoiding premature population convergence and increasing the probability of obtaining high-quality optimized solutions. By constructing a composite objective function that comprehensively considers path length, threat cost, flight safety altitude, and trajectory smoothness, and by strictly defining various environmental constraints, the final planned 3D path is ensured to be not only shorter but also has higher flight safety and smoothness, which is more in line with the actual flight dynamics requirements of UAVs. The method described in this invention has a clear optimization objective and a highly targeted improvement strategy, which enables the algorithm to achieve a synergistic improvement in convergence speed and solution stability. The generated trajectory can effectively avoid the threats of terrain and no-fly zones in practical applications, providing an efficient and reliable solution for the autonomous navigation of UAVs in complex environments. Attached Figure Description

[0016] Figure 1 This is a flowchart of an improved sparrow search method for path planning of a three-dimensional UAV proposed in this invention. Detailed Implementation

[0017] Example 1, as Figure 1 As shown, the present invention proposes an improved sparrow search method for path planning of three-dimensional UAVs, which includes the following specific implementation steps: S1. A 3D mountain terrain model is generated using the Gaussian function superposition method. A cylindrical geometric model is used to define obstacles and no-fly zones in the environment. To ensure flight safety, obstacle avoidance constraints, takeoff and landing safety constraints, and flight altitude constraints are clearly defined. A comprehensive cost function is constructed with path length, threat penalty, safe flight altitude, and path smoothness as sub-objectives. This cost function is then transformed into an objective function to be optimized through weighted summation. The weights are preset according to task requirements, specifically: S11. Generate a 1000×1000×500 grid of 3D terrain using the Gaussian function superposition method and MATLAB's Peaks function. Define obstacles and no-fly zones in the environment using a cylindrical geometric model, and mathematically describe them using parameters such as their center coordinates, radius, and height. Using the Gaussian function superposition method, specifically the built-in Peaks function in MATLAB, an initial 3D terrain with a grid of 1000×1000×500 is generated. The height function of this terrain is: ; Where Z represents the theoretical height of the Gaussian function superposition method; (x,y) represents the horizontal and vertical coordinates of the mountain. Based on the above theoretical framework, the following formula can be used: ; The simulated mountain terrain height H(x,y) used in this embodiment was calculated. Static obstacles and no-fly zones in the environment are defined using a cylindrical geometric model, namely: Given n obstacles, the geometric features of the k-th obstacle are defined by the following parameters: center coordinates (x... k ,y k ), that is, the coordinates of the center of the k-th obstacle projected onto the (XY) plane; the radius R of the k-th obstacle. k The height h of the kth obstacle k Then all obstacles can be represented by the following set of parameters: ; in, Represents the set of environmental obstacle parameters; Let m no-fly zones be defined. The geometric characteristics of the j-th no-fly zone are defined by the following parameters: center coordinates (x... j ,y j radius R j Height range The set of No-Fly Zones (NFZs) can be represented by the following formula: ; Among them, T NFZ This represents the set of parameters for environmental no-fly zones; m represents the number of no-fly zones; the center coordinates (x, y) represent the number of no-fly zones. j ,y j ) represents the coordinates of the center of the j-th no-fly zone projected onto the (XY) plane; R j This represents the radius of the j-th no-fly zone; Indicates the lower and upper limits of the altitude of the j-th no-fly zone; S12. Clearly define obstacle avoidance constraints, requiring waypoints not to enter the cylinder of an obstacle or a specific altitude range within a no-fly zone. Simultaneously, establish spherical safety zones around the start and end points to ensure the takeoff and landing areas are free of obstacles, thus meeting flight safety requirements. Specifically: Obstacle avoidance constraint: For any point (x, y, z) on the path, it must not fall into any obstacle or no-fly zone. Obstacle avoidance constraints: ; No-fly zone collision avoidance constraints: ; Where (x,y,z) represents the three-dimensional coordinates of any point in the planned trajectory; This represents the mathematical AND, meaning that both conditions are simultaneously satisfied. Takeoff and landing safety constraints: at the starting point (x start ,y start ,z start ) and endpoint (x) end ,y end ,z end Around which, set a radius of r safe A spherical safety zone, within which no obstructions may be present: ; ; S13. Construct a comprehensive objective function that includes four sub-costs: path length, threat penalty, flight safety altitude, and path smoothness. Transform the multi-objective problem into a single-objective optimization problem by weighted summation: Comprehensive cost function F total It is a weighted sum of four sub-costs: path length, threat penalty, safe flight altitude, and path smoothness, and its expression is: ; in, This represents the total cost of the planned route; Indicates the cost of the planned path length; Indicates the cost of obstacles posing a threat to the planned path; Indicates the cost of planning the route; The cost of smoothing the planned path is composed of horizontal curvature cost and vertical curvature cost. , , and These represent the path length weighting coefficient, threat penalty weighting coefficient, flight safety altitude weighting coefficient, and path smoothness weighting coefficient, respectively. In this embodiment, we take... =0.4, =0.2, =0.2, =0.2; Planning path length cost : Calculated as the sum of Euclidean distances between all consecutive waypoints. ; Where N represents the number of waypoints in the planned path; (x i ,y i ,z i (x) represents the three-dimensional coordinates of the i-th waypoint; i+1 ,y i+1 ,z i+1() represents the three-dimensional coordinates of the (i+1)th waypoint; Planning path obstacle threat cost For each waypoint i, calculate its three-dimensional distance d to the nearest obstacle. i If d i <d safe (Safe obstacle avoidance distance threshold, set to d in this embodiment) safe =2), then apply a penalty (d) safe -d i ) 2 Otherwise, the penalty is 0: ; Planning route height cost Design a piecewise function, if the altitude coordinate z of the i-th waypoint is... i Below the minimum safe height H min or above the maximum flight altitude H max If the altitude is too high, a maximum penalty M (hard constraint) will be imposed; if it is within the safe range, a penalty will be imposed for its deviation from the ideal cruising altitude H. idea =0.5(H min +H max Deviation: ; in, Describes the linear penalty coefficient and That is, controlling the sensitivity to deviations from the ideal altitude; As a hard constraint, illegal solutions are directly excluded; Planning path smoothness cost It consists of a weighted average of horizontal curvature cost and vertical curvature cost. ; ; ; ; in, Indicates the horizontal curvature cost of the planned path; This represents the cost of curvature in the vertical direction of the planned path; Indicates the curvature weighting coefficient; This represents the vertical acceleration weighting coefficient, which is taken in this embodiment. , ;K i This represents the curvature of the track at the i-th waypoint; This represents the vector cross product operation; This represents the modulo operation; u represents the vector composed of the i-th waypoint and the previous waypoint (the (i-1)-th waypoint). ; v represents the vector consisting of the (i+1)th waypoint and the previous waypoint (the i-th waypoint). ; Represents the vector consisting of the (i+1)th waypoint and the (i-1)th waypoint; N represents the number of waypoints in the planned path; K max This represents the maximum permissible curvature threshold; in this embodiment, K is taken as K. max =0.1, the horizontal curvature K of the target planned trajectory at that node is estimated by using the positional differences of three adjacent waypoints in the horizontal direction. i If it exceeds the maximum allowable value K max If so, a penalty is applied to that point to suppress sharp horizontal turns; It represents the horizontal projection length of the flight segment composed of the three waypoints i-1, i, and i+1. The degree of vertical motion change is quantified by the second difference of the altitude values ​​of the three waypoints, and a penalty is imposed on steep climb or dive paths.

[0018] S2. Set basic parameters for algorithm operation, including population size, maximum number of iterations, ratio of discoverers to watchers, and warning threshold. Also set specific parameters for the improved strategy: dynamic weights for the sine and cosine strategies and the stability index for Lévy flight. Under the premise of satisfying all environmental constraints, randomly generate the initial path population, specifically: S21. Set the population size to N=100 and the maximum iteration time to T. max =2000 times; the role ratio is based on the top 20% of fitness as discoverers and the bottom 10% as vigilants; and the warning threshold ST=0.8 is set to lay the basic framework for the algorithm to run; S22. Initialize the dynamic weights 'a' of the sine and cosine strategies, decreasing them linearly from 0.9 to 0.4; simultaneously, set the key parameter of the Lévy flight mechanism—the stability index β—to control the distribution of the random step size, i.e.: Sine and cosine strategy parameter a: ; Where a represents the local exploration weight in the discoverer update strategy at the t-th iteration; a min and a max These represent the lower and upper limits of the weight range, respectively; ite rmax This is a constant, i.e., the maximum number of iterations; It should be noted that the function changes over time; in the early stages of the iteration, as t gradually increases... As 'a' gradually increases, it approaches its upper limit, allowing for rapid decay, which is beneficial for global exploration; later, as 't' gradually reaches its maximum iteration count, iter... max , As the value gradually approaches 0, a decreases to the lower limit, and the convergence becomes gradual and gentle, which helps with local development and avoids premature convergence of the algorithm. Lévy flight parameters: stability index β=1.5, used to control the step size distribution of Lévy flight; S23. Within the established 3D environment model, randomly generate an initial path population that satisfies all obstacle avoidance, take-off and landing safety, and other constraints: Under the premise of satisfying all constraints in step S1 (especially take-off and landing safety constraints and collision avoidance constraints), randomly generate an initial population containing N paths, each path consisting of a series of ordered 3D waypoints.

[0019] S3. Calculate the fitness value of each path (individual) in the population based on the comprehensive cost function. Sort all individuals according to their fitness values, classifying the top 20% as discoverers, the bottom 10% as vigilant individuals, and the remaining individuals as followers. This lays the foundation for subsequent collaborative optimization behavior. For each individual in the population (i.e., each path), according to the comprehensive cost function F defined in step S13... total Calculate its fitness value; the lower the fitness value, the higher the path quality. Sort all individuals according to their fitness values ​​from low to high (i.e., from best to worst): The top 20% of individuals are designated as discoverers, responsible for guiding the population's search direction; The bottom 10% of individuals are classified as vigilant individuals, responsible for monitoring threats and triggering escapes; The remaining 70% of individuals were classified as followers, responsible for local development around the discoverer.

[0020] S4. Set up the core iteration process, updating the positions of the three types of roles respectively: The discoverer position introduces a sine / cosine strategy, dynamically selecting sine or cosine perturbations based on the warning value to balance horizontal exploration and vertical obstacle avoidance; the follower position introduces a Lévy flight mechanism, enhancing the ability to explore locally and escape local optima through alternating long and short step lengths; the vigilant position is updated according to the original rules, responsible for monitoring threats and triggering escape behavior, specifically: S41. Discoverer Position Update (Introducing Sine and Cosine Strategy): The discoverer updates its position using a sine and cosine strategy: if the warning value is below the safety threshold, a sine perturbation is used to expand the horizontal search range; otherwise, a cosine perturbation is used to adjust the vertical height for obstacle avoidance. The dynamic weight 'a' controls the perturbation amplitude. For each individual discoverer, the position update formula is improved to: ; in, Let represent the position of the i-th discoverer-type sparrow individual in the j-th dimension at the t-th iteration, where i = 1, 2, ..., n, j = 1, 2, ..., d, n is the number of individuals in the sparrow population, and d is the dimension of the objective variable; 'a' represents the local exploration weight in the discoverer update strategy at the t-th iteration; r1 and r2 are random numbers. , ; Rt represents the optimal position among all sparrows in the t-th iteration; R2 represents the current path warning value calculated based on obstacle distance, flight altitude, etc. When R2 is lower than the safety threshold ST, it is considered a safe environment, and a sine function is used to perturb the path nodes to expand the horizontal search range; when When an obstacle is detected, the threat response is switched to a cosine function-guided path, causing the flight altitude to rise or fall vertically. S42, Follower Position Update (Introducing Lévy Flight Mechanism): Introducing the Lévy flight mechanism: The top half of the followers add a Lévy random step size to their position updates to achieve fine-grained search over short distances and jumps over long distances, effectively avoiding group convergence and helping to escape local optima. For each follower, the position update formula is improved to: ; ; ; in, This represents the worst position among all sparrows at the t-th iteration. Let represent the optimal position among all discoverer sparrow individuals in the (t+1)th iteration; Q represents the perturbation factor that follows a standard normal distribution; This represents element-wise multiplication, multiplying each component of a Lévy-distributed random vector by... Multiply corresponding components; λ represents the step size of Lévy flight, which is a d-dimensional vector; r4 represents a standard normal distribution random number with a mean of 0 and a variance of 1; r3 represents a standard normal distribution with a mean of 0 and a variance of σ; λ is the key stability index of Lévy flight, used to balance the jump capabilities of local search and global search. For gamma function, ; This represents a random number generator that is uniformly distributed in the interval [0,1). S43. For each individual vigilant, its position update follows the original Sparrow Search Algorithm (SSA) formula: ; in, The step size is denoted by , and its value follows a normal distribution with a mean of 0 and a variance of 1; K is generated based on a uniform distribution and controls the direction of movement for each individual. ; and Let represent the local optimal and worst fitness in the current sparrow population, respectively; To represent a very small constant, 10 is selected in this embodiment. -8 ; This represents the fitness value of the current individual.

[0021] S5. Perform collision detection on all paths in the new generation population to ensure they meet the constraints defined in step 1, such as obstacles, no-fly zones, and altitude. Eliminate or correct infeasible solutions. At the same time, adopt an elite retention strategy, unconditionally retaining the best individual from the previous generation to the current generation and replacing the worst individual. This prevents backsliding during the optimization process and ensures the convergence performance of the algorithm. For all paths in the new generation population obtained after step S4, the constraints in step S12 are reapplied for collision detection. Any path that does not meet the obstacle avoidance constraint, no-fly zone constraint, or altitude constraint will be regarded as an infeasible solution and will be corrected or eliminated to ensure the feasibility of the population. An elite retention strategy is adopted, in which the individual with the best fitness (i.e. the best path) in the previous generation is directly retained in the new generation, replacing the worst individual in the new generation. This can prevent the optimization process from backtracking and ensure the convergence of the algorithm.

[0022] S6. Check if the current iteration count has reached the preset maximum iteration count T. max =2000: If the target is not reached, the algorithm returns to step S3 to continue iterative optimization. If the target has been reached, the optimization process will be terminated immediately.

[0023] S7. When the algorithm terminates, output the current global optimal individual, which is the three-dimensional flight path with the lowest comprehensive cost obtained after 2000 iterations of optimization; this path consists of a series of three-dimensional coordinate points. This optimal path is used as the preset flight trajectory for the UAV and applied to actual flight missions. It should be noted that this path is the optimal or near-optimal solution after balancing path length, obstacle avoidance safety, flight altitude compliance, and trajectory smoothness.

[0024] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited thereto. Various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention.

Claims

1. An improved sparrow search method for path planning of three-dimensional unmanned aerial vehicles, characterized in that, The specific implementation steps include the following: S1. A three-dimensional mountain terrain model is generated using the Gaussian function superposition method, and obstacles and no-fly zones in the environment are defined using a cylindrical geometric model. Obstacle avoidance constraints, take-off and landing safety constraints, and flight altitude constraints are set. A comprehensive cost function with path length, threat penalty, flight safety altitude, and path smoothness as sub-objectives is constructed, and it is transformed into an objective function to be optimized by weighted summation. S2. Set the algorithm running parameters, including population size, maximum number of iterations, ratio of discoverers to vigilants, and warning threshold. At the same time, set the dynamic weights of the sine and cosine strategies and the stability index of Lévy flight. Randomly generate the initial path population under the premise of satisfying all environmental constraints. S3. Calculate the fitness value of each path in the population based on the comprehensive cost function, sort all individuals according to the fitness value, and classify the top 20% of individuals as discoverers, the bottom 10% of individuals as vigilants, and the rest as followers. S4. Perform iterative optimization and update the positions of the three types of roles respectively: the position of the discoverer introduces a sine and cosine strategy to dynamically balance horizontal exploration and vertical obstacle avoidance based on the warning value; the position of the follower introduces a Lévy flight mechanism to enhance the ability to explore locally and escape local optima through a strategy of alternating long and short step lengths; the position of the vigilant is updated using the original sparrow search algorithm rules. S5. Perform collision detection on all paths in the new generation population to ensure that obstacle avoidance constraints, no-fly zone constraints and flight altitude constraints are met. Eliminate and correct infeasible solutions, and at the same time adopt an elite retention strategy to retain the best individuals from the previous generation to the current generation. S6. Check if the current iteration count has reached the preset maximum iteration count. If not, return to step S3 to continue iterating. If it has reached the maximum iteration count, terminate the optimization process. S7. Output the current global optimal individual as the three-dimensional flight path.

2. The improved sparrow search method for path planning of a three-dimensional unmanned aerial vehicle according to claim 1, characterized in that, Step S1, which describes generating a 3D mountain terrain model using the Gaussian function superposition method, specifically includes: generating a 1000×1000×500 grid of 3D terrain using the Gaussian function superposition method, with the terrain height function being: ; And calculate the simulated mountain terrain height H(x,y): ; Where Z represents the theoretical height of the Gaussian function superposition method; (x,y) represents the horizontal and vertical coordinates of the mountain.

3. An improved sparrow search method for path planning of a three-dimensional unmanned aerial vehicle (UAV) according to claim 2, characterized in that, Step S1, which uses a cylindrical geometric model to define obstacles and no-fly zones in the environment, specifically includes: setting n obstacles, each defined by center coordinates, radius, and height parameters; and setting m no-fly zones, each defined by center coordinates, radius, and height range parameters.

4. An improved sparrow search method for path planning of a three-dimensional unmanned aerial vehicle (UAV) according to claim 3, characterized in that, In step S1, the obstacle avoidance constraint requires that the path point must not enter the cylinder of the obstacle or a specific height range of the no-fly zone; Takeoff and landing safety constraints require the establishment of spherical safety zones around the start and end points; Flight altitude constraints require waypoint altitudes to be between the minimum safe altitude and the maximum flight altitude.

5. An improved sparrow search method for path planning of a three-dimensional unmanned aerial vehicle (UAV) according to claim 4, characterized in that, The comprehensive cost function mentioned in step S1 is a weighted sum of four sub-costs: path length, threat penalty, flight safety altitude, and path smoothness. The weighting coefficients are 0.4, 0.2, 0.2, and 0.2, respectively. The path length sub-cost is calculated as the sum of the Euclidean distances between all consecutive waypoints; The threat penalty sub-cost is applied based on the distance from the waypoint to the nearest obstacle; Flight safety altitude sub-cost design uses a piecewise function to penalize altitude deviation; The path smoothness sub-cost is composed of a weighted average of the horizontal curvature cost and the vertical curvature cost.

6. An improved sparrow search method for path planning of a three-dimensional unmanned aerial vehicle according to claim 5, characterized in that, The algorithm's operating parameters in step S2 include a population size of 100, a maximum number of iterations of 2000, a discoverer ratio of 20%, a vigilant ratio of 10%, and a warning threshold of 0.

8. The dynamic weight 'a' of the sine and cosine strategies decreases linearly from 0.9 to 0.

4. The stability index β for Lévy flight is set to 1.

5.

7. An improved sparrow search method for path planning of a three-dimensional unmanned aerial vehicle according to claim 6, characterized in that, In step S4, the discoverer's position is updated using a sine / cosine strategy, and the position update formula is: ; in, Let represent the position of the i-th discoverer-type sparrow individual in the j-th dimension at the t-th iteration, where i = 1, 2, ..., n, j = 1, 2, ..., d, n is the number of individuals in the sparrow population, and d is the dimension of the objective variable; 'a' represents the local exploration weight in the discoverer update strategy at the t-th iteration; r1 and r2 are random numbers. , ; R² represents the optimal position among all sparrows at the t-th iteration; R² represents the current path warning value; ST is the safety threshold. Follower position updates employ the Lévy flight mechanism, incorporating a Lévy stochastic step size into the position update formula: ; ; ; in, This represents the worst position among all sparrows at the t-th iteration. Let represent the optimal position among all discoverer sparrow individuals in the (t+1)th iteration; Q represents the perturbation factor that follows a standard normal distribution; Indicates element-wise product; λ represents the step size of Lévy flight and is a d-dimensional vector; r4 represents a standard normal random number with a mean of 0 and a variance of 1; r3 represents a standard normal distribution with a mean of 0 and a variance of σ; λ is the key stability index of Lévy flight. For gamma function, ; This represents a random number generator that is uniformly distributed in the interval [0,1). The position update of the vigilant follows the original sparrow search algorithm formula.

8. An improved sparrow search method for path planning of a three-dimensional unmanned aerial vehicle according to claim 7, characterized in that, In step S5, collision detection includes reapplying obstacle avoidance constraints, no-fly zone constraints, and flight altitude constraints to check path feasibility. The elite retention strategy unconditionally retains the best individuals from the previous generation into the current generation and replaces the worst individuals.

9. An improved sparrow search method for path planning of a three-dimensional unmanned aerial vehicle (UAV) according to claim 1, characterized in that, In step S7, the output three-dimensional flight path consists of a series of three-dimensional coordinate points, which are used as the preset flight trajectory of the UAV for actual flight missions.

Citation Information

Cited By

  • Forklift drive axle floating half shaft optimization design method and system

    CN121881552A

  • Plateau multi-unmanned aerial vehicle static route planning and dynamic rescheduling method and system

    CN122176964A