A method, device, medium and product for three-dimensional path planning of a UAV
Patent Information
- Application Number
- CN202611087797.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-08-18
AI Technical Summary
[0004]本申请的目的是提供一种无人机三维路径规划方法、设备、介质及产品,解决了现有无人机三维路径规划方法存在易陷入局部最优、收敛精度不足的问题,满足在具有障碍物的环境下,三维路径规划更好,飞行代价更低,稳定性更好,从而能够显著提升无人机的能源利用效率与飞行安全性
[0010]根据本申请提供的具体实施例,本申请具有了以下技术效果:本申请提供了一种无人机三维路径规划方法、设备、介质及产品,通过改进麻雀搜索算法,根据算法搜索空间对综合代价函数进行求解,得到最优球坐标编码解,融合粒子群优化速度更新策略,引入精英局部深度搜索,并采用周期性全局扰动与智能停滞检测机制跳出局部最优,解决了现有无人机三维路径规划方法存在易陷入局部最优、收敛精度不足的问题,满足在具有障碍物的环境下,三维路径规划更好,飞行代价更低,稳定性更好,从而能够显著提升无人机的能源利用效率与飞行安全性;本申请规划的路径能耗降低,算法稳定性提升,适用于灾后应急通信、电力巡检、物流配送等多种无人机应用场景。
Smart Images

Figure CN122590911A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of UAV path planning and intelligent optimization algorithms, and in particular to a UAV three-dimensional path planning method, device, medium and product. Background Technology
[0002] In recent years, Unmanned Aerial Vehicle (UAV) technology has developed rapidly and has been widely used in civilian and military fields such as disaster emergency communication, power line inspection, logistics distribution, and agricultural plant protection. UAV path planning is one of the core technologies of autonomous UAV flight. Its goal is to find an optimal or suboptimal flight path from the starting point to the destination under multiple constraints such as terrain, obstacles, and UAV platform performance. Optimization indicators typically include path length, flight time, energy consumption, safety, and smoothness.
[0003] Therefore, in complex 3D terrain environments containing columnar obstacles, planning an optimal flight path for UAVs that accurately reflects the differences in energy consumption across multiple states while also considering obstacle avoidance and flight stability is crucial for improving UAV endurance and mission efficiency. However, existing UAV 3D path planning methods are prone to getting trapped in local optima and suffer from insufficient convergence accuracy. This makes it difficult to achieve better 3D path planning, lower flight costs, and greater stability in obstacle-filled environments, thereby significantly improving UAV energy efficiency and flight safety. Summary of the Invention
[0004] The purpose of this application is to provide a method, device, medium, and product for three-dimensional path planning of unmanned aerial vehicles (UAVs), which solves the problems of existing UAV three-dimensional path planning methods being prone to getting trapped in local optima and having insufficient convergence accuracy. It meets the requirements of better three-dimensional path planning, lower flight cost, and better stability in environments with obstacles, thereby significantly improving the energy utilization efficiency and flight safety of UAVs.
[0005] To achieve the above objectives, this application provides the following solution.
[0006] Firstly, this application provides a method for three-dimensional path planning for unmanned aerial vehicles (UAVs), including: A three-dimensional flight environment model is constructed based on terrain and obstacle data from the drone's flight. In the three-dimensional flight environment model, the UAV flight path is represented by spherical coordinate encoding. The three-dimensional path in continuous space is mapped into a discrete vector composed of step size, pitch angle and azimuth angle. The lower limit and upper limit of each encoding parameter are determined to form a search space. The encoding parameters include step size, pitch angle and azimuth angle. Construct a comprehensive cost function; the comprehensive cost function includes precise 3D energy consumption cost, obstacle avoidance penalty cost, height constraint cost, and path smoothness cost; By using the improved sparrow search algorithm, the comprehensive cost function is solved according to the algorithm search space to obtain the optimal spherical coordinate encoded solution. The improved sparrow search algorithm integrates the particle swarm optimization speed update strategy, introduces elite local depth search, and adopts periodic global perturbation and intelligent stagnation detection mechanism to escape local optima. The optimal spherical coordinate encoding solution is converted into path points in the Cartesian coordinate system to obtain the final three-dimensional flight path.
[0007] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the steps of the above-described UAV three-dimensional path planning method.
[0008] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described UAV three-dimensional path planning method.
[0009] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described UAV three-dimensional path planning method.
[0010] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a method, device, medium, and product for UAV three-dimensional path planning. By improving the sparrow search algorithm, solving the comprehensive cost function according to the algorithm search space, the optimal spherical coordinate encoded solution is obtained. The particle swarm optimization speed update strategy is integrated, an elite local depth search is introduced, and a periodic global perturbation and intelligent stagnation detection mechanism are adopted to escape local optima. This solves the problems of existing UAV three-dimensional path planning methods being prone to getting trapped in local optima and having insufficient convergence accuracy. It meets the requirements of better three-dimensional path planning, lower flight cost, and better stability in environments with obstacles, thereby significantly improving the energy utilization efficiency and flight safety of UAVs. The path planning of this application has reduced energy consumption and improved algorithm stability, making it suitable for various UAV application scenarios such as post-disaster emergency communication, power line inspection, and logistics distribution. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort: Figure 1 This is an application environment diagram of a UAV three-dimensional path planning method according to an embodiment of this application; Figure 2 A flowchart illustrating a UAV three-dimensional path planning method provided in an embodiment of this application; Figure 3 A three-dimensional flight environment model diagram of an unmanned aerial vehicle provided in an embodiment of this application; Figure 4 A flowchart illustrating the overall process of a UAV 3D path planning method provided in an embodiment of this application; Figure 5 A flowchart illustrating an improved sparrow search algorithm provided in an embodiment of this application; Figure 6 A comparison of convergence curves of the improved sparrow search algorithm provided in an embodiment of this application with other algorithms; Figure 7 A 3D path comparison diagram between the improved sparrow search algorithm provided in one embodiment of this application and other algorithms; Figure 8 A top-down view of the improved sparrow search algorithm provided in one embodiment of this application and other algorithms; Figure 9 A path side view of the improved sparrow search algorithm provided in one embodiment of this application and other algorithms; Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0013] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0014] The UAV three-dimensional path planning method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on another server. Terminal 102 can send requests to be processed to server 104. After receiving the request, server 104 constructs a 3D flight environment model based on the terrain and obstacle data of the UAV flight, represents the UAV flight path using spherical coordinate encoding, determines the algorithm search space, and constructs a comprehensive cost function including accurate 3D energy consumption cost, obstacle avoidance penalty cost, altitude constraint cost, and path smoothness cost. An improved sparrow search algorithm is used to solve the comprehensive cost function to obtain the optimal spherical coordinate encoded solution. The optimal spherical coordinate encoded solution is converted into path points in Cartesian coordinates to obtain the final 3D flight path. Server 104 can then feed back the obtained final 3D flight path for the request to terminal 102. In addition, in some embodiments, the UAV 3D path planning method can also be implemented by the server 104 or the terminal 102 separately. For example, the terminal 102 can directly perform UAV 3D path planning for the request to be processed, or the server 104 can obtain the request to be processed from the data storage system and perform UAV 3D path planning for the request to be processed.
[0015] The terminal 102 can be, but is not limited to, various desktop computers and laptops. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers, or it can be a cloud server.
[0016] In one exemplary embodiment, such as Figure 2 As shown, a three-dimensional path planning method for unmanned aerial vehicles (UAVs) is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 201 to 205.
[0017] Step 201: Construct a three-dimensional flight environment model based on the terrain and obstacle data of the UAV flight.
[0018] Step 202: Under the three-dimensional flight environment model, the UAV flight path is represented by spherical coordinate encoding. The three-dimensional path in the continuous space is mapped into a discrete vector composed of step size, pitch angle and azimuth angle. The lower limit and upper limit of each encoding parameter are determined to form a search space. The encoding parameters include step size, pitch angle and azimuth angle.
[0019] Step 203: Construct the comprehensive cost function; the comprehensive cost function includes the precise 3D energy consumption cost, obstacle avoidance penalty cost, height constraint cost, and path smoothness cost.
[0020] Step 204: Using the Improved Sparrow Search Algorithm (ISSA), the comprehensive cost function is solved according to the algorithm search space to obtain the optimal spherical coordinate encoded solution. The improved sparrow search algorithm integrates the Particle Swarm Optimization (PSO) speed update strategy, introduces elite local depth search, and adopts periodic global perturbation and intelligent stagnation detection mechanism to escape local optima.
[0021] Step 205: Convert the optimal spherical coordinate encoding solution into path points in the Cartesian coordinate system to obtain the final three-dimensional flight path.
[0022] By implementing steps 201 to 205 above, the sparrow search algorithm is improved. The comprehensive cost function is solved according to the algorithm search space to obtain the optimal spherical coordinate encoded solution. The particle swarm optimization speed update strategy is integrated, an elite local depth search is introduced, and a periodic global perturbation and intelligent stagnation detection mechanism are adopted to escape local optima. This solves the problems of existing UAV 3D path planning methods being prone to getting trapped in local optima and having insufficient convergence accuracy. It meets the requirements of better 3D path planning, lower flight cost, and better stability in environments with obstacles, thereby significantly improving the energy utilization efficiency and flight safety of UAVs.
[0023] First, a 3D terrain and cylindrical obstacle flight environment is constructed by loading a publicly available online dataset. Spherical coordinate encoding is used to convert the continuous 3D path into discrete vectors of step length, pitch angle, and azimuth angle. A comprehensive cost function is established, centered on multi-state accurate 3D energy consumption and integrating hierarchical obstacle avoidance penalties, altitude constraints, and path smoothness. The energy consumption cost distinguishes between four flight states: level flight, climb, descent, and turning, and uses calibration coefficients from real UAVs. An improved sparrow search algorithm incorporating a particle swarm optimization velocity update strategy is proposed. Through quasi-opposites learning initialization, dynamic parameter adaptive adjustment, elite local depth search, and intelligent stagnation detection and escape mechanisms, the problem of traditional algorithms easily getting trapped in local optima and having insufficient convergence accuracy is solved. Finally, the optimal solution is converted into Cartesian coordinates and a smooth, flyable path is generated through cubic B-spline interpolation. The path planned in this application has reduced energy consumption and improved algorithm stability, making it suitable for various UAV application scenarios such as post-disaster emergency communication, power line inspection, logistics distribution, and agricultural plant protection.
[0024] This embodiment focuses on addressing the energy efficiency issue of UAVs flying in complex 3D terrain. Through precise energy consumption modeling and an efficient path search algorithm, it plans a path with lower energy consumption and smoother flight. Therefore, this embodiment constructs a path as follows: Figure 3 The image shows a 3D flight environment model of the drone. (Example:) Figure 3 As shown, the environment includes a 3D terrain similar to mountainous and hilly areas generated by loading terrain data, multiple insurmountable cylindrical obstacles (simulating buildings or no-fly zones), and the drone's starting point S and ending point G. The drone's flight is subject to multiple constraints, including terrain altitude, obstacles, and its own platform performance (maximum turning angle, maximum climb angle, minimum flight altitude, and maximum flight altitude). date1 represents the terrain background, and dates2-7 represent the established cylindrical obstacles.
[0025] like Figure 4 As shown, firstly, a three-dimensional flight environment is constructed (i.e., a three-dimensional flight environment model is constructed), then spherical coordinate encoding and search space are performed (corresponding to step 202), a low-energy integrated cost function is constructed, the sparrow search algorithm is improved to solve the problem, the optimal spherical coordinate solution is obtained (i.e., the optimal spherical coordinate encoded solution), coordinate transformation and boundary constraints are applied, B-spline smoothing is performed, and finally a low-energy three-dimensional path (i.e., the final three-dimensional flight path) is output.
[0026] Step 201 above includes: First, loading terrain elevation data to generate realistic 3D terrain. Based on the terrain mode selection parameters, either standard terrain data or Christmas terrain data can be loaded to generate the corresponding terrain mesh. Depending on the obstacle complexity parameter settings (simple or complex), publicly available online terrain data can be imported to generate realistic undulating terrain. Impassable cylindrical obstacles (representing no-fly zones for drones) are placed in the environment, and different numbers of cylindrical obstacles are generated randomly or at fixed locations within the environment. Obstacle attributes include center coordinates. Height h and radius r.
[0027] Set the starting coordinates, ending coordinates, and three-dimensional flight boundary of the UAV. The platform performance constraints include the maximum turning angle, maximum pitch rate, minimum flight altitude, maximum flight altitude, maximum climb angle variation, UAV size, and danger distance.
[0028] To reduce the dimensionality of the path planning problem and ensure the feasibility of the path, this application uses spherical coordinate encoding to represent the UAV flight path. Assuming the number of intermediate nodes in the path is a preset value, the complete path starts from the starting point... It consists of all intermediate nodes and the endpoint. Each path segment is described by three spherical coordinate parameters: step size. Pitch angle and direction Angle, among which Therefore, a complete path is encoded as a 3n-dimensional vector. The number of path segments; They are the starting points respectively , and coordinate.
[0029] Based on the spatial distance from the starting point to the ending point and the flight constraints of the UAV, the lower and upper limits of each encoding parameter are determined to form a search space. Step size The maximum value is set to a multiple of the Euclidean distance from the starting point to the ending point divided by the number of intermediate nodes, and the minimum value is set to 0. Pitch angle The range is set to a symmetrical, small angular interval to limit the drone's climb and descent slope. Azimuth angle The range is centered on the direction angle from the starting point to the ending point, extending to the left and right by one angle interval. Ultimately, the lower bound lb and upper bound ub of the algorithm's search are formed by combining the ranges of the aforementioned encoding parameters.
[0030] The following constructs a comprehensive cost function, centered on precise 3D energy consumption cost and integrating obstacle avoidance penalty cost, height constraint cost, and path smoothness cost. This comprehensive cost function serves as the fitness function for subsequent improvements to the sparrow search algorithm; a smaller value indicates a better path.
[0031] The formula for calculating the overall cost function is as follows: (1); in, The comprehensive cost function; The cost of precise three-dimensional energy consumption; To avoid the consequences of punishment; This comes at the cost of high constraints; This is the cost of path smoothness; , , , These are weighting coefficients, used to balance various optimization objectives. Each weighting coefficient is preset according to the application scenario; in this embodiment, to highlight the primary objective of energy consumption optimization, corresponding weight values are set.
[0032] 1) Precise 3D Energy Consumption Cost: Unlike traditional methods that only consider path length, this application distinguishes the energy consumption differences of four flight states: level flight, climb, descent, and turn. It also uses a pre-set energy consumption coefficient calibrated from UAV data, making the planned path closer to the actual flight energy consumption characteristics. The precise 3D energy consumption cost is expressed as follows: (2); (3); (4); (5); (6); in, The cost of precise three-dimensional energy consumption; Energy consumption during level flight; This refers to the energy consumption coefficient during level flight. This represents the total number of path points. and For the first The x and y coordinates of each path point; and For the first The x and y coordinates of each path point; Energy consumption for climbing; The climbing energy consumption coefficient; This is a function to find the maximum value. and For the first The and the first The absolute height of each path point; To reduce energy consumption; To reduce the energy consumption coefficient; Energy consumption during turning; Energy consumption coefficient for turning; For the first The turning angle of each path point.
[0033] 2) Obstacle avoidance penalty costs employ a tiered penalty mechanism: a maximum penalty value (specific value set based on actual conditions) is applied when the distance between the drone and an obstacle is less than the collision distance; a linear penalty is applied when the distance is between the collision distance and the safe distance; and the penalty is zero when the distance is greater than the safe distance. To ensure flight safety, a tiered penalty mechanism is used. For each path segment, the shortest distance to each cylindrical obstacle is calculated. The penalty rules are as follows: If If the distance is less than the collision distance (the sum of the obstacle radius and the drone size), a maximum penalty value is applied, denoted as the obstacle avoidance collision hard constraint penalty; if If the distance falls between the collision distance and the safe distance (the sum of the collision distance and the danger distance), a linear penalty is applied; otherwise, a penalty is applied. When the distance exceeds the safe distance, the penalty is 0. The obstacle avoidance penalty cost is obtained by summing the penalty values of all path segments and obstacles.
[0034] This embodiment employs a three-level obstacle avoidance penalty mechanism, with the obstacle avoidance penalty cost represented as follows: (7); (8); in, The obstacle avoidance penalty cost is the sum of the penalty values for all "path segment-obstacle" pairs; The total number of obstacles; This represents the total number of path points. For the first The path segment and the first The obstacle avoidance penalty value for each obstacle; It is a hard constraint penalty for obstacle avoidance and collision, corresponding to the infeasible scenario where "the distance between the path segment and the obstacle is less than the collision distance"; For the first The path segment and the first The shortest distance to each obstacle; The collision distance is equal to the sum of the obstacle's radius and the drone's size. The safe distance is equal to the sum of the collision distance and the danger distance.
[0035] 3) Altitude constraint cost: Penalizes waypoints that exceed the minimum and maximum flight altitudes, and encourages flight altitudes to remain within the middle range. For each waypoint's relative flight altitude... If the altitude exceeds the range defined by the minimum and maximum flight altitudes, a maximum penalty is imposed. Simultaneously, to encourage drones to fly at the energy-optimal altitude, an additional penalty term is added to ensure the flight altitude is as close as possible to the center of the altitude range. The sum of the penalty values for all path points yields the altitude constraint cost.
[0036] The cost of high constraint is expressed as follows: (9); (10); in, This comes at the cost of high constraints; For the first The height penalty value of each path point is calculated and accumulated to obtain the height constraint cost. No. The relative flight altitude of each waypoint; These are the preset minimum and maximum flight altitudes, respectively. The center value of the height interval It is a hard constraint penalty for exceeding the altitude limit, corresponding to the infeasible scenario of "the waypoint exceeding the flight altitude range".
[0037] 4) Path smoothness penalty for path segments exceeding the maximum turning angle and maximum climb angle variation of the UAV. To meet the performance constraints of the UAV platform, penalties are imposed on path points exceeding the maximum turning angle and maximum climb angle variation. For each turning point, if the turning angle is greater than the maximum turning angle, the penalty is increased; for each path segment, if the climb angle variation between two adjacent segments is greater than the maximum climb angle variation threshold, the penalty is increased. All penalty values are summed to obtain... .
[0038] (11); (12); (13); in, For the first The turning angle penalty value for each path point (turning point); For the first The path segment and the first +1 climb angle penalty between path segments; Penalty for turning corners; Maximum turning angle; Penalty for changes in climb angle; For the first The path segment and the first The absolute value of the change in the angle of ascent between each path segment; This is the threshold for the maximum climb angle change.
[0039] In step 204 above, an improved sparrow search algorithm with a fusion particle swarm optimization speed update strategy is used to solve for the minimum value of the comprehensive cost function: the diversity of population initialization is enhanced through quasi-oppositional learning; the inertia weight and learning factor are dynamically adjusted to adaptively balance global exploration and local development; elite local depth search is introduced to improve convergence accuracy; and periodic global perturbation and intelligent stagnation detection mechanisms are used to effectively escape local optima, and finally obtain the optimal spherical coordinate encoded solution.
[0040] The traditional Sparrow Search Algorithm (SSA) simulates the foraging and predation behavior of a sparrow population, including three roles: discoverer, joiner, and scout. Its position update formula is as follows: Discoverer Update: (14); in, For the discoverer Generation, First Only sparrows in the first The position of the dimension; For the first Generation, First Only sparrows in the first The position of the dimension; It is a natural exponential function; The value is a random number within the range (0,1); M is the maximum number of iterations of the algorithm; This is the warning value, and its range is [0,1]. For safety, the value ranges from [0.5, 1]. These are random numbers that follow a standard normal distribution. It is a 1×d matrix of all 1s (the values are always 1). To determine the dimension of the solution space.
[0041] Joiner Update: (15); in, For the first member Generation, First Only sparrows in the first The position of the dimension; For the first member Generation, First Only sparrows in the first The position of the dimension; These are random numbers that follow a standard normal distribution. For the first The position with the worst global fitness in the entire population; The sequence number of individual sparrows sorted from best to worst fitness; Population size; For the first The optimal position in the discoverer population; Given a 1×d matrix, each element is randomly assigned the value 1 or -1; For matrix The generalized inverse; Indicates except Outside of this situation.
[0042] Scout Update: (16); in, For the scouts Generation, First Only sparrows in the first The position of the dimension; For the scouts Generation, First Only sparrows in the first The position of the dimension; For the first The globally optimal position; The step size control parameter is used to adjust the local search step size, and it conforms to the standard normal distribution. A random number within the range [-1, 1], used to control the direction of movement and step size; For the first The position with the worst global fitness in the entire population; For the first The fitness value of a single sparrow; and These are the current best and worst fitness values globally, respectively. It should be a very small positive number to prevent the denominator from being 0.
[0043] The improved sparrow search algorithm is used to solve the comprehensive cost function based on the algorithm's search space, obtaining the optimal spherical coordinate encoded solution. This specifically includes the following steps 2041-2044. The improved sparrow search algorithm flowchart is as follows: Figure 5 As shown.
[0044] Step 2041: Initialize population parameters; population parameters include population size, maximum number of iterations, upper and lower limits of inertia weight, learning factor range, elite ratio and stagnation threshold.
[0045] Step 2042: A quasi-oppositional learning strategy is used for population initialization. The first 50% of individuals are initialized using standard randomization, while the second 50% are initialized using quasi-oppositional learning. The first 50% of individuals are in the search space... Individuals are randomly generated and directly enter the initial population, without participating in the selection competition. For the latter 50% of individuals, candidate pairs are generated one by one: for each population slot, one standard random individual is generated first. Then through the formula Generate its corresponding quasi-opposite individuals Calculate the fitness values of both individuals separately, and select the individual with the lower fitness value to enter the initial population; Individuals generated through quasi-oppositional learning; These are the lower and upper bound vectors of the search space, respectively; These are individuals generated randomly according to a standard; specific calculations can be performed separately. and The fitness value is used to select individuals with lower fitness values to enter the initial population. Simultaneously, a velocity vector is initialized for each individual, with the velocity range set as a certain proportion of the search space.
[0046] Step 2043: During the iteration process, execute the following sub-steps 20431 to 20436.
[0047] Step 20431: Calculate the current iteration progress and dynamically adjust the inertia weight and learning factor. The inertia weight decreases linearly from its maximum value to its minimum value. The learning factor is adjusted in stages: in the early stages of the iteration (i.e., Set the iteration progress value to a large value, and keep it large in the later stages of the iteration (i.e., The iterative progress value is set to dynamically change (cognitive factors decrease, social factors increase).
[0048] The dynamic adjustment formula for inertia weight is expressed as follows: (17); in, Inertial weight; and These represent the maximum and minimum values of the inertia weight; The current iteration progress is equal to the current iteration count divided by the maximum iteration count. In a specific example... , .
[0049] The dynamic adjustment mechanism of learning factors is as follows: learning factors include cognitive factors. social factors ;when When setting the iteration progress value, , ;when When setting the iteration progress value, , In a specific example, the iteration progress value can be set to 0.3.
[0050] Step 20432: The particle swarm optimization velocity update formula is used to update the velocity and position of all individuals based on the inertia weight and learning factor.
[0051] The particle swarm optimization velocity update formula is expressed as follows: (18); in, and For the first The individual The speed and position of the next iteration ; This represents the maximum number of iterations. and For the first The individual The speed and position of the next iteration; Inertial weights; learning factors include cognitive factors. social factors ; A uniformly random number in the interval [0, 1]; For the first The individual The historical best position in the next iteration; For the first The global optimal position in the next iteration.
[0052] Step 20433: Perform boundary processing on the updated individual positions, calculate the fitness value of the updated individual positions, and update the individual's historical best position and global best position. The fitness value is calculated based on the comprehensive cost function.
[0053] Step 20434, Elite Local Depth Search: The fitness values are sorted from smallest to largest, and a Gaussian perturbation local search with dynamic step size is periodically performed on the top first preset proportion of elite individuals.
[0054] After updating, boundary conditions are handled, and the fitness value of the updated individual position is calculated. The individual's historical best and global best are then updated. Elite local depth search: Every few generations, the top individuals with the highest fitness values are... Elite individuals perform Gaussian perturbation local search.
[0055] (19); in, The individual position after local search with Gaussian perturbation; The individual position before the Gaussian perturbation local search; These are random numbers that follow a standard normal distribution.
[0056] The formula for calculating the dynamic step size is as follows: (20); in, The step size is dynamic and adjusted according to the iteration progress: in the early stage of iteration ( ) Use a larger step size, later ( A smaller step size is used. If the Euclidean distance between the elite individual and the globally optimal individual is less than a certain proportion of the diagonal length of the search space, the step size is halved.
[0057] Step 20435: Sort fitness values from smallest to largest, and periodically perform global Gaussian perturbation on the top two preset proportions of individuals.
[0058] Periodic global perturbation: Every certain number of generations, a moderate Gaussian perturbation is applied to a certain proportion of individuals with the highest fitness values. (twenty one); in, The individual position after global Gaussian perturbation; The individual position before the global Gaussian perturbation; These are random numbers that follow a standard normal distribution. This operation only takes effect when the iteration progress is greater than a preset threshold, avoiding excessive perturbation in the early stages that could destroy high-quality solutions, thus enhancing population diversity.
[0059] Step 20436, Intelligent Stagnation Detection Mechanism: Calculate the standard deviation of population fitness. When the global optimal fitness value has not improved for a consecutive preset number of generations or the standard deviation of population fitness is less than a preset threshold, the fitness values are sorted from largest to smallest, and the top three preset proportions of individuals are reinitialized.
[0060] Calculate the standard deviation of the population fitness. If the global optimal fitness value (i.e., the fitness function result corresponding to the global optimal position) has not improved for several consecutive generations, or if the standard deviation of the population fitness is less than a certain threshold and the iteration has not reached the later stage, the algorithm is considered to have stalled. At this time, reinitialize a certain proportion of the individuals with the worst fitness in the population (positions at...). (randomly generated internally) and its speed is reset.
[0061] Step 2044: After the iteration is complete, output the globally optimal position. As the optimal spherical coordinate encoding solution.
[0062] The optimal spherical coordinate encoding solution obtained from the above steps Convert to 3D path points in Cartesian coordinates using the following recursive formula. This process yields discrete path points including the starting point, all intermediate nodes, and the ending point. Then, cubic B-spline interpolation is used for smoothing, interpolating these discrete points into a sufficient number of continuous points to generate a first-order continuously differentiable smooth flight path that meets the flight control requirements of the UAV.
[0063] The recursive formula for converting the optimal spherical coordinate encoding solution into path points in Cartesian coordinates is as follows: (twenty two); in, , and The first The path points in the Cartesian coordinate system , and coordinate; , and The first The path points in the Cartesian coordinate system , and coordinate; For the first Step size of each path point; For the first The pitch angle of each path point; For the first The azimuth angle of each path point; It is a cosine function; It is a sine function.
[0064] It should be noted that cubic B-spline interpolation smoothing interpolates the original path points into 500 consecutive points, generating a first-order continuously differentiable smooth flight path.
[0065] To verify the effectiveness and advancement of the proposed method, a comparative experiment was conducted between the ISSA algorithm of this application and the standard SSA, standard PSO, and standard GWO algorithms under the same environment. Each algorithm was run independently multiple times, and its optimal value, average value, worst value, and standard deviation were statistically analyzed, and the average convergence time was recorded.
[0066] Figure 6 The convergence curves of the various algorithms are compared. It is clear from the figure that the ISSA algorithm of this application (bottom curve) converges the fastest, reaching the optimal value exponentially, and its final convergence accuracy is significantly higher than the other compared algorithms. In contrast, the standard SSA and PSO both exhibited varying degrees of premature convergence.
[0067] Figures 7 to 9 The 3D paths, top views, and side views planned by each algorithm are shown respectively. As can be seen from the comparison, the path (the smoothest curve) planned by the ISSA algorithm proposed in this application has the following significant advantages: shorter path length, smoother path (fewer turns and fewer climbs / descents), and stronger obstacle avoidance ability (all paths can effectively avoid cylindrical obstacles and maintain a reasonable distance from the obstacles).
[0068] Table 1 presents the statistical results of each algorithm running independently multiple times (30 times). As can be seen from Table 1, the improved sparrow search algorithm proposed in this application significantly outperforms the other three comparative algorithms in terms of optimal value, average value, and worst value, indicating that it has the highest optimization accuracy. Furthermore, its standard deviation is the smallest, demonstrating the best algorithm stability and minimal fluctuation in results across multiple runs.
[0069] Table 1 Performance Comparison of Different Algorithms
[0070] Among numerous 3D path planning algorithms, swarm intelligence optimization algorithms are widely used in UAV 3D path planning problems due to their advantages such as independence from gradient information, strong global search capability, and good robustness. The Sparrow Search Algorithm (SSA), a novel swarm intelligence algorithm proposed by Xue and Shen in 2020, simulates the foraging and anti-predation behavior of a sparrow population, including the roles of discoverer, joiner, and scout. It has advantages such as fast convergence speed, few parameters, and simple implementation. For example, a related technology proposed a UAV path planning algorithm based on an improved Sparrow Search Algorithm. This algorithm calculates the fitness function through the mesenchymal cell migration mechanism and updates the population using an improved position update formula, which can avoid getting trapped in local optima and accelerate the convergence speed. Furthermore, Zhu Yifan et al. improved the algorithm's global search capability and ability to escape local optima by using an improved Circle chaotic mapping, nonlinear normal distribution coefficients, and differential mutation strategy. Wu Xueli et al. improved the convergence speed and solution accuracy by introducing dynamic weight factors, Gaussian mutation, quantum particle swarm generation of new solutions, and Cauchy mutation. Yang Daoyong et al. enhanced population diversity and optimization performance by using an improved infinite folding iterative chaotic mapping, nonlinear adaptive factor and sine and cosine perturbation mechanism.
[0071] However, the aforementioned existing technologies, as well as traditional sparrow search algorithms and their improved versions, still suffer from the following common problems and shortcomings when solving UAV path planning problems in complex 3D environments: First, the cost function is severely disconnected from the actual energy consumption of UAV flight. Most existing studies use path length, path smoothness, or simple altitude changes as the main or even sole optimization objective. However, the energy consumption of real UAVs is not only related to path length but also closely related to flight states such as climb, descent, and turn, and the energy consumption coefficients of different flight states differ significantly (for example, climb energy consumption is much higher than level flight, while descent energy consumption is lower than level flight). Planning methods that only target path length may cause UAVs to frequently perform high-energy-consuming climb and turn maneuvers in actual flight. Although the path length is shorter, the overall energy consumption is actually higher, which seriously shortens the effective endurance of UAVs and cannot meet the application requirements of high-energy-consuming sensitive scenarios such as post-disaster emergency communication and long-endurance inspection. Second, traditional sparrow search algorithms and their existing improvements are still prone to getting trapped in local optima and have insufficient convergence accuracy. Traditional SSA algorithms experience a rapid decline in population diversity in the later stages of iteration, making it easy to converge to a local optimum prematurely. Existing improvement strategies, such as single chaotic mapping initialization, single mutation strategy, or single population search mechanism, while improving algorithm performance to some extent, struggle to effectively balance global exploration and local exploitation capabilities in high-dimensional complex path planning problems. This results in planned paths that are not globally optimal in real-world complex terrains, and the convergence accuracy is insufficient to meet engineering requirements. Third, there is a lack of effective dynamic stagnation detection and escape mechanisms. When an algorithm falls into a local optimum due to loss of population diversity, existing improved algorithms generally lack intelligent mechanisms to promptly identify stagnation states and guide the population to escape quickly. While some algorithms introduce periodic random perturbations or mutations, the amplitude and timing of these perturbations are fixed, lacking the ability to adaptively respond to the algorithm's current state. This leads to inefficient escape from local optima and may even destroy converged high-quality solutions due to excessive perturbation. Fourth, path encoding methods are unfavorable for optimization under complex constraints. Existing methods often use Cartesian coordinates to directly encode path points, resulting in a high-dimensional search space and complex constraints. This makes it difficult for algorithms to efficiently optimize while meeting performance constraints of UAV platforms such as turning angles and climb angles. Furthermore, the polyline paths generated by directly connecting discrete path points are often not smooth and require further processing; the processed paths may also deviate from the optimal solution.
[0072] This application addresses the significant disconnect between energy consumption models and actual flight energy consumption in traditional path planning. For the first time, it distinguishes between four states—level flight, climb, descent, and turn—and employs calibration coefficients to make the planned path's energy consumption more realistic. To overcome the shortcomings of sparrow search algorithms, such as getting trapped in local optima and insufficient convergence accuracy, it integrates a particle swarm optimization speed update mechanism and introduces quasi-oppositional learning, dynamic parameter adjustment, elite local search, and intelligent stagnation detection, significantly improving global optimization capabilities and solution quality. Simulation experiments demonstrate that the path planned in this application has lower energy consumption, smoother path performance, and more reliable obstacle avoidance, allowing more energy to be used for communication or mission payloads. This makes it suitable for various UAV applications such as disaster emergency communication, power line inspection, and logistics delivery (low-altitude economy).
[0073] This application also provides an application scenario in which the above-mentioned UAV 3D path planning method is applied. Specifically, the UAV 3D path planning method provided in this embodiment can be applied in a power line inspection scenario. The power line inspection scenario includes a content production stage, a UAV 3D path planning link, and a power line inspection stage. The request to be processed enters the UAV 3D path planning link from the content production stage, obtains the corresponding final 3D flight path through human-machine collaboration, and then enters the downstream power line inspection stage. The UAV 3D path planning method provided in this embodiment belongs to the UAV 3D path planning link. Specifically, in the process of UAV 3D path planning for a request, a 3D flight environment model can be constructed based on the terrain data and obstacle data of the UAV flight. The UAV flight path is represented by spherical coordinate encoding, and the algorithm search space is determined. A comprehensive cost function including accurate 3D energy consumption cost, obstacle avoidance penalty cost, altitude constraint cost, and path smoothness cost is constructed. The comprehensive cost function is solved using an improved sparrow search algorithm to obtain the optimal spherical coordinate encoded solution. The optimal spherical coordinate encoded solution is converted into path points in the Cartesian coordinate system to obtain the final 3D flight path.
[0074] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 10As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores UAV 3D path planning data. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a UAV 3D path planning method.
[0075] Figure 10 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0076] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0077] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0078] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with relevant regulations and be authorized by the owner of the corresponding device.
[0079] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0080] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0081] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0082] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A three-dimensional path planning method for unmanned aerial vehicles (UAVs), characterized in that, The UAV three-dimensional path planning method includes: A three-dimensional flight environment model is constructed based on terrain and obstacle data from the drone's flight. In the three-dimensional flight environment model, the UAV flight path is represented by spherical coordinate encoding. The three-dimensional path in continuous space is mapped into a discrete vector composed of step size, pitch angle and azimuth angle. The lower limit and upper limit of each encoding parameter are determined to form a search space. The encoding parameters include step size, pitch angle and azimuth angle. Construct a comprehensive cost function; the comprehensive cost function includes precise 3D energy consumption cost, obstacle avoidance penalty cost, height constraint cost, and path smoothness cost; By using the improved sparrow search algorithm, the comprehensive cost function is solved according to the algorithm search space to obtain the optimal spherical coordinate encoded solution. The improved sparrow search algorithm integrates the particle swarm optimization speed update strategy, introduces elite local depth search, and adopts periodic global perturbation and intelligent stagnation detection mechanism to escape local optima. The optimal spherical coordinate encoding solution is converted into path points in the Cartesian coordinate system to obtain the final three-dimensional flight path.
2. The UAV three-dimensional path planning method according to claim 1, characterized in that, The formula for calculating the comprehensive cost function is as follows: ; in, The comprehensive cost function; The cost of precise three-dimensional energy consumption; To avoid the consequences of punishment; This comes at the cost of high constraints; This is the cost of path smoothness; , , , These are the weighting coefficients.
3. The UAV three-dimensional path planning method according to claim 1, characterized in that, The precise three-dimensional energy consumption cost is expressed as follows: ; ; ; ; ; in, The cost of precise three-dimensional energy consumption; Energy consumption during level flight; This refers to the energy consumption coefficient during level flight. This represents the total number of path points. and For the first The x and y coordinates of each path point; and For the first The x and y coordinates of each path point; Energy consumption for climbing; The climbing energy consumption coefficient; This is a function to find the maximum value. and For the first The and the first The absolute height of each path point; To reduce energy consumption; To reduce the energy consumption coefficient; Energy consumption during turning; Energy consumption coefficient for turning; For the first Turning angles at each path point; The penalty for obstacle avoidance is expressed as follows: ; ; in, To avoid the consequences of punishment; The total number of obstacles; This represents the total number of path points. For the first The path segment and the first The obstacle avoidance penalty value for each obstacle; Hard constraint penalties for obstacle avoidance and collision avoidance; For the first The path segment and the first The shortest distance to each obstacle; This refers to the collision distance. To maintain a safe distance; The cost of high constraint is expressed as follows: ; ; in, This comes at the cost of high constraints; For the first The height penalty value for each path point; No. The relative flight altitude of each waypoint; These are the preset minimum and maximum flight altitudes, respectively. The center value of the height interval; It is a hard constraint penalty for highly excessive boundaries; The path smoothness penalty exceeds the path segments where the drone's maximum turning angle and maximum climb angle change.
4. The UAV three-dimensional path planning method according to claim 1, characterized in that, By utilizing an improved sparrow search algorithm and solving the comprehensive cost function based on the algorithm's search space, the optimal spherical coordinate encoded solution is obtained, specifically including: Initialize population parameters; population parameters include population size, maximum number of iterations, upper and lower limits of inertia weight, learning factor range, elite ratio, and stagnation threshold; A quasi-oppositional learning strategy was adopted for population initialization, with the first 50% of individuals being initialized using standard randomization and the last 50% being initialized using quasi-oppositional learning. During the iteration process, the following sub-steps are performed: Calculate the current iteration progress and dynamically adjust the inertia weight and learning factor; The particle swarm optimization velocity update formula is adopted to update the velocity and position of all individuals based on inertia weights and learning factors; Boundary processing is performed on the updated individual positions, the fitness value of the updated individual positions is calculated, and the historical best position and global best position of the individual are updated. Elite Local Depth Search: Fitness values are sorted from smallest to largest, and a Gaussian perturbation local search with dynamic step size is periodically performed on the top 100 elite individuals. Fitness values are sorted from smallest to largest, and a global Gaussian perturbation is periodically applied to the top two preset proportions of individuals. Intelligent Stagnation Detection Mechanism: Calculate the standard deviation of population fitness. When the global optimal fitness value has not improved for a preset number of generations or the standard deviation of population fitness is less than a preset threshold, the fitness values are sorted from largest to smallest, and the top three preset proportions of individuals are reinitialized. After the iteration is complete, the globally optimal position is output as the optimal spherical coordinate encoded solution.
5. The UAV three-dimensional path planning method according to claim 4, characterized in that, The dynamic adjustment formula for inertia weight is expressed as follows: ; in, Inertial weight; and These represent the maximum and minimum values of the inertia weight; The current iteration progress is equal to the current iteration count divided by the maximum iteration count; The dynamic adjustment mechanism of learning factors is as follows; learning factors include cognitive factors. social factors :when When setting the iteration progress value, , ;when When setting the iteration progress value, , .
6. The UAV three-dimensional path planning method according to claim 4, characterized in that, The particle swarm optimization velocity update formula is expressed as follows: ; in, and For the first The individual The speed and position of the next iteration; and For the first The individual The speed and position of the next iteration; Inertial weights; learning factors include cognitive factors. social factors ; A uniformly random number in the interval [0, 1]; For the first The individual The historical best position in the next iteration; For the first The global optimal position in the next iteration.
7. The UAV three-dimensional path planning method according to claim 1, characterized in that, The recursive formula for converting the optimal spherical coordinate encoding solution into path points in Cartesian coordinates is as follows: ; in, , and The first The path points in the Cartesian coordinate system , and coordinate; , and The first The path points in the Cartesian coordinate system , and coordinate; For the first Step size of each path point; For the first The pitch angle of each path point; For the first The azimuth angle of each path point; It is a cosine function; It is a sine function.
8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the UAV three-dimensional path planning method according to any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the UAV three-dimensional path planning method as described in any one of claims 1-7.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the UAV three-dimensional path planning method as described in any one of claims 1-7.