Method and device for determining optimal driving path, storage medium and electronic device

By applying snake optimization algorithm in drone path planning, the problem that drone path planning in the existing technology is difficult to adapt to complex mountain photovoltaic power station environments, and more efficient and safer path planning is achieved.

CN119416994APending Publication Date: 2025-02-11HUANENG JILIN POWER GENERATION JIUTAI ELECTRIC FACTORY +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411440258.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The existing drone path planning algorithm is difficult to adapt to the complex mountain photovoltaic power station environment, resulting in poor path planning effect, slow convergence speed, repeated motion trajectory, and excessive path length, affecting the operation efficiency and safety of the drone.

Method used

The drone path is optimized by using snake optimization algorithm. By initializing multiple objects and dividing them into two groups, each population is respectively used to optimize the path length and security of candidate paths to determine the optimal path.

Benefits of technology

Quickly searching for the optimal or close to the optimal path in complex environments improves the accuracy and reliability of path planning and solves the problem that existing algorithms are difficult to adapt to complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416994A_ABST
    Figure CN119416994A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for determining an optimal driving path, a storage medium and an electronic device, and relates to the field of computers.The method for determining the optimal driving path comprises the steps that a plurality of objects are initialized and generated according to an environment model of a target area, the objects are divided into a first population and a second population, the position information of the plurality of objects is coded information of a driving path of the target object driving in the target area; performing path optimization on the first population and the second population by using a snake optimization algorithm to obtain a plurality of candidate optimal position information; the optimal position information is determined according to the fitness of the multiple pieces of candidate optimal position information, the optimal driving path is determined according to the optimal position information, and the fitness is used for comprehensively evaluating the path length and the path safety of the candidate driving path corresponding to the multiple pieces of candidate optimal position information. The fitness of the optimal position information is the highest among the fitness of the plurality of candidate optimal position information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and more specifically, to a method and device for determining an optimal driving path, a storage medium, and an electronic device. Background Art

[0002] Against the backdrop of increasingly severe global energy shortages, photovoltaic power generation has developed rapidly as a renewable energy alternative and has been widely promoted and applied. At present, photovoltaic power stations are built in various forms. Among them, mountain photovoltaic stations, as an important part of large-scale power stations, have the characteristics of large land area, complex and changeable terrain, and non-uniform component layout, which brings many challenges to the daily operation and maintenance of power stations. The operation and maintenance environment of mountain photovoltaic power stations is complex, the daily workload is large, and the components are exposed to harsh natural environments such as wind, sand, rain, snow, and extreme temperatures all year round. The failure rate is high, and it is easy to have poor or no power generation due to hot spot failures and dust obstruction. The traditional manual inspection method is inefficient and costly, and is accompanied by high safety risks, such as the operating risks of inspectors in harsh environments, and the long-term existence of faults that may be caused by untimely inspections, which in turn affects the overall power generation and economic benefits of the power station.

[0003] In order to improve the operation and maintenance efficiency and safety of photovoltaic power stations, drone technology has emerged and has gradually become an important means of intelligent inspection of photovoltaic power stations. With its advantages of high-altitude operation, rapid response, and precise positioning, drones have played an important role in the inspection of photovoltaic power stations. However, the application of drones in mountain photovoltaic power stations also faces new challenges, especially the problem of drone path planning. Most of the existing drone path planning models are based on two-dimensional or ordinary three-dimensional models, which fail to fully consider the complex and changeable terrain characteristics of mountain photovoltaic power stations, resulting in the planned paths being too idealized and difficult to adapt to the actual complex environment. At the same time, the existing path planning methods also have problems such as slow convergence speed, tortuous and repetitive motion trajectories, and long path lengths, which seriously affect the operation efficiency and safety of drones.

[0004] Regarding the problem in related technologies that the current UAV path planning algorithm is difficult to adapt to the actual complex environment, resulting in poor path planning effects, no effective solution has been proposed so far.

[0005] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention

[0006] The embodiments of the present application provide a method and device for determining an optimal driving path, a storage medium, and an electronic device to at least solve the problem in the related art that the current drone path planning algorithm is difficult to adapt to the actual complex environment, resulting in poor path planning effect.

[0007] According to one aspect of an embodiment of the present application, a method for determining an optimal driving path is provided, comprising: generating a plurality of objects based on an initialization of an environmental model of a target area, and dividing the plurality of objects into a first population and a second population, wherein the position information of the plurality of objects is coded information of a driving path of the target object in the target area; performing path optimization on the first population and the second population using a snake optimization algorithm respectively to obtain a plurality of candidate optimal position information; determining optimal position information based on the fitness of the plurality of candidate optimal position information, and determining an optimal driving path based on the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving paths corresponding to the plurality of candidate optimal position information, and the fitness of the optimal position information is the highest among the fitness of the plurality of candidate optimal position information.

[0008] In an exemplary embodiment, the snake optimization algorithm is used to perform path optimization on the first population and the second population respectively to obtain multiple candidate optimal position information, including: a determination step: determining the ambient temperature and the amount of food, wherein the ambient temperature and the amount of food are algorithm parameters of the snake optimization algorithm; a first update step: updating the position information of multiple objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food; a second update step: updating the ambient temperature and the amount of food; and looping the determination step, the first update step and the second update step for a preset number of times to obtain the multiple candidate optimal position information, wherein the preset number of times is the number of algorithm iterations of the snake optimization algorithm.

[0009] In an exemplary embodiment, updating the position information of the plurality of objects in the first population and the second population according to the value of the ambient temperature and the value of the food amount includes: when the food amount is less than a first preset threshold, updating the first position information of the plurality of first objects in the first population by formula X i,m (t+1)=X rand,m (t)±c2×A m ×((X max -X min )×rand+X min ) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X rand,f (t)±c2×A f ×((X max -X min )×rand+X min ) is updated, where X max is the upper bound of the location information in the target area, Xmin is the lower bound of the location information in the target area, X rand,m is the random position information of the first object in the target area, X rand,f is the random position information of the second object in the target area, X i,m is the position information of the i-th first object, X i,f is the position information of the i-th second object, rand is a random number (0, 1), A m The ability to find food for the first object, A f The ability to find food for a second subject, c2 is a constant parameter.

[0010] In an exemplary embodiment, when the amount of food is greater than a first preset threshold and the ambient temperature is greater than a second preset threshold, the first position information of the plurality of first objects in the first population and the second position information of the plurality of second objects in the second population are calculated by formula X i,j (t+1)=X food (t)±c3×Temp×rand×(X food (t)-X i,j (t)) is updated, where X food is the third position information, the third position information is the position information with the greatest fitness among the plurality of the first position information and the plurality of the second position information, X i,j is the position information of the first object or the second object, c3 is a constant parameter, Temp is the ambient temperature, and rand is a random number of (0, 1).

[0011] In an exemplary embodiment, updating the position information of multiple objects in the first population and the second population according to the values ​​of the ambient temperature and the food amount includes: determining the size of the random number rand when the food amount is greater than a first preset threshold and the ambient temperature is less than a second preset threshold; and updating the first position information of multiple first objects in the first population according to the formula X when it is determined that the random number is greater than a third preset threshold. i,m (t+1)=X i,m (t)+c3×FM×rad×(Q×X best,f -X i,m (t)) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X i,f (t+1)+c3×FF×rand×(Q×X best,m -X i,F (t+1)) is updated, where Xbest,m is the fourth position information, and the fourth position information is the position information with the greatest fitness among the plurality of the first position information, and X best,f is the fifth position information, the fifth position information is the position information with the largest fitness among the plurality of the second position information, FM is the combat power of the first object, FF is the combat power of the second object, the combat power of the first object and the second object is determined by initialization of the plurality of objects, and X i,m is the position information of the i-th first object, X i,f is the position information of the i-th second object, Q is the food amount, and c3 is a constant parameter; when it is determined that the random number is less than the third preset threshold, the first position information of the plurality of first objects in the first population is calculated by the formula X i,m (t+1)=X i,m (t)+c3×M m ×rand×(Q×X i,f (t)-X i,m (t)) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X i,f (t)+c3×M f ×rand×(Q×X i,m (t)-X i,f (t)) is updated, where M m is the mating ability of the first object, M f The mating capability of the second object is determined by initialization of the plurality of objects.

[0012] In an exemplary embodiment, after updating the position information of the plurality of objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food, the method further comprises: updating the sixth position information of the third object in the plurality of first objects by using the formula X worst,m =X min +rand×(X max -X min ) is updated, and the seventh position information of the fourth object in the plurality of second objects is updated by formula X worst,f =X min +rand×(X max -X min ), wherein the sixth position information is the position information with the smallest fitness among the plurality of the first position information, the seventh position information is the position information with the smallest fitness among the plurality of the second position information, and X max is the upper bound of the location information in the target area, X minis the lower bound of the location information in the target area, X worst,m is the updated sixth position information, X worst,f =X min +rand×(X max -X min ) is the updated seventh position information.

[0013] In an exemplary embodiment, the sixth position information of the third object among the plurality of first objects is obtained by formula X worst,m =X min +rand×(X max -X min ) is updated, and the seventh position information of the fourth object in the plurality of second objects is updated by formula X worst,f =X min +rand×(X max -X min ) is updated, the method further comprises: respectively calculating the Hamming distance between each two objects in the plurality of first objects and the plurality of second objects; when it is determined that the Hamming distance between the fifth object and the sixth object is less than the fourth preset threshold, calculating the Hamming distance between each two objects by formula c′ i =(1+Levy(0.1))c i The eighth position information of the fifth object or the ninth position information of the sixth object is updated, wherein c′ i is the updated eighth position information or the ninth position information, c i is the eighth position information or the ninth position information, and Levy() is the disturbance distribution function.

[0014] In an exemplary embodiment, updating the ambient temperature and the food amount includes: The ambient temperature is updated, and the formula The food amount is updated, wherein Temp is the ambient temperature, Q is the food amount, t is the current iteration number, and T is the preset number.

[0015] According to another aspect of an embodiment of the present application, a device for determining an optimal driving path is also provided, including: an initialization module, used to initialize and generate multiple objects according to an environmental model of a target area, and divide the multiple objects into a first population and a second population, wherein the position information of the multiple objects is the encoding information of the driving path of the target object in the target area; an optimization module, used to perform path optimization on the first population and the second population using a snake optimization algorithm, respectively, to obtain multiple candidate optimal position information; a determination module, used to determine the optimal position information according to the fitness of the multiple candidate optimal position information, and determine the optimal driving path according to the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving paths corresponding to the multiple candidate optimal position information, and the fitness of the optimal position information is the highest among the fitness of the multiple candidate optimal position information.

[0016] According to another aspect of the embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for determining the optimal driving path when running.

[0017] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for determining the optimal driving path through the computer program.

[0018] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0019] Through the present application, a plurality of objects are first generated based on the environmental model of the target area, and then the plurality of objects are divided into a first population and a second population, wherein the position information of the plurality of objects is the coded information of the driving path of the target object in the target area; the first population and the second population are respectively subjected to path optimization using the snake optimization algorithm to obtain a plurality of candidate optimal position information; the optimal position information is determined based on the fitness of the plurality of candidate optimal position information, and the optimal driving path is determined based on the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving path corresponding to the candidate optimal position information; the above scheme is adopted, and efficient path planning of complex mountain photovoltaic power stations is realized by using the snake optimization algorithm, so that the optimal or near-optimal path can be quickly searched in a complex environment, thereby improving the accuracy and reliability of path planning; and thus solving the problem in the related technology that the current UAV path planning algorithm is difficult to adapt to the actual complex environment, resulting in poor path planning effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0022] Figure 1 It is a hardware structure block diagram of a computer terminal of a method for determining an optimal driving path according to an embodiment of the present application;

[0023] Figure 2 is a flow chart of a method for determining an optimal driving path according to an embodiment of the present application;

[0024] Figure 3 is a schematic diagram of an optional cellular automaton model structure according to an embodiment of the present application;

[0025] Figure 4 is a schematic diagram of an optional snake optimization algorithm flow according to an embodiment of the present application;

[0026] Figure 5 It is a structural block diagram of a device for determining an optimal driving path according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal for determining an optimal driving path according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the optimal driving path in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0031] A wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0032] In this embodiment, a method for determining an optimal driving path is provided. Figure 2 is a flow chart of a method for determining an optimal driving path according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps S202-S208:

[0033] Step S202: Initializing and generating a plurality of objects according to the environment model of the target area, and dividing the plurality of objects into a first group and a second group, wherein the position information of the plurality of objects is the coded information of the driving path of the target object in the target area;

[0034] Optionally, a uniformly distributed random population can be generated as the initial population based on the UAV environment model. The formula is as follows: X i =X min +r×(X max -X min ), where r is a random number ranging from 0 to 1, and X i represents the position of the i-th individual; X max and X min are the upper and lower bounds of the problem respectively.

[0035] Step S204: using a snake optimization algorithm to perform path optimization on the first population and the second population respectively, to obtain multiple candidate optimal position information;

[0036] Step S206: Determine the optimal position information based on the fitness of the multiple candidate optimal position information, and determine the optimal driving path based on the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving paths corresponding to the multiple candidate optimal position information, and the fitness of the optimal position information is the highest among the fitness of the multiple candidate optimal position information.

[0037] Through the above steps, a plurality of objects are first generated according to the environmental model of the target area, and then the plurality of objects are divided into a first population and a second population, wherein the position information of the plurality of objects is the coded information of the driving path of the target object in the target area; the first population and the second population are respectively subjected to path optimization using the snake optimization algorithm to obtain a plurality of candidate optimal position information; the optimal position information is determined according to the fitness of the plurality of candidate optimal position information, and the optimal driving path is determined according to the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving path corresponding to the candidate optimal position information; the above scheme is adopted, and efficient path planning of complex mountain photovoltaic power stations is realized by using the snake optimization algorithm, so that the optimal or near-optimal path can be quickly searched in a complex environment, thereby improving the accuracy and reliability of path planning; and thus solving the problem in the related technology that the current UAV path planning algorithm is difficult to adapt to the actual complex environment, resulting in poor path planning effect.

[0038] In an exemplary embodiment, the snake optimization algorithm is used to perform path optimization on the first population and the second population respectively to obtain multiple candidate optimal position information, including: a determination step: determining the ambient temperature and the amount of food, wherein the ambient temperature and the amount of food are algorithm parameters of the snake optimization algorithm; a first update step: updating the position information of multiple objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food; a second update step: updating the ambient temperature and the amount of food; and looping the determination step, the first update step and the second update step for a preset number of times to obtain the multiple candidate optimal position information, wherein the preset number of times is the number of algorithm iterations of the snake optimization algorithm.

[0039] One round of optimization process of the snake optimization algorithm includes: first determining the size of the ambient temperature and the amount of food, which are both algorithm parameters of the snake optimization algorithm and are used to control different optimization stages; then updating the positions of all snake individuals (multiple objects) according to the values ​​of ambient temperature and food amount; after the position update is completed, updating the ambient temperature and food amount once to enter the next iterative optimization process.

[0040] Optionally, updating the position information of the plurality of objects in the first population and the second population according to the value of the ambient temperature and the value of the food amount includes: when the food amount is less than a first preset threshold, updating the first position information of the plurality of first objects in the first population by formula X i,m (t+1)=X rand,m (t)±c2×A m ×((X max -X min )×rand+X min ) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X rand,f (t)±c2×A f ×((X max -X min )×rand+X min ) is updated, where X max is the upper bound of the location information in the target area, X min is the lower bound of the location information in the target area, X rand,m is the random position information of the first object in the target area, X rand,f is the random position information of the second object in the target area, X i,m is the position information of the i-th first object, X i,f is the position information of the i-th second object, rand is a random number (0, 1), A m The ability to find food for the first object, A f The ability to find food for a second subject, c2 is a constant parameter.

[0041] In an optional embodiment, when the amount of food in the snake group is lower than a first preset threshold (i.e., Q≤0.25), the snake group is in a search phase, and individual snakes will search for food by selecting random positions and update their positions relative to the food. In the search phase, the positions of male individuals (i.e., the first object) and female individuals (i.e., the second object) are updated as follows:

[0042] X i,m (t+1)=X rand,m (t)±c2×A m ×((X max -X min )×rand+X min ),

[0043] X i,f (t+1)=X rand,f (t)±c2×A f×((X max -X min )×rand+X min ),

[0044]

[0045] Where, X rand,m represents the position of a random male; X rand,f represents the position of a random female; X i,m represents the position of the ith male; rand is a random number ranging from 0 to 1; A m , A f are the food-finding abilities of males and females, respectively; c2 is a constant with a value of 0.05.

[0046] Optionally, updating the position information of the plurality of objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food includes: when the amount of food is greater than a first preset threshold and the ambient temperature is greater than a second preset threshold, updating the first position information of the plurality of first objects in the first population and the second position information of the plurality of second objects in the second population by formula X i,j (t+1)=X food (t)±c3×Temp×rand×(X food (t)-X i,j (t)) is updated, where X food is the third position information, the third position information is the position information with the greatest fitness among the plurality of the first position information and the plurality of the second position information, X i,j is the position information of the first object or the second object, c3 is a constant parameter, Temp is the ambient temperature, and rand is a random number of (0,1).

[0047] In another optional embodiment, when the snake group is in a situation where there is sufficient food and the ambient temperature is high (Q>0.25 and T>0.6), the snakes will only move towards the food, and their positions are updated as follows:

[0048] X i,j (t+1)=X food (t)±c3×Temp×rand×(X food (t)-X i,j (t)), where X food represents the position of the best individual; X i,j represents the position of all individuals (male or female); c3 represents a constant with a value of 2.

[0049] Optionally, updating the position information of multiple objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food includes: determining the size of the random number rand when the amount of food is greater than a first preset threshold and the ambient temperature is less than a second preset threshold; and updating the first position information of multiple first objects in the first population by formula X when it is determined that the random number is greater than a third preset threshold. i,m (t+1)=X i,m (t)+c3×FM×rand×(Q×X best,f -X i,m (t)) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X i,f (t+1)+c3×FF×rand×(Q×X best,m -X i,F (t+1)) is updated, where X best,m is the fourth position information, and the fourth position information is the position information with the greatest fitness among the plurality of the first position information, and X best,f is the fifth position information, the fifth position information is the position information with the largest fitness among the plurality of the second position information, FM is the combat power of the first object, FF is the combat power of the second object, the combat power of the first object and the second object is determined by initialization of the plurality of objects, and X i,m is the position information of the i-th first object, X i,f is the position information of the i-th second object, Q is the food amount, and c3 is a constant parameter; when it is determined that the random number is less than the third preset threshold, the first position information of the plurality of first objects in the first population is calculated by the formula X i,m (t+1)=X i,m (t)+c3×M m ×rand×(Q×X i,f (t)-X i,m (t)) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X i,f (t)+c3×M f ×rand×(Q×X i,m (t)-X i,f (t)) is updated, where M m is the mating ability of the first object, M f The mating capability of the second object is determined by initialization of the plurality of objects.

[0050] In a third optional embodiment, when the snake group has sufficient food and the ambient temperature is low (Q>0.25 and T<0.6), the snakes will be in fighting mode or mating mode, and the positions of all individual snakes will be updated according to the value of the random number by obtaining the random number rand.

[0051] When rand>0.6, the snake is in fighting mode, and the positions of the male (first object) and the female (second object) are updated as follows:

[0052] X i,m (t+1)=X i,m (t)+c3×FM×rand×(Q×X best,f -X i,m (t)),

[0053] X i,f (t+1)=X i,f (t+1)+c3×FF×rand×(Q×X best,m -X i,F (t+1)), where X best,m and X best,f Represent the positions of the best individuals in the male and female groups, respectively; FM and FF represent the fighting power of male and female individuals, respectively.

[0054] When rand < 0.6, the snake is in mating mode, and the positions of male and female individuals are updated as follows:

[0055] X i,m (t+1)=X i,m (t)+c3×M m ×rand×(Q×X i,f (t)-X i,m (t)),

[0056] X i,f (t+1)=X i,f (t)+c3×M f ×rand×(Q×X i,m (t)-X i,f (t)), where M m and M f The mating abilities of males and females respectively.

[0057] Optionally, after updating the position information of multiple objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food, the method further includes: updating the sixth position information of the third object in the multiple first objects by formula X worst,m =X min +rand×(X max -Xmin ) is updated, and the seventh position information of the fourth object in the plurality of second objects is updated by formula X worst,f =X min +rand×(X max -X min ), wherein the sixth position information is the position information with the smallest fitness among the plurality of the first position information, the seventh position information is the position information with the smallest fitness among the plurality of the second position information, and X max is the upper bound of the location information in the target area, X min is the lower bound of the location information in the target area, X worst,m is the updated sixth position information, X worst,f =X min +rand×(X max -X min ) is the updated seventh position information.

[0058] After the individual snake positions are updated, the worst male and female individuals will be replaced:

[0059] X worst,m =X min +rand×(X max -X min ),

[0060] X worst,f =X min +rand×(X max -X min ), where X worst,f is the worst individual in the female group, X worst,m Is the worst individual in the male group.

[0061] Optionally, the sixth position information of the third object among the plurality of first objects is obtained by formula X worst,m =X min +rand×(X max -X min ) is updated, and the seventh position information of the fourth object in the plurality of second objects is updated by formula X worst,f =X min +rand×(X max -X min ) is updated, the method further comprises: respectively calculating the Hamming distance between each two objects in the plurality of first objects and the plurality of second objects; when it is determined that the Hamming distance between the fifth object and the sixth object is less than the fourth preset threshold, calculating the Hamming distance between each two objects by formula c′ i =(1+Levy(0.1))c iThe eighth position information of the fifth object or the ninth position information of the sixth object is updated, wherein c′ i is the updated eighth position information or the ninth position information, c i is the eighth position information or the ninth position information, and Levy() is the disturbance distribution function.

[0062] like Figure 3 As shown in the figure, each snake individual is regarded as a cell, each cell has 8 neighboring cells around it, and the Hamming distance between the cell and its neighbor cells is calculated respectively. If the Hamming distance is small, it means that the cell is highly similar to the neighbor cell, and it is necessary to add disturbance to increase the dissimilarity, so as to improve the diversity of the algorithm population and avoid falling into the local optimum: c′ i =(1+Levy(0.1))c i , where c′ i represents the updated position, c i represents the current position, and Levy is the disturbance distribution function.

[0063] Optionally, updating the ambient temperature and the food amount includes: updating the ambient temperature and the food amount by formula The ambient temperature is updated, and the formula The food amount is updated, wherein Temp is the ambient temperature, Q is the food amount, t is the current iteration number, and T is the preset number.

[0064] The update formula for ambient temperature is: In the formula, t represents the current number of iterations, T represents the maximum number of iterations, which is the preset number mentioned above; and the update formula for the amount of food is: Where c1 is a constant equal to 0.5.

[0065] Optionally, this application also proposes an optimal local jitter mechanism, which is to search for individuals with higher fitness by randomly searching in a small range around the optimal individual by means of local perturbations, thereby improving the global search capability of the algorithm and accelerating the convergence speed of the algorithm: Among them, X′(t) is the updated individual, X(t) is the current individual, and g represents a random number in the interval [0, 1].

[0066] Through the above embodiments, a UAV path planning method based on the improved snake optimization algorithm is proposed. The method has stable convergence, can avoid falling into the local optimum, generate a feasible, safe and optimal flight path for the UAV operation, and can demonstrate good path planning capabilities in complex mountain photovoltaic power station scenarios.

[0067] In an optional embodiment, the present application embodiment provides an optional drone path optimization method, the process is as follows: Figure 4 As shown, the following steps are included:

[0068] Step 1: Set parameters and initialize the population;

[0069] Step 2, dividing the population into male population and female population;

[0070] Step 3, current iteration number t=t+1;

[0071] Step 4: Find the best male individual and the best female individual;

[0072] Step 5: Calculate the ambient temperature and food quantity for this iteration;

[0073] Step 6: Determine whether the amount of food is less than 0.25 (i.e., the first preset threshold value). If yes, proceed to step 7; otherwise, proceed to step 8;

[0074] Step 7: Enter the stage of finding food;

[0075] During the food search phase, the positions of male and female individuals are updated as follows:

[0076] X i,m (t+1)=X rand,m , (t) ±c2×A m ×((X max -X min )×rand+X min ),

[0077] X i,f (t+1)=X rand,f (t)±c2×A f ×((X max -X min )×rand+X min ),

[0078]

[0079] In the formula, X rand,m represents the position of a random male; X rand,f represents the position of a random female; X i,m represents the position of the ith male; rand is a random number ranging from 0 to 1; A m , A f are the food-finding abilities of males and females, respectively; c2 is a constant with a value of 0.05.

[0080] Step 8: Determine whether the ambient temperature is greater than 0.6 (i.e., the second preset threshold value). If so, execute step 9; otherwise, execute step 10.

[0081] Step 9: Move towards the food;

[0082] At this stage, the snake will only move towards the food, and its position is updated as follows: i,j (t+1)=X food (t)±c3×Temp×rand×(X food (t)-X i,j (t)), where X food represents the position of the best individual; X i,j represents the position of all individuals (male or female); c3 represents a constant with a value of 2.

[0083] Step 10, determine whether rand is greater than 0.6 (i.e., the third preset threshold), if so, execute step 11, if not, execute step 12;

[0084] Step 11: Enter combat mode;

[0085] When rand>0.6, the snake is in fighting mode, and the positions of male and female individuals are updated as follows:

[0086] X i,m (t+1)=X i,m (t)+c3×FM×rand×(Q×X best,f -X i,m (t)),

[0087] X i,f (t+1)=X i,f (t+1)+c3×FF×rad×(Q×X best,m -X i,F (t+1)),

[0088] In the formula, X best,m and X best,f Represent the positions of the best individuals in the male and female groups, respectively; FM and FF represent the fighting power of male and female individuals, respectively.

[0089] Step 12: Enter mating mode;

[0090] When rand < 0.6, the snake is in mating mode, and the positions of male and female individuals are updated as follows:

[0091] X i,m (t+1)=X i,m (t)+c3×M m ×rand×(Q×X i,f(t)-X i,m (t)),

[0092] X i,f (t+1)=X i,f (t)+c3×M f ×rand×(Q×X i,m (t)-X i,f (t)),

[0093] Where M m and M f The mating abilities of males and females respectively.

[0094] Step 13: Lay eggs to replace the worst individuals;

[0095] After the individual snake positions are updated, the worst male and female individuals will be replaced:

[0096] X worst,m =X min +rand×(X max -X min ),

[0097] X worst,f =X min +rand×(X max -X min ),

[0098] Where, X worst,f is the worst individual in the female group, X worst,m Is the worst individual in the male group.

[0099] Step 14: Determine whether the maximum number of iterations has been reached; if not, return to step 3; if yes, end the optimization process and output the optimization result.

[0100] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0101] In this embodiment, a device for determining an optimal driving path is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0102] Figure 5 : is a structural block diagram of a device for determining an optimal driving path according to an embodiment of the present application, the device comprising:

[0103] An initialization module 52, configured to initialize and generate a plurality of objects according to an environmental model of a target area, and divide the plurality of objects into a first group and a second group, wherein the position information of the plurality of objects is coded information of a driving path of the target object in the target area;

[0104] An optimization module 54, configured to perform path optimization on the first population and the second population using a snake optimization algorithm to obtain multiple candidate optimal position information;

[0105] The determination module 56 is used to determine the optimal position information according to the fitness of the multiple candidate optimal position information, and determine the optimal driving path according to the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving paths corresponding to the multiple candidate optimal position information, and the fitness of the optimal position information is the highest among the fitness of the multiple candidate optimal position information.

[0106] Through the above-mentioned device, a plurality of objects are first generated according to the environmental model of the target area, and then the plurality of objects are divided into a first population and a second population, wherein the position information of the plurality of objects is the coded information of the driving path of the target object in the target area; the first population and the second population are respectively subjected to path optimization using the snake optimization algorithm to obtain a plurality of candidate optimal position information; the optimal position information is determined according to the fitness of the plurality of candidate optimal position information, and the optimal driving path is determined according to the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving path corresponding to the candidate optimal position information; the above-mentioned scheme is adopted, and efficient path planning of complex mountain photovoltaic power stations is realized by using the snake optimization algorithm, so that the optimal or near-optimal path can be quickly searched in a complex environment, thereby improving the accuracy and reliability of path planning; thereby solving the problem in the related technology that the current UAV path planning algorithm is difficult to adapt to the actual complex environment, resulting in poor path planning effect.

[0107] Optionally, the above-mentioned optimization module 54 is also used to loop the preset number of determination steps, the first update step and the second update step to obtain the multiple candidate optimal position information, wherein the preset number is the number of algorithm iterations of the snake optimization algorithm, wherein the determination step includes: determining the size of the ambient temperature and the amount of food, wherein the ambient temperature and the amount of food are both algorithm parameters of the snake optimization algorithm; the first update step includes: updating the position information of multiple objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food; the second update step includes: updating the ambient temperature and the amount of food; looping the preset number of determination steps, the first update step and the second update step to obtain the multiple candidate optimal position information, wherein the preset number is the number of algorithm iterations of the snake optimization algorithm.

[0108] Optionally, the optimization module 54 is further configured to, when the amount of food is less than a first preset threshold, calculate the first position information of the plurality of first objects in the first population by using the formula X i,m (t+1)=X rand,m (t)±c2×A m ×((X max -X min )×rand+X min ) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X rand,f (t)±c2×A f ×((X max -X min )×rand+X min ) is updated, where X max is the upper bound of the location information in the target area, X min is the lower bound of the location information in the target area, X rand,m is the random position information of the first object in the target area, X rand,f is the random position information of the second object in the target area, X i,m is the position information of the i-th first object, X i,f is the position information of the i-th second object, rand is a random number (0, 1), A m The ability to find food for the first object, A f The ability to find food for a second subject, c2 is a constant parameter.

[0109] Optionally, the optimization module 54 is further configured to, when the amount of food is greater than a first preset threshold and the ambient temperature is greater than a second preset threshold, calculate the first position information of the plurality of first objects in the first population and the second position information of the plurality of second objects in the second population by using the formula X i,j (t+1)=X food (t)±c3×Temp×rand×(X food (t)-X i,j (t)) is updated, where X food is the third position information, the third position information is the position information with the greatest fitness among the plurality of the first position information and the plurality of the second position information, X i,j is the position information of the first object or the second object, c3 is a constant parameter, Temp is the ambient temperature, and rand is a random number of (0,1).

[0110] Optionally, the optimization module 54 is further configured to determine the size of the random number rand when the amount of food is greater than a first preset threshold and the ambient temperature is less than a second preset threshold; and when it is determined that the random number is greater than a third preset threshold, calculate the first position information of the plurality of first objects in the first population by using the formula X i,m (t+1)=X i,m (t)+c3×FM×rand×(Q×X best,f -X i,m (t)) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X i,f (t+1)+c3×FF×rand×(Q×X best,m -X i,F (t+1)) is updated, where X best,m is the fourth position information, and the fourth position information is the position information with the greatest fitness among the plurality of the first position information, and X best,f is the fifth position information, the fifth position information is the position information with the largest fitness among the plurality of the second position information, FM is the combat power of the first object, FF is the combat power of the second object, the combat power of the first object and the second object is determined by initialization of the plurality of objects, and X i,m is the position information of the i-th first object, X i,f is the position information of the i-th second object, Q is the food amount, and c3 is a constant parameter; when it is determined that the random number is less than the third preset threshold, the first position information of the plurality of first objects in the first population is calculated by the formula X i,m (t+1)=X i,m (t)+c3×Mm ×rand×(Q×X i,f (t)-X i,m (t)) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X i,f (t)+c3×M f ×rand×(Q×X i,m (t)-X i,f (t)) is updated, where M m is the mating ability of the first object, M f The mating capability of the second object is determined by initialization of the plurality of objects.

[0111] Optionally, the optimization module 54 is further configured to calculate the sixth position information of the third object among the plurality of first objects by formula X worst,m =X min +rand×(X max -X min ) is updated, and the seventh position information of the fourth object in the plurality of second objects is updated by formula X worst,f =X min +rand×(X max -X min ), wherein the sixth position information is the position information with the smallest fitness among the plurality of the first position information, the seventh position information is the position information with the smallest fitness among the plurality of the second position information, and X max is the upper bound of the location information in the target area, X min is the lower bound of the location information in the target area, X worst,m is the updated sixth position information, X worst,f =X min +rand×(X max -X min ) is the updated seventh position information.

[0112] Optionally, the optimization module 54 is further configured to respectively calculate the Hamming distance between each two objects in the plurality of first objects and the plurality of second objects; when it is determined that the Hamming distance between the fifth object and the sixth object is less than a fourth preset threshold, the formula c′ is used to calculate the Hamming distance between each two objects in the plurality of first objects and the plurality of second objects; i =(1+Levy(0.1))c i The eighth position information of the fifth object or the ninth position information of the sixth object is updated, wherein c′ i is the updated eighth position information or the ninth position information, c iis the eighth position information or the ninth position information, and Levy() is the disturbance distribution function.

[0113] Optionally, the optimization module 54 is further configured to: The ambient temperature is updated, and the formula The food amount is updated, wherein Temp is the ambient temperature, Q is the food amount, t is the current iteration number, and T is the preset number.

[0114] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0115] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0116] S1, generating a plurality of objects according to an initialization of an environmental model of a target area, and dividing the plurality of objects into a first group and a second group, wherein the position information of the plurality of objects is coded information of a driving path of the target object in the target area;

[0117] S2, performing path optimization on the first population and the second population using a snake optimization algorithm to obtain multiple candidate optimal position information;

[0118] S3, determining the optimal position information according to the fitness of the multiple candidate optimal position information, and determining the optimal driving path according to the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving paths corresponding to the multiple candidate optimal position information, and the fitness of the optimal position information is the highest among the fitness of the multiple candidate optimal position information.

[0119] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0120] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0121] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0122] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0123] S1, generating a plurality of objects according to an initialization of an environmental model of a target area, and dividing the plurality of objects into a first group and a second group, wherein the position information of the plurality of objects is coded information of a driving path of the target object in the target area;

[0124] S2, performing path optimization on the first population and the second population using a snake optimization algorithm to obtain multiple candidate optimal position information;

[0125] S3, determining the optimal position information according to the fitness of the multiple candidate optimal position information, and determining the optimal driving path according to the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving paths corresponding to the multiple candidate optimal position information, and the fitness of the optimal position information is the highest among the fitness of the multiple candidate optimal position information.

[0126] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0127] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0128] Optionally, in this embodiment, the above computer program may be configured to implement the following steps when executed by a processor:

[0129] S1, generating a plurality of objects according to an initialization of an environmental model of a target area, and dividing the plurality of objects into a first group and a second group, wherein the position information of the plurality of objects is coded information of a driving path of the target object in the target area;

[0130] S2, performing path optimization on the first population and the second population using a snake optimization algorithm to obtain multiple candidate optimal position information;

[0131] S3, determining the optimal position information according to the fitness of the multiple candidate optimal position information, and determining the optimal driving path according to the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving paths corresponding to the multiple candidate optimal position information, and the fitness of the optimal position information is the highest among the fitness of the multiple candidate optimal position information.

[0132] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0133] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0134] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for determining an optimal driving path, characterized in that: include: Initializing and generating a plurality of objects according to an environmental model of a target area, and dividing the plurality of objects into a first group and a second group, wherein the position information of the plurality of objects is coded information of a driving path of the target object in the target area; Using a snake optimization algorithm to perform path optimization on the first population and the second population respectively to obtain multiple candidate optimal position information; The optimal position information is determined based on the fitness of the multiple candidate optimal position information, and the optimal driving path is determined based on the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving paths corresponding to the multiple candidate optimal position information, and the fitness of the optimal position information is the highest among the fitness of the multiple candidate optimal position information.

2. The method according to claim 1, characterized in that: The first population and the second population are respectively subjected to path optimization using a snake optimization algorithm to obtain multiple candidate optimal location information, including: Determining step: determining the ambient temperature and the amount of food, wherein the ambient temperature and the amount of food are both algorithm parameters of the snake optimization algorithm; A first updating step: updating the position information of a plurality of objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food; Second updating step: updating the ambient temperature and the food amount; The determining step, the first updating step and the second updating step are executed cyclically for a preset number of times to obtain the plurality of candidate optimal position information, wherein the preset number of times is the number of algorithm iterations of the snake optimization algorithm.

3. The method according to claim 2, characterized in that Updating the position information of a plurality of objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food includes: When the amount of food is less than a first preset threshold, the first position information of the plurality of first objects in the first population is obtained by using the formula X i,m (t+1)=X rand,m (t)±c2×A m ×((X max -X min )×randd+X min ) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X rand,f (t)±c2×A f ×((X max -X min )×rand+X min ) is updated, where X max is the upper bound of the location information in the target area, X min is the lower bound of the location information in the target area, X rand,m is the random position information of the first object in the target area, X rand,f is the random position information of the second object in the target area, X i,n is the position information of the i-th first object, X i,f is the position information of the i-th second object, rand is a random number (0, 1), A m The ability to find food for the first object, A f The ability to find food for a second subject, c2 is a constant parameter.

4. The method according to claim 2, characterized in that: Updating the position information of a plurality of objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food includes: When the amount of food is greater than a first preset threshold and the ambient temperature is greater than a second preset threshold, the first position information of the first objects in the first population and the second position information of the second objects in the second population are calculated by formula X i,j (t+1)=X food (t)±c3×Temp×rand×(X food (t)-X i,j (t)) is updated, where X food is the third position information, the third position information is the position information with the greatest fitness among the plurality of the first position information and the plurality of the second position information, X i,j is the position information of the first object or the second object, c3 is a constant parameter, Temp is the ambient temperature, and rand is a random number of (0, 1).

5. The method according to claim 2, characterized in that: Updating the position information of a plurality of objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food includes: When the food amount is greater than a first preset threshold and the ambient temperature is less than a second preset threshold, determining a size of a random number rand; When it is determined that the random number is greater than a third preset threshold, the first position information of the plurality of first objects in the first population is obtained by using the formula X i,m (t+1)=X i,m (t)+c3×FM×rand×(Q×X best,f -X i,m (t)) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X i,f (t+1)+c3×FF×rand×(Q×X best,m -X i,F (t+1)) is updated, where X best,m is the fourth position information, and the fourth position information is the position information with the greatest fitness among the plurality of the first position information, and X best,f is the fifth position information, the fifth position information is the position information with the largest fitness among the plurality of the second position information, FM is the combat power of the first object, FF is the combat power of the second object, the combat power of the first object and the second object is determined by initialization of the plurality of objects, and X i,m is the position information of the i-th first object, X i,f is the position information of the i-th second object, Q is the amount of food, and c3 is a constant parameter; When it is determined that the random number is less than the third preset threshold, the first position information of the plurality of first objects in the first population is obtained by using the formula X i,m (t+1)=X i,m (t)+c3×M m ×rand×(Q×X i,f (t)-X i,m (t)) is updated, and the second position information of the plurality of second objects in the second population is updated by formula X i,f (t+1)=X i,f (t)+c3×M f ×rand×(Q×X i,m (t)-X i,f (t)) is updated, where M m is the mating capability of the first object, Mf is the mating capability of the second object, and the mating capabilities of the first object and the second object are determined by initialization of the multiple objects.

6. The method according to any one of claims 3 to 5, characterized in that After updating the position information of a plurality of objects in the first population and the second population according to the values ​​of the ambient temperature and the amount of food, the method further includes: The sixth position information of the third object among the plurality of first objects is obtained by formula X worst,m =X min +rand×(X max -X min ) is updated, and the seventh position information of the fourth object in the plurality of second objects is updated by formula X worst,f =X min +rand×(X max -X min ), wherein the sixth position information is the position information with the smallest fitness among the plurality of the first position information, the seventh position information is the position information with the smallest fitness among the plurality of the second position information, and X max is the upper bound of the location information in the target area, X min is the lower bound of the location information in the target area, X worst,m is the updated sixth position information, X worst,f =X min +rand×(X max -X min ) is the updated seventh position information.

7. The method according to claim 6, characterized in that The sixth position information of the third object among the plurality of first objects is obtained by formula X worst,m =X min +rand×(X max -X min ) is updated, and the seventh position information of the fourth object in the plurality of second objects is updated by formula X worst,f =X min +rand×(X max -X min ) is updated, the method further comprises: respectively calculating the Hamming distance between each two objects in the plurality of first objects and the plurality of second objects; In the case where it is determined that the Hamming distance between the fifth object and the sixth object is less than the fourth preset threshold, the formula c′ is used. i =(1+Levy(0.1))c i The eighth position information of the fifth object or the ninth position information of the sixth object is updated, wherein c′ i is the updated eighth position information or the ninth position information, c i is the eighth position information or the ninth position information, and Levy() is the disturbance distribution function.

8. The method according to claim 2, characterized in that: Updating the ambient temperature and the food amount includes: By formula The ambient temperature is updated, and the formula The food amount is updated, wherein Temp is the ambient temperature, Q is the food amount, t is the current iteration number, and T is the preset number.

9. A device for determining an optimal driving path, characterized in that: include: An initialization module, used for initializing and generating a plurality of objects according to an environmental model of a target area, and dividing the plurality of objects into a first group and a second group, wherein the position information of the plurality of objects is coded information of a driving path of the target object in the target area; an optimization module, configured to perform path optimization on the first population and the second population using a snake optimization algorithm to obtain multiple candidate optimal position information; A determination module is used to determine the optimal position information according to the fitness of the multiple candidate optimal position information, and determine the optimal driving path according to the optimal position information, wherein the fitness is used to comprehensively evaluate the path length and path safety of the candidate driving paths corresponding to the multiple candidate optimal position information, and the fitness of the optimal position information is the highest among the fitness of the multiple candidate optimal position information.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 8 when executed.

11. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 8 through the computer program.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.