A UAV path planning method, device, computer equipment and storage medium
By using a combination of large language models and two-dimensional topological networks in UAV path planning, dynamically generate and optimize path planning strategies, the problem of existing technology performing poorly in complex environments is solved, and the key nodes are achieved quickly and accurately Identification and path planning improve adaptability and robustness.
Patent Information
- Application Number
- CN202411489929.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-10-24
AI Technical Summary
The existing drone path planning algorithm performs poorly in complex and changing task scenarios and emergencies, especially when computing resources are limited, it cannot meet real-time decision-making needs, and lacks consideration of the characteristics of different tasks, resulting in Performance in atypical environments is uncertain.
By determining the initial optimal node scoring function within the preset number of iterations, cross-operation is used to generate cross-codes using a large language model, and population classification of node scoring functions is performed according to the output of the fitness function, dynamically generate and optimize path planning strategies, Combining the node and edge information in the two-dimensional topological network, dynamically adapt to environmental changes.
It realizes the rapid and accurate identification of key nodes in complex environments, improves the adaptability and robustness of drone path planning, meets real-time decision-making needs, and provides an optimized solution that is more in line with specific situations.
Smart Images

Figure CN118999584B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle (UAV) planning, and in particular to a method, device, computer equipment and storage medium for UAV path planning. Background Art
[0002] The path planning of UAV refers to the design of the optimal flight trajectory that meets the performance constraints of the UAV by considering factors such as terrain conditions and surrounding environment. According to different application scenarios, the existing UAV path planning algorithms have different focuses on the setting of goals and constraints. From the algorithmic point of view, it can be divided into two categories: traditional planning algorithms and intelligent optimization algorithms. Traditional planning algorithms include the shortest path optimization algorithm suitable for weighted graphs proposed by Tisdale et al. and the dynamic programming method proposed by Jennings et al. Intelligent optimization algorithms include the genetic algorithm proposed by Zhang et al., the neural network method proposed by Gautam et al., the particle swarm algorithm proposed by Roberge et al., etc. These algorithms can provide efficient and accurate solutions in certain predefined environments. However, when faced with complex and changing mission scenarios, especially the rapid response requirements in emergency environments, their limitations are exposed. On the one hand, heuristic algorithms usually assume that environmental characteristics have a certain stability. Once they encounter unexpected obstacles or targets, their performance will drop significantly; on the other hand, although the optimization algorithm can find the global optimal solution, it often takes too long to meet the needs of real-time decision-making under limited computing resources.
[0003] In recent years, with the development of deep learning, some studies have tried to use neural networks to learn the importance of drone nodes, that is, by assigning weights or scores to each node in the network to determine its importance in path planning. This method can be adaptively adjusted according to environmental changes, and in theory is more in line with the flexibility requirements of drone path planning in emergency environments. However, this method also faces challenges, especially when training on large-scale data sets, where high computational costs and long iteration processes limit its practical application value. In addition, due to the lack of consideration of different task characteristics, there is uncertainty in the performance of this method in atypical or special environments. Summary of the invention
[0004] Based on this, it is necessary to provide a UAV path planning method, device, computer equipment and storage medium to address the above technical problems, so as to more accurately identify key tasks and provide strong support for UAV path planning.
[0005] A method for unmanned aerial vehicle path planning, the method comprising:
[0006] Within a preset number of iterations, determine the initial best node scoring function in the function code pool of the current iteration; wherein, the input of the node scoring function is defined to include a node feature vector and an adjacency matrix, and the output includes a node ID and a node edge score; the node feature vector and the adjacency matrix are respectively converted from the node and edge information extracted from the two-dimensional topological network corresponding to the task scenario; the node is used to store task information; the edge is used to represent the association information between task locations; the initial best node scoring function is determined by comparing the size of the algorithm score output by the fitness function; wherein, the input of the fitness function is defined to be the node scoring function, and the output is the algorithm score and the algorithm similarity;
[0007] Randomly select two node scoring functions from the function code pool of the current iteration, combine them with the initial best node scoring function and use a large language model to perform crossover operations, generate crossover subcodes and put them into the function code pool after verification;
[0008] Traverse all crossover subcodes. If the random number is not less than the preset mutation probability threshold, the corresponding crossover subcode is input into the fitness function. The node scoring function corresponding to the crossover subcode is classified into populations according to the output algorithm similarity.
[0009] If the population size does not exceed 1, the fitness function is called to record the candidate best node scoring function and its corresponding candidate best algorithm score in the current iteration population saved on the current adjacency matrix;
[0010] If the candidate best algorithm score meets the preset conditions, the corresponding candidate best node scoring function is used as the target node scoring function, and the key node ID is determined according to the target node scoring function to guide the UAV's path planning.
[0011] A drone path planning device, the device comprising:
[0012] The initial best node scoring function determination module is used to determine the initial best node scoring function in the function code pool of the current iteration within a preset number of iterations; wherein the input of the node scoring function is defined to include a node feature vector and an adjacency matrix, and the output includes a node ID and a node edge score; the node feature vector and the adjacency matrix are respectively converted from the node and edge information extracted from the two-dimensional topological network corresponding to the task scenario; the node is used to store task information; the edge is used to represent the association information between task locations; the initial best node scoring function is determined by comparing the size of the algorithm score output by the fitness function; wherein the input of the fitness function is defined to be the node scoring function, and the output is the algorithm score and the algorithm similarity;
[0013] The crossover operation module is used to randomly select two node scoring functions from the function code pool of the current iteration, combine the initial best node scoring function with the large language model to perform crossover operations, generate crossover subcodes and put them into the function code pool after verification;
[0014] The population classification module is used to traverse all crossover subcodes. If the random number is not less than the preset mutation probability threshold, the corresponding crossover subcode is input into the fitness function, and the node scoring function corresponding to the crossover subcode is classified into populations according to the output algorithm similarity;
[0015] The candidate best node scoring function determination module is used to call the fitness function to record the candidate best node scoring function and its corresponding candidate best algorithm score in the current iteration population stored on the current adjacency matrix if the population size does not exceed 1;
[0016] The target node scoring function determination module is used to use the corresponding candidate best node scoring function as the target node scoring function if the candidate best algorithm score meets the preset conditions, and determine the key node ID according to the target node scoring function to guide the path planning of the drone.
[0017] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0018] Within a preset number of iterations, determine the initial best node scoring function in the function code pool of the current iteration; wherein, the input of the node scoring function is defined to include a node feature vector and an adjacency matrix, and the output includes a node ID and a node edge score; the node feature vector and the adjacency matrix are respectively converted from the node and edge information extracted from the two-dimensional topological network corresponding to the task scenario; the node is used to store task information; the edge is used to represent the association information between task locations; the initial best node scoring function is determined by comparing the size of the algorithm score output by the fitness function; wherein, the input of the fitness function is defined to be the node scoring function, and the output is the algorithm score and the algorithm similarity;
[0019] Randomly select two node scoring functions from the function code pool of the current iteration, combine them with the initial best node scoring function and use a large language model to perform crossover operations, generate crossover subcodes and put them into the function code pool after verification;
[0020] Traverse all crossover subcodes. If the random number is not less than the preset mutation probability threshold, the corresponding crossover subcode is input into the fitness function. The node scoring function corresponding to the crossover subcode is classified into populations according to the output algorithm similarity.
[0021] If the population size does not exceed 1, the fitness function is called to record the candidate best node scoring function and its corresponding candidate best algorithm score in the current iteration population saved on the current adjacency matrix;
[0022] If the candidate best algorithm score meets the preset conditions, the corresponding candidate best node scoring function is used as the target node scoring function, and the key node ID is determined according to the target node scoring function to guide the UAV's path planning.
[0023] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0024] Within a preset number of iterations, determine the initial best node scoring function in the function code pool of the current iteration; wherein, the input of the node scoring function is defined to include a node feature vector and an adjacency matrix, and the output includes a node ID and a node edge score; the node feature vector and the adjacency matrix are respectively converted from the node and edge information extracted from the two-dimensional topological network corresponding to the task scenario; the node is used to store task information; the edge is used to represent the association information between task locations; the initial best node scoring function is determined by comparing the size of the algorithm score output by the fitness function; wherein, the input of the fitness function is defined to be the node scoring function, and the output is the algorithm score and the algorithm similarity;
[0025] Randomly select two node scoring functions from the function code pool of the current iteration, combine them with the initial best node scoring function and use a large language model to perform crossover operations, generate crossover subcodes and put them into the function code pool after verification;
[0026] Traverse all crossover subcodes. If the random number is not less than the preset mutation probability threshold, the corresponding crossover subcode is input into the fitness function. The node scoring function corresponding to the crossover subcode is classified into populations according to the output algorithm similarity.
[0027] If the population size does not exceed 1, the fitness function is called to record the candidate best node scoring function and its corresponding candidate best algorithm score in the current iteration population saved on the current adjacency matrix;
[0028] If the candidate best algorithm score meets the preset conditions, the corresponding candidate best node scoring function is used as the target node scoring function, and the key node ID is determined according to the target node scoring function to guide the UAV's path planning.
[0029] The above-mentioned method, device, computer equipment and storage medium for UAV path planning construct a two-dimensional topological network of the real mission environment, and store various influencing factors in the UAV path planning process in the form of nodes and edges; then extract the node and edge information from the two-dimensional topological network, and convert the extracted network features into node feature vectors and adjacency matrices, and define the node scoring function with the node feature vectors and adjacency matrices as inputs, convert the UAV path planning task into a code generation task of the node scoring function, and take the code with the best algorithm score in the iterative process as the optimal solution, so as to find the optimal path planning strategy. By introducing the evolutionary algorithm of the large model, solutions can be dynamically generated and optimized, and the contextual understanding and programming skills of the large model can be used to automatically generate optimization functions that are more suitable for specific situations, thereby improving the adaptability and robustness of the solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of a flow chart of a method for planning a path for a drone in one embodiment;
[0031] Figure 2 In order to extract node and edge information from a two-dimensional topological network, the extracted network features are converted into a schematic diagram of an adjacency matrix and a node feature vector, where Figure 2 (a) is to convert the extracted network features into node feature vectors. Figure 2 (b) Convert the extracted network features into an adjacency matrix;
[0032] Figure 3 It is a flowchart based on the combination of domestic Qwen large language models (LLMs) and evolutionary algorithms (EA);
[0033] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0035] In one embodiment, Figure 1 As shown, a UAV path planning method is provided, comprising the following steps:
[0036] Step 102: Determine the initial best node scoring function in the function code pool of the current iteration within a preset number of iterations.
[0037] Before a new round of iterative calculation begins, it is necessary to determine whether the current number of iterations exceeds the preset number of iterations. If it has not exceeded the preset number of iterations, a new round of iterative calculation begins.
[0038] The inputs to define the node scoring function include: node feature vector and adjacency matrix, and the output includes node ID and node edge score. The node edge score is used to describe the relevance and importance of nodes and directly connected edges in a two-dimensional topological network. The node edge score is a quantitative indicator used to evaluate the comprehensive value or utility of nodes and directly connected edges in a graph. It not only takes into account the properties of the node itself (such as resources, location, task priority, etc.), but also takes into account the ability and cost of the node to interact with other nodes through its connecting edges.
[0039] Specifically, the node feature vector and the adjacency matrix are obtained by converting the node and edge information extracted from the two-dimensional topological network corresponding to the mission scenario. That is, the information contained in the node is converted into the node feature vector, and the information contained in the edge is converted into the adjacency matrix. The node is used to store the mission information, that is, the mission location in the actual mission scenario is abstracted as a node in the two-dimensional plane, and the edge is used to represent the association information between the mission locations. The node feature vector is usually a description of a single node, which contains various attributes and information related to the node. When a specific node (such as the node corresponding to the current location of the drone) needs to be evaluated, the feature vector of the node is used as the input of the scoring function. This means that each node scoring is completed based on the feature vector of a single node. For example, if the drone is currently located at node A, the feature vector of node A will be used to calculate the score of node A; if the drone moves to node B, the feature vector of node B will be used to recalculate the score. However, when it is mentioned that "the scores of all nodes are compared", this means that at a certain stage or decision point, all potential nodes that the drone can reach may be scored, and then the node with the highest score is selected as the next target node. Therefore, although the scoring function processes the feature vector of one node at a time, multiple nodes may be scored during the entire decision-making process and decisions may be made based on these scores.
[0040] The initial optimal node scoring function is determined by comparing the size of the algorithm score output by the fitness function. The input of the fitness function is defined as the node scoring function, and the output is the algorithm score and algorithm similarity.
[0041] In addition, the generation process of the function code pool in the first round of iteration includes: proposing specific task instructions to the large language model, and generating a series of different node scoring function code snippets based on the network characteristics of the two-dimensional topological network (i.e., node feature vectors and adjacency matrices) and the task instructions. For each code snippet generated by the large language model, syntax checking and preliminary logic verification are performed to ensure that the code is executable and has no obvious errors. Based on the results of the preliminary verification, node scoring functions with algorithm scores not lower than the preset threshold (such as 0.75) are selected and integrated into the initial algorithm population to obtain the function code pool for the first round of iteration. For the most initial node scoring function constructed in the first round of iteration, only the fitness function will be called to obtain the score of the corresponding initial algorithm, and the population will not be classified according to its algorithm similarity. Therefore, there is no population at the beginning of the first round of iteration.
[0042] Step 104, randomly select two node scoring functions from the function code pool of the current iteration, combine them with the initial best node scoring function and use a large language model to perform a crossover operation, generate a crossover sub-code and put it into the function code pool after verification.
[0043] The process of randomly selecting two node scoring functions for crossover operation is repeated n times, where n is a preset value, and thus n crossover sub-codes are generated.
[0044] The crossover operation using a large language model in combination with the initial best node scoring function refers to: determining whether the initial best node scoring function is in the two randomly selected node scoring functions, and determining the execution object of the crossover operation based on the determination result. Specifically:
[0045] If the initial best node scoring function of the current iteration is among the two randomly selected node scoring functions, the large language model is used to perform a cross operation on the codes of the two randomly selected node scoring functions;
[0046] If the initial best node scoring function of the current iteration is not among the two randomly selected node scoring functions, the code of one of the two randomly selected node scoring functions is randomly replaced with the initial best node scoring function of the current iteration, and then the code of the initial best node scoring function of the current iteration and the randomly selected node scoring function that has not been replaced is cross-operated using a large language model.
[0047] The large language model can be the domestic Qwen model.
[0048] Step 106, traverse all crossover subcodes, if the random number is not less than the preset mutation probability threshold, input the corresponding crossover subcode into the fitness function, and perform population classification on the node scoring function corresponding to the crossover subcode according to the output algorithm similarity.
[0049] Among them, if the random number of a sub-code is not less than the preset mutation probability threshold, it means that the sub-code does not need to perform a mutation operation.
[0050] Step 108: If the population size does not exceed 1, the fitness function is called to record the candidate best node scoring function and its corresponding candidate best algorithm score in the current iteration population stored on the current adjacency matrix.
[0051] The population is divided according to the algorithm similarity of the node scoring function. If the similarities are close, there is only one population, and subsequent operations only need to be performed on the current population.
[0052] The current adjacency matrix means: the mission scenario may change dynamically, and the two-dimensional topological network will change accordingly, so the corresponding node feature vector and adjacency matrix will also change. The mission scenario at the current moment corresponds to a certain adjacency matrix. It is necessary to find the best node scoring function on this adjacency matrix to find the next target node of the drone.
[0053] Step 110, if the candidate best algorithm score meets the preset conditions, the corresponding candidate best node scoring function is used as the target node scoring function, and the key node ID is determined according to the target node scoring function to guide the path planning of the UAV.
[0054] The feature vector of the node corresponding to the current mission position of the drone and the current adjacency matrix are input into the target node scoring function to output the node edge score. The next movement path of the drone and the target node ID can be determined based on the highest node edge score.
[0055] The "best node scoring function" can dynamically assign a score to each node based on the real-time status of the two-dimensional topological network. This means that no matter how the structure or node information of the two-dimensional topological network changes, as long as this best scoring function is applied, it can quickly and accurately identify the most critical or suitable nodes under the current conditions, thereby guiding the path planning of the drone. Therefore, the core value of solving the best node scoring function lies in providing a dynamically adaptive and intelligently optimized framework that enables the path planning system to flexibly respond to complex and changing environments and mission requirements, rather than being limited to the initial static scoring settings.
[0056] The above-mentioned drone path planning method combines the creative potential of large language models with the optimization capabilities of evolutionary algorithms, and innovatively transforms the drone path planning problem into a code generation and optimization selection task of a node scoring function, effectively expanding the application boundaries of artificial intelligence in the field of complex path planning and the innovation space of solutions.
[0057] It should be understood that although Figure 1The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0058] In one embodiment, the generation of a two-dimensional topological network corresponding to a task scenario includes the following steps:
[0059] 1) Build a node list to store information about all task locations.
[0060] The attributes of each node include: the location coordinates of the task location position=(x, y), set to position=(random.randint(0,100), random.randint(0,100)); the task requirement level taskLevel=TL, set taskLevel = random.choice([1, 2, 3]), where 1 means low, 2 means medium, and 3 means high; and the task requirement time timeRequirement=TR, set timeRequirement = random.uniform(1, 5), in hours; this increases the diversity of node class attributes.
[0061] 2) Construct an edge list to store the connection information between any two task locations.
[0062] The attributes of each edge include: the distance cost distance=D between the task locations, which is an important reference for path selection, and the risk obstacle level riskLevel=RL of the path between the task locations, which reflects the safety and feasibility of the path. The distance cost D between two points in the edge attribute is calculated using the Euclidean distance formula, as follows:
[0063] .
[0064] Set to math.sqrt((node1.position[0] - node2.position[0])**2 + (node1.position[1] - node2.position[1])**2).
[0065] Regarding the risk barrier level in the edge attribute: through the risk assessment function, a risk barrier level RL is assigned to each pair of edges between nodes, which is initially set to 0 and updated after the risk assessment function is calculated. The specific steps involved in the risk assessment function include:
[0066] The first step is to collect and integrate multi-source data, including but not limited to collecting terrain height H around the mission site through satellites, set to elevation_height = random.randint(0, 1000); vegetation density P, set to vegetation_density = random.randint(1, 10); building distribution S data, set to building_distribution = random.randint(1, 10); and obtain real-time and predicted weather data, including wind speed V, set to wind_speed = random.uniform(0, 20); rainfall probability PR, set to rain_probability = random.uniform(0, 100); At the same time, consider the air traffic control data on the mission path, the no-fly zone BAN-MAX and the restricted zone BAN-MIN, simplified to Boolean values, here do not consider the specific location, only the example of whether it is affected; input the above data into the risk assessment function to provide comprehensive and dynamic data support for risk assessment.
[0067] The second step is to set the risk scoring criteria. The risk assessment function can be defined as follows:
[0068] Terrain height (H): High altitude areas increase risk. A threshold is set. Every time a certain height exceeds the threshold, the risk score increases by 1.
[0069] Vegetation density / building distribution (P / S): Dense areas increase the risk of collision. The density level is set based on satellite image data. For each additional level, the risk score is +2.
[0070] Weather factors (V / PR): If the wind speed exceeds the safe flight speed, the risk score is +3; if the probability of rainfall exceeds 50%, the risk score is +2.
[0071] Air Traffic Control: When crossing a no-fly zone, the risk is set to the highest level of 10 points. For a restricted zone, the risk score is +5.
[0072] The third step is to define a comprehensive risk score, comprehensively evaluate the path risk, accurately divide the risk level, and provide risk avoidance guidance for path planning. The formula is as follows:
[0073] ;
[0074] Where WH is the terrain height weight, W P is the vegetation or building density weight, W S is the building distribution density weight, W V is the wind speed weight, W PR is the rainfall probability weight, W BAN Weights for no-fly zones and restricted zones. The concepts of "building density" and "building density" are related, but they focus on different aspects. Building density: Building density usually refers to the ratio of the floor space occupied by buildings per unit area to the total area. It measures the extent to which buildings cover the land in a given area. High building density means that most of the ground is occupied by buildings, while low building density means there is more open space or green space. Building density focuses more on describing the spatial distribution pattern of buildings. Even if two areas have the same building density, their building density may be different. For example, one area may have evenly distributed buildings, while another area may have concentrated tall buildings alternating with large open spaces. Building density focuses on how buildings are clustered in space, not just how much ground they cover.
[0075] f(), g(), h(), i(), j() are the risk scoring functions of their respective factors, which are mapped to corresponding risk scores based on the input data. k is a coefficient less than 1, indicating that the risk of crossing the restricted area is lower than that of the no-fly zone.
[0076] After obtaining the comprehensive risk score through the risk scoring function, the risk barrier level RL is divided into several levels: level one risk barrier (1-3 points), level two risk barrier (4-6 points), level three risk barrier (7-9 points), and level four risk barrier (10 points and above).
[0077] The location coordinates (x, y) of the task location, the task requirement level TL, and the task requirement time TR in the node class attributes are input by the user or imported from an external file.
[0078] 3) Create edge objects based on the distance cost and risk barrier level between nodes and add the edge objects to the edge dictionary.
[0079] The edge dictionary is associated with the node ID to ensure the logical integrity and query efficiency of the graph. In particular, if there is an inaccessible situation between nodes (for example, there is a no-fly zone between nodes), a large distance cost is assigned or the edge object is not created directly to maintain the true reflection of the graph to the task environment.
[0080] 4) Construct an undirected graph based on the dictionary form of the edge dictionary.
[0081] The key of the undirected graph is the node ID, and each position coordinate corresponds to a node ID.
[0082] The value of an undirected graph is a list, the first element of which is the node score and the second element is the edge dictionary. The node score here is a set of scores initially defined based on external conditions. The initial scoring mechanism for each node is described below. It has nothing to do with the subsequent node scoring function. The initial node score is necessary information for the subsequent construction of the node feature vector. In other words, the node score defined here and the constructed network topology are used as basic input to start the entire optimization process.
[0083] The node score is determined based on the task requirement level and task requirement time. The node score formula can be defined as follows:
[0084] ;
[0085] in, and They are the weight factors of the task requirement level and the task requirement time. The reciprocal of the task requirement time TR is used in the formula. This is because urgency is inversely proportional to time. The less time, the higher the urgency, so the score should increase accordingly. If the completion of the task is crucial to the overall goal, a higher weight should be given. If the timely completion of the task is extremely critical, the urgency weight should be higher. This scoring formula scientifically and reasonably quantifies the urgency and importance of the task, providing a quantitative basis for decision-making.
[0086] The key of the edge dictionary is the distance cost and the value is the risk barrier level.
[0087] Thus forming a flexible and efficient task scenario model.
[0088] 5) Traverse the edge list, identify and remove the edges in the edge list with the same start node and end node, that is, check and process self-loops. If edge.node1_id == edge.node2_id is found, delete it from the edge list to avoid logical errors and computational redundancy.
[0089] And check whether all nodes are connected, that is, use nx.is_connected(G) to check whether the undirected graph is connected. Ensure that all nodes in the graph can be connected through a series of edges, there are no isolated nodes, and ensure the consistency and accessibility of task planning.
[0090] Finally, a two-dimensional topological network is obtained.
[0091] In addition, every change in topological graph data (node list, edge list and undirected graph structure) is recorded and saved to a file for subsequent use or analysis. The pickle library is used to serialize the entire undirected graph structure (including detailed information of nodes and edges) and save it to a local file.
[0092] In one embodiment, the node and edge information extracted from the two-dimensional topological network corresponding to the task scenario is converted into a node feature vector and an adjacency matrix, respectively, including:
[0093] The node position coordinates and node scores are combined into a node feature vector. Because each node has two features: position coordinates and node score. Thus, the dimension of the node feature vector is 3.
[0094] Initialize an adjacency matrix of size N×N, where N is the total number of nodes;
[0095] The adjacency matrix is filled according to the existence of the edge and the attributes of the edge. Specifically, if there is an edge from node i to node j, then A[i][j] in the adjacency matrix will be assigned the corresponding distance cost or risk barrier level. In most cases, each element A[i][j] of the adjacency matrix usually represents a certain cost or weight from node i to node j, and this cost can be diversified, such as including both distance cost and risk barrier level. Here, the A[i][j] value of the adjacency matrix should be a comprehensive cost that integrates all relevant factors (such as distance, risk, time, etc.), which can more comprehensively reflect the true situation of the edge in the two-dimensional topological network.
[0096] like Figure 2 The flowchart shown extracts node and edge information from a two-dimensional topological network and converts the extracted network features into an adjacency matrix and a node feature vector.
[0097] exist Figure 2 In (a), the network topology dictionary is used to represent the structure and properties of the entire network. It refers to a composite data structure that contains all node information and edge information, including node and edge information. The edge dictionary is a part of the network topology dictionary, which is specifically used to store edge attributes, such as distance cost and risk barrier level. The network topology dictionary contains not only the edge dictionary, but also the attributes of the node, such as location coordinates and node scores. The construction of the node feature vector is mainly based on the attributes of the node itself, such as location coordinates and node scores; the information in the edge dictionary is mainly used to construct the adjacency matrix, reflecting the connection relationship between nodes and the attributes of the edges.
[0098] exist Figure 2In (b), the value list of the network topology dictionary refers to the value under each node entry in the network topology dictionary. The value under each node entry is a list that contains the node score and other information. When constructing the node feature vector, the first element in this list, the node score, is used.
[0099] When building the adjacency matrix, the "second dictionary element of the value list" traversed refers to the edge dictionary under each node entry. This edge dictionary stores the attributes of the edges connected to the node, such as distance cost and risk barrier level.
[0100] In one embodiment, the method further comprises:
[0101] If the current number of iterations is greater than the preset number of iterations, the fitness function is called to output the best algorithm score on the current adjacency matrix, that is, the highest algorithm score in the historical iterations;
[0102] The best node scoring function corresponding to the best algorithm score is used as the target node scoring function.
[0103] In one embodiment, the method randomly selects two node scoring functions from the function code pool of the current iteration, combines the initial best node scoring function with a large language model to perform a crossover operation, generates a crossover subcode, and puts it into the function code pool after verification, including:
[0104] If the initial best node scoring function of the current iteration is among the two randomly selected node scoring functions, the large language model is used to perform a cross operation on the codes of the two randomly selected node scoring functions to generate a cross sub-code;
[0105] If the initial best node scoring function of the current iteration is not in the two randomly selected node scoring functions, the code of one of the two randomly selected node scoring functions is randomly replaced with the initial best node scoring function of the current iteration, and then the code of the initial best node scoring function of the current iteration and the randomly selected node scoring function that has not been replaced is cross-operated using a large language model to generate a crossover sub-code;
[0106] Call the code verification function to verify the cross sub-code;
[0107] If the verification passes, the cross sub-code is placed into the function code pool of the current iteration;
[0108] If the verification fails, the large language model is used to re-perform the crossover operation to generate a new crossover sub-code, and the verification is continued until the verification passes. Re-performing the crossover operation means that the scoring functions of the two parent nodes of the crossover operation need to be randomly re-selected.
[0109] In one embodiment, the method further comprises:
[0110] Traverse all cross subcodes. If the random number is less than the preset mutation probability threshold, use the large language model to perform mutation operations on the corresponding cross subcode to generate a mutant subcode.
[0111] Call the code verification function to verify the variant code;
[0112] If the verification is successful, the variant subcode is placed into the corresponding population and then included in the function code pool;
[0113] If the verification fails, the large language model is used to perform mutation operation again to generate new mutant sub-code, and the verification is continued until the verification passes.
[0114] In one embodiment, the node scoring functions corresponding to the cross subcodes are classified into populations according to the output algorithm similarity, including:
[0115] Obtaining a similarity threshold interval consisting of two similarity thresholds;
[0116] The crossover subcodes whose algorithm similarity is within a similarity threshold interval are divided into the same population, thereby obtaining several populations.
[0117] In one embodiment, the method further comprises:
[0118] If the number of populations is greater than 1, traverse each population in the function code pool of the current iteration;
[0119] Randomly select two node scoring functions in the current population, use a large language model to perform a crossover operation on the two randomly selected node scoring functions, and generate a crossover sub-code;
[0120] Call the code verification function to verify the cross sub-code;
[0121] If the verification is successful, the crossover subcode is placed in the current population and then included in the function code pool of the current iteration;
[0122] If the verification fails, the large language model is used to re-perform the crossover operation to generate a new crossover subcode, and the verification is continued until the verification passes;
[0123] Traverse all codes in the current population after the crossover operation, that is, the crossover subcodes generated by two randomly selected codes in the current population and the original codes;
[0124] If the random number is less than the mutation probability, the mutation operation is performed using the code generation capability of the large language model to generate mutant subcodes; the code verification function is called to verify the mutant subcodes; if the verification passes, the mutant subcodes are placed in the corresponding population and then included in the function code pool; if the verification fails, the mutation operation is performed again using the large language model to generate new mutant subcodes, and the verification is continued until the verification passes;
[0125] If the random number is not less than the mutation probability, the corresponding sub-code is retained and placed in the corresponding population and then included in the function code pool.
[0126] In summary, a path planning model based on the optimization of the domestic Qwen large language model (LLMs) and the evolutionary algorithm (EA) is constructed according to the two-dimensional topological network. The specific implementation steps include:
[0127] Before starting, define the various operation prompt templates for the code generation selection task. The templates are defined as follows:
[0128] system_prompt: "Given the edge matrix of a network, you need to find the critical nodes in the network. These nodes, when removed from the network, will cause the size of the largest connected component in the network to decrease. ”.
[0129] prompt_initial: "Please generate a new algorithm. ”.
[0130] prompt_crossover: "I have two codes as follows: ”.
[0131] prompt_mutation: "Without changing the input and output of this code, modify this code to make the node score more reasonable: ”.
[0132] prompt_code_request: "Combine the above two algorithms and create a completely different and better Python function named "score_nodes". The function should accept "edge_matrix" and "eigenvector" as input and return "scored_nodes" as output. "edge_matrix" should be an adjacency matrix in the form of a NumPy array, "eigenvector" is a three-dimensional eigenvector, and "scored_nodes" should be a dictionary whose keys are node IDs and values are node edge scores.".
[0133] extra_prompt: "Just a Python function provided, no explanation required.".
[0134] Using a large language model, we design a set of initial node scoring functions as the starting point of the population based on the characteristics of the two-dimensional topological network. The specific steps include:
[0135] Design a node scoring function, define the scoring function's input as the adjacency matrix and the node feature vector of the graph, and the output as the node ID and the node edge score.
[0136] The large model language intervenes in the design, proposes specific task instructions to the LLM, and uses the code generation function of LLMs to generate a series of different node scoring function code snippets based on the provided network characteristics and task instructions. The prompt content constructed in this step is system_prompt+ prompt_initial+ prompt_code_request+ extra_prompt.
[0137] Design a code verification function check_code, in which all possible results of scored_nodes are preset: all_results = np.array([[0,1,2][0,2,1][1,0,2][1,2,0][2,0,1] [2,1,0]]). For each code snippet generated by LLM, perform syntax checking and preliminary logic verification to ensure that the code is executable and has no obvious errors. The verification logic of the subsequent code verification function check_code is unified in this way.
[0138] Based on the results of preliminary verification, those scoring functions that perform well or are innovative are selected and integrated into the initial population.
[0139] Based on the above functions and the construction of the initial algorithm population, the evolutionary algorithm enters the key node addressing and path iterative calculation on the adjacency matrix. The specific steps include:
[0140] By defining the get_best_algorithm function, that is, the fitness function, the score of the generated algorithms in the current algorithm pool is compared to obtain the best algorithm in the current algorithm pool.
[0141] Determine whether the current number of iterations is less than the preset number of iterations.
[0142] If the current number of iterations is greater than the preset number of iterations, the fitness function is called to output the current best algorithm and its best fitness score on the current adjacency matrix. The best algorithm is the most planned strategy for the current path. If the current number of iterations is less than the preset number of iterations, the current number of iterations is increased by 1, and the code for randomly selecting two algorithms from the initial algorithm population is returned to determine whether the best algorithm is among the two randomly sampled algorithms.
[0143] If the best algorithm is between the two randomly sampled algorithms, the code generation capability of the Qwen large model is used to generate sub-codes for crossover operations. The prompt content constructed in this step is system_prompt+prompt_crossover+algorithm1+algorithm2+prompt_code_request+extra_prompt, and all subsequent crossover operation prompts use this unified template.
[0144] If the best algorithm is not among the two randomly sampled algorithms, the best algorithm will randomly replace the algorithm code of one of the two algorithms, and the code generation capability of the Qwen large model will be used to perform a crossover operation to generate a sub-code and put it into the algorithm pool after the crossover.
[0145] Call the code verification function to verify the subcode.
[0146] If the verification passes, the current cross subcode is put into the algorithm pool.
[0147] If the verification fails, the code generation capability of the Qwen large model is used again to perform cross-operation to generate sub-codes, and the verification is continued until it passes.
[0148] Algorithm after traversal intersection.
[0149] Set the mutation probability threshold to 0.3. If the random number is less than the mutation probability, use the code generation capability of the Qwen large model to perform the mutation operation and generate the mutated sub-code. The prompt content constructed in this step is system_prompt+prompt_mutation+algorithmextra_prompt, and all subsequent mutation operation prompts use this unified template.
[0150] Call the code verification function to verify the subcode.
[0151] If the verification passes, the current variant subcode is placed into the corresponding population and then included in the algorithm pool.
[0152] If the verification fails, the code generation capability of the Qwen large model is used to perform mutation operations to generate sub-codes, and the verification is continued until the verification passes.
[0153] If the random number is greater than the mutation probability, the current code is used as the sub-code and the output similarity after the fitness function is passed. The algorithm is classified according to the similarity threshold. The similarity lower threshold similarity_lower_threshold is set to 0.9, and the similarity lower threshold similarity_upper_threshold is set to 0.99. After classification, it is put back into the algorithm pool. The "similarity_lower_threshold" and "similarity_upper_threshold" mentioned here are thresholds used to classify algorithms or generated code snippets. The main purpose is to group them according to the similarity between algorithms or codes, so as to manage the diversity in the algorithm pool and optimize the search process. 1) Processing less than 0.9: If the similarity between two algorithms or code snippets is less than 0.9, it means that they are significantly different in function or structure. These algorithms may use different strategies or have significantly different implementation details. In the context of evolutionary algorithms, algorithms that maintain low similarity help maintain population diversity and avoid premature convergence to local optimal solutions. Therefore, these algorithms will be classified as the "low similarity" group and may be retained for further mutation or crossover operations to explore different parts of the solution space. 2) Treatment between 0.9 and 0.99: Algorithms with similarities between 0.9 and 0.99 indicate that there is a certain degree of similarity between them, but still maintain a certain degree of difference. Such algorithms may share similar strategies in some aspects, but differ in details. In the algorithm pool, these algorithms can be regarded as the "medium similarity" group, which may be the offspring generated by crossover operations during evolution, or through slight mutation. For such algorithms, the strategy that the evolutionary algorithm may adopt is to allow them to exist in the population, while also encouraging them to promote the evolution and improvement of the algorithm through further mutation or crossover with other algorithms with large differences. 3) Treatment greater than 0.99: When the similarity is higher than 0.99, it means that the two algorithms or code snippets are almost identical or extremely similar, with almost no difference. In evolutionary algorithms, algorithms that are too similar may mean that the population lacks diversity, which may hinder the further development of the algorithm and lead to premature convergence. Therefore, for algorithms with extremely high similarity, measures may need to be taken to avoid duplication, such as retaining only one of them, or forcing them to mutate to introduce new features or behaviors, thereby promoting the diversity and evolution of the algorithms. In general, by setting a similarity threshold, this method aims to maintain the diversity of the algorithm pool, ensure that the evolutionary algorithm can effectively explore the solution space, avoid falling into the local optimal solution, and promote the continuous evolution and optimization of the algorithm.
[0154] Iterate over each population in the algorithm pool.
[0155] Determine whether the total number of groups is greater than 1.
[0156] If the algorithm population is greater than 1, two algorithms randomly sampled from the current population are cross-operated to generate sub-codes using the code generation capability of the Qwen large model.
[0157] Call the code verification function to verify the subcode.
[0158] If the verification is successful, the current crossover subcode is placed into the corresponding population and then returned to the algorithm pool.
[0159] If the verification fails, the code generation capability of the Qwen large model is used again to perform cross-operation to generate sub-codes, and the verification is continued until it passes.
[0160] The current algorithm population after traversal crossover.
[0161] The mutation probability threshold is set to 0.3. If the random number is less than the mutation probability, the code generation capability of the Qwen large model is used to perform the mutation operation and generate the mutated sub-code.
[0162] Call the code verification function to verify the subcode.
[0163] If the verification passes, the current variant subcode is placed into the corresponding population and then included in the algorithm pool.
[0164] If the verification fails, the code generation capability of the Qwen large model is used to perform mutation operations to generate sub-codes, and the verification is continued until the verification passes.
[0165] If the random number is greater than the mutation probability, the current subcode is retained and placed in the corresponding population and then returned to the algorithm pool.
[0166] If the algorithm population is less than or equal to 1, call the fitness function to record the best algorithm and its best algorithm score in the current round of population stored in the current adjacency matrix;
[0167] Set the best algorithm score to 1 and determine whether the preset best algorithm score is reached.
[0168] If so, output the corresponding best algorithm in the current population.
[0169] If not, start the next iteration.
[0170] like Figure 3 As shown, a flow chart based on the combination of the domestic Qwen large language model (LLMs) and the evolutionary algorithm (EA) is provided.
[0171] In one embodiment, a drone path planning device is provided, comprising: an initial best node scoring function determination module, a cross operation module, a population classification module, a candidate best node scoring function determination module and a target node scoring function determination module, wherein:
[0172] The initial best node scoring function determination module is used to determine the initial best node scoring function in the function code pool of the current iteration within a preset number of iterations; wherein the input of the node scoring function is defined to include a node feature vector and an adjacency matrix, and the output includes a node ID and a node edge score; the node feature vector and the adjacency matrix are respectively converted from the node and edge information extracted from the two-dimensional topological network corresponding to the task scenario; the node is used to store task information; the edge is used to represent the association information between task locations; the initial best node scoring function is determined by comparing the size of the algorithm score output by the fitness function; wherein the input of the fitness function is defined to be the node scoring function, and the output is the algorithm score and the algorithm similarity;
[0173] The crossover operation module is used to randomly select two node scoring functions from the function code pool of the current iteration, combine the initial best node scoring function with the large language model to perform crossover operations, generate crossover subcodes and put them into the function code pool after verification;
[0174] The population classification module is used to traverse all crossover subcodes. If the random number is not less than the preset mutation probability threshold, the corresponding crossover subcode is input into the fitness function, and the node scoring function corresponding to the crossover subcode is classified into populations according to the output algorithm similarity;
[0175] The candidate best node scoring function determination module is used to call the node scoring function to record the candidate best node scoring function and its corresponding candidate best algorithm score in the current iteration population stored on the current adjacency matrix if the population size does not exceed 1;
[0176] The target node scoring function determination module is used to use the corresponding candidate best node scoring function as the target node scoring function if the candidate best algorithm score meets the preset conditions, and determine the key node ID according to the target node scoring function to guide the path planning of the drone.
[0177] For the specific definition of the drone path planning device, please refer to the definition of the drone path planning method above, which will not be repeated here. Each module in the above-mentioned drone path planning device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0178] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as two-dimensional topological network characteristics. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for drone path planning is implemented.
[0179] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0180] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.
[0181] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.
[0182] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0183] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0184] The above-mentioned embodiments only express several implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.
Claims
1. A method for UAV path planning, characterized in that: The method comprises: Within a preset number of iterations, determine the initial best node scoring function in the function code pool of the current iteration; wherein, the input of the node scoring function is defined to include a node feature vector and an adjacency matrix, and the output includes a node ID and a node edge score; the node feature vector and the adjacency matrix are respectively converted from the node and edge information extracted from the two-dimensional topological network corresponding to the task scenario; the node is used to store task information; the edge is used to represent the association information between task locations; the initial best node scoring function is determined by comparing the size of the algorithm score output by the fitness function; wherein, the input of the fitness function is defined to be the node scoring function, and the output is the algorithm score and the algorithm similarity; Randomly select two node scoring functions from the function code pool of the current iteration, combine them with the initial best node scoring function and use a large language model to perform crossover operations, generate crossover subcodes and put them into the function code pool after verification; Traverse all crossover subcodes. If the random number is not less than the preset mutation probability threshold, the corresponding crossover subcode is input into the fitness function. The node scoring function corresponding to the crossover subcode is classified into populations according to the output algorithm similarity. If the population size does not exceed 1, the fitness function is called to record the candidate best node scoring function and its corresponding candidate best algorithm score in the current iteration population saved on the current adjacency matrix; If the candidate best algorithm score meets the preset conditions, the corresponding candidate best node scoring function is used as the target node scoring function, and the key node ID is determined according to the target node scoring function to guide the path planning of the drone.
2. The method according to claim 1, characterized in that: The generation of the two-dimensional topological network corresponding to the task scenario includes the following steps: Construct a node list; the attributes of each node include: the location coordinates of the task location, the task requirement level, and the task requirement time; Construct an edge list; the attributes of each edge include: the distance cost between task locations and the risk obstacle level of the path between task locations; Creating edge objects based on the distance cost and risk barrier level between nodes, and adding the edge objects to the edge dictionary; An undirected graph is constructed according to the dictionary form of the edge dictionary; wherein the key of the undirected graph is the node ID; wherein each position coordinate corresponds to a node ID; the value of the undirected graph is a list; the first element of the list is the node score, and the second element is the edge dictionary; the node score is determined according to the task requirement level and the task requirement time; the key of the edge dictionary is the distance cost, and the value is the risk obstacle level; The edge list is traversed, edges with the same starting node and ending node in the edge list are identified and removed, and all nodes are checked to see whether they are connected, so as to finally obtain a two-dimensional topological network.
3. The method according to claim 1, characterized in that The method further comprises: If the current number of iterations is greater than the preset number of iterations, the fitness function is called to output the best algorithm score on the current adjacency matrix; The best node scoring function corresponding to the best algorithm score is used as the target node scoring function.
4. The method according to claim 1, characterized in that The method randomly selects two node scoring functions from the function code pool of the current iteration, combines the initial best node scoring function with a large language model to perform crossover operations, generates crossover subcodes and puts them into the function code pool after verification, including: If the initial best node scoring function of the current iteration is among the two randomly selected node scoring functions, the large language model is used to perform a cross operation on the codes of the two randomly selected node scoring functions to generate a cross sub-code; If the initial best node scoring function of the current iteration is not in the two randomly selected node scoring functions, the code of one of the two randomly selected node scoring functions is randomly replaced with the initial best node scoring function of the current iteration, and then the code of the initial best node scoring function of the current iteration and the randomly selected node scoring function that has not been replaced is cross-operated using a large language model to generate a crossover sub-code; Calling a code verification function to verify the cross sub-code; If the verification is successful, the cross sub-code is placed into the function code pool of the current iteration; If the verification fails, the large language model is used to re-perform the crossover operation to generate a new crossover subcode, and the verification is continued until the verification passes.
5. The method according to claim 1, characterized in that The method further comprises: Traverse all cross subcodes. If the random number is less than the preset mutation probability threshold, use the large language model to perform mutation operations on the corresponding cross subcode to generate a mutant subcode. Calling a code verification function to verify the variant subcode; If the verification is successful, the variant subcode is placed into the corresponding population and then included in the function code pool; If the verification fails, the large language model is used to perform mutation operation again to generate new mutant sub-code, and the verification is continued until the verification passes.
6. The method according to claim 1, characterized in that The node scoring functions corresponding to the cross subcodes are classified into populations according to the output algorithm similarity, including: Obtaining a similarity threshold interval consisting of two similarity thresholds; The crossover subcodes whose algorithm similarity is within the similarity threshold interval are divided into the same population, thereby obtaining a plurality of populations.
7. The method according to claim 1, characterized in that The method further comprises: If the number of populations is greater than 1, traverse each population in the function code pool of the current iteration; Randomly select two node scoring functions in the current population, use a large language model to perform a crossover operation on the two randomly selected node scoring functions, and generate a crossover sub-code; Calling a code verification function to verify the cross sub-code; If the verification is successful, the crossover subcode is placed in the current population and then included in the function code pool of the current iteration; If the verification fails, the large language model is used to re-perform the crossover operation to generate a new crossover subcode, and the verification is continued until the verification passes; Traverse all subcodes in the current population after the crossover operation; If the random number is less than the mutation probability, the mutation operation is performed using the code generation capability of the large model to generate a mutant subcode; the code verification function is called to verify the mutant subcode; if the verification passes, the mutant subcode is placed in the corresponding population and then included in the function code pool; if the verification fails, the mutation operation is performed again using the large language model to generate a new mutant subcode, and the verification is continued until the verification passes; If the random number is not less than the mutation probability, the corresponding sub-code is retained and placed in the corresponding population and then included in the function code pool.
8. A drone path planning device, characterized in that: The device comprises: The initial best node scoring function determination module is used to determine the initial best node scoring function in the function code pool of the current iteration within a preset number of iterations; wherein the input of the node scoring function is defined to include a node feature vector and an adjacency matrix, and the output includes a node ID and a node edge score; the node feature vector and the adjacency matrix are obtained by respectively converting the node and edge information extracted from the two-dimensional topological network corresponding to the task scenario; the node is used to store task information; the edge is used to represent the association information between task locations; the initial best node scoring function is determined by comparing the size of the algorithm score output by the fitness function; wherein the input of the fitness function is defined to be the node scoring function, and the output is the algorithm score and the algorithm similarity; The crossover operation module is used to randomly select two node scoring functions from the function code pool of the current iteration, combine the initial best node scoring function with the large language model to perform crossover operations, generate crossover subcodes and put them into the function code pool after verification; The population classification module is used to traverse all crossover subcodes. If the random number is not less than the preset mutation probability threshold, the corresponding crossover subcode is input into the fitness function, and the node scoring function corresponding to the crossover subcode is classified into populations according to the output algorithm similarity; The candidate best node scoring function determination module is used to call the fitness function to record the candidate best node scoring function and its corresponding candidate best algorithm score in the current iteration population stored on the current adjacency matrix if the population size does not exceed 1; The target node scoring function determination module is used to use the corresponding candidate best node scoring function as the target node scoring function if the candidate best algorithm score meets the preset conditions, and determine the key node ID according to the target node scoring function to guide the path planning of the drone.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, 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 7 are implemented.
Citation Information
Cited By
Heterogeneous intelligent computing node service path planning and task scheduling method based on bilateral matching game architecture
CN122044854A
