Unmanned aerial vehicle path planning method based on improved snake optimization algorithm
By improving the snake optimization algorithm and dynamically adjusting the search mode based on ambient temperature and food quantity, the problems of local optima and low search efficiency in UAV path planning were solved, achieving efficient and accurate path planning.
Patent Information
- Application Number
- CN202511787790.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-02-10
AI Technical Summary
Existing snake optimization algorithms are prone to getting stuck in local optima in UAV path planning, resulting in low search efficiency and difficulty in finding the global optimum in high-dimensional problems, leading to low path planning accuracy and poor stability.
By improving the snake optimization algorithm, an adaptive field-of-view scaling model that dynamically changes environmental temperature and food quantity is introduced. Combined with a water flow optimizer and the exploration strategy of female snake population, the algorithm automatically switches between global search and local search modes. Furthermore, the path planning is optimized through exploration and development balancing strategies and adaptive mutation mechanisms.
In complex flight environments, it can quickly converge to a safe and feasible path, reduce path entanglement, and improve path smoothness and the practicality and reliability of UAV autonomous navigation.
Smart Images

Figure CN121501002A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of path planning technology, and in particular relates to a UAV path planning method based on an improved snake optimization algorithm. Background Technology
[0002] In recent years, heuristic optimization algorithms have made significant progress in solving complex optimization problems. These algorithms, by simulating natural phenomena, physical principles, or human behavior, excel in high-dimensional, nonlinear, and multimodal problems. For example, the butterfly optimization algorithm is inspired by the foraging and mating behavior of butterflies, the dragonfly algorithm by the static and dynamic swarming behavior of dragonflies, the atom search algorithm by the interaction forces between atoms, and the snake optimization algorithm by the foraging and reproductive behavior of snakes. The snake optimization algorithm, by simulating the foraging behavior of snakes, can perform a broad global search in the solution space, avoiding getting trapped in local optima. Secondly, by simulating the movement behavior of snakes, the algorithm can perform a fine search in local regions, improving the accuracy of the solution. Finally, the snake optimization algorithm has fewer parameters and, by simulating the energy management and reproductive behavior of snakes, can dynamically adjust its search strategy. These advantages make the snake optimization algorithm very effective in solving complex high-dimensional, nonlinear, and multimodal optimization problems. However, in some complex problems, the algorithm may get trapped in local optima and fail to find the global optimum. Also, although the algorithm has fewer parameters, the adjustment of some parameters (such as the step size factor) still relies on experience.
[0003] In existing snake optimization algorithms, the search field of individual snakes is fixed, and their movement direction is overly dependent on the current global best individual. In the later stages of iteration, the snake population is prone to clustering. When there are multiple local optima in the optimization problem, the snake population is easily attracted to a certain local optimum, causing the global search to stagnate.
[0004] In high-dimensional problems, the search efficiency of existing technologies may decrease, requiring more iterations to find the optimal solution. Furthermore, they suffer from low accuracy, poor stability, and degradation in high-dimensional problems in UAV path planning. Summary of the Invention
[0005] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a UAV path planning method based on an improved snake optimization algorithm, which enhances the accuracy of UAV path planning.
[0006] In a first aspect, this application provides a UAV path planning method based on an improved snake optimization algorithm, the method comprising:
[0007] (1) Obtain the flight environment and three-dimensional terrain information of the target UAV;
[0008] (2) Set the parameters and population size of the improved snake optimization algorithm, wherein the population includes male and female populations;
[0009] (3) Determine the ambient temperature and the amount of food. Based on the relationship between the amount of food and the ambient temperature, select to enter the global search mode or the local search mode.
[0010] (4) When entering the local search mode and the ambient temperature is higher than the temperature threshold, the exploration-development balance strategy is executed to obtain the first position update, and the population position is updated based on the first position update.
[0011] (5) When entering the local search mode and the ambient temperature is lower than the temperature threshold, the adaptive mutation mechanism is executed to obtain the second position update, and the population position is updated based on the second position update.
[0012] (6) Based on the population location updated in step (4) or (5), obtain several paths of the target UAV, and select the shortest path as the current target path;
[0013] (7) Repeat steps (2) to (6) until the preset number of iterations is reached, and output the target path.
[0014] According to one embodiment of this application, the step of executing the exploratory development balancing strategy to obtain a first position update includes:
[0015] Choose between small-scale or large-scale search based on probability thresholds;
[0016] When using a small-scale search, the first number of individuals are randomly selected from the current population to calculate the position mean, thus obtaining the first mean vector;
[0017] When using a large-scale search, a second number of individuals are randomly selected from the current population to calculate the position mean, resulting in a second mean vector, where the second number is greater than the first number.
[0018] Generate a random individual location;
[0019] The difference between the random individual position and the selected mean vector is calculated, and the first position update is obtained by combining the random factor.
[0020] According to one embodiment of this application, the formula for calculating the first position update amount is as follows:
[0021]
[0022] in, Calculate the position mean for the first number of individuals. Calculate the position mean for the second number of individuals. X represents the location of a random individual.new,i For the first position update, X m It is a random factor.
[0023] According to one embodiment of this application, the step of performing an adaptive mutation mechanism to obtain a second position update includes:
[0024] Construct a random diagonal matrix, perform a Hadamard product operation between the random diagonal matrix and the population gene pool to obtain an undirected mutation path, which serves as the first basis for the second position update.
[0025] The normalized weights are calculated based on the fitness values of all individuals in the population, and the population positions are weighted and aggregated to obtain the directional mutation path, which serves as the second basis for the second position update.
[0026] The second position update is obtained by multiplying the first basis or the second basis of the second position update by the adaptive decay hybrid scaling factor.
[0027] According to one embodiment of this application, the male population is a flow optimizer population.
[0028] According to one embodiment of this application, the method further includes a path optimization step:
[0029] If the target path has a tangled path segment, select three points on the tangled path segment, with two points located on either side of the tangled position and the other point located at the tangled position.
[0030] Based on the three points, the local path is reconstructed to replace the entangled path segments, resulting in the optimized target path.
[0031] According to one embodiment of this application, the three-dimensional terrain information includes the map extent of the target UAV's flight environment and mountain feature information.
[0032] Secondly, this application provides a UAV path planning device based on an improved snake optimization algorithm, the device comprising:
[0033] The acquisition module is used to acquire the flight environment and three-dimensional terrain information of the target UAV;
[0034] The first processing module is used to set the parameters and population size of the improved snake optimization algorithm, wherein the population includes male and female populations;
[0035] The second processing module is used to determine the ambient temperature and the quantity of food, and select to enter the global search mode or the local search mode based on the relationship between the quantity of food and the ambient temperature.
[0036] The third processing module is used to execute an exploration-development balance strategy when entering local search mode and the ambient temperature is higher than the temperature threshold, to obtain the first position update, and to update the population position based on the first position update.
[0037] The fourth processing module is used to execute an adaptive mutation mechanism when entering local search mode and the ambient temperature is lower than the temperature threshold, to obtain the second position update, and to update the population position based on the second position update.
[0038] The fifth processing module is used to obtain several paths of the target UAV based on the population position updated in step (4) or (5), and select the shortest path as the current target path.
[0039] The output module is used to repeat steps (2) to (6) until the preset number of iterations is reached, and output the target path.
[0040] Thirdly, 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 UAV path planning method based on the improved snake optimization algorithm as described in the first aspect above.
[0041] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the UAV path planning method based on the improved snake optimization algorithm as described in the first aspect above.
[0042] Fifthly, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the UAV path planning method based on the improved snake optimization algorithm as described in the first aspect.
[0043] Sixthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the UAV path planning method based on the improved snake optimization algorithm as described in the first aspect above.
[0044] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application.
[0045] The present invention provides a UAV path planning method based on an improved snake optimization algorithm, which has the following advantages over existing technologies:
[0046] This invention employs an adaptive field-of-view scaling model: it correlates the search field of view of individual snakes with the iteration process and their current fitness value. A large field of view is used in the early stages of iteration, and then nonlinearly shrinks as iteration progresses (shifting to local development). Simultaneously, a larger field of view is reserved for low-fitness individuals, forcing them to explore uncovered areas. By combining the flow optimizer's diversion strategy and spiral flow exploration mechanism with the female snake population's exploration strategy to form a dual-population exploration strategy, the algorithm achieves both global search robustness and local convergence accuracy in complex optimization problems. By introducing a balance mechanism between exploration and development during the high-temperature development stage, the algorithm finds a balance between local refined search and global wide-area exploration, ultimately achieving efficient optimization. A multi-path exploration mechanism is introduced during the low-temperature development stage to improve the quality and diversity of solutions. These improvements aim to enhance the algorithm's global optimization capability for multi-peak problems while maintaining convergence speed.
[0047] (2) This invention applies the improved snake optimization algorithm to the three-dimensional path planning of UAVs. By utilizing the dynamic changes in ambient temperature and food quantity in the algorithm, it automatically switches between global search and local search modes. In scenarios with complex flight environments and numerous mountain obstacles, it can quickly converge to a safe and feasible flight path. By introducing optimization steps for path entanglement, it reconstructs the local path by selecting three points, reducing unreasonable path intersections, improving the smoothness and flyability of the generated path, and enhancing the practicality and reliability of UAV autonomous navigation. Attached Figure Description
[0048] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0049] Figure 1 This is a flowchart illustrating the UAV path planning method based on the improved snake optimization algorithm provided in the embodiments of this application;
[0050] Figure 2 This is a graph showing the change of the perturbation factor with the number of iterations provided in the embodiments of this application;
[0051] Figure 3 This is a schematic diagram of the structure of the UAV path planning device based on the improved snake optimization algorithm provided in the embodiments of this application;
[0052] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0053] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0054] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0055] The following description, in conjunction with the accompanying drawings, details the UAV path planning method, UAV path planning device, electronic device, and readable storage medium based on the improved snake optimization algorithm provided in this application, through specific embodiments and application scenarios.
[0056] Among them, the UAV path planning method based on the improved snake optimization algorithm can be applied to the terminal, specifically executed by the hardware or software in the terminal.
[0057] The terminal includes, but is not limited to, portable communication devices such as mobile phones or tablets with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).
[0058] The following embodiments describe a terminal including a display and a touch-sensitive surface. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
[0059] The UAV path planning method based on the improved snake optimization algorithm provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the UAV path planning method based on the improved snake optimization algorithm. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras and wearable devices. The UAV path planning method based on the improved snake optimization algorithm provided in this application embodiment will be described below using an electronic device as the execution subject.
[0060] Figure 1 This is a flowchart illustrating the UAV path planning method based on the improved snake optimization algorithm provided in this application embodiment, as shown below. Figure 1 As shown, the UAV path planning method based on the improved snake optimization algorithm includes steps 110, 120, 130, 140, 150, 160 and 170.
[0061] Step 110: Obtain the flight environment and 3D terrain information of the target UAV;
[0062] In some embodiments, the three-dimensional terrain information includes the map extent of the target UAV's flight environment and mountain feature information.
[0063] Step 120: Set the parameters and population size of the improved snake optimization algorithm, wherein the population includes male and female populations;
[0064] It's easy to understand that the snake optimization algorithm was inspired by the unique survival strategies and group behaviors of snakes in nature. Snakes are reptiles, widely distributed in various ecosystems worldwide except for polar regions, and are named for their limbless, streamlined bodies and unique, meandering locomotion. Most snakes prefer a solitary life, only briefly gathering during the breeding season or under specific climatic conditions (such as hibernation). They are typically active at dawn and dusk or at night, using their forked tongues to sense environmental temperature and chemical information to accurately locate prey. When faced with threats, snakes have evolved diverse defense strategies: cobras raise their necks and spray venom, tree snakes blend into vegetation with their scales, and members of the Colubridae family rely on explosive muscle power to quickly slip into rock crevices. Throughout their long evolutionary history, hunting and predation, as well as countering predators, have always constituted their core behavioral patterns.
[0065] Before the exploration phase, the algorithm divides the snake population into females (50%) and males (50%) to simulate the sex ratio of natural snake populations. The position update formulas for all behaviors of the snake population are the same for both males and females. The following only uses the male population as an example, and will not elaborate on the female population.
[0066] During the exploration phase, the behavior of snakes randomly searching when there is no food is simulated, thus expanding the global search area. One snake is randomly selected from the swarm as a temporary guide, mimicking the behavior of other snakes following and exploring after some individuals in the group discover potential food areas. The position update formula for the snake population during the exploration phase is as follows:
[0067]
[0068] in, A leader is randomly selected from the snake swarm. The flag is a directional marker; the snake may move forward or backward (+1 or -1), simulating how snakes adjust their direction in real-world situations due to environmental changes (such as obstacles). A m Amplitude factor f rand_leader f is the fitness value of the random leader. current This represents the fitness value of the current male individual. If the guide snake's fitness (i.e., the quality of food found) is better than the current snake's, the current snake trusts the guide more and increases its stride length (A). m Increase the step size (or decrease it) for global exploration, and vice versa. C2 is the step size factor for global exploration, similar to the "movement speed" of a snake. It is small by default (0.05) to avoid excessive jumping and missing local optima.
[0069] In high-temperature environments (such as midday), snakes, being cold-blooded animals whose body temperature depends on the external environment, may find that extreme heat can actually limit their activity range and hunting time. To cope with this challenge, snakes tend to meticulously search near known food sources, reducing long-distance travel to conserve energy. The snake's location can be updated using the following formula:
[0070]
[0071] in, The food source represents the best food location currently discovered, and all snakes move towards this location, similar to a snake swarm gathering around prey in reality. Temp is a temperature variable; in the early stages of high temperature (early iterations), snakes move more aggressively (Temp is close to 1), and as the temperature gradually decreases (Temp approaches 0), the disturbance decreases, and a finer search begins. C3 is the development factor (default 2), controlling the intensity of movement towards the food source; snakes are more proactive in approaching food at higher temperatures.
[0072] Low temperatures (such as at night) significantly suppress the metabolic rate, locomotion, and sensory sensitivity of snake populations. Therefore, snakes have evolved a series of adaptations to efficiently hunt within a limited activity window. In low-temperature conditions, snakes may fight for resources or increase population diversity through mating.
[0073] Males move towards the best females, competing to get closer to females with higher fitness, thus promoting survival of the fittest within the population and improving overall fitness. The fighting behavior of a snake population can be represented by the following formula:
[0074]
[0075] Among them, combat factor F M Fitness of the optimal female individual (f) best,f The better the F-value, the stronger the male's willingness to move towards it. M (Increase) to simulate resource contention. Q is a control parameter; initially, Q is larger, encouraging global exploration, while later, Q decreases, favoring local competition.
[0076] Male and female snakes mate to produce offspring, increasing population diversity through gene mixing and eliminating inferior individuals to prevent premature maturation. The mating behavior and egg hatching stage (replacing the worst individual) of snakes under low-temperature conditions can be represented by the following formula:
[0077]
[0078] Among them, M m Female fitness f is related to mating attractiveness. mate The higher the value, the stronger the attraction (M). m (Increase) to promote the transmission of high-quality genes.
[0079] Offspring replacement: The worst individual is randomly reset, simulating the elimination mechanism in natural selection. An egg is used to control whether the replacement of the worst individual is triggered (the replacement operation is performed with a 50% probability to avoid excessive interference with the population's evolutionary direction). When the egg is 1, the elimination of inferior individuals is simulated using the following formula:
[0080]
[0081] Where k is the index of the worst-fitting individual in the male population, satisfying... (Assuming the optimization objective is to minimize, then the maximum fitness value is the worst solution). l is the index of the worst-fit individual in the female population.
[0082] In some embodiments, the male population is a flow optimizer population.
[0083] Like most other algorithms, the snake optimization algorithm is prone to getting trapped in local optima, ultimately failing to find the optimal value. During the exploration phase, the snake optimization algorithm exhibits blindness in leader selection. Individuals randomly choose a leader of the same sex (males refer to males, females to females), completely ignoring the leader's fitness. If the leader's position is poor, it can cause the group to move into ineffective areas, wasting computational resources. In high-dimensional and complex problems, random leaders may not provide effective exploration information. Therefore, this paper combines the flow-diversion strategy and spiral flow exploration mechanism of the water flow optimization algorithm with the exploration strategy of the female snake population to form a dual-population exploration strategy.
[0084] After introducing a water-flow population during the exploration and development phase, the original male snake population was replaced by the water-flow population, forming a dual-population exploration strategy with the female population. Within the water-flow population, there is a 70% probability of performing a spiral flow operation, exploring the solution space in the target dimension through nonlinear angular perturbation (θ·cosθ), suitable for escaping local optima. There is a 30% probability of performing a dimension mapping operation, transferring information across dimensions, and generating new solutions using the distribution characteristics of other dimensions, enhancing population diversity. The following formula is used to simulate the water flow operation:
[0085]
[0086] Among them, X m The current population matrix (dimension N) m ×d). Let θ be the absolute distance between individuals i and k in dimension j1. θ is the helix angle parameter (θ = (2rand-1)·π). j1 is the randomly selected target dimension index (j1 = ceil(rand*dim)).
[0087]
[0088] Among them, X m The current population matrix (dimension N) m ×d). j2 is a randomly selected auxiliary dimension index (1≤j2≤dim, and j2≠j1). This means that the value of individual k in dimension j2 is normalized to [0, 1].
[0089] Step 130: Determine the ambient temperature and the amount of food. Based on the relationship between the amount of food and the ambient temperature, select to enter the global search mode or the local search mode.
[0090] Step 140: When entering local search mode and the ambient temperature is higher than the temperature threshold, execute the exploration-development balance strategy to obtain the first position update value, and update the population position based on the first position update value;
[0091] In some embodiments, executing the exploratory development balancing strategy to obtain the first position update includes:
[0092] Choose between small-scale or large-scale search based on probability thresholds;
[0093] When using a small-scale search, the first number of individuals are randomly selected from the current population to calculate the position mean, thus obtaining the first mean vector;
[0094] When using a large-scale search, a second number of individuals are randomly selected from the current population to calculate the position mean, resulting in a second mean vector, where the second number is greater than the first number.
[0095] Generate a random individual location;
[0096] The difference between the random individual position and the selected mean vector is calculated, and the first position update is obtained by combining the random factor.
[0097] In the high-temperature environment of the development phase, snakes' movements are limited by temperature, confining them to a meticulous search near food sources. However, during this phase, all individuals focus on the current global optimum, the "food source," without exploring potential better solutions. If the "food source" becomes a local optimum, the algorithm will stagnate. In complex multimodal functions, once the population clusters in a local optimum, it becomes difficult to escape. Therefore, this paper observes that under high temperatures, most snakes hide in various rock crevices or sand caves and do not actively seek food; only a few snakes actively venture out to hunt. These snakes in the shadows patiently wait for prey around their encampments, resulting in a better balance between capturing prey and preserving their own state. To simulate this mechanism, this paper flexibly switches between population exploration and development to reduce the probability of the algorithm getting trapped in local optima.
[0098] In exploring and developing balanced strategies, snake populations of different sizes are dynamically selected using p and q, allowing the population to flexibly switch between local development and global search, avoiding getting trapped in local optima. Subsequently, the population X... pmean or X qmean With random individual X m The difference in (K1) generates a perturbation term, which, combined with the random factor rand, enhances the diversity of search directions and the adaptability of the step size. Furthermore, the probability threshold Threshold3 controls the selection of a small-scale or large-scale mean strategy, achieving a dynamic balance between development and exploration. For example, a higher Threshold3 favors local development, while a lower Threshold3 favors global exploration. The exploration-development balance strategy is achieved using formula (8):
[0099]
[0100] in, Calculate the position mean for the first number of individuals. Calculate the position mean for the second number of individuals. X represents the location of a random individual. new,i For the first position update, X m It is a random factor.
[0101] Step 150: When entering local search mode and the ambient temperature is below the temperature threshold, execute the adaptive mutation mechanism to obtain the second position update, and update the population position based on the second position update.
[0102] In some embodiments, performing the adaptive mutation mechanism to obtain the second position update includes:
[0103] Construct a random diagonal matrix, perform a Hadamard product operation between the random diagonal matrix and the population gene pool to obtain an undirected mutation path, which serves as the first basis for the second position update.
[0104] The normalized weights are calculated based on the fitness values of all individuals in the population, and the population positions are weighted and aggregated to obtain the directional mutation path, which serves as the second basis for the second position update.
[0105] The second position update is obtained by multiplying the first basis or the second basis of the second position update by the adaptive decay hybrid scaling factor.
[0106] In the low-temperature mode of snake optimization, the snake population has a 40% probability of engaging in combat behavior and a 60% probability of engaging in mating behavior. However, snakes have certain drawbacks when engaging in mating behavior, such as the following:
[0107] Low diversity: M m Based on female fitness, and female attractiveness M f Based on male fitness. When there is a large difference in fitness distribution between the sexes (e.g., males are generally superior), it will lead to:
[0108] Females excessively clustered around males, causing a sharp drop in diversity.
[0109] Males lack the motivation to move toward females, causing the search to stall.
[0110] Invalid perturbation: M m Random scaling of rand will cause M to... m When M is very small (with large individual differences), the step size is close to 0, which easily leads to oscillations in place. m When the number of individuals is large (and they are similar), an excessively large step size can often cause the optimal solution to be skipped.
[0111] To address the shortcomings of the aforementioned study on snake population mating behavior in low-temperature conditions, this paper introduces a gene-based exploration mechanism to simulate gene exchange during snake population aggregation and the formation of overwintering nests, as well as the random migration behavior of juvenile snakes leaving their birthplace in spring. In the low-temperature mode, there is a 35% probability that individuals are randomly selected to construct a diagonal matrix (diag(M)) during gene exchange, simulating undirected variation in small populations (similar to the founder effect in genetics). There is a 65% probability of migration behavior; in the snake population migration behavior mode, a population is weighted according to fitness proportions to achieve species-directed gene mutation (similar to adaptive radiation in Darwin's finches). Finally, a random direction factor is introduced during location updates to enhance the ability to escape local optima. The following formula is used to realize gene exchange in overwintering nests:
[0112]
[0113] Where M is a random mapping matrix. Let cab be the undirected mutation path of the gene, and t be the adaptive weighting coefficient. Let diag(A) be its main diagonal vector. Construct matrix A to represent the gene pool in the snake population.
[0114] A weighted aggregation strategy is used to simulate undirected mutation of genes in a population. The weights are set positively correlated with fitness to guide the search in the direction of fastest fitness growth. This mutation is implemented using the following formula:
[0115]
[0116] Where f j Let ω be the fitness value of individual j. j Let j be the normalized fitness weight. This refers to gene mutation pathways that involve directed mutations.
[0117] Based on the above formula, the following formula is designed to update the location of snake populations in low-temperature environments:
[0118]
[0119] Where θ is the hybrid scaling factor, R i To obtain from population X m Selected high-quality individuals, W i E is a superior individual selected from the population. i In population X m An individual randomly selected from the group, α i For an individual adaptive vector, the perturbation factor is α = exp(ln(1-r) - 4r). 2 ), r = t / T, α changes with the number of iterations as follows Figure 2As shown. In the early stages of development, α is close to 1 to achieve large-scale perturbations; in the later stages of development, α is close to 0 to achieve micro-amplitude vibrations for local refinement.
[0120] Step 160: Based on the updated population position in step (4) or (5), obtain several paths of the target UAV, and select the shortest path as the current target path;
[0121] Step 170: Repeat steps (2) to (6) until the preset number of iterations is reached, and output the target path.
[0122] The UAV path planning method based on the improved snake optimization algorithm provided in this application can be executed by a UAV path planning device based on the improved snake optimization algorithm. This application uses the execution of the UAV path planning method based on the improved snake optimization algorithm by a UAV path planning device as an example to illustrate the UAV path planning device based on the improved snake optimization algorithm provided in this application.
[0123] This application also provides a UAV path planning device based on an improved snake optimization algorithm, such as... Figure 3 As shown, the UAV path planning device based on the improved snake optimization algorithm includes: an acquisition module 310, a first processing module 320, a second processing module 330, a third processing module 340, a fourth processing module 350, a fifth processing module 360, and an output module 370.
[0124] The acquisition module 310 is used to acquire the flight environment and three-dimensional terrain information of the target UAV;
[0125] The first processing module 320 is used to set the parameters and population size of the improved snake optimization algorithm, wherein the population includes a male population and a female population.
[0126] The second processing module 330 is used to determine the ambient temperature and the quantity of food, and select to enter the global search mode or the local search mode based on the relationship between the quantity of food and the ambient temperature.
[0127] The third processing module 340 is used to execute an exploration-development balance strategy when entering a local search mode and the ambient temperature is higher than the temperature threshold, to obtain the first position update, and to update the population position based on the first position update.
[0128] The fourth processing module 350 is used to execute an adaptive mutation mechanism when entering a local search mode and the ambient temperature is lower than the temperature threshold, to obtain the second position update amount, and to update the population position based on the second position update amount.
[0129] The fifth processing module 360 is used to obtain several paths of the target UAV based on the population position updated in step (4) or (5), and select the shortest path as the current target path.
[0130] Output module 370 is used to repeat steps (2) to (6) until the preset number of iterations is reached, and output the target path.
[0131] According to the UAV path planning method based on the improved snake optimization algorithm provided in the embodiments of this application, by applying the improved snake optimization algorithm to the UAV three-dimensional path planning, the algorithm automatically switches between global search and local search modes by utilizing the dynamic changes of ambient temperature and food quantity. In scenarios with complex flight environments and numerous mountain obstacles, it can quickly converge to a safe and feasible flight path. By introducing optimization steps to address path entanglement, the local path is reconstructed by selecting three points, reducing unreasonable path intersections, improving the smoothness and flyability of the generated path, and enhancing the practicality and reliability of UAV autonomous navigation.
[0132] The UAV path planning device based on the improved snake optimization algorithm provided in this application embodiment can achieve... Figures 1 to 2 The various processes implemented in the UAV path planning method based on the improved snake optimization algorithm will not be described again here to avoid repetition.
[0133] In some embodiments, such as Figure 4 As shown, this application embodiment also provides an electronic device 400, including a processor 401, a memory 402, and a computer program stored in the memory 402 and executable on the processor 401. When the program is executed by the processor 401, it implements the various processes of the above-described embodiment of the UAV path planning method based on the improved snake optimization algorithm and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0134] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0135] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described embodiment of the UAV path planning method based on the improved snake optimization algorithm and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0136] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0137] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described UAV path planning method based on the improved snake optimization algorithm.
[0138] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0139] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described UAV path planning method embodiment based on the improved snake optimization algorithm, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0140] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a device-level chip, device chip, chip device, or on-chip device chip, etc.
[0141] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0142] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the UAV path planning method based on the improved snake optimization algorithm of the various embodiments of this application.
[0143] In the description of this application, "first feature" and "second feature" may include one or more of the features.
[0144] In the description of this application, "multiple" means two or more.
[0145] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0146] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0147] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A UAV path planning method based on an improved snake optimization algorithm, characterized in that, The method includes: (1) Obtain the flight environment and three-dimensional terrain information of the target UAV; (2) Set the parameters and population size of the improved snake optimization algorithm, wherein the population includes male and female populations; (3) Determine the ambient temperature and the amount of food. Based on the relationship between the amount of food and the ambient temperature, select to enter the global search mode or the local search mode. (4) When entering the local search mode and the ambient temperature is higher than the temperature threshold, the exploration-development balance strategy is executed to obtain the first position update, and the population position is updated based on the first position update. (5) When entering the local search mode and the ambient temperature is lower than the temperature threshold, the adaptive mutation mechanism is executed to obtain the second position update, and the population position is updated based on the second position update. (6) Based on the population location updated in step (4) or (5), obtain several paths of the target UAV, and select the shortest path as the current target path; (7) Repeat steps (2) to (6) until the preset number of iterations is reached, and output the target path.
2. The UAV path planning method based on the improved snake optimization algorithm according to claim 1, characterized in that, The execution of the exploration-development balancing strategy to obtain the first position update includes: Choose between small-scale or large-scale search based on probability thresholds; When using a small-scale search, the first number of individuals are randomly selected from the current population to calculate the position mean, thus obtaining the first mean vector; When using a large-scale search, a second number of individuals are randomly selected from the current population to calculate the position mean, resulting in a second mean vector, where the second number is greater than the first number. Generate a random individual location; The difference between the random individual position and the selected mean vector is calculated, and the first position update is obtained by combining the random factor.
3. The UAV path planning method based on the improved snake optimization algorithm according to claim 2, characterized in that, The formula for calculating the first position update is as follows: in, Calculate the position mean for the first number of individuals. Calculate the position mean for the second number of individuals. X represents the location of a random individual. new,i For the first position update, X m It is a random factor.
4. The UAV path planning method based on the improved snake optimization algorithm according to claim 1, characterized in that, The execution of the adaptive mutation mechanism to obtain the second position update includes: Construct a random diagonal matrix, perform a Hadamard product operation between the random diagonal matrix and the population gene pool to obtain an undirected mutation path, which serves as the first basis for the second position update. The normalized weights are calculated based on the fitness values of all individuals in the population, and the population positions are weighted and aggregated to obtain the directional mutation path, which serves as the second basis for the second position update. The second position update is obtained by multiplying the first basis or the second basis of the second position update by the adaptive decay hybrid scaling factor.
5. The UAV path planning method based on the improved snake optimization algorithm according to claim 1, characterized in that, The male population is the flow optimizer population.
6. The UAV path planning method based on the improved snake optimization algorithm according to claim 1, characterized in that, The method also includes a path optimization step: If the target path has a tangled path segment, select three points on the tangled path segment, with two points located on either side of the tangled position and the other point located at the tangled position. Based on the three points, the local path is reconstructed to replace the entangled path segments, resulting in the optimized target path.
7. The UAV path planning method based on the improved snake optimization algorithm according to claim 1, characterized in that, The three-dimensional terrain information includes the map range of the target UAV's flight environment and mountain feature information.
8. A UAV path planning device based on an improved snake optimization algorithm, implemented using the UAV path planning method based on the improved snake optimization algorithm as described in any one of claims 1 to 7, characterized in that, The device includes: The acquisition module is used to acquire the flight environment and three-dimensional terrain information of the target UAV; The first processing module is used to set the parameters and population size of the improved snake optimization algorithm, wherein the population includes male and female populations; The second processing module is used to determine the ambient temperature and the quantity of food, and select to enter the global search mode or the local search mode based on the relationship between the quantity of food and the ambient temperature. The third processing module is used to execute an exploration-development balance strategy when entering local search mode and the ambient temperature is higher than the temperature threshold, to obtain the first position update, and to update the population position based on the first position update. The fourth processing module is used to execute an adaptive mutation mechanism when entering local search mode and the ambient temperature is lower than the temperature threshold, to obtain the second position update, and to update the population position based on the second position update. The fifth processing module is used to obtain several paths of the target UAV based on the population position updated in step (4) or (5), and select the shortest path as the current target path. The output module is used to repeat steps (2) to (6) until the preset number of iterations is reached, and output the target path.
9. 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 program, it implements the UAV path planning method based on the improved snake optimization algorithm as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the UAV path planning method based on the improved snake optimization algorithm as described in any one of claims 1 to 7.
Citation Information
Cited By
Unmanned aerial vehicle three-dimensional flight path planning method based on improved snake optimization algorithm
CN121898437A