Local sequence constrained path planning method and device, electronic equipment and medium
Through the path planning method of local sequential constraints, individual cognitive search, social cognitive search and free search in the particle swarm algorithm are used to optimize the path planning process, and the path quality and cost problems under local access sequence constraints are solved, achieving efficient path optimization.
Patent Information
- Application Number
- CN202510882418.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-08-15
AI Technical Summary
When existing path planning algorithms deal with path problems containing local access order constraints, they cannot effectively balance path feasibility and path quality, resulting in a significant increase in path length.
By randomly generating particles that meet the sequential constraints of local targets, combining individual cognitive search, social cognitive search and free search, the path planning process is optimized, and individual optimal solutions, global optimal solutions and current paths are used for path updates to ensure sequential constraints while improving path optimization effects.
On the premise of meeting local access order constraints, high-quality optimization of paths is achieved, taking into account path costs, and improving the diversity and efficiency of path planning.
Smart Images

Figure CN120499071A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent connected vehicles, and in particular to a path planning method, device, electronic equipment and medium with local sequence constraints. Background Art
[0002] Path planning is widely used in multiple scenarios such as navigation systems, logistics distribution, and inspection operations. Its main goal is usually to optimize path length, time cost, or energy consumption, and generate a shortest or optimal path starting from a starting point and visiting multiple destination nodes in sequence.
[0003] In related technologies, path planning methods are mostly based on graph theory, heuristic search algorithms, and swarm intelligence optimization algorithms. These methods can effectively handle the problem of shortest path. However, in some practical application scenarios, there may be access order requirements between some destinations in the path, such as the delivery order specified by customers in logistics scenarios, and the order of operations in facility operations. Such order constraints are usually local and only involve the relative order of access to several target nodes in the path. The relevant path planning algorithms cannot effectively handle such problems. If the access order constraints are forcibly enforced, the overall length of the path will increase significantly.
[0004] In summary, relevant path planning technologies have obvious shortcomings when dealing with complex path problems containing access order constraints, and a better balance needs to be achieved between path feasibility and path quality. Summary of the Invention
[0005] The present invention aims to at least partially address one of the technical problems in the related art. To this end, the present invention provides a method, apparatus, electronic device, and medium for path planning with local order constraints, which balance the local access order requirements of target nodes with path optimization during path planning.
[0006] To achieve the above objectives, a first embodiment of the present invention provides a path planning method with local order constraints, comprising:
[0007] Randomly generate n particles based on the starting node and the target node set; the particles represent a complete path from the starting node through all target nodes in the target node set and satisfy a preset local target order constraint sequence;
[0008] Based on the search parameters, individual cognitive factors and social cognitive factors in the current iteration round, the search method adopted by each particle is determined, and the corresponding search method is used to search in the set solution space to update the particle; the search method is one of individual cognitive search, social cognitive search or free search; the individual cognitive search is used to search in the individual optimal solution of the particle; the social cognitive search is used to search in the global optimal solution of the particle swarm; the free search is used to search in the current path of the particle;
[0009] After all the particles are updated, the fitness corresponding to the updated particles is calculated according to the distance between the starting node and any two nodes in the target node set, and the global optimal solution and the individual optimal solution are updated;
[0010] When the preset iteration stopping condition is met, the global optimal solution obtained in the last round of iteration is output as the target path.
[0011] In addition, the path planning method with local sequence constraints in the above embodiment of the present invention may also have the following additional technical features:
[0012] According to one embodiment of the present invention, the search method used is individual cognitive search, and the corresponding search method is used to search within a set solution space to update the particles, including:
[0013] Randomly selecting a continuous first path in the current path of the particle, and randomly selecting a continuous second path in the individual optimal solution of the particle; the first path and the second path have the same length;
[0014] The second path replaces the first path in the current path of the particle.
[0015] According to one embodiment of the present invention, the search method used is social cognitive search, and the corresponding search method is used to search within a set solution space to update the particles, including:
[0016] Randomly selecting a continuous first path in the current path of the particle, and randomly selecting a continuous third path in the global optimal solution; the first path and the third path have the same length;
[0017] The third path replaces the first path in the current path of the particle.
[0018] According to one embodiment of the present invention, the search method adopted is a free search, and the corresponding search method is adopted to search within a set solution space to update the particles, including:
[0019] randomly selecting a continuous first path in the current path of the particle, and performing a reverse process on the first path to obtain a reverse result of the first path;
[0020] The reversed result of the first path replaces the first path in the current path of the particle.
[0021] According to one embodiment of the present invention, the method further includes:
[0022] If there are repeated nodes in the path of the replaced particle, the repeated nodes are replaced by nodes not included.
[0023] According to one embodiment of the present invention, the method further includes:
[0024] If the path of the replaced particle does not conform to the local target order constraint sequence, the nodes included in the local target order constraint sequence in the path of the particle are reordered.
[0025] According to one embodiment of the present invention, the method further includes:
[0026] According to the current iteration round, the search parameters, individual cognitive factors and social cognitive factors are updated.
[0027] To achieve the above-mentioned object, a second embodiment of the present invention provides a path planning device with local sequence constraints, comprising:
[0028] A particle generation module is used to randomly generate n particles based on a starting node and a target node set; the particles represent a complete path from the starting node through all target nodes in the target node set and satisfy a preset local target order constraint sequence;
[0029] A search module is configured to determine a search method for each particle based on the search parameters, individual cognitive factors, and social cognitive factors in the current iteration round, and to use the corresponding search method to search within a set solution space to update the particle; the search method is one of individual cognitive search, social cognitive search, or free search; the individual cognitive search is used to search within the individual optimal solution of the particle; the social cognitive search is used to search within the global optimal solution of the particle swarm; and the free search is used to search within the current path of the particle;
[0030] An updating module, configured to calculate the fitness corresponding to the updated particles according to the distance between the starting node and any two nodes in the target node set after all the particles are updated, and to update the global optimal solution and the individual optimal solution;
[0031] The output module is used to output the global optimal solution obtained in the last round of iteration as the target path when a preset iteration stopping condition is met.
[0032] To achieve the above-mentioned purpose, an embodiment of the third aspect of the present invention proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned local sequence constraint path planning method when executing the computer program.
[0033] To achieve the above-mentioned purpose, the fourth embodiment of the present invention proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed, the steps of the above-mentioned path planning method with local sequence constraints are implemented.
[0034] The path planning method, device, electronic device and medium with local order constraints of the embodiments of the invention introduce order constraints in the path generation stage by randomly generating multiple particles based on the starting node and the target node set, and making each particle represent a complete path that satisfies the local target order constraint; by combining the search parameters, individual cognitive factors and social cognitive factors of the current iteration round, the search method of the particles is determined, and the search is updated based on the individual optimal solution, the global optimal solution or the current path within the set solution space, thereby improving the diversity of the search and the optimization efficiency; after the particles are updated, the fitness is calculated based on the distance between the nodes, and the individual optimal solution and the global optimal solution are updated to continuously optimize the path quality while satisfying the order constraint; finally, the global optimal solution is output as the target path, taking into account the order requirements and the path cost, and achieving high-quality path planning in scenarios with local order constraints. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 1 is a flow chart of a path planning method with local target order constraints in one embodiment;
[0036] Figure 2 An example diagram of social cognitive search in one embodiment;
[0037] Figure 3 is a schematic diagram of free search in one embodiment;
[0038] Figure 4 Schematic diagram of the execution flow of a path planning method in one embodiment;
[0039] Figure 5 4 is a structural block diagram of a path planning device with local target sequence constraints in one embodiment. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0041] The following describes in detail the implementation details of the technical solutions of the embodiments of the present application.
[0042] In one embodiment, Figure 1 As shown, a flow chart of a path planning method with local target order constraints is provided, which may include the following steps:
[0043] Step S101: randomly generate n particles according to the start node and target node set.
[0044] According to user needs, the starting node [o] and the target node set input by the user are received, wherein the target node set includes multiple target nodes to be visited, for example, the target node set T = [t1, t2, t3, t4, t5, t6, t7, t8, t9, t 10 Based on the start node and target node set, n initial paths are constructed by random permutation. Each initial path starts and ends at the start node and contains all target nodes in the target node set. n is an important parameter of the particle swarm algorithm. The value of n can be determined according to actual needs and is usually selected between 20 and 100 to strike a balance between the convergence speed and diversity of the path search.
[0045] It should be noted that the n initial paths constructed need to satisfy the preset local target order constraint sequence to ensure that the local order constraint is introduced in the path initialization phase. These local ordered sequences are used to limit the order of access between target nodes. For example, the local target order constraint sequence can include two ordered sequences [t1, t3, t7], [t2, t5, t9]. In the first ordered sequence, it means that t1 needs to be accessed before t3, and t3 needs to be accessed before t7. However, it should be noted that t1 needs to be accessed before t3 does not mean that t3 will be accessed immediately after t1. Other destinations can be included between t1 and t3, such as the access sequence [t8, t1, t2, t5, t3, t7, t4, t7]. 10 ,t9,t6] satisfies the local target order constraint sequence.
[0046] Based on this, each initial path is checked to see if it satisfies the local target order constraint sequence. For paths that do not satisfy the order constraint, the relevant target nodes in the path are reordered according to the access order of the local ordered sequence to ensure that the local order constraint is satisfied. The corrected path, that is, the complete path that satisfies the local access order constraint, is stored as a particle in the particle swarm, resulting in an initial particle swarm containing n particles, which serves as the basis for subsequent path search optimization.
[0047] Step S102: Based on the search parameters, individual cognitive factors, and social cognitive factors in the current iteration round, the search method adopted by each particle is determined, and the corresponding search method is used to search in the set solution space to update the particle.
[0048] For each particle in the current particle swarm, the search method adopted by the particle is determined based on the weighted calculation results of the inertia weight ω corresponding to the current iteration round, the individual cognition factor c1, and the social cognition factor c2. Among them, the inertia weight ω is used to control the particle's free search tendency, the individual cognition factor c1 reflects the particle's dependence on the individual optimal solution (pbest), and the social cognition factor c2 reflects the degree to which the particle is influenced by the global optimal solution (gbest).
[0049] Here, there are three search methods for particles: individual cognitive search, social cognitive search, and free search. By introducing a certain amount of randomness and weight factor control, each particle will randomly select one of these three search methods as the search behavior for this round. In a feasible approach, the probability of each search method can be used to determine the search method adopted by the particle in the current iteration round. Specifically, this coefficient is normalized to obtain three non-negative proportional factors, so that the sum of the three is 1, that is:
[0050]
[0051] Among them, W1, W2, and W3 represent the selection probabilities of free search, personal cognitive search, and social cognitive search, respectively.
[0052] For each particle, a random number r in the range of [0,1] is generated in each iteration, and the search method is selected according to the probability interval, specifically:
[0053] If 0≤r<W1, choose free search;
[0054] If 0≤r<W1, then select individual cognitive search;
[0055] If 0≤r<W1, social cognitive search is selected.
[0056] After selecting a search method, particles will search and update within the corresponding set solution space. The set solution space refers to a search space related to the path corresponding to the current particle, used to adjust the structure or replace fragments within the particle's path representation. In practical applications, individual cognitive search is performed within the particle's individual optimal solution, used to explore effective empirical paths from that individual's history; social cognitive search is performed within the current particle swarm's global optimal solution, guiding particles to converge toward the group's optimal direction; and free search is restricted to the particle's current path representation, primarily implementing local perturbations and path structure adjustments. Based on this, by alternating the execution of these three search methods within the set solution space, particles can be updated and path optimization achieved.
[0057] It should be noted that after completing the path update under any search mode, the path represented by the updated particles still satisfies the preset local target order constraint sequence, that is, the path meets the local node access order requirements set by the user, thereby ensuring that the task constraints are always followed while ensuring search diversity.
[0058] In one embodiment, when the determined search method is individual cognitive search, the path is updated based on the individual optimal solution obtained in the particle's historical search process, which is a process in which the particle approaches the individual optimal solution. Specifically, for the particle's current path, a continuous path segment is randomly selected as the first path. The first path can start from any position, and the length is set to a preset segment length value. From the particle's historical individual optimal solution, a second path with the same length as the first path is randomly selected in the same way. Among them, the individual optimal solution refers to the path with the highest fitness (i.e., the shortest path distance) among all the paths experienced by the particle in the past iterative process, representing the best result in the particle's own search experience.
[0059] The second path is used as an alternative path to replace the first path in the current particle's path. This means that the original continuous node sequence in the current path is replaced with the corresponding fragment from the individual optimal solution. This replacement operation allows the particle to fully utilize its own historical optimal information during the search process, thereby optimizing in the solution space along the direction guided by its individual experience, enhancing the search's targetedness and local optimization capabilities while maintaining a certain degree of path diversity.
[0060] In one embodiment, when the determined search method is social cognitive search, the particle path structure is updated and optimized based on the global optimal solution in the particle swarm as a reference. Specifically, for the particle to be updated, a continuous path segment is randomly selected from its current path as the first path. Subsequently, a continuous path segment with the same length as the first path is randomly selected from the global optimal solution recorded by the current particle swarm as the third path. The global optimal solution refers to the path with the highest fitness among the optimal paths previously obtained by all particles in the entire particle swarm's historical search process, representing the optimal path result in the current global search.
[0061] The third path is used as an alternative path to replace the first path in the particle's current path. In this way, during the path evolution process, the particle can be guided by the global optimal path and move closer to the path structure with the best overall performance in the current particle swarm, thereby improving the overall convergence speed of path optimization and the global quality of the solution.
[0062] It's important to note that social cognitive search and individual cognitive search have similar execution mechanisms for path updates. The main difference between the two lies in the reference object. Individual cognitive search involves particles replacing path segments based on their own individual optimal solutions from their search history, while social cognitive search involves particles replacing path segments based on the global optimal solution from their group's history.
[0063] In one embodiment, selecting a path segment from an individual or global optimal solution to replace the corresponding segment in a particle's current path may cause nodes to be duplicated or omitted in the replaced path. To ensure that the particle's path remains a complete path containing all target nodes without duplication, further corrections to the replaced path are required.
[0064] After completing the path segment replacement operation, the replaced particle path is subjected to a node integrity check to determine whether there are any duplicate nodes in the path. If duplicate nodes are found in the path, it means that the target node appears multiple times in the path, and at the same time, some nodes may not be included. Therefore, the path needs to be corrected. The redundant nodes in the repeated path are replaced with the target nodes that have not yet appeared in the path. This ensures that each target node in the path appears only once and all target nodes are covered.
[0065] In practical applications, the target nodes that are irrelevant to the replacement segment in the repeated nodes are prioritized for deduplication, that is, the target nodes in the node path that are replaced by the second path or the third path are retained. For example, Figure 2 As shown, Figure 2An example diagram of social cognitive search is shown. The local access order constraint sequence is [t1, t3, t7], [t2, t5, t9], and the current path of the particle is [o, t1, t2, t3, t4, t5, t6, t7, t8, t9, t 10 ,o], select [t4.t5,t6,t7] in the particle’s current path as the first path. The global optimal solution is [o,t1,t3,t 10 ,t2,t4,t5,t7,t6,t9,t8,o], select t2,t4,t5,t7 in the global optimal solution as the third path. Replace the first path with the third path, so that the path of the replaced particle is [o,t1,t2,t3,t2,t4,t5,t7,t8,t9,t 10 ,o]. There are two target nodes t2 in the path of the replaced particle, among which the first target node t2 is the target node outside the replacement segment, and the second target node t2 is the target node inside the replacement segment. Therefore, the first target node t2 is corrected first. The corrected particle path is [[o,t1,t6,t3,t2,t4,t5,t7,t8,t9,t 10 ,o].
[0066] In one embodiment, when the determined search method is free search, the particle's path update does not rely on a historical individual optimal solution or a global optimal solution. Instead, a local perturbation operation is performed based on the particle's current path. Specifically, for the particle to be updated, a continuous path segment is first randomly selected from its current path. This path segment is recorded as the first path. A reverse operation is performed on the first path, reversing the order in which the nodes in this path segment are visited. This results in a path segment with the opposite order of the original path, referred to as the reversed result of the first path.
[0067] The inverse result of the first path replaces the original first path position in the particle's current path to form a new particle path. This path replacement process randomly disrupts the order of accessing some of its own paths without relying on other particles' information, thereby improving global exploration capabilities and preventing particles from falling into local optimal solution areas.
[0068] In one embodiment, after the particle path is replaced according to individual cognitive search, social cognitive search, or free search, path order disturbance may be introduced. To ensure that the particle path always meets the local target order constraint, the path of the replaced particle needs to be verified and corrected.
[0069] Specifically, after a particle's path is replaced, a determination is made as to whether the replaced particle's path violates a preset local target order constraint sequence. If a violation of the local target order constraint is found in the replaced particle's path, for example, if target node t3 precedes target node t1 in the replaced particle's path, a local adjustment operation is performed. This operation involves locating target nodes in the current particle's path that do not conform to the local target order constraint sequence and reordering these nodes to restore their original order as specified in the local order constraint sequence, thereby ensuring that the updated particle path satisfies the local order constraint requirements.
[0070] like Figure 3 As shown, Figure 3 The diagram of free search is shown. The local access order constraint sequence is [t1, t3, t7], [t2, t5, t9], and the current path of the particle is [o, t1, t2, t3, t4, t5, t6, t7, t8, t9, t 10 ,o], select [t3,t4.t5,t6,t7,t8,t9] in the current path of the particle as the first path, and after reverse processing, the reverse result of the first path is [t9,t8,t7,t6,t5,t4,t3], and replace the first path with the reverse result of the first path, so that the replaced particle path is [o,t1,t2,t9,t8,t7,t6,t5,t4,t3,t 10 ,o]. By comparing the local access order constraint sequence, it can be determined that the replaced particle path cannot meet the local access order constraint sequence. Therefore, the particle path needs to be further modified by exchanging the access order of the target nodes t9 and t5. Similarly, t7 and t3 are exchanged. Therefore, the modified particle path is [o, t1, t2, t5, t8, t3, t6, t9, t4, t7, t 10 ,o].
[0071] In one embodiment, in order to improve the global exploration capability and local convergence accuracy of particle search, the search behavior parameters of the particles are dynamically adjusted. After each round of iteration, the search parameters are updated according to the current iteration round, including the inertia weight ω, the individual cognition factor c1, and the social cognition factor c2. In practical applications, the inertia weight ω is used to control the influence of the particle's current path on the subsequent search direction. As the number of iterations increases, the value of the inertia weight ω is gradually reduced, thereby reducing the particle's dependence on the original path. Correspondingly, the individual cognition factor c1 and the social cognition factor c2 are used to guide the particle closer to its own individual optimal solution and the global optimal solution of the group, respectively. In order to gradually improve the particle's ability to utilize the individual optimal solution and the global optimal solution, the value of the individual cognition factor c1 and the social cognition factor c2 is gradually increased as the number of iterations increases.
[0072] Step S103: After all particles are updated, the fitness corresponding to the updated particles is calculated according to the distance between any two nodes in the start node and target node set, and the global optimal solution and the individual optimal solution are updated.
[0073] After completing the path update for all particles, for each particle in the current particle swarm, the distance between two adjacent nodes in the path is calculated sequentially based on the order of the nodes in the particle's path representation. The distance values between all adjacent node pairs are then accumulated to obtain the total path length of the particle. In practical applications, after obtaining the starting and target node sets, the distance between any two nodes in the starting and target node sets can be calculated and the corresponding distance matrix can be generated. This allows the distance between two adjacent nodes in the particle path to be directly found from the distance matrix and the total path length of the particle to be calculated.
[0074] After obtaining the total path length, the particle's fitness is calculated. Fitness is defined as the inverse of the total path length. The smaller the total path length, the greater the fitness, indicating a higher quality path represented by the particle. The fitness of the particle's current path is compared with the individual optimal path in its historical records. If the current path has a better fitness, the current path is used to update the particle's corresponding individual optimal solution.
[0075] After completing the update of the individual optimal solutions of all particles, the particle with the highest fitness is selected from the individual optimal solutions of all particles, and the path of the particle with the highest fitness is compared with the current global optimal solution. If the fitness of the particle is higher than the fitness corresponding to the current global optimal solution, the path of the particle is used to update the global optimal solution.
[0076] Step S104: When a preset iteration stop condition is met, the global optimal solution obtained in the last round of iteration is output as the target path.
[0077] During the particle swarm iteration process, it is continuously determined whether the preset iteration stop condition is met. When any stop condition is met, the iteration process is terminated and the path planning result is output. The maximum number of iterations can be set to I max , and set the maximum number of rounds allowed for continuous iteration without updating the global optimal solution to m. After each round of iteration is completed, if the current number of iterations has reached I max , or if the global optimal solution does not change in m consecutive rounds of iterations, the particle swarm is considered to have converged, triggering the iteration termination condition.
[0078] When the iteration stopping condition is met, the global optimal solution is selected from the current particle swarm and output as the final target path. The target path is the global optimal path solution obtained during the particle swarm iteration process while satisfying the local target sequence constraints. In practical applications, this target path can be visualized to facilitate subsequent analysis and presentation, making the path structure more intuitive.
[0079] In practical applications, if the preset iterative stop condition has not been met yet, it means that the particle swarm has not completed sufficient search or has not converged. At this time, the path result is not output, but the next round of iteration is continued. The corresponding search method is re-selected for each particle based on the search parameters, individual cognitive factors and social cognitive factors, and the particle path is searched and updated. Then, the subsequent fitness calculation and optimal solution update process are continued until the preset iterative stop condition is finally met.
[0080] like Figure 4 As shown, Figure 4 A schematic diagram of the execution flow of the path planning method is shown.
[0081] First, n particles are generated to initialize the particle swarm. Based on the set of start and target nodes, n particles are randomly generated. Each particle corresponds to a complete path from the start point through all target nodes. When constructing the path, particles are ensured to satisfy the local target sequence constraints. All particles together form the initial particle swarm.
[0082] Each particle's search method is weighted and updated within the set solution space using the corresponding search method. For each particle, a weighted search method is selected from free search, individual cognitive search, and social cognitive search based on the inertia weight ω, individual cognitive factor c1, and social cognitive factor c2 at the current iteration. Once selected, a local path replacement or rearrangement operation is performed within the set solution space to update the particle's path.
[0083] Determine whether the updated particle path meets the local target order constraint. If the updated particle path does not meet the local target order requirement, proceed to the next step of the correction process; if it does, skip the correction and enter the fitness calculation phase.
[0084] In the correction process, particles that do not meet the order constraints are corrected. For paths that do not meet the local order constraints, nodes are reordered to meet the preset local target order constraint sequence.
[0085] During the fitness calculation phase, the fitness of each particle is calculated. Fitness is calculated based on the total distance of the path, typically defined as the inverse of the total path length, and is used to measure path quality. A larger value indicates a shorter path and better fitness.
[0086] The global optimal solution gbest and the individual optimal solution pbest are recorded, and the inertia factor ω, individual factor c1, and social factor c2 are updated. If the current particle's fitness is better than its previous individual optimal, the individual optimal solution for that particle is updated; if a particle has a fitness better than the current global optimal, the global optimal solution is updated. Subsequently, parameters are dynamically updated based on the iteration rounds: the inertia factor ω is reduced, the individual factor c1, and the social factor c2 are increased.
[0087] Determine whether the maximum number of iterations I has been reached max Or the global optimal solution is not updated in round m. If the preset maximum number of iterations I is reached max , or if no update occurs in m consecutive iterations, the algorithm is judged to have converged and the iteration termination condition is met.
[0088] Select the global optimal solution and visualize it. When the termination condition is met, output the global optimal path gbets obtained in the last iteration as the target path. This path can be further visualized for subsequent use or user review.
[0089] The local order-constrained path planning method, device, electronic device, and medium of the embodiments of the present invention introduce local target order constraints into the path generation process by randomly generating multiple particles based on a set of start and target nodes, and having each particle represent a complete path that passes through all target nodes and satisfies the local target order constraint sequence. The search method used by each particle is determined based on the search parameters, individual cognitive factors, and social cognitive factors in the current iteration round, and the particles are searched and updated within a set solution space. The particles are guided to optimize paths from the individual optimal solution, the global optimal solution, and the current path using three methods: individual cognitive search, social cognitive search, and free search, thereby improving the diversity and optimization efficiency of path search. After all particles have been updated, the fitness of each particle is calculated based on the distance between any two nodes in the start and target node sets, and the global optimal solution and individual optimal solution are updated accordingly. This allows for continuous optimization of path quality while ensuring that the constraints are satisfied. Finally, after a preset iteration stop condition is satisfied, the global optimal solution of the last round is output as the target path. This allows for high-quality path planning that balances order constraints and path costs, and implements path planning under local target order constraints.
[0090] In one embodiment, a path planning device with local target order constraints is provided, referring to Figure 2 As shown, the path planning device 200 with local target order constraints may include: a particle generation module 201, a search module 202, an update module 203 and an output module 204.
[0091] The particle generation module 201 is used to randomly generate n particles based on the starting node and the target node set; the particles represent a complete path from the starting node through all target nodes in the target node set and meet the preset local target order constraint sequence;
[0092] The search module 202 is used to determine the search method used by each particle based on the search parameters, individual cognitive factors and social cognitive factors in the current iteration round, and use the corresponding search method to search in the set solution space and update the sub-particles; the search method is one of individual cognitive search, social cognitive search or free search; individual cognitive search is used to search in the individual optimal solution of the particle; social cognitive search is used to search in the global optimal solution of the particle swarm; free search is used to search in the current path of the particle;
[0093] The updating module 203 is used to calculate the fitness corresponding to the updated particles according to the distance between any two nodes in the starting node and the target node set after all particles are updated, and to update the global optimal solution and the individual optimal solution;
[0094] The output module 204 is configured to output the global optimal solution obtained in the last round of iteration as the target path when a preset iteration stopping condition is met.
[0095] In one embodiment, the search method adopted is individual cognitive search. The search module 202 is specifically configured to randomly select a continuous first path in the current path of the particle and randomly select a continuous second path in the individual optimal solution of the particle; the first path and the second path have the same length; and replace the first path in the current path of the particle with the second path.
[0096] In one embodiment, the search method adopted is social cognitive search, and the search module 202 is specifically configured to randomly select a continuous first path in the current path of the particle and randomly select a continuous third path in the global optimal solution; the first path and the third path have the same length; and replace the first path in the current path of the particle with the third path.
[0097] In one embodiment, the search method adopted is free search, and a corresponding search method is used to search within a set solution space. The search module 202 is specifically used to randomly select a continuous first path in the current path of the particle, and reverse the first path to obtain a reversed result of the first path; and replace the reversed result of the first path with the first path in the current path of the particle.
[0098] In one embodiment, the search module 202 is specifically configured to, if there are duplicate nodes in the path of the replaced particle, replace the duplicate nodes with nodes not included in the path.
[0099] In one embodiment, the search module 202 is specifically configured to reorder the nodes included in the local target order constraint sequence in the particle path if the path of the replaced particle does not comply with the local target order constraint sequence.
[0100] In one embodiment, the updating module 204 is further configured to update the search parameters, the individual cognitive factors, and the social cognitive factors according to the current iteration round.
[0101] Regarding the specific definition of the path planning device 200 with local target order constraints, please refer to the definition of the path planning method with local target order constraints above, which will not be repeated here. The various modules in the above-mentioned path planning device 200 with local target order constraints 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.
[0102] In one embodiment, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, a path planning method with local target sequence constraints is implemented.
[0103] In one embodiment, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, a path planning method with local target order constraints is implemented.
[0104] It should be noted that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wires (electronic device), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.
[0105] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0106] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0107] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0108] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A path planning method with local target order constraints, characterized in that: include: Randomly generate n particles based on the start node and target node sets; The particle represents a complete path from the starting node through all target nodes in the target node set, and satisfies a preset local target order constraint sequence; Based on the search parameters, individual cognitive factors and social cognitive factors in the current iteration round, the search method adopted by each particle is determined, and the corresponding search method is used to search in the set solution space to update the particle; the search method is one of individual cognitive search, social cognitive search or free search; the individual cognitive search is used to search in the individual optimal solution of the particle; the social cognitive search is used to search in the global optimal solution of the particle swarm; the free search is used to search in the current path of the particle; After all the particles are updated, the fitness corresponding to the updated particles is calculated according to the distance between the starting node and any two nodes in the target node set, and the global optimal solution and the individual optimal solution are updated; When the preset iteration stopping condition is met, the global optimal solution obtained in the last round of iteration is output as the target path.
2. The path planning method with local target order constraints according to claim 1, characterized in that: The search method adopted is individual cognitive search, and the corresponding search method is used to search in a set solution space to update the particles, including: Randomly selecting a continuous first path in the current path of the particle, and randomly selecting a continuous second path in the individual optimal solution of the particle; the first path and the second path have the same length; The second path replaces the first path in the current path of the particle.
3. The path planning method with local target order constraints according to claim 1, characterized in that: The search method adopted is social cognitive search, and the corresponding search method is used to search in a set solution space and update the particles, including: Randomly selecting a continuous first path in the current path of the particle, and randomly selecting a continuous third path in the global optimal solution; the first path and the third path have the same length; The third path replaces the first path in the current path of the particle.
4. The path planning method with local target order constraints according to claim 1, characterized in that: The search method adopted is free search, and the corresponding search method is used to search in a set solution space to update the particles, including: randomly selecting a continuous first path in the current path of the particle, and performing a reverse process on the first path to obtain a reverse result of the first path; The reversed result of the first path replaces the first path in the current path of the particle.
5. The path planning method with local target order constraints according to claim 2 or 3, characterized in that: The method further comprises: If there are repeated nodes in the path of the replaced particle, the repeated nodes are replaced by nodes not included.
6. The path planning method with local target order constraints according to any one of claims 2 to 4, characterized in that: The method further comprises: If the path of the replaced particle does not conform to the local target order constraint sequence, the nodes included in the local target order constraint sequence in the path of the particle are reordered.
7. The path planning method with local target order constraints according to claim 1, characterized in that: The method further comprises: According to the current iteration round, the search parameters, individual cognitive factors and social cognitive factors are updated.
8. A path planning device with local target order constraints, characterized in that: include: The particle generation module is used to randomly generate n particles based on the start node and target node sets; The particle represents a complete path from the starting node through all target nodes in the target node set, and satisfies a preset local target order constraint sequence; A search module is configured to determine a search method for each particle based on the search parameters, individual cognitive factors, and social cognitive factors in the current iteration round, and to use the corresponding search method to search within a set solution space to update the particle; the search method is one of individual cognitive search, social cognitive search, or free search; the individual cognitive search is used to search within the individual optimal solution of the particle; the social cognitive search is used to search within the global optimal solution of the particle swarm; and the free search is used to search within the current path of the particle; An updating module, configured to calculate the fitness corresponding to the updated particles according to the distance between the starting node and any two nodes in the target node set after all the particles are updated, and to update the global optimal solution and the individual optimal solution; The output module is used to output the global optimal solution obtained in the last round of iteration as the target path when a preset iteration stopping condition is met.
9. An electronic 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 path planning method with local target order constraints 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 path planning method with local target order constraints according to any one of claims 1 to 7 is implemented.