Unmanned aerial vehicle path planning method and device, electronic equipment and readable storage medium
By improving the beaver optimization algorithm and combining it with a path planning method with multiple constraints, the problem of insufficient safety and reliability in UAV path planning is solved, and more efficient and safer path generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JILIN JIANZHU UNIVERSITY
- Filing Date
- 2026-04-01
- Publication Date
- 2026-06-19
AI Technical Summary
Existing UAV path planning methods fail to effectively integrate multiple practical constraints such as energy, altitude, and turning angle, resulting in generated paths that are infeasible or pose safety risks in practice. Furthermore, existing algorithms struggle to adaptively balance exploration and development capabilities.
An improved beaver optimization algorithm is adopted. By initializing the population, dynamically assigning roles and exchanging information, and combining a preset cost function with path length, turning angle, threat avoidance and altitude constraints, the individual positions are dynamically updated to generate safe and feasible flight paths.
It improves global search capabilities and convergence efficiency, enhances path optimization performance in complex environments, improves flight safety and terrain adaptability, enhances local optimal escape capabilities and solution quality, and improves the overall performance and reliability of UAV path planning.
Smart Images

Figure CN121977576B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of unmanned aerial vehicle (UAV) control technology, and in particular to a UAV path planning method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] In the field of autonomous path planning for unmanned aerial vehicles (UAVs), existing technologies mainly rely on intelligent optimization algorithms such as genetic algorithms and particle swarm optimization to search for the optimal path by constructing a cost function that includes basic factors such as distance and obstacle threats. However, these methods typically only consider path length and static obstacles, ignoring various physical and safety constraints that UAVs must adhere to during actual flight, such as energy, altitude, and turning angle. This can lead to generated paths that may be infeasible or pose safety risks in practice.
[0003] In existing technologies, one approach is to use multiple constraints as post-hoc verification conditions, but this method may cause the planned path to fail due to non-compliance with constraints. Another approach is to try to assign weights to different constraints and integrate them into a cost function, but improper weight settings can cause the algorithm to favor a single objective and sacrifice other key performance aspects. Other research focuses on improving the mechanism of the optimization algorithm itself, such as adjusting the role allocation strategy to balance exploration and development, but static or simple strategies are difficult to adapt to the dynamic needs of different stages of the optimization process, and the weak information exchange between roles affects search efficiency and collaboration.
[0004] Therefore, existing technologies still struggle to adaptively and deeply integrate multiple practical constraints such as travel distance, altitude, turning angle, and threat avoidance during path planning, and to achieve a dynamic balance between algorithm exploration and development capabilities, in order to address the shortcomings in the safety, economy, and reliability of drone flight paths generated by existing technologies. Summary of the Invention
[0005] In view of this, embodiments of this application provide a method, apparatus, electronic device, and readable storage medium for planning unmanned aerial vehicle (UAV) paths, in order to solve the problems of insufficient safety, economy, and reliability of UAV flight paths generated in the prior art.
[0006] A first aspect of this application provides a method for unmanned aerial vehicle (UAV) path planning, comprising: acquiring environmental information of a task area and constraint parameters of the UAV, wherein the constraint parameters include a maximum safe flight distance, a minimum flight altitude, and a maximum flight altitude; initializing a population of an improved beaver optimization algorithm, wherein each individual in the population represents a candidate flight path composed of multiple path point coordinates; determining a fitness value for each individual in the population based on a preset cost function, wherein the preset cost function is determined based on path length, turning angle, threat avoidance, and altitude constraints; dynamically assigning a role to each individual in the population based on the fitness value, updating the individual's position according to the assigned role using a corresponding update strategy, and performing information exchange between roles during the update process, wherein roles include explorer individuals, developer individuals, and guardian individuals; and determining the individual with the lowest fitness value from the iteratively updated population based on a preset termination condition, and outputting the path point sequence represented by the individual as the planned UAV flight path.
[0007] A second aspect of this application provides a drone path planning device, comprising: an acquisition module for acquiring environmental information of a task area and constraint parameters of the drone, wherein the constraint parameters include a maximum safe flight distance, a minimum flight altitude, and a maximum flight altitude; an initialization module for initializing a population of improved beaver optimization algorithms, wherein each individual in the population represents a candidate flight path composed of multiple path point coordinates; a fitness determination module for determining a fitness value for each individual in the population based on a preset cost function, wherein the preset cost function is determined based on path length, turning angle, threat avoidance, and altitude constraints; an iterative optimization module for dynamically assigning a role to each individual in the population based on the fitness value, updating the individual's position according to the assigned role using a corresponding update strategy, and performing information exchange between roles during the update process, wherein roles include explorer individuals, developer individuals, and guardian individuals; and an output module for determining the individual with the lowest fitness value from the iteratively updated population based on a preset termination condition, and outputting the path point sequence represented by the individual as the planned drone flight path.
[0008] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0009] A fourth aspect of this application provides a readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0010] Compared with the prior art, the embodiments of this application have the following advantages: improved global search capability and convergence efficiency, enhanced path optimization performance in complex environments, improved population diversity and adaptability, enhanced local optimal escape capability and solution quality, improved flight safety and terrain adaptability, and improved overall performance and reliability of UAV path planning.
[0011] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced 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.
[0013] Figure 1 This is a schematic diagram illustrating an application scenario of this application embodiment;
[0014] Figure 2 This is a flowchart illustrating a UAV path planning method provided in an embodiment of this application;
[0015] Figure 3 This is a flowchart illustrating another UAV path planning method provided in an embodiment of this application;
[0016] Figures 4(a) and 4(b) are schematic diagrams of a drone flight process provided in an embodiment of this application;
[0017] Figures 5(a) and 5(b) are schematic diagrams of two different perspective views of an obstacle threat environment 1 provided in an embodiment of this application;
[0018] Figures 6(a) and 6(b) are schematic diagrams of two different perspective views of an obstacle threat environment 2 provided in an embodiment of this application;
[0019] Figure 7(a) and Figure 7(b) are schematic diagrams of an obstacle avoidance route generated in environment 1 according to an embodiment of this application;
[0020] Figures 7(c) and 7(d) are schematic diagrams of the path after arc transition based on the path generated by IBBO;
[0021] Figures 8(a) and 8(b) are schematic diagrams of an obstacle avoidance route in an obstacle environment 2 provided in an embodiment of this application;
[0022] Figures 8(c) and 8(d) show the paths after circular transition based on the IBBO generated paths;
[0023] Figure 9 This is a schematic diagram of the structure of a drone path planning device provided in an embodiment of this application;
[0024] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0025] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0026] The following detailed description, in conjunction with the accompanying drawings, describes a method, apparatus, electronic device, and readable storage medium for unmanned aerial vehicle (UAV) path planning according to embodiments of this application.
[0027] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this application. The application scenario may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a server 104, and a network 105.
[0028] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be hardware or software. When the first terminal device 101, the second terminal device 102, and the third terminal device 103 are hardware, they can be various electronic devices with displays and supporting communication with the server 104, including but not limited to smartphones, tablets, laptops, and desktop computers. When the first terminal device 101, the second terminal device 102, and the third terminal device 103 are software, they can be installed on the aforementioned electronic devices. The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be implemented as multiple software programs or software modules, or as a single software program or software module; this application embodiment does not impose any limitations on this. Furthermore, various applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as data processing applications, instant messaging tools, social platform software, search applications, shopping applications, etc.
[0029] Server 104 can be a server that provides various services, such as a backend server that receives requests sent by terminal devices with which it has established communication connections. This backend server can receive and analyze the requests sent by the terminal devices and generate processing results. Server 104 can be a single server, a server cluster consisting of several servers, or a cloud computing service center. This application embodiment does not limit this.
[0030] It should be noted that the server 104 can be either hardware or software. When the server 104 is hardware, it can be various electronic devices that provide various services to the first terminal device 101, the second terminal device 102, and the third terminal device 103. When the server 104 is software, it can be multiple software programs or software modules that provide various services to the first terminal device 101, the second terminal device 102, and the third terminal device 103, or it can be a single software program or software module that provides various services to the first terminal device 101, the second terminal device 102, and the third terminal device 103. This application embodiment does not impose any limitations on this.
[0031] Network 105 can be a wired network using coaxial cable, twisted pair, and fiber optic connection, or it can be a wireless network that enables interconnection of various communication devices without wiring, such as Bluetooth, Near Field Communication (NFC), and Infrared. This application embodiment does not limit this.
[0032] Users can establish a communication connection with the server 104 via the network 105 through the first terminal device 101, the second terminal device 102 and the third terminal device 103 to receive or send information, etc.
[0033] It should be noted that the specific types, quantities and combinations of the first terminal device 101, the second terminal device 102, the third terminal device 103, the server 104 and the network 105 can be adjusted according to the actual needs of the application scenario, and this application embodiment does not limit this.
[0034] It should be noted that the acquisition, storage, use, and processing of data in this application embodiment all comply with the relevant provisions of national laws and regulations.
[0035] Furthermore, it should be noted that in the embodiments of this application, certain software, components, models, and other existing solutions in the industry may be mentioned. These should be considered as exemplary, and their purpose is only to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0036] Figure 2This is a flowchart illustrating a drone path planning method provided in an embodiment of this application. Figure 2 The drone path planning method can be derived from Figure 1 The server executes the command. For example... Figure 2 As shown, the UAV path planning method includes:
[0037] Step S201: Obtain environmental information of the mission area and constraint parameters of the UAV, including the maximum safe flight distance, minimum flight altitude, and maximum flight altitude.
[0038] Specifically, the environmental information of the mission area can be a set of relevant data within the physical space of the UAV's planned flight mission, to ensure that the planned path can adapt to the actual terrain and avoid known hazards. It can be used to characterize the terrain undulations and threat distribution of the mission area. The environmental information can include terrain elevation data and threat area location data. Threat area location data can be geographical location information that identifies obstacles, no-fly zones or other hazards within the mission area. Threat area location data can be used to calculate threat costs, guide the planning algorithm to generate flight paths that avoid these areas, and ensure flight safety. This threat area location data can be obtained through pre-labeling, real-time sensing or import from the airspace management system, and can be used to define the spatial range that must be avoided in path planning.
[0039] The constraint parameters of the UAV can serve as a direct basis for cost function construction and path evaluation, ensuring that the generated path is physically executable and complies with safety specifications. They provide a clear search boundary for the optimization algorithm. The constraint parameters can specifically include the maximum safe flight distance, minimum flight altitude, and maximum flight altitude.
[0040] Furthermore, the specific methods for obtaining environmental information can be by reading pre-stored digital map files, which may include raster-format elevation data and vector-format threat area polygon data; the specific methods for obtaining constraint parameters can be by loading them from the configuration file of the UAV flight control system, or by having the operator manually input them in the mission planning interface.
[0041] This application's embodiments improve the adaptability of path planning to real terrain and threat distribution by acquiring environmental information including terrain elevation and threat area location, thereby enhancing obstacle avoidance performance and flight safety in complex terrain. By acquiring constraint parameters including maximum safe flight distance, minimum flight altitude, and maximum flight altitude, the application improves the compliance of path planning with UAV physical limitations and regulatory requirements, ensuring the feasibility and compliance of the generated path. This ensures that the planning is based on reliable data that matches the actual aircraft capabilities and adapts to external environmental constraints from the initial planning stage, providing necessary data support for generating safe, feasible, and optimized flight paths.
[0042] Step S202: Initialize the population of the improved beaver optimization algorithm, where each individual in the population represents a candidate flight path consisting of multiple path point coordinates.
[0043] Specifically, the population of the improved beaver optimization algorithm can be a set containing multiple candidate solutions based on the improved beaver optimization algorithm. It can be used to explore possible flight paths in parallel in the search space. The population of the improved beaver optimization algorithm can be the set of basic objects for iterative optimization of the beaver optimization algorithm. The population of the improved beaver optimization algorithm can be used to carry and evolve different path schemes. Through competition, cooperation and information exchange among individuals, it gradually approaches the optimal or near-optimal flight path that satisfies multiple constraints. The population of the improved beaver optimization algorithm can be obtained by the processor randomly generating an initial set of candidate solutions in the solution space of the path planning problem or based on specific rules according to a preset population size parameter.
[0044] Each individual in the population of the improved Beaver Optimization Algorithm can be a member of the population, i.e., a specific candidate solution. This individual can be the basic unit constituting the population and can be used to represent a complete flight path scheme from the start point to the end point. This individual can be used to specifically carry path information, and its quality is evaluated by the fitness function and continuously improved through the algorithm update strategy. This individual can be formed by the processor randomly generating a series of path point coordinates for each individual during the initialization phase. The path point coordinates can be the key parameters for defining the flight path, and can usually be represented in the form of three-dimensional coordinates (x, y, z), where x and y can represent the horizontal position and z can represent the flight altitude. The path point coordinates can be a series of discrete spatial position points that constitute the flight path trajectory. The path point coordinates can be used to represent the flight trajectory of the UAV. Connecting adjacent path points constitutes the flight segment and can be the basis for calculating all costs such as path length, turning angle, altitude, and threat avoidance. The path point coordinates can be obtained by the processor randomly generating values within the coordinate range for each path point within the search space boundary defined by the task area during individual initialization.
[0045] A candidate flight path can be a complete flight trajectory proposal from the starting point to the ending point, which is formed by connecting a series of ordered path point coordinates. This candidate flight path can be a potential flight route to be evaluated and optimized. The candidate flight path can be the direct optimization object of the optimization algorithm. Its quality is quantitatively evaluated by a comprehensive cost function. The algorithm improves the quality of all candidate flight paths in the population through iteration to obtain the best one. This candidate flight path can be obtained by connecting the path point coordinates contained in the initialized individuals in sequence to form a broken line trajectory that starts from the starting point coordinates, passes through intermediate path points, and finally reaches the ending point coordinates.
[0046] Furthermore, relevant parameters for the UAV path planning task can be obtained, including the starting coordinates, ending coordinates, spatial boundaries of the task area, maximum safe flight distance, flight altitude constraint range, and location information of the threat area. An initial population of N individuals can be generated based on the preset population size N of the improved beaver optimization algorithm. For each individual in the population of the improved beaver optimization algorithm, the number M of path points required for the candidate flight path represented by that individual can be determined; M can be a fixed value or randomly determined within a preset range. Coordinate values can be generated for each of the M path points in its corresponding search dimension. For the x and y coordinates representing horizontal position, their generation range can be determined by the horizontal boundaries of the task area map; for the z coordinate representing flight altitude, its generation range can be determined by the minimum value H of the flight altitude constraint. min and maximum value H max The coordinates of the start and end points are fixed and not used as randomly generated variables. Therefore, for each individual, the coordinates of M-2 intermediate path points are actually randomly generated. Connecting these coordinates with the start and end points in order forms a complete candidate flight path. All N individuals are generated in this way, which together form the initial population of the improved beaver optimization algorithm.
[0047] For example, in mountain supply delivery, it is necessary to plan flight paths for drones performing the task. A digital map containing mountain terrain elevation and known no-fly zone information can be loaded. The starting point of the drone can be set as the coordinates of a supply station located in a valley, and the ending point can be set as the coordinates of the target camp on a ridge. An improved beaver optimization algorithm population can be initialized, and the population size can be set to 50. For each individual in the population, it can be determined that it represents a flight path consisting of 10 waypoints (including the starting point and the ending point). The three-dimensional coordinates of 8 intermediate waypoints can be randomly generated for each individual: the horizontal coordinates can be randomly selected within the latitude and longitude boundaries of the task map. By connecting these 8 intermediate point coordinates with the fixed starting point and ending point coordinates in sequence, 50 different initial candidate flight paths from the supply station to the target camp can be formed.
[0048] This application embodiment initializes a population of improved beaver optimization algorithms consisting of multiple individuals, with each individual explicitly represented as a candidate flight path defined by specific path point coordinates. This improves the directness and explicitness of the optimization algorithm's operational objects, enhances the global search capability of the improved beaver optimization algorithm in a diverse solution space, avoids the limitations of a single initial solution, increases the probability of finding high-quality flight paths that satisfy complex constraints, and lays the foundation for subsequent iterative optimization based on the improved beaver optimization algorithm.
[0049] Step S203: Determine the fitness value for each individual in the population based on a preset cost function, wherein the preset cost function is determined based on path length, turning angle, threat avoidance, and height constraints.
[0050] Specifically, the preset cost function can be a comprehensive evaluation function used to calculate the total cost of a given flight path. This preset cost function can be obtained by weighted summation of path length cost, turning angle cost, threat avoidance cost, and altitude constraint cost. The fitness value can be a numerical index used to quantify the quality of the path represented by an individual. The smaller the fitness value, the better the overall performance of the path. The fitness value can be used to guide the search direction of improving the beaver optimization algorithm and gradually improve the overall quality of the population through a survival-of-the-fittest mechanism.
[0051] Furthermore, by traversing each individual in the population, extracting its represented path point sequence, calculating the path length, evaluating the angle at each turn, detecting the distance between each flight segment and the threat area, and verifying whether the altitude of each flight segment point meets the constraints, the evaluation results can be converted into corresponding cost components according to preset rules, and then weighted and summed according to preset weight coefficients to obtain the comprehensive cost of the individual's path. The weight coefficients can reflect the relative importance of different constraints in the overall optimization objective and can be adjusted according to specific task requirements. The calculated comprehensive cost can be transformed into the fitness value of the individual through mathematical transformation, completing the fitness evaluation of all individuals in the population.
[0052] This application embodiment determines the fitness value for each individual in the population based on a preset cost function that integrates path length, turning angle, threat avoidance, and altitude constraints. This improves the comprehensiveness of the path evaluation criteria and its closeness to actual flight requirements, enhances the algorithm's comprehensive optimization capabilities for flight distance, trajectory smoothness, threat avoidance, and altitude compliance, and improves the safety and feasibility of path planning. By integrating threat avoidance costs, penalties are imposed on behaviors that approach or cross dangerous areas during the path evaluation stage, improving the safety of the final planned path and ensuring that the algorithm prioritizes paths with compliant flight altitudes during the optimization process.
[0053] Step S204: Based on the fitness value, dynamically assign a role to each individual in the population, update the position of the individual according to the assigned role using the corresponding update strategy, and perform information exchange between roles during the update process.
[0054] The roles include Explorer, Developer, and Guardian.
[0055] Specifically, dynamic role allocation is an adaptive task allocation mechanism that determines the specific role each individual in the population plays in the current iteration based on its fitness value. This dynamic role allocation can be used to adaptively adjust the proportion of various roles and individual affiliation in the population according to different stages of the optimization process, so as to balance global search and local optimization capabilities. This dynamic role allocation can normalize the fitness value, calculate the preference probability of each individual becoming an explorer, developer, or guardian, and use the role allocation probability (Softmax) function combined with a temperature parameter that decays with the number of iterations to transform the preference probability into a specific role allocation probability, and determine the target role for each individual according to the target role proportion of the current iteration.
[0056] The target proportion of each role in each iteration is:
[0057] ; ; ;
[0058] in, This represents the proportion of individual explorers targeting the target at the t-th iteration. This represents the target proportion of individual developers at the t-th iteration. This represents the target proportion of individual guardians at the t-th iteration, where t represents the current iteration number. This indicates the maximum number of iterations.
[0059] Explorers can be a role type that focuses on extensive global exploration in the solution space to discover new areas for future exploration. This type of explorer can be used to perform large-scale searches.
[0060] Its basic exploratory behavior can be represented as: ;
[0061] in, It is the exploration coefficient t represents the current iteration number. Indicates the maximum number of iterations. It is a Gaussian random vector. Randomly selected individual states, Stochastic guiding coefficient, This represents the individual state of the i-th explorer.
[0062] Individual explorers have a high probability of executing a Levi flight during the exploration process to perform a large-scale search. The process of executing a Levi flight can be represented as follows: .
[0063] in, This represents the probability that an individual explorer will perform a Levy flight in the current iteration, where t represents the current iteration number. This indicates the maximum number of iterations.
[0064] During Levi's flight, the Levi flight step size can be: .
[0065] in, This represents the step size vector when the i-th individual performs Levy's flight. Denotes the generating function of the Lévy distribution. The characteristic index of the Lévy distribution is used to control the heavy-tailed property of the step size distribution. Representing dimension, This represents element-wise multiplication. It is a Gaussian random vector.
[0066] The location update of an individual explorer is represented by the following formula:
[0067] ; ;
[0068] in, Let represent the updated position vector of the i-th individual. This represents a random number used to determine whether to execute Levi's Flight. This represents the scaling factor for the Levi flight step size, used to control the size of the Levi flight step size.
[0069] Furthermore, the developer can be a role type that focuses on fine-grained local development near discovered high-quality solutions to improve solution quality. This developer can be used to deepen the mining of high-quality regions, and can be used to drive the developer to learn from known elite individuals, conduct small-step local random searches, or move closer to its own historical best position.
[0070] The guardian individual can be a role type that focuses on maintaining population diversity by introducing perturbations or restarting to prevent the algorithm from converging to a local optimum too early. The guardian individual can be used to inject new mutations into the population to avoid search stagnation. The guardian individual can update its position by adopting an update strategy that selects to perform diversity perturbation, move to a high diversity region, or explore the search space boundary with a certain probability. The intensity of diversity perturbation can be adaptively adjusted according to the relationship between the current population diversity and the initial diversity. It can be used to inject new mutations into the population by performing diversity perturbation, exploring the search space boundary, or restarting stagnant individuals when the population diversity decreases.
[0071] Information exchange can be a knowledge-sharing mechanism that transmits valuable search information between individuals with different roles during the individual's position update process. This information exchange can be used to accelerate the convergence process of the algorithm and improve the quality of the solution. Information exchange can also be used to guide the search direction through information sharing.
[0072] Furthermore, based on the dynamically assigned role results, a corresponding update strategy can be executed for each individual to calculate and generate a new sequence of path point coordinates for the path represented by that individual, thereby driving the population to evolve towards a better path solution. During the update process, information can be collected and exchanged in real time among explorer individuals, developer individuals, and guardian individuals to achieve effective sharing of population knowledge.
[0073] For example, in mountainous supply delivery, based on the fitness value of each individual in the current iteration, individuals with moderate and dispersed fitness values can be assigned the role of explorer individuals, enabling them to conduct a global search in the vast airspace of the mountains using an update strategy that includes the Levy flight term. Individuals with low fitness values located near potentially high-quality areas can be assigned the role of developer individuals, enabling them to finely optimize paths near discovered low-threat valley passages using an adaptive step-size local search strategy. Individuals with high fitness values or those that have not improved for a long time can be assigned the role of guardian individuals, enabling them to explore new possible paths at the boundaries of the search space using a diversity perturbation strategy. In each iteration, the positions of all optimal explorer individuals are calculated and passed to developer individuals as information for future exploration areas, guiding them to concentrate their search on low-threat valley areas. At the same time, the positions of the top 20% of fitness values among developer individuals can be selected and passed to guardian individuals as local optimum information, warning them to avoid over-exploited local optimum areas, thus accelerating convergence while maintaining population diversity.
[0074] This application's embodiments dynamically assign roles based on fitness values, improving the algorithm's ability to adaptively adjust search strategies according to the optimization process and enhancing the balance between global search and local optimization. By adopting differentiated update strategies corresponding to roles, the efficiency of various roles in performing specific functions is improved. By performing information exchange between roles during the update process, population cooperation and knowledge sharing are enhanced, search efficiency is improved, convergence speed is accelerated, and it helps to find flight paths with better overall performance.
[0075] Step S205: Based on the preset termination condition, determine the individual with the lowest fitness value from the iteratively updated population, and output the path point sequence represented by the individual as the planned UAV flight path.
[0076] Specifically, the preset termination condition can be a criterion used to determine when the algorithm stops iterating, so as to obtain the current optimal solution under the condition of limited computing resources. The preset termination condition can be a pre-set maximum number of iterations, a fitness value convergence threshold, or a computing time limit. The population after iteration can be a set of candidate solutions after multiple rounds of role assignment, position update, and information exchange.
[0077] The individual with the lowest fitness value can be the candidate solution with the best overall performance in the current population. This individual with the lowest fitness value can be used to represent the currently found optimal flight path scheme. This individual with the lowest fitness value can be determined by comparing the fitness values of all individuals in the population and selecting the individual corresponding to the minimum value. The path point sequence can be a series of ordered spatial coordinate points that constitute a flight path. This path point sequence can be used to characterize the continuous flight trajectory from the starting point to the ending point, providing the three-dimensional position point set required for UAV navigation, so as to plan the UAV flight path and guide the UAV flight control system to complete the actual flight mission.
[0078] Furthermore, during continuous monitoring and iteration, it is possible to determine in real time whether the preset termination conditions are met. When the termination conditions are met, the algorithm's iteration loop can be stopped immediately. The entire population after the current iteration update can be scanned to read the fitness value stored in each individual. By comparing the fitness values of all individuals, the individual with the smallest value can be identified, and the path point sequence corresponding to that individual, i.e., the trajectory formed by connecting the coordinate points it represents, can be extracted as the flight path of the UAV after the target planning is completed. This path can then be directly loaded and executed by the UAV's flight control system.
[0079] For example, in mountainous material delivery, a preset termination condition can be set as a maximum of 200 iterations or a change in the optimal fitness value of less than 0.1% over 50 consecutive generations. During the operation of the improved beaver optimization algorithm, the convergence of the current iteration count and the optimal fitness value of the population can be continuously monitored. When the algorithm reaches the 180th generation, if it detects that the change in the optimal fitness value of less than 0.1% over 50 consecutive generations, the preset termination condition can be met, and iteration can be stopped immediately. All 50 individuals in the current population can be scanned, and the fitness value of the path represented by each individual can be read. By comparison, the individual with the lowest fitness value is determined as the optimal individual. The path point sequence represented by this optimal individual can be extracted. This sequence can contain 10 three-dimensional coordinate points from the starting point of the valley supply station to the target camp on the ridge, and output as a planned UAV flight path to guide the UAV to complete the material delivery task along this path.
[0080] This application embodiment improves the utilization efficiency of computing resources by controlling the algorithm iteration through preset termination conditions; enhances the reliability of path planning results by determining the individual with the lowest fitness value from the iteratively updated population; and improves the practicality and safety of the planning results by outputting the path point sequence of the optimal individual as the planned UAV flight path, so that the output path meets multiple constraints such as travel distance, altitude, turning angle and threat avoidance, providing the UAV flight control system with a safe, feasible and optimized flight guide that can be directly executed.
[0081] According to the technical solution provided in this application, environmental information of the task area and constraint parameters of the UAV are obtained to form the input conditions for path planning. Based on this, an improved beaver optimization algorithm population is initialized. Each individual in the population represents a candidate flight path composed of multiple path point coordinates, forming an initial solution space. A fitness value is determined for each individual in the population based on a preset cost function to achieve a comprehensive evaluation of the candidate paths. Based on the fitness value, each individual in the population is dynamically assigned a role. The position of the individual is updated according to the assigned role using a corresponding update strategy. During the update process, information exchange is performed between explorer individuals, developer individuals, and guardian individuals. The population is continuously evolved through iterative optimization. Based on a preset termination condition, the individual with the lowest fitness value is determined from the iteratively updated population, and the path point sequence represented by this individual is output as the planned UAV flight path. This improves the global search capability and convergence efficiency, enhances the path optimization performance in complex environments, improves population diversity and adaptability, enhances the ability to escape local optima and the quality of solutions, improves flight safety and terrain adaptability, and improves the overall performance and reliability of UAV path planning.
[0082] In some embodiments, a role is dynamically assigned to each individual in the population based on fitness values, including: normalizing the fitness value of each individual to obtain a normalized fitness value; determining the preference probability of each individual becoming an explorer, developer, or guardian based on the current iteration number and the normalized fitness value; determining the specific probability of each individual being assigned as an explorer, developer, or guardian based on a role assignment function using a temperature parameter that decays with the iteration number and the preference probability; and determining the role of each individual in the current iteration based on the specific probability and the target role ratio of the current iteration number.
[0083] Specifically, the normalized fitness value can be the value obtained by normalizing the fitness value of each individual. This normalized fitness value can be used to map the original fitness value to a specific interval (such as [0,1]) to eliminate the influence of dimensions. The normalized fitness value can be obtained by transforming the original fitness value through linear scaling or min-max normalization methods.
[0084] The preference probability can be a preliminary probability determined based on the current iteration number and normalized fitness value, representing the tendency of each individual to be assigned to a certain role. It is used to characterize the functional tendency of individuals in the optimization search. The preference probability of explorers can be used to assign individuals with medium fitness values to encourage them to explore new areas. The preference probability of developers can be used to assign individuals with low fitness values to encourage them to perform local fine-grained searches. The preference probability of guardians can be used to assign individuals with high fitness values to maintain population diversity. This preference probability can be calculated based on a Gaussian distribution function, and its center parameter and width parameter can be dynamically adjusted according to the current iteration number, so that the preference probability distribution of explorers is wider in the early stage of iteration to encourage exploration, and the preference probability distribution of developers is more concentrated in the later stage of iteration to encourage development.
[0085] The temperature parameter can be a control parameter that decays with the number of iterations. It is used to maintain the randomness of role allocation in the early stage of the iteration to promote exploration, and to enhance the determinism of role allocation in the later stage of the iteration to promote development. The specific probability is the specific probability that each individual is assigned to an explorer, developer, or guardian individual, determined by the role allocation probability function based on the temperature parameter and preference probability that decay with the number of iterations. It is used to comprehensively consider the individual fitness level and the characteristics of the optimization stage, and to provide a precise quantitative basis for role allocation.
[0086] The target role ratio can be a preset proportion of the three roles in the population expected in each iteration, used to guide the dynamic balance of the population role composition. The proportion of explorer individuals can decrease with the number of iterations to reflect the need to transition from global exploration to local development, while the proportion of developer individuals can increase with the number of iterations to reflect the need for fine-grained search in the later stages of optimization. The proportion of guardian individuals can be dynamically adjusted according to the proportion of explorer and developer individuals to ensure that the overall role ratio of the population conforms to the preset strategy and maintains the necessary diversity. This target role ratio can be preset according to the optimization process stage and called through the current iteration number index.
[0087] The fitness value of each individual can be normalized to obtain a normalized fitness value. Based on the current iteration number and the normalized fitness value, the preference probability of each individual becoming an explorer, developer, or guardian can be determined. That is, based on the Gaussian distribution function, the center parameter and width parameter are dynamically adjusted according to the current iteration number to calculate the preference probability of each individual as an explorer, developer, or guardian. Based on the temperature parameter that decays with the iteration number and the preference probability, the specific probability of each individual being assigned as an explorer, developer, or guardian can be determined through the role assignment probability function. The preference probability vector is scaled by the temperature parameter to calculate the specific probability of each individual becoming one of the three roles.
[0088] Based on the specific probability and the target role ratio of the current iteration number, the role of each individual in this iteration is determined: it can be randomly assigned according to the specific probability, and then the actual number of each role is counted. If there is a deviation between the actual ratio and the target ratio, it can be fine-tuned by adjusting the roles of a few marginal individuals to make the actual role ratio close to the target role ratio.
[0089] The normalization process can be expressed as: ;
[0090] in, This represents the normalized fitness value of the i-th individual. The initial fitness value of the i-th individual, This represents the minimum initial fitness value of all individuals in the current population. This represents the maximum initial fitness value of all individuals in the current population. Indicates a minimum value (to prevent division by zero).
[0091] Furthermore, the individual explorer's preference probability can be determined by the individual explorer's preference function, which can be expressed as: ;
[0092] ;
[0093] in, Let represent the probability that the i-th individual is assigned the preference of the explorer individual in the t-th iteration. Let t represent the normalized fitness value of the i-th individual, and t represent the current iteration number. This represents the dynamic mean of the explorer's individual preference function. This represents the dynamic standard deviation of the explorer's individual preference function. This indicates the maximum number of iterations for the algorithm.
[0094] The individual developer's preference probability can be determined by the individual developer preference function, which can be expressed as: ;
[0095] ;
[0096] in, This represents the probability that the i-th individual is assigned the preference of the developer individual in the t-th iteration. This represents the dynamic mean of the individual developer's preference function. This represents the dynamic standard deviation of the developer's individual preference function.
[0097] The preference probability of an individual guardian can be determined by the individual guardian preference function, which can be expressed as: ;
[0098] ;
[0099] in, Let represent the probability that the i-th individual is assigned to be a guardian individual in the t-th iteration. Let be the dynamic mean of the individual preference function of the guards. This represents the dynamic standard deviation of the individual preference function of the guardian.
[0100] According to the technical solution provided in the embodiments of this application, by normalizing the fitness value of each individual, the comparability of fitness values and the accuracy of probability calculation are improved. By determining the preference probability based on the current iteration number and the normalized fitness value, the adaptability of role allocation to individual performance and optimization stage is enhanced. By determining the specific probability based on the temperature parameter that decays with the iteration number and the preference probability, the smooth transition capability of role allocation from initial random exploration to later deterministic development is improved. By determining the role for each individual based on the specific probability and the target role ratio of the current iteration number, the matching degree between the population role composition and the needs of the optimization stage is enhanced, a dynamic balance between exploration and development capabilities is achieved, and the efficiency and accuracy of the algorithm in searching for high-quality paths that satisfy multiple constraints in UAV path planning are improved.
[0101] In some embodiments, updating the position of an individual according to the assigned role using a corresponding update strategy includes: for a developer individual, determining the learning parameters of the elite individuals based on a weighted sum of the differences between the positions of multiple elite individuals and the current developer individual's position, wherein the elite individuals are a preset number of individuals in the current population whose fitness values rank within a preset proportion range; adaptively determining the covariance matrix of a multivariate Gaussian distribution based on the current developer individual's fitness value, the best fitness value of the population, the worst fitness value of the population, and the current iteration number; sampling a random vector based on the multivariate Gaussian distribution corresponding to the covariance matrix to determine the local fine-grained random search parameters; determining the learning parameters of the developer individual's own historical best position based on the difference between the current developer individual's historical best position and its current position; and jointly determining the position update amount based on the elite individual learning parameters, the local fine-grained random search parameters, and the developer individual's own historical best position learning parameters.
[0102] Specifically, for individual developers, the K individuals with the lowest fitness values in the current population can be selected as the set of elite individuals. The learning parameters of the elite individuals are determined by weighted summation of the differences between the positions of multiple elite individuals and the current developer individual. That is, the vector difference between the position of each elite individual and the position of the current developer individual can be calculated, and the vector difference can be multiplied by the corresponding elite individual learning weight and then summed.
[0103] Among them, the position of elite individuals can represent the region of better solutions that have been found in the current search space. Elite individuals can be used to provide developers with a reference for learning towards the region of better solutions. The learning parameters of elite individuals can be used to guide developers to move closer to the region of better solutions represented by individuals that perform well in the population, thereby accelerating local convergence.
[0104] Based on the fitness value of the current developer, the best fitness value of the population, the worst fitness value of the population, and the current iteration number, the covariance matrix of the multivariate Gaussian distribution is adaptively determined. That is, a dynamic step size scaling factor can be calculated, which is proportional to the ratio of the difference between the fitness value of the current developer and the best fitness value of the population to the difference between the worst fitness value and the best fitness value of the population, and proportional to the exponential decay factor of the current iteration number. The preset initial step size coefficient can be multiplied by this scaling factor to obtain the search step size variance of each dimension, and a diagonal covariance matrix can be constructed based on this.
[0105] The parameters for local fine-grained random search are determined by using a multivariate Gaussian distribution random vector. This means that random vectors can be sampled from a multivariate Gaussian distribution with a mean of zero and a covariance matrix. The covariance matrix of the multivariate Gaussian distribution can be a symmetric positive definite matrix adaptively determined based on the fitness value of the current developer, the best fitness value of the population, the worst fitness value of the population, and the current iteration number. It can be used to control the step size and direction of the local search, that is, to dynamically adjust the search granularity according to individual performance and iteration progress, so as to achieve a balance between coarse-grained exploration and fine-grained mining.
[0106] Local fine-grained random search parameters can be parameter terms determined based on multivariate Gaussian distributed random vectors. They are used to provide developers with a controllable and fine-grained random exploration mechanism near their current position to explore the potential of local optima.
[0107] The developer determines its own historical best position learning parameters based on the difference between its current historical best position and its current position. These parameters can be parameters determined based on the difference between the developer's current historical best position and its current position. They are used to enable the developer to retain and utilize its own best experiences, preventing the developer from forgetting the high-quality solutions found during the local search process.
[0108] The historical best position can be the position with the lowest fitness value that an individual developer has reached in all previous iterations. It is used to represent the individual's best search experience and maintain the stability of the solution during the development process.
[0109] The position update amount can be jointly determined based on the learning parameters of elite individuals, the local fine-grained random search parameters, and the learning parameters of its own historical best position. It represents the position adjustment amount of the developer individual and is used to comprehensively guide the developer individual to learn from elite individuals, conduct local random exploration, and return to its own historical best, so as to realize the efficient search of the developer individual role in local development.
[0110] This application's embodiments determine elite individual learning parameters by weighted summation of the differences between the positions of multiple elite individuals and the current developer individual's position. This improves the targeting and convergence speed of the developer individual's learning towards high-quality solution regions. By determining the covariance matrix of a multivariate Gaussian distribution, it enhances the flexibility of local search granularity adjustment and adaptability to the optimization stage. By determining local fine-grained random search parameters based on a multivariate Gaussian distributed random vector, it enhances the randomness and fineness of local exploration. By determining its own historical best position learning parameters based on the difference between the current developer individual's historical best position and its current position, it improves the stability of the development process and the ability to retain its best experience. By jointly determining the position update amount based on elite individual learning parameters, local fine-grained random search parameters, and its own historical best position learning parameters, it improves the search efficiency and solution quality of the developer individual role in local development.
[0111] In some embodiments, the position of an individual is updated using a corresponding update strategy based on the assigned role, including: for a guardian individual, determining the population diversity missing degree based on the relationship between the current population diversity and the initial population diversity, and determining a diversity perturbation term based on the population diversity missing degree and a random direction vector; identifying highly diverse individuals based on the degree of deviation between the individual's position and the population center position, and determining a suboptimal region exploration term based on the difference between the current guardian individual's position and the position of highly diverse individuals; determining an edge exploration term based on the vector between the current guardian individual's position and the nearest boundary of the search space; and updating the guardian individual's position by selecting a combination of the diversity perturbation term and the suboptimal region exploration term, the edge exploration term, or a random restart operation based on a preset probability.
[0112] Specifically, before updating the location of individual guardians, the population diversity missing degree is calculated. The population diversity missing degree is an adaptive adjustment parameter determined based on the relationship between the current population diversity and the initial population diversity. The magnitude of the population diversity missing degree is positively correlated with the degree of population aggregation in the solution space. That is, the more aggregated the population is, the less the current population diversity is than the initial population diversity, and the closer the diversity missing degree is to 1. Conversely, the less aggregated the population is, the closer the diversity missing degree is to 0.
[0113] After obtaining the diversity loss degree, the diversity perturbation term is determined by combining the random direction vector. The diversity perturbation term can be determined by the position difference between two different guardian individuals randomly selected from the current population. Then, the random direction vector is multiplied by the diversity loss degree and the perturbation intensity coefficient to obtain the diversity perturbation term. The perturbation intensity coefficient is used to control the basic effect strength of the diversity perturbation term.
[0114] When the population exhibits a clustered state in the solution space of UAV path planning, the value of the diversity loss increases, enhancing the strength of the diversity perturbation term. The random direction vector provides the individual guardians with a movement direction without fixed preferences, enabling the clustered individual guardians to spread in different directions in the solution space, thus breaking the clustered state of the population.
[0115] In addition, based on the determination of the diversity perturbation term, a suboptimal region exploration term is determined. This exploration term is first determined by screening out highly diverse individuals based on the degree of deviation between the individual's position and the population center position. That is, the Euclidean distance between the position of each individual in the population and the population center position is calculated. The Euclidean distance represents the quantitative value of the degree of deviation of the individual from the population center in the solution space. The larger the distance, the greater the difference between the individual's position in the solution space and the core area of the population, and the lower the exploration degree of the corresponding solution space region. The individual with the largest Euclidean distance is determined as a highly diverse individual.
[0116] The difference between the current position of the guardian individual and the position of the highly diverse individual is determined. This difference is then multiplied by the suboptimal region exploration coefficient to obtain the suboptimal region exploration term. The suboptimal region exploration coefficient is used to control the intensity of the guardian individual's movement towards the highly diverse individual's position. Thus, in the solution space of the UAV obstacle avoidance path planning, in addition to the optimal path candidate in the core area of the population, there may also be paths that satisfy the obstacle avoidance constraints in the suboptimal region with low exploration degree. Guiding the guardian individual to move towards this region can enrich the search range of the algorithm and reduce the probability of missing the optimal path.
[0117] Meanwhile, to explore the edge regions of the UAV path planning solution space, edge exploration for individual guardians is calculated. Edge exploration is determined based on the vector between the current guardian's position and the nearest boundary of the search space. That is, first, the boundary point in the solution space closest to the current guardian's position is determined, and then the unit vector pointing from the guardian's position to the nearest boundary point is calculated. This unit vector is the direction vector of the guardian's movement towards the edge of the solution space. This direction vector is multiplied by the edge exploration intensity coefficient to obtain the edge exploration term. As a result, the edge regions of the solution space are far from the initial search area of the population and have a low degree of exploration, directional edge exploration can fill the search gaps in these regions, allowing the algorithm's search range to cover the entire solution space and improving the comprehensiveness of the UAV obstacle avoidance path search.
[0118] After obtaining the diversity perturbation term, the suboptimal region exploration term, and the edge exploration term, the location update operation of the individual guardian is selected based on the preset probability to complete the location update of the individual guardian.
[0119] The preset probability is determined by randomly selecting a random number ξ from a uniform distribution of 0-1. When the random number ξ≤0.6, a diversity perturbation term and a suboptimal region exploration term are added to the current position of the guardian individual to complete the position update. When 0.6<ξ<0.8, only an edge exploration term is added to the current position of the guardian individual to complete the position update. When the random number ξ takes other values, a random restart operation is performed on the guardian individual, that is, the guardian individual is randomly regenerated within the upper and lower bounds of the solution space of the UAV path planning. This allows the position update of the guardian individual to have both regularity and randomness. The regularity is reflected in the fact that in most cases the guardian individual will move towards the diversity region, the suboptimal region, and the edge region. The randomness is reflected in the fact that there is no fixed choice of update method, which ensures the diversity of the population.
[0120] In this embodiment, information exchange is performed among explorer individuals, developer individuals, and guardian individuals, and the position of guardian individuals is updated according to the above rules. This allows the algorithm to maintain population diversity in the solution space search of UAV obstacle avoidance path planning, avoiding the algorithm from getting stuck in local optima due to population aggregation. At the same time, it enables global and multi-level search of the solution space, allowing the algorithm to discover the optimal UAV obstacle avoidance path that meets constraints such as travel distance, altitude, and turning angle. This ensures that the algorithm has stable search capabilities and high search accuracy in UAV obstacle avoidance path planning, and that the planned path can effectively avoid static and dynamic obstacles, satisfying the flight physics constraints of the UAV.
[0121] In some embodiments, information exchange includes exploration information exchange between explorer individuals and developer individuals, and guard information exchange between guardian individuals and developer individuals;
[0122] Among them, exploration information exchange is used to indicate that an individual explorer will transmit exploration information, including information about future exploration areas, to an individual developer, so that the individual developer can develop the future exploration areas based on the exploration information;
[0123] Guardian information exchange is used to indicate that a developer will pass local information, including the local optimum, to a guardian, so that the guardian can move away from the local optimum based on the local information.
[0124] Specifically, this information exchange can be achieved during the update process by having the explorer transmit exploration information, including information about future exploration areas, to the developer, while the developer transmits local information, including information about local optimal locations, to the guardian.
[0125] Among them, the future exploration area is the area where better solutions are expected to be found. Its relevant information is used as exploration information. The exploration information can be composed of explorer individuals with lower evaluation values and is used as a guiding signal to transmit to developer individuals, so that the local search of developer individuals can be more targeted towards these potentially high-quality areas.
[0126] Local information can be a set of data representing the better solutions found in the local search during the current iteration. It can consist of the locations of some high-quality individuals found among the developer individuals. It is used as a warning signal to be passed to the guardian individuals, so that the guardian individuals can actively avoid these areas that may fall into local optima while maintaining diversity. This local information can be obtained by screening out the individuals with the highest fitness values from all developer individuals and extracting their location coordinates, thereby realizing the closed-loop exchange of information among the three types of individuals and realizing the collaboration between exploration and development.
[0127] In this embodiment, information exchange enables explorers to transmit exploration information, which may include better solutions, to developers, allowing developers to conduct detailed exploration based on the information. Simultaneously, developers can transmit local information to guardians, causing guardians to move away from local optimal positions, thereby ensuring population diversity.
[0128] In some embodiments, a fitness value is determined for each individual in the population based on a preset cost function, including: determining a distance cost based on the total length of the candidate flight path; determining a turning angle cost based on the angle at each turn in the candidate flight path; determining a threat cost based on the minimum distance between each segment of the candidate flight path and the threat area; determining an altitude cost based on the relationship between the flight altitude of each segment of the candidate flight path and the minimum and maximum flight altitudes; and determining a fitness value based on a weighted sum of the distance cost, turning angle cost, threat cost, and altitude cost.
[0129] Specifically, the distance cost can be a cost component determined based on the total length of the candidate flight path. This distance cost can be the sum of the lengths of all segments of the candidate flight path, used to measure the total distance of the path, so as to guide the algorithm to plan a path with a shorter total distance, thereby saving the UAV's flight time and energy consumption.
[0130] The turning angle cost can be a cost component determined based on the angle of each turn in the candidate flight path, or a cost component calculated based on the angle between the vectors formed by three consecutive path points in the path. It is used to quantify the severity of the heading change at the turn of the path. The turning angle cost can be used to penalize path segments with excessive turning angles, thereby planning a smoother path with more gradual changes in flight attitude that better meets the constraints of UAV maneuverability.
[0131] Threat cost can be a cost component determined based on the minimum distance between each segment of the candidate flight path and the threat area, a cost component used to assess the risk of the path approaching or crossing the threat area, and a penalty value calculated based on the shortest distance between the path segment and the boundaries of all threat areas. Threat cost can be used to guide the algorithm to plan a path away from the threat area and ensure flight safety.
[0132] Minimum distance R {r-1,r} It can refer to the path point p {r-1} and p r The shortest Euclidean distance from the line segment to all threat regions can be calculated by traversing all threat regions and finding the minimum value among them as R. {r-1, r} If the minimum distance is greater than the preset safety threshold, the threat cost of that flight segment can be zero; otherwise, a higher fixed penalty value can be assigned. The sum of the threat costs of all flight segments can be the total threat cost.
[0133] Altitude cost can be a cost component determined based on the relationship between the flight altitude of each segment in the candidate flight path and the minimum and maximum flight altitudes; a cost component used to evaluate whether the path meets the flight altitude constraints; a penalty value calculated based on whether the altitude of each segment of the path exceeds the preset safe altitude range; and a value used to force the generated path flight altitude to be within the safe range, avoid collision risks, and meet airspace requirements.
[0134] The weights can be preset coefficients used to adjust the relative importance of distance cost, turning angle cost, threat cost, and altitude cost in the total cost function, and are used to balance the priorities among multiple optimization objectives such as shortest distance, smooth turning, threat avoidance, and high compliance in path planning.
[0135] Furthermore, during the initialization phase, user-defined weight coefficients ω1, ω2, ω3, and ω4 can be received. When calculating the fitness of each candidate flight path, the distance cost is determined based on the total length of the candidate flight path, the turning angle cost is determined based on the angles at each turn in the candidate flight path, the threat cost is determined based on the minimum distance between each segment of the candidate flight path and the threat area, and the altitude cost is determined based on the relationship between the flight altitude of each segment of the candidate flight path and the minimum and maximum flight altitudes. The distance cost F is then calculated for each of these parameters. dist Turning angle cost F angle Threat cost F threat and high cost F high According to expression F cost =ω1× F dist +ω2×F angle + ω3× F threat + ω4 ×F highPerform a weighted summation to obtain the total cost of the path, and use the reciprocal or negative value of the total cost as the fitness value of the individual corresponding to the path.
[0136] In addition, a flight segment can be a straight flight segment consisting of two adjacent path points in a candidate flight path. A flight segment can be the basic unit that constitutes a candidate flight path and is used as the basic unit for threat cost calculation and path discretization. The shortest geometric distance can be the minimum distance from a flight segment to the boundary of all threat areas. The shortest geometric distance can be the minimum of all possible distances from any point on the flight segment to any point on the boundary of the threat area.
[0137] Threat cost can be a scalar value used to quantify the overall safety performance of the entire candidate flight path in terms of avoiding threat areas. It is the sum of the threat cost values corresponding to all segments of the candidate flight path. The smaller the threat cost value, the higher the overall safety of the path.
[0138] Furthermore, for each segment of the candidate flight path, the shortest geometric distance from that segment to the boundary of all threat areas can be determined: traverse all threat areas, and for each threat area, calculate the shortest distance from the segment to its boundary. If the threat area is modeled as a circle, calculate the distance from the segment to the center of the circle and then subtract the absolute value of the radius. If the threat area is modeled as a convex polygon, calculate the shortest distance from the segment to each side of the polygon and take the minimum value. Among the shortest distances corresponding to all threat areas, the smallest value can be taken as the minimum distance corresponding to that segment. Based on this minimum distance and a preset safety threshold, the threat cost corresponding to that segment can be determined. Summing the threat costs corresponding to all segments of the candidate flight path yields the threat cost.
[0139] According to the technical solution provided in the embodiments of this application, the ability of path planning to optimize energy efficiency and task execution time is improved by determining the distance cost; the smoothness of the flight trajectory and the stability of UAV flight are enhanced by the turning angle cost; the safety of the path and the threat avoidance capability are improved by the threat cost; and the flight altitude compliance and terrain adaptability are enhanced by the altitude cost. By determining the fitness value based on the weighted summation of distance cost, turning angle cost, threat cost and altitude cost, the comprehensiveness of the path evaluation and the targeting of the algorithm search are improved, providing a reliable evaluation basis for generating safe, smooth, economical and compliant flight paths that meet multiple constraints.
[0140] In some embodiments, determining the turning angle cost based on the angles at each turn in the candidate flight path includes: for each turn in the candidate flight path, obtaining the coordinates of a predetermined number of consecutive path points constituting the turn; determining the preceding path segment vector and the following path segment vector based on the coordinates of the predetermined number of path points; determining the cosine value of the angle at the turn based on the preceding and following path segment vectors; determining the angle cost corresponding to the turn based on the cosine value and a predetermined piecewise function; and summing the angle costs corresponding to all turns in the candidate flight path to obtain the turning angle cost.
[0141] Specifically, for each turn in the candidate flight path, the coordinates of a consecutive preset number of path points constituting the turn are obtained. The turn can be a point in the candidate flight path where the heading changes, and can be composed of a consecutive preset number of path points. The intermediate path points can be the turning points. The consecutive preset number of path points can be a set of path points that constitute the turn and have position data in three-dimensional space, used to characterize the spatial geometry of the flight trajectory.
[0142] Based on the coordinates of the path points of the preset number of turns, the vectors of the previous path segment and the next path segment are determined. The vector of the previous path segment can be a directed line segment pointing from the previous path point to the current turning point. The coordinate components of the vector of the previous path segment can be equal to the coordinates of the current turning point minus the coordinates of the previous path point, which is used to represent the flight direction before the turn. The vector of the next path segment can be a directed line segment pointing from the current turning point to the next path point. The coordinate components of the vector of the next path segment can be equal to the coordinates of the next path point minus the coordinates of the current turning point, which is used to represent the flight direction after the turn.
[0143] Based on the vectors of the preceding and following path segments, the cosine value of the angle at the turn is determined. The angle can be the angle between the vectors of the preceding and following path segments, which is used to characterize the degree of change in flight direction. The cosine value can be used to quantify the smoothness of the turn.
[0144] Based on the cosine value and the preset piecewise function, the angle cost corresponding to the turn is determined. The preset piecewise function can be a mathematical rule that inputs and outputs different angle cost values according to the cosine value. The angle cost can be the cost value of a single turn determined based on the cosine value and the preset piecewise function, which is used to characterize the smoothness cost of the turn. The turn angle cost can be the sum of the angle cost values of all turns of the candidate flight path, which is used to characterize the overall cost of the entire path in terms of turn smoothness.
[0145] For example, in mountainous supply delivery, the coordinates of three consecutive path points constituting that turn can be obtained for each bend in the candidate flight path (p... {r-1} ,p r ,p{r+1} Based on the coordinates of the three path points, determine the vector a=p of the previous path segment. r -p {r-1} and the next path segment vector b=p {r+1} -p r Based on the previous path segment vector a and the next path segment vector b, the cosine value of the angle at the turn is determined as cosθ=(a·b) / (|a||b|). Based on the cosine value cosθ and the preset piecewise function, the angle cost corresponding to the turn is determined. The angle costs corresponding to all turns of the candidate flight path are summed to obtain the total turning angle cost of the candidate flight path.
[0146] This application improves the geometric accuracy of turning angle calculation and the accuracy of vector representation by obtaining the coordinates of a preset number of path points for each turn in the candidate flight path and determining the vectors of the preceding and following path segments. By determining the cosine value of the included angle based on the vectors of the preceding and following path segments, the accuracy and computational efficiency of turning smoothness quantification are enhanced. By determining the angle cost based on the cosine value and a preset piecewise function, the ability to distinguish different types of turns and the rationality of cost calculation are improved. By summing the angle costs corresponding to all turns in the candidate flight path to obtain the turning angle cost, the comprehensiveness of the overall path smoothness assessment and the completeness of the cumulative calculation are enhanced. By integrating the turning angle cost into the comprehensive cost function, the ability of path planning to optimize flight trajectory smoothness is improved, thereby improving flight stability, safety, and energy efficiency.
[0147] Figure 3 This is a schematic diagram of another UAV path planning method provided in an embodiment of this application, such as... Figure 3 As shown, explorer individuals are responsible for exploring new areas (equivalent to the exploration phase of the algorithm), and move randomly with a large range when updating their positions; developer individuals are used to perform fine-grained searches near known high-quality resources (equivalent to the development phase of the algorithm), and make small adjustments to their positions; guardian individuals are random individuals to maintain population diversity and prevent premature convergence.
[0148] Improvements to the Beaver Optimization (IBBO) algorithm typically focus on increasing convergence speed, accuracy, and avoiding local optima.
[0149] All the following formulas are from the first... Generate in the next iteration For simplicity, all formulas omit the superscript indicating the iteration number.
[0150] Each explorer is responsible for the overall exploration, searching for new areas to be explored in the future.
[0151] Explorers have a high probability of executing Levi's flight, while developers are responsible for local development, conducting detailed searches around high-quality solutions.
[0152] Learn from elite individuals; developers should primarily learn from outstanding individuals. .
[0153] Weighting (ranked based on fitness value): .
[0154] in, It is the first An elite individual. yes The ranking Control the smoothness of weight allocation. It is the total number of elite individuals.
[0155] Meanwhile, individual developers perform small-scale random searches: ;
[0156] in, The local search step size coefficient is a function that decays with the number of iterations, controlling the overall search range.
[0157] ; : From a mean of 0 and a covariance matrix of A random vector drawn from a multivariate Gaussian distribution.
[0158] ; .
[0159] At the same time, individual developers can refer to their own historical best practices: ; ;in, Indicates the first The individual's own historical optimal state.
[0160] .
[0161] Guardian individuals are responsible for maintaining population diversity and preventing premature convergence. When population diversity declines, guardian individuals execute strong perturbations: ,in, Disturbance intensity coefficient, the basic intensity controlling the disturbance. . This represents the degree of diversity loss, i.e., an adaptive regulator. This indicates initial diversity, representing the most dispersed and active state of the population.
[0162] ;in, It is the population size. It is the diagonal length of the search space (used for normalization). It is the population center location (average state value).
[0163] ; It indicates current diversity and reflects the current degree of aggregation in the population.
[0164] ;when At the time (diversity remains at its initial level): This indicates that the population is sufficiently dispersed and does not require additional disturbance.
[0165] when Time (complete convergence, all individuals converge to a single point):
[0166] This indicates that the population is completely homogeneous and requires the strongest possible perturbation.
[0167] when Time (partial convergence): The larger the value, the more severe the lack of diversity and the stronger the disturbance.
[0168] Random direction vector, generated by perturbation direction. It is the difference between two randomly selected individuals from the current population. It satisfies randomness, the direction is completely random, and there is no preference.
[0169] If the population is dispersed (high diversity): two random individuals may be far apart, resulting in a long difference vector. If the population is clustered (low diversity): two random individuals may be very close together, resulting in a short difference vector. In the long run, the expectation of a random vector is 0.
[0170] Suboptimal area exploration: Guardians individually explore suboptimal but highly diverse areas. ,in, The guiding coefficient controls the intensity of migration to areas of high diversity. The selection is based on the degree of deviation of the individual from the population center.
[0171] For each individual : .
[0172] ; It is the target vector.
[0173] Stagnant individuals are restarted when a guardian individual has not improved for an extended period, indicating it may be stuck in a hopeless search area. In this case, it is completely abandoned and a fresh start is initiated. That is, for guardian individuals that have not improved for a long time, a restart is performed: .
[0174] At the same time, individual guardians are encouraged to search the edges of space: ,in, It is the edge exploration intensity coefficient, which controls the intensity of movement towards the boundary. It is the boundary direction vector, a unit vector pointing from the current position to the nearest boundary.
[0175] .
[0176] ;in, Random number.
[0177] Explorer-Developer Information Transmission: Future exploration areas discovered by the explorer are transmitted to the developer. ,in, It is a collection of individual explorers. .
[0178] Individual developers use this information: ;in, It is a collection of individual developers.
[0179] Local optima discovered by individual developers: ,in, It is a locally optimal set among the individual developers.
[0180] Guardians should avoid these areas: ;in, It is a collection of individual guardians. It is a set One of the local optima, Individual Guardians The current state ( ), It is a very small positive number, to prevent the denominator from being 0. This represents the square of the distance between the current position and the local optimum (squared Euclidean distance). Represents individual guardians The amount of displacement to avoid local optima.
[0181] The Beaver Algorithm (BBO) is designed based on observations of beaver community ecology, primarily simulating the following four behaviors: 1) Habitat creation and dam-building behavior: Beavers seek suitable water areas and use materials such as branches and soil to build dams to create safe habitats. This corresponds to the exploration phase of the algorithm, which aims to extensively search the solution space to find potential areas.
[0182] 2) Cooperation and Information Sharing: Beavers are highly social animals that develop and maintain dams through cooperation. In the algorithm, this is reflected in individuals sharing information about "good areas" (high-quality solutions) through location updates.
[0183] 3) Optimal Area Selection (Habitat Quality): Beavers continuously evaluate and select the best habitat and foraging locations. In the algorithm, each solution (beaver location) has a "habitat quality" index, usually determined by the objective function value (the better the quality, the higher the quality), which is used to guide the search direction.
[0184] 4) Escape from predators and random exploration: To avoid predators such as bears and wolves, beavers make sudden and unpredictable movements. This is modeled in the algorithm as a random perturbation or escape mechanism, which helps to escape local optima and enhance global exploration capabilities.
[0185] Suppose we have an m-dimensional minimization problem, with a population of N beavers. We randomly generate the position of each beaver within the search space: ;in, Representing the Individual beaver, The first representing the state One dimension, The representative indicated the first The first individual Each dimension.
[0186] The initial state matrix of the entire beaver population is represented as follows:
[0187] ;
[0188] Set the objective function as The fitness value of each individual is expressed as: .
[0189] in, Indicates will Introducing the fitness function The fitness value. The higher the quality of the habitat found by each beaver, the better its corresponding... The smaller the value, the worse the habitat quality and the lower the fitness value. The larger.
[0190] Location updates are the result of multiple actions working together, and typically include the following components:
[0191] Beavers tend to move to the best location (best habitat) found in their current population or to a better local location in their area.
[0192] ;in, It is the first The individual in the first The state of each iteration phase It is a learning factor. Is The optimal solution for the current stage.
[0193] Simulate beavers observing and following the behavior of other successful individuals: .
[0194] in, It is in the Each iteration phase randomly selects a state of an individual from those with good fitness. It is the collaboration coefficient.
[0195] Simulating random movements caused by foraging or escaping predators is key to escaping local optima. ,in, It is a random number.
[0196] ;in, These are weights used to balance development and exploration. These weights need to be dynamically adjusted as the number of iterations increases, initially... Larger sizes encourage exploration, later stages Larger capacity to enhance development.
[0197] For states that exceed the upper and lower bounds after the update, a truncation strategy is used to ensure the feasibility of the solution: ;
[0198] ;in, It is the individual state after the boundary constraint phase is updated, which is the individual's state. No. A new state in each dimension.
[0199] By comparing fitness values, better solutions are retained, thus achieving population evolution. ;
[0200] in, For the first After the nth iteration The state of an individual.
[0201] Individual historical best :like Then update for .
[0202] Group historical best : Iterate through all individuals, if there exists a first individual... Individual satisfaction Then update .
[0203] This means that, for an individual, It is a constant. For a group, .
[0204] Due to limited energy (battery power), drones are subject to a maximum range constraint during flight; the flight path length must be limited by this maximum range. To ensure successful mission completion and avoid energy depletion, we assume the maximum safe flight distance is... .
[0205] The total flight distance must meet the following constraints: Where node represents the number of travel segments. Indicates the first The flight distance of a segment of the journey.
[0206] During flight, try to choose the shortest route possible, that is... ;in, This indicates that the path length is used as the standard, and the first... The optimal search path for each individual.
[0207] The drone needs to have its flight altitude limited during flight, requiring the drone to maintain a certain altitude between consecutive waypoints. The altitude cannot be too high or too low; the minimum flight altitude is [missing information]. Maximum flight altitude is The flight distance for each segment must meet the following requirements: .
[0208] When a drone turns, it needs to adjust its attitude (such as roll angle and yaw angle) to change its heading. If the turning angle is too small, the drone will suddenly change its flight direction, resulting in a very abrupt and violent maneuver. Especially when flying in complex terrain or threatening environments, the drone needs to maintain a safer and more stable attitude to successfully complete the turn. The path in this embodiment uses a cosine formula to obtain the turning angle, assuming the node of the previous path is... , The drone is expected to turn and fly to the path node. The cosine of the angle between the two paths satisfies: .
[0209] During path planning, drones may encounter various obstacles, such as fixed obstacles, moving obstacles, and suddenly appearing obstacles. In this embodiment, movable grids under a grid map are used to represent obstacles. Figures 4(a) and 4(b) are schematic diagrams of a drone flight process provided by this embodiment. As shown in Figure 4(a), it is assumed that during the drone's flight, it is expected to... arrive ,Although and It is not in the obstacle zone, but its flight path may enter the obstacle zone. Figure 4(b) shows that it can be accessed through the obstacle zone. and Add nodes between This allows the drone to bypass obstacle areas and avoid collisions.
[0210] In the process of UAV path planning, the cost function is used to measure the merits of different paths, and it is also the evaluation function of the IBBO optimization algorithm. A well-designed cost function can guide the algorithm to generate safe and efficient paths in complex environments, avoiding obstacles and threat areas. Based on a comprehensive consideration of factors such as maximum travel distance, altitude, turning angle constraints, and obstacle / threat area avoidance, this application constructs the following UAV path cost function: ;
[0211] ; ;
[0212] ;
[0213] ; ;
[0214] ;
[0215] in, It is the total number of waypoints in the journey. Indicates distance cost. Indicates the cost of turning angle. Indicates the cost of obstacles and threats. , , These are the weighting coefficients corresponding to each cost item. Indicates the first The coordinates of the path points and This represents the coordinates of the path points adjacent to it. Representing path points and waypoints The minimum distance between the formed path and the obstacle threat.
[0216] To ensure that the UAV can effectively avoid obstacles and safely reach the target point, a path planning simulation experiment was conducted. The path planning process was based on map rasterization, and threat areas were modeled. The experiment included adding sudden obstacles to a map with a fixed threat state to simulate the generation of highly complex real-time obstacle avoidance paths for UAV flight. The obstacle threat model parameters are shown in Table 1.
[0217] Table 1. Parameter Table for Barrier Threat Model
[0218]
[0219] Figures 5(a) and 5(b) are schematic diagrams of two different perspective views of an obstacle threat environment 1 provided in an embodiment of this application.
[0220] Figures 6(a) and 6(b) are two different perspective views of an obstacle threat environment 2 provided in an embodiment of this application.
[0221] In the above environment, the designed IBBO algorithm was used to solve the 3D path planning problem. To ensure the fairness and consistency of the experiment, the population of the algorithm was set to 30, the maximum number of iterations was set to 50, and the starting coordinates of the obstacle avoidance path were (3,35,1) and the ending coordinates were (38,8,3). Each algorithm was run independently 20 times in both Environment 1 and Environment 2 maps. The optimal path length generated under the two environmental conditions was compared. The parameter settings of the IBBO algorithm are shown in Table 2.
[0222] Table 2 Algorithm Parameter Settings
[0223]
[0224] To more intuitively demonstrate the performance comparison of various algorithms in 3D path planning, this application's embodiment selects a typical experimental result of the original 3D path and its optimized path view.
[0225] Figures 7(a) and 7(b) are schematic diagrams of an obstacle avoidance route generated in an obstacle environment 1 according to an embodiment of this application. As shown in Figures 7(a) and 7(b), it can be observed that the overall altitude change of the path planned by the IBBO algorithm is stable, the flight process is smooth, and it has good obstacle avoidance capabilities.
[0226] The optimized obstacle avoidance route information for obstacle environment 1 is shown in Table 3.
[0227] Table 3 Obstacle Avoidance Route Parameters for Obstacle Environment 1
[0228]
[0229] To further ensure the smooth flight of the UAV, the turning points of each flight path should be rounded. Figures 7(c) and 7(d) show the paths after rounding based on the IBBO generated paths.
[0230] Figures 8(a) and 8(b) are schematic diagrams of an obstacle avoidance route in an obstacle environment 2 provided in an embodiment of this application. As shown in Figures 8(a) and 8(b), obstacle environment 2 sets a set of obstacle threats on the obstacle avoidance route generated in environment 1 to simulate changes in the environment. It can be observed that the path planned by the original IBBO algorithm generates a new obstacle avoidance route at the path point (17,25,3) before flying to the sudden obstacle. The overall altitude change of the route is stable and the flight process is smooth.
[0231] The optimized obstacle avoidance route information for obstacle environment 2 is shown in Table 4.
[0232] Table 4 Obstacle Environment 2 Obstacle Avoidance Route Parameter Table
[0233]
[0234] To further ensure the smooth flight of the UAV, the turning points of each route should be rounded. Figures 8(c) and (d) show the paths after rounding based on the IBBO generated paths.
[0235] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0236] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0237] Figure 9 This is a schematic diagram of a drone path planning device provided in an embodiment of this application. Figure 9 As shown, the UAV path planning device includes:
[0238] The acquisition module 901 is used to acquire environmental information of the mission area and the constraint parameters of the UAV, including the maximum safe flight distance, minimum flight altitude and maximum flight altitude.
[0239] Initialization module 902 is used to initialize the population of the improved beaver optimization algorithm, wherein each individual in the population represents a candidate flight path consisting of multiple path point coordinates;
[0240] The fitness determination module 903 is used to determine the fitness value for each individual in the population based on a preset cost function, wherein the preset cost function is determined based on path length, turning angle, threat avoidance and height constraints;
[0241] The iterative optimization module 904 is used to dynamically assign roles to each individual in the population based on fitness values, update the position of the individual according to the assigned role using the corresponding update strategy, and perform information exchange between roles during the update process. Roles include developer individuals, explorer individuals, and guardian individuals.
[0242] The output module 905 is used to determine the individual with the lowest fitness value from the iteratively updated population based on a preset termination condition, and output the path point sequence represented by the individual as the planned UAV flight path.
[0243] In some embodiments, the UAV path planning device is used to: normalize the fitness value of each individual to obtain a normalized fitness value; determine the preference probability of each individual becoming an explorer, developer, or guardian based on the current iteration number and the normalized fitness value; determine the specific probability of each individual being assigned as an explorer, developer, or guardian based on a temperature parameter that decays with the iteration number and the preference probability, using a preset role allocation function; and determine the role of each individual in the current iteration based on the specific probability and the target role ratio of the current iteration number.
[0244] In some embodiments, the UAV path planning device is used to: determine the learning parameters of an elite individual based on a weighted sum of the differences between the positions of multiple elite individuals and the current position of the developer individual, wherein the elite individuals are a preset number of individuals in the current population whose fitness values rank within a preset proportion range; adaptively determine the covariance matrix of a multivariate Gaussian distribution based on the fitness value of the current developer individual, the best fitness value of the population, the worst fitness value of the population, and the current iteration number; sample a random vector based on the multivariate Gaussian distribution corresponding to the covariance matrix to determine the local fine-grained random search parameters; determine the learning parameters of the developer individual's own historical best position based on the difference between the current developer individual's historical best position and its current position; and determine the position update amount based on the elite individual learning parameters, the local fine-grained random search parameters, and the developer individual's own historical best position learning parameters.
[0245] In some embodiments, the UAV path planning device is used to: determine the population diversity missing degree based on the relationship between the current population diversity and the initial population diversity; for a guardian individual, determine the population diversity missing degree based on the relationship between the current population diversity and the initial population diversity; determine a diversity perturbation term based on the population diversity missing degree and a random direction vector; determine a high-diversity individual based on the degree of deviation between the individual's position and the population center position; determine a suboptimal region exploration term based on the difference between the current guardian individual's position and the position of a high-diversity individual; determine an edge exploration term based on the vector between the current guardian individual's position and the nearest boundary of the search space; and update the guardian individual's position by selecting and executing a combination of the diversity perturbation term and the suboptimal region exploration term, an edge exploration term, or a random restart operation based on a preset probability.
[0246] In some embodiments, information exchange includes exploration information exchange between explorer individuals and developer individuals, and guardian information exchange between guardian individuals and developer individuals; wherein, exploration information exchange is used to indicate that the explorer individual transmits exploration information including future exploration areas to the developer individual, so that the developer individual can develop towards the future exploration areas based on the exploration information; guardian information exchange is used to indicate that the developer individual transmits local information including local optimal positions to the guardian individual, so that the guardian individual can move away from the local optimal positions based on the local information.
[0247] In some embodiments, the UAV path planning device is used to: determine the distance cost based on the total length of the candidate flight path; determine the turning angle cost based on the angle of each turn in the candidate flight path; determine the threat cost based on the minimum distance between each segment of the candidate flight path and the threat area; determine the altitude cost based on the relationship between the flight altitude of each segment of the candidate flight path and the minimum and maximum flight altitudes; and determine the fitness value based on the weighted sum of the distance cost, turning angle cost, threat cost, and altitude cost.
[0248] In some embodiments, the UAV path planning device is used to: for each turn in a candidate flight path, obtain the coordinates of a preset number of consecutive path points constituting the turn; determine the previous path segment vector and the next path segment vector based on the coordinates of the preset number of path points; determine the cosine value of the angle at the turn based on the previous path segment vector and the next path segment vector; determine the angle cost corresponding to the turn based on the cosine value and a preset piecewise function; and sum the angle costs corresponding to all turns in the candidate flight path to obtain the turning angle cost.
[0249] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0250] Figure 10 This is a schematic diagram of the electronic device provided in an embodiment of this application. For example... Figure 10 As shown, the electronic device of this embodiment includes: a processor 1001, a memory 1002, and a computer program 1003 stored in the memory 1002 and executable on the processor 1001. When the processor 1001 executes the computer program 1003, it implements the steps in the various method embodiments described above. Alternatively, when the processor 1001 executes the computer program 1003, it implements the functions of each module / unit in the various device embodiments described above.
[0251] The electronic device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The electronic device may include, but is not limited to, the processor 1001 and the memory 1002. Those skilled in the art will understand that... Figure 10 This is merely an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer parts than shown, or different parts.
[0252] The processor 1001 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0253] The memory 1002 can be an internal storage unit of an electronic device, such as a hard drive or RAM. The memory 1002 can also be an external storage device of the electronic device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. The memory 1002 can also include both internal and external storage units. The memory 1002 is used to store computer programs and other programs and data required by the electronic device.
[0254] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0255] If integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a readable storage medium (e.g., a computer-readable storage medium). Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which may be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0256] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for unmanned aerial vehicle (UAV) path planning, characterized in that, include: Obtain environmental information of the mission area and constraint parameters of the UAV, wherein the constraint parameters include maximum safe flight distance, minimum flight altitude and maximum flight altitude; Initialize a population for the improved beaver optimization algorithm, wherein each individual in the population represents a candidate flight path consisting of multiple path point coordinates; A fitness value is determined for each individual in the population based on a preset cost function, wherein the preset cost function is determined based on path length, turning angle, threat avoidance, and height constraints; The fitness value of each individual is normalized to obtain a normalized fitness value; Based on the current iteration number and the normalized fitness value, determine the preference probability of each individual becoming an explorer, developer, or guardian individual, respectively. Based on the temperature parameter that decays with the number of iterations and the preference probability, the specific probability of each individual being assigned as an explorer, developer, or guardian is determined by a preset role assignment function. Based on the specific probability and the target role ratio of the current iteration number, determine the role of each individual in this iteration; The position of an individual is updated according to the assigned role using the corresponding update strategy, and information exchange between roles is performed during the update process. The roles include developer individuals, explorer individuals, and guardian individuals. Based on a preset termination condition, the individual with the lowest fitness value is determined from the iteratively updated population, and the path point sequence represented by the individual is output as the planned UAV flight path.
2. The method of claim 1, wherein, The step of updating the individual's position according to the assigned role and using the corresponding update strategy includes: For the developer individual, the learning parameters of the elite individual are determined by weighted summation of the differences between the positions of multiple elite individuals and the current developer individual, wherein the elite individual is a preset number of individuals in the current population whose fitness value ranks within a preset proportion range. Based on the fitness value of the current individual developer, the best fitness value of the population, the worst fitness value of the population, and the current iteration number, the covariance matrix of the multivariate Gaussian distribution is adaptively determined. Random vectors are sampled based on the multivariate Gaussian distribution corresponding to the covariance matrix to determine the local fine-grained random search parameters. The learning parameters for a developer's historical best position are determined based on the difference between the current developer's historical best position and the current position. The position update amount is determined based on the elite individual learning parameters, the local fine random search parameters, and the learning parameters of its own historical best position.
3. The method of claim 1, wherein, The step of updating the individual's position according to the assigned role and using the corresponding update strategy includes: For the individual guardian, the population diversity missing degree is determined based on the relationship between the current population diversity and the initial population diversity, and the diversity perturbation term is determined based on the population diversity missing degree and the random direction vector. Highly diverse individuals are identified based on the degree of deviation between their location and the population center, while suboptimal region exploration items are determined based on the difference between the current guardian individual's location and the location of highly diverse individuals. Edge exploration terms are determined based on the vector between the current location of the individual guardian and the nearest boundary of the search space; Based on preset probabilities, a combination of diversity perturbation items and suboptimal area exploration items, edge exploration items, or random restart operations are selected to update the position of individual guardians.
4. The method of claim 1, wherein, The information exchange includes the exchange of exploration information between the explorer individual and the developer individual, and the exchange of guarding information between the guardian individual and the developer individual; The exploration information exchange is used to indicate that the explorer individual transmits exploration information, including future exploration areas, to the developer individual, so that the developer individual can develop the future exploration areas based on the exploration information; The guard information exchange is used to indicate that the developer individual will pass local information including the local optimal position to the guard individual, so that the guard individual can move away from the local optimal position based on the local information.
5. The method of claim 1, wherein, The step of determining the fitness value for each individual in the population based on a preset cost function includes: The distance cost is determined based on the total length of the candidate flight paths; The cost of determining the turning angle based on the angle at each turn in the candidate flight path; Threat cost is determined based on the minimum distance between each segment of the candidate flight path and the threat area; The altitude cost is determined based on the relationship between the flight altitude of each segment in the candidate flight path and the minimum and maximum flight altitudes. The fitness value is determined by a weighted sum of the distance cost, the turning angle cost, the threat cost, and the altitude cost.
6. The method according to claim 5, characterized in that, The cost of determining the turning angle based on the angles at each turn in the candidate flight path includes: For each turn in the candidate flight path, obtain the coordinates of the path points that constitute a consecutive preset number of turns at the turn. Based on the coordinates of the path points with the preset number of turns, determine the vector of the previous path segment and the vector of the next path segment; Based on the vector of the previous path segment and the vector of the next path segment, determine the cosine value of the angle at the turning point; Based on the cosine value and the preset piecewise function, the angle value corresponding to the turning point is determined; The turning angle cost is obtained by summing the angle values corresponding to all turns of the candidate flight path.
7. An unmanned aerial vehicle path planning apparatus, characterized by, include: The acquisition module is used to acquire environmental information of the mission area and the constraint parameters of the UAV, wherein the constraint parameters include the maximum safe flight distance, the minimum flight altitude, and the maximum flight altitude; An initialization module is used to initialize the population of the improved beaver optimization algorithm, wherein each individual in the population represents a candidate flight path consisting of multiple path point coordinates. The fitness determination module is used to determine the fitness value for each individual in the population based on a preset cost function, wherein the preset cost function is determined based on path length, turning angle, threat avoidance and height constraints; The iterative optimization module is used to normalize the fitness value of each individual to obtain a normalized fitness value. Based on the current iteration number and the normalized fitness value, determine the preference probability of each individual becoming an explorer, developer, or guardian individual, respectively. Based on the temperature parameter that decays with the number of iterations and the preference probability, the specific probability of each individual being assigned as an explorer, developer, or guardian is determined by a preset role assignment function. Based on the specific probability and the target role ratio of the current iteration number, determine the role of each individual in this iteration; The position of an individual is updated according to the assigned role using the corresponding update strategy, and information exchange between roles is performed during the update process. The roles include explorer individuals, developer individuals, and guardian individuals. The output module is used to determine the individual with the lowest fitness value from the iteratively updated population based on a preset termination condition, and output the path point sequence represented by the individual as the planned UAV flight path.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6.
9. A readable storage medium, the readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.