Cable path planning method and system based on meta-heuristic algorithm
Through the cable path planning method based on metaheuristic algorithm, the problems of cable path planning in the prior art are solved, and efficient and stable cable path planning is achieved.
Patent Information
- Application Number
- CN202411891996.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The existing cable path planning methods rely on manual design, which consumes time and is very labor-intensive, and are prone to falling into local optimal solutions, especially when obstacle distribution is complex, resulting in high path complexity and instability.
The cable path planning method based on the metaheuristic algorithm is adopted. By obtaining the obstacle map of the target area, segmenting it into a grid planning map, generating an initial comparison route, combining the data in the preset database and the ant colony algorithm to generate multiple candidate paths, and correcting each path, and finally selecting the shortest route as the cable path.
It improves the efficiency and quality of path planning, avoids local optimal solutions, adapts to changes in complex obstacle environments, and ensures low complexity and high stability of the final path.
Smart Images

Figure CN119830495A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of cable path planning, and in particular relates to a cable path planning method and system based on a meta-heuristic algorithm. Background Art
[0002] Cable path layout planning refers to solving cable path planning problems and finding relatively reasonable overall design results by comprehensively considering optimization goals, laying constraints and other conditions based on the spatial constraints of the specific task environment. The power supply scheme and power supply design of residential communities are important components of residential design. They are related to the beauty of residential buildings, reducing residential costs, and protecting the lives and property of residents. However, there are still many problems in the actual power supply design. Traditional cable path planning mainly relies on manual design. Designers manually plan the path based on experience. This method is often time-consuming and labor-intensive. Due to differences in the experience level of designers, the quality of planning results varies. Especially in scenarios with complex obstacle distribution and strict spatial constraints, the designed path may not be optimized enough to meet the actual construction and use requirements.
[0003] Patent CN112749458B discloses a cable path planning method and apparatus, equipment and storage medium. The scheme adjusts the weight of the priority path according to the priority and sets the necessary path. Then, based on the preset cable type, the shortest path of the cable is calculated first, and then the path search is performed according to the predetermined rules and priority order. After the path search is completed, the path information and its length are recorded and evaluated. If the length difference between the shortest paths is less than or equal to the set value, the current path is selected as the cable path, and further search is terminated to determine the preferred cable path. Although the scheme improves efficiency to a certain extent based on the shortest path planning, it may fall into a local optimal solution, especially in the case of complex obstacle distribution. There are oscillations between local optimal solutions instead of converging to a single solution, which may lead to frequent adjustments of the scheme, and ultimately lead to high complexity and instability of the final path. Summary of the invention
[0004] The purpose of the present invention is to solve the above problems and to propose a cable path planning method and system based on meta-heuristic algorithm.
[0005] In a first aspect of the present invention, a cable path planning method based on a meta-heuristic algorithm is first proposed, the method comprising:
[0006] Obtain an obstacle map in the target area, segment the obstacle map to obtain a grid planning map, map the cable planning point and the cable starting point to the grid planning map to obtain a target planning map, and generate an initial comparison route from the starting point to the cable planning point according to the target planning map;
[0007] Acquire data from a preset database, obtain a first route set by combining the target planning map with a preset algorithm, and obtain a second route set by screening the first route set with the initial comparison route;
[0008] For each route in the second route set, the route is corrected to obtain a corrected route, and the route with the shortest corrected route is taken as the final cable path.
[0009] Optionally, generating an initial comparison route from the starting point to the cable planning point according to the target planning diagram includes:
[0010] Step 1, record the starting point as the current node, calculate the movement probability of the next feasible node of the current node according to the preset requirements, and determine the target node according to the movement probability;
[0011] Step 2, selecting a node according to the roulette wheel, and updating the selected node to a temporary node, and determining whether the temporary node is a target node;
[0012] Step 3: If the temporary node is not the target node, reselect the node using the roulette wheel, and save the selected information in a preset database;
[0013] Step 4: If the temporary node is the target node, return to step 1 until the target node is the cable planning point.
[0014] Optionally, calculating the movement probability of the next feasible node of the current node according to preset requirements, and determining the target node according to the movement probability includes:
[0015] Obtain all moving directions of the current node to obtain a moving direction set, obtain a target moving direction, and calculate the angle between each moving direction and the target moving direction to obtain an initial moving deviation angle; the target moving direction is the direction from the current node to the cable planning point;
[0016] If the initial movement deviation angle is an acute angle or a right angle, the area corresponding to the movement direction is recorded as the initial movement area. According to the initial movement deviation angle corresponding to each initial movement area, the movement probability corresponding to each initial movement area is determined, and the movement area with the largest movement probability is obtained and recorded as the target area;
[0017] Determining whether the target moving area is a movable area according to the target planning map, if the target moving area is not a movable area, assigning the moving probability corresponding to the target moving area to the initial moving area adjacent to the target moving area, and updating the target area according to the moving probability;
[0018] If the target moving area is a movable area, the target moving area is recorded as a target node.
[0019] Optionally, obtaining data from a preset database and obtaining a first route set by combining a preset algorithm with the target planning map includes:
[0020] Using the data in the preset database as the initial pheromone distribution;
[0021] An ant colony algorithm is executed according to the target planning map and the initial pheromone distribution to obtain a first route set.
[0022] Optionally, for each route in the second route set, correcting the route to obtain a corrected route includes:
[0023] Step 1: for each route in the second route set, take the target starting point S of the route as the parent node, obtain two adjacent nodes after the target starting point S and record them as N1 and N2; the target starting point S is the starting point of the cable;
[0024] Step 2: Calculate the angle between the SN1 line and the N1 N2 line to obtain the target angle θ;
[0025] Step 3: If the target angle θ is 0, delete node N1 and update node N2 as the target starting point S, and return to step 1; if the target angle θ is not 0, proceed to step 4;
[0026] Step 4: Calculate the SN2 line and determine whether there is an obstacle point on the SN2 line. If there is an obstacle point on the SN2 line, update the node N1 to the target starting point S and return to step 1; if there is no obstacle point on the SN2 line, proceed to step 5;
[0027] Step 5, obtaining the shortest distance d between the SN2 line and the obstacle point. If d is greater than or equal to the preset distance D, the node N1 is deleted, and the node N2 is updated to the target starting point S, and the process returns to step 1; if d is less than D, the node remains unchanged, and the node N2 is updated to the target starting point S, and the process returns to step 1;
[0028] Step 6: Repeat the above steps 1 to 5 until all nodes of the route are judged to obtain a corrected route of the route.
[0029] In a second aspect of the present invention, a cable path planning system based on a meta-heuristic algorithm is proposed, comprising:
[0030] An initial comparison route determination module is used to obtain an obstacle map in a target area, segment the obstacle map to obtain a grid planning map, map the cable planning point and the cable starting point to the grid planning map to obtain a target planning map, and generate an initial comparison route from the starting point to the cable planning point according to the target planning map;
[0031] A route screening module, used to obtain data from a preset database, obtain a first route set by combining the target planning map with a preset algorithm, and obtain a second route set by screening the first route set with the initial comparison route;
[0032] The route correction module is used to correct each route in the second route set to obtain a corrected route, and use the shortest corrected route as the final cable path.
[0033] Optionally, the initial comparison route determination module includes:
[0034] A target node determination module is used to record the starting point as the current node, calculate the movement probability of the next feasible node of the current node according to preset requirements, and determine the target node according to the movement probability;
[0035] A roulette node selection module is used to select a node according to the roulette wheel, update the selected node to a temporary node, and determine whether the temporary node is a target node;
[0036] A roulette wheel node selection update module, used for re-selecting a roulette wheel node if the temporary node is not the target node, and saving the selection information in a preset database;
[0037] The target node updating module is used to return to the target node determining module if the temporary node is the target node, until the target node is the cable planning point.
[0038] Optionally, the target node determination module includes:
[0039] An initial movement deviation angle determination module is used to obtain all movement directions of the current node to obtain a movement direction set, obtain a target movement direction, and calculate the angle between each movement direction and the target movement direction to obtain an initial movement deviation angle; the target movement direction is the direction from the current node to the cable planning point;
[0040] A movement probability determination module is used to record the area corresponding to the movement direction as the initial movement area if the initial movement deviation angle is an acute angle or a right angle, determine the movement probability corresponding to each initial movement area according to the initial movement deviation angle corresponding to each initial movement area, and obtain the movement area with the largest movement probability as the target area;
[0041] A movement probability updating module, used for determining whether the target movement area is a movable area according to the target planning map; if the target movement area is not a movable area, distributing the movement probability corresponding to the target movement area to the initial movement area adjacent to the target movement area, and updating the target area according to the movement probability;
[0042] The target node judgment module is used to record the target moving area as a target node if the target moving area is a movable area.
[0043] Optionally, the route screening module includes:
[0044] The pheromone initialization module is used to use the data in the preset database as the initial pheromone distribution;
[0045] The route generation module is used to execute an ant colony algorithm according to the target planning map and the initial pheromone distribution to obtain a first route set.
[0046] Optionally, the route correction module includes:
[0047] An adjacent node determination module is used for obtaining two adjacent nodes after the target starting point S of each route in the second route set, which are recorded as N1 and N2, with the target starting point S being the starting point of the cable;
[0048] The line angle determination module is used to calculate the angle between the SN1 line and the N1 N2 line to obtain the target angle θ;
[0049] An angle judgment module, used for deleting node N1 if the target angle θ is 0, updating node N2 as the target starting point S, and returning to the adjacent node determination module; if the target angle θ is not 0, entering the line obstacle point existence judgment module;
[0050] The line obstacle point existence judgment module is used to calculate the SN2 line and determine whether there is an obstacle point on the SN2 line. If there is an obstacle point on the SN2 line, the node N1 is updated to the target starting point S, and the module returns to the adjacent node determination module; if there is no obstacle point on the SN2 line, the module enters the shortest distance judgment module;
[0051] The shortest distance judgment module is used to obtain the shortest distance d between the SN2 line and the obstacle point. If d is greater than or equal to the preset distance D, the node N1 is deleted, and the node N2 is updated to the target starting point S, and the module returns to the adjacent node determination module; if d is less than D, the node remains unchanged, the node N2 is updated to the target starting point S, and the module returns to the adjacent node determination module;
[0052] The node loop module is used to repeat the above-mentioned adjacent node determination module to the shortest distance judgment module until all the nodes of the route are judged to obtain a corrected route of the route.
[0053] Beneficial effects of the present invention:
[0054] The present invention proposes a cable path planning method based on a meta-heuristic algorithm, which obtains an obstacle map in a target area, segments the obstacle map to obtain a grid planning map, maps cable planning points and cable starting points to the grid planning map to obtain a target planning map, and generates an initial comparison route from the starting point to the cable planning point according to the target planning map; obtains data from a preset database, obtains a first route set by combining the target planning map with a preset algorithm, and screens the first route set with the initial comparison route to obtain a second route set; for each route in the second route set, corrects the route to obtain a corrected route, and takes the shortest corrected route as the final cable path. By acquiring data from the database and generating multiple path sets in combination with the target planning map, the system can provide multiple candidate paths, ensuring the diversity of path selection, so that the most suitable path can be selected from multiple feasible paths, and then the first route set is screened through the initial comparison route, so that the screened paths are all valid paths, further improving the selection of paths that meet the minimum cost requirements, and can also effectively avoid the limitations that may exist in a single path; when correcting each path, it can adapt to changes in complex obstacle environments. Path correction can not only optimize the original route, reduce possible bends and detours, and avoid falling into local optimal solutions, but also make the final path low in complexity and high in stability even in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The present invention will be further described below in conjunction with the accompanying drawings.
[0056] Figure 1 A flow chart of a cable path planning method based on a meta-heuristic algorithm is provided for an embodiment of the present invention;
[0057] Figure 2 A structural schematic diagram of a cable path planning system based on a meta-heuristic algorithm is provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the present invention, the description of "first", "second", etc. is only used for descriptive purposes, and cannot be understood as indicating or implying its relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0059] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of the present invention.
[0060] The embodiment of the present invention provides a cable path planning method based on a meta-heuristic algorithm. Figure 1 , Figure 1 A flow chart of a cable path planning method based on a meta-heuristic algorithm provided in an embodiment of the present invention. The method comprises the following steps:
[0061] S101, obtaining an obstacle map in the target area, segmenting the obstacle map to obtain a grid planning map, mapping the cable planning point and the cable starting point to the grid planning map to obtain a target planning map, and generating an initial comparison route from the starting point to the cable planning point according to the target planning map;
[0062] S102, obtaining data from a preset database, obtaining a first route set by combining a preset algorithm with a target planning map, and filtering the first route set with an initial comparison route to obtain a second route set;
[0063] S103, for each route in the second route set, modify the route to obtain a modified route, and use the shortest modified route as the final cable path.
[0064] A cable path planning method based on a metaheuristic algorithm provided by an embodiment of the present invention obtains data from a database and generates multiple path sets in combination with a target planning graph. The system can provide multiple candidate paths, ensure the diversity of path selection, and make it possible to select the most suitable path from multiple feasible paths. The first path set is then screened through an initial comparison route so that all the screened paths are valid paths, further improving the selection of paths that meet the minimum cost requirements, and effectively avoiding the limitations that may exist in a single path. When correcting each path, it can adapt to changes in a complex obstacle environment. The path correction can not only optimize the original route, reduce possible bends and detours, and avoid falling into a local optimal solution, but also make the final path low in complexity and high in stability even in a complex environment.
[0065] In one implementation, by converting the obstacle map into a grid planning map, complex continuous space problems can be discretized and the path search process can be simplified. The grid map can more clearly analyze the location of obstacles and the feasibility of cable paths, making path planning more efficient and reducing computational complexity.
[0066] In one implementation, by acquiring data from a database and generating multiple path sets in combination with a target planning map, the system can provide multiple candidate paths, ensuring the diversity of path selection, so that the most suitable path can be selected from multiple feasible paths. The first route set is screened through an initial comparison route, which further improves the selectivity of the path and can effectively avoid the limitations that may exist in a single path.
[0067] In one implementation, the target area is the area where cable path planning is required; the obstacle map indicates which areas in the target area are passable and which areas are occupied or blocked by obstacles and are inaccessible, and the obstacle map is prepared in advance by relevant personnel; the cable planning point is the end point of the cable path, which can be a receiving device, a power distribution box, etc., determined by technical personnel; the cable starting point is the starting point of the cable path, which can be a substation, a power distribution box, a generator, etc., determined by technical personnel; the first route set is screened by the initial comparison route to obtain the second route set, specifically, comparing the length of the path in the first route set with the initial comparison route. If the length of the first route set is shorter than the length of the initial comparison route, it is substituted into the second route set.
[0068] In one implementation, by correcting each path, it is possible to adapt to changes in complex obstacle environments. Path correction can not only optimize the original route, reduce possible bends and detours, but also better avoid new obstacles. By selecting the corrected shortest path, the solution ensures that the final cable path is both safe and efficient.
[0069] In one implementation, during the path planning process, the initial comparison route provides a starting point for the entire path planning. Then, through the multi-path generation and screening method, it is possible to avoid falling into the local optimal solution and find a better global solution as much as possible. Even if the environment is complex, the complexity of the final path can be low and the stability is high.
[0070] In one embodiment, generating an initial comparison route from a starting point to a cable planning point according to a target planning diagram includes:
[0071] Step 1: record the starting point as the current node, calculate the moving probability of the next feasible node of the current node according to the preset requirements, and determine the target node according to the moving probability;
[0072] Step 2, select a node according to the roulette wheel, and update the selected node to a temporary node, and determine whether the temporary node is the target node;
[0073] Step 3: If the temporary node is not the target node, the roulette wheel is used to select the node again, and the selection information is saved in the preset database;
[0074] Step 4: If the temporary node is the target node, return to step 1 until the target node is the cable planning point.
[0075] In one implementation, nodes are selected according to a roulette wheel with the current node as the center, and then nodes to be moved are selected from eight directions, namely, front, back, left, right, left front, right front, left back and right back, and the probability of moving in each of these eight directions is one eighth; a preset database is used to save the number of times each node corresponding to a temporary node is selected, that is, selection information, and the probability of selecting each direction in the other seven directions excluding the direction where the target node is located can be determined based on the number of times each node corresponding to the temporary node is selected in each direction; this selection probability is used as the pheromone distribution of the subsequent ant algorithm, and the pheromone distribution is used as the penalty pheromone for path selection.
[0076] In one implementation, each target node adjusts its selection based on the environment and the state of the node, can continuously optimize the path, and enhance decision-making capabilities by continuously updating information.
[0077] In one implementation, the target node is used for judgment, the number of times the target node is selected according to the roulette wheel is determined, and the selection result when the target node is not selected according to the roulette wheel is recorded as the pheromone for the subsequent ant algorithm to select the path at this point, providing a reference for subsequent selection.
[0078] In one embodiment, calculating the movement probability of the next feasible node of the current node according to preset requirements, and determining the target node according to the movement probability includes:
[0079] Obtain all moving directions of the current node to obtain a moving direction set, obtain the target moving direction, calculate the angle between each moving direction and the target moving direction to obtain the initial moving deviation angle; the target moving direction is the direction from the current node to the cable planning point;
[0080] If the initial movement deviation angle is an acute angle or a right angle, the area corresponding to the movement direction is recorded as the initial movement area. According to the initial movement deviation angle corresponding to each initial movement area, the movement probability corresponding to each initial movement area is determined, and the movement area with the largest movement probability is obtained and recorded as the target area;
[0081] According to the target planning map, it is determined whether the target moving area is a movable area. If the target moving area is not a movable area, the moving probability corresponding to the target moving area is distributed to the initial moving area adjacent to the target moving area, and the target area is updated according to the moving probability;
[0082] If the target moving area is a movable area, the target moving area is recorded as the target node.
[0083] In one implementation, by calculating the included angle and the deviation angle, the algorithm can accurately determine the proximity of the current direction to the target direction, ensure that the selected path is consistent with the direction of the target cable planning point, and reduce path deviation and invalid search; when the target area is immovable, the selection right is transferred to the adjacent area through probability allocation, and the path search direction can be flexibly adjusted. Dynamic adjustment can quickly respond to environmental changes and is particularly suitable for complex planning environments.
[0084] In one implementation, the feasible node is the area corresponding to the initial movement deviation angle being an acute angle or a right angle, that is, the initial movement area; if there is an obstacle in the movable area, the selection probability of this node is recorded as 0.
[0085] In one implementation, the movement probability corresponding to each initial movement area is determined according to the initial movement deviation angle corresponding to each initial movement area. Specifically, the sum of all initial movement deviation angles is calculated to obtain a total angle, the total angle is divided by each initial movement deviation angle to obtain a probability value corresponding to each initial movement deviation angle, the sum of all probability values is calculated to obtain a total probability value, and the probability value corresponding to each initial movement area is divided by the total probability value to obtain the movement probability corresponding to the initial movement area; the preset algorithm is an ant colony algorithm.
[0086] In one implementation, if the initial moving deviation angle is neither an acute angle nor a right angle, the method area is not selected; the movable area is the area within the grid area that can be passed through; there are usually two initial moving areas adjacent to the target moving area, and the probability is equally divided between the two adjacent initial moving areas. If there is only one initial moving area adjacent to the target moving area, the probability is directly added to the probability of the initial moving area and used as the probability of the initial moving area.
[0087] In one implementation, by continuously updating the probability of the area, the algorithm effectively avoids the selection of dead ends or unreachable paths. The areas that have not been passed will reduce their selection probability, thereby reducing the computational burden and accelerating the path search. By considering the initial deviation angle and probability distribution, the algorithm can perform accurate searches in local areas and adjust the direction according to the global goal, avoiding local optimal solutions and finding the final cable planning point more effectively.
[0088] In one implementation, by judging the path direction and adjusting the probability at each step, the algorithm can gradually optimize the path to ensure that each choice is efficient and meaningful, thereby reducing invalid path searches and improving planning efficiency; by allocating movement probabilities and adjusting target areas, the algorithm can automatically bypass immovable areas, thereby adapting to complex environmental layouts and ensuring the feasibility of the final path.
[0089] In one embodiment, obtaining data from a preset database and obtaining a first route set by combining a preset algorithm with a target planning map includes:
[0090] Using the data in the preset database as the initial pheromone distribution;
[0091] The first route set is obtained by executing the ant colony algorithm according to the target planning graph and the initial pheromone distribution.
[0092] In one implementation, before starting the ant colony algorithm, the initial pheromone distribution is set using preset data in the database, and the penalty pheromone corresponding to each path selection point recorded in the database is determined. The penalty pheromone serves as a penalty for selecting this direction, so that subsequent ants will not choose this path, thereby improving the efficiency of path selection and optimizing the search process.
[0093] In one implementation, through the ant colony algorithm, the distribution of the initial pheromone will be continuously adjusted with iterations, thereby guiding the ants to converge to the global optimal path more quickly. Even in complex or incompletely understood environments, the mechanism of the ant colony algorithm can still gradually find a better solution instead of just staying at the local optimal solution.
[0094] In one implementation, the ant colony algorithm not only searches for a single optimal path, but also finds multiple valid paths through parallel exploration by multiple ants. Through parallel search, the algorithm can avoid over-reliance on a single path, increase the breadth of the global search, and provide multiple alternative paths. For practical applications such as cable planning, this means that multiple optimized paths can be obtained with high flexibility and redundancy.
[0095] In one embodiment, for each route in the second route set, modifying the route to obtain a modified route includes:
[0096] Step 1: for each route in the second route set, take the target starting point S of the route as the parent node, obtain the two adjacent nodes after the target starting point S and record them as N1 and N2; the target starting point S is the starting point of the cable;
[0097] Step 2: Calculate the angle between the SN1 line and the N1 N2 line to obtain the target angle θ;
[0098] Step 3: If the target angle θ is 0, delete node N1 and update node N2 to the target starting point S, and return to step 1; if the target angle θ is not 0, proceed to step 4;
[0099] Step 4: Calculate the SN2 line and determine whether there is an obstacle point on the SN2 line. If there is an obstacle point on the SN2 line, update the node N1 to the target starting point S and return to step 1; if there is no obstacle point on the SN2 line, proceed to step 5;
[0100] Step 5: Obtain the shortest distance d between the SN2 line and the obstacle point. If d is greater than or equal to the preset distance D, delete node N1 and update node N2 to the target starting point S, and return to step 1; if d is less than D, the node remains unchanged, and node N2 is updated to the target starting point S, and return to step 1;
[0101] Step 6: Repeat the above steps 1 to 5 until all nodes of the route are judged to obtain a corrected route of the route.
[0102] In one implementation, each node is adjusted and corrected to ensure that each path segment meets the optimal conditions, taking into account not only the shortest distance, but also the straightness of the path, obstacle avoidance, and feasibility of the path. Each adjustment can accurately handle possible turns and obstacles, making the route more in line with actual requirements.
[0103] In one implementation, calculating the target angle can help determine whether the path has excessive turns or unnecessary changes in direction. If the path between two nodes is a straight line, that is, the angle is 0, the path is automatically simplified, thereby avoiding unnecessary turns and reducing the complexity and cost of the path; if the target angle θ is 0, it means that the three points S, N1, and N2 are on the same straight line; the preset distance D is determined by the technician.
[0104] In one implementation, by checking the obstacles on the SN2 route, potential obstacles in the path can be detected in real time, and a decision can be made as to whether the route needs to be changed. This allows path planning to not only pursue the shortest distance, but also effectively avoid obstacles and ensure the passability of the path. By judging the shortest distance d and the preset distance D, the algorithm ensures that the path will not be too close to the obstacle, thereby improving the safety of the path. For cable planning tasks, it is very important to avoid obstacles and maintain a sufficient safety distance. By repeatedly checking the feasibility of the path and the obstacle situation, the algorithm can gradually adjust the route to avoid falling into a local optimal solution. The gradual correction process helps to find a more suitable and optimized path.
[0105] Based on the same inventive concept, the embodiment of the present invention also provides a cable path planning system based on a meta-heuristic algorithm. Figure 2 , Figure 2 A schematic diagram of the structure of a cable path planning system based on a meta-heuristic algorithm provided by an embodiment of the present invention includes:
[0106] An initial comparison route determination module is used to obtain an obstacle map in the target area, segment the obstacle map to obtain a grid planning map, map the cable planning point and the cable starting point to the grid planning map to obtain a target planning map, and generate an initial comparison route from the starting point to the cable planning point according to the target planning map;
[0107] A route screening module, used to obtain data from a preset database, obtain a first route set by combining a preset algorithm with a target planning map, and obtain a second route set by screening the first route set with an initial comparison route;
[0108] The route correction module is used to correct each route in the second route set to obtain a corrected route, and take the shortest corrected route as the final cable path.
[0109] A cable path planning system based on a metaheuristic algorithm provided by an embodiment of the present invention obtains data from a database and generates multiple path sets in combination with a target planning diagram. The system can provide multiple candidate paths, ensure the diversity of path selection, and make it possible to select the most suitable path from multiple feasible paths. The first path set is then screened through an initial comparison route so that all the screened paths are valid paths, further improving the selection of paths that meet the minimum cost requirements, and effectively avoiding the limitations that may exist in a single path. Each path is corrected to adapt to changes in a complex obstacle environment. The path correction can not only optimize the original route, reduce possible bends and detours, and avoid falling into a local optimal solution, but also make the final path low in complexity and high in stability even in a complex environment.
[0110] In one embodiment, the initial comparison route determination module includes:
[0111] The target node determination module is used to record the starting point as the current node, calculate the movement probability of the next feasible node of the current node according to the preset requirements, and determine the target node according to the movement probability;
[0112] A roulette node selection module is used to select a node according to the roulette wheel, update the selected node to a temporary node, and determine whether the temporary node is a target node;
[0113] A roulette wheel selection node update module is used to re-select the roulette wheel node if the temporary node is not the target node, and save the selection information into a preset database;
[0114] The target node updating module is used to return to the target node determining module if the temporary node is the target node, until the target node is the cable planning point.
[0115] In one embodiment, the target node determination module includes:
[0116] The initial movement deviation angle determination module is used to obtain all movement directions of the current node to obtain a movement direction set, obtain a target movement direction, and calculate the angle between each movement direction and the target movement direction to obtain an initial movement deviation angle; the target movement direction is the direction from the current node to the cable planning point;
[0117] A movement probability determination module is used to record the area corresponding to the movement direction as the initial movement area if the initial movement deviation angle is an acute angle or a right angle, determine the movement probability corresponding to each initial movement area according to the initial movement deviation angle corresponding to each initial movement area, and obtain the movement area with the largest movement probability as the target area;
[0118] A movement probability updating module is used to determine whether the target movement area is a movable area according to the target planning map. If the target movement area is not a movable area, the movement probability corresponding to the target movement area is distributed to the initial movement area adjacent to the target movement area, and the target area is updated according to the movement probability;
[0119] The target node judgment module is used to record the target moving area as a target node if the target moving area is a movable area.
[0120] In one embodiment, the route screening module includes:
[0121] The pheromone initialization module is used to use the data in the preset database as the initial pheromone distribution;
[0122] The route generation module is used to execute the ant colony algorithm according to the target planning map and the initial pheromone distribution to obtain the first route set.
[0123] In one embodiment, the route correction module includes:
[0124] The adjacent node determination module is used for obtaining two adjacent nodes after the target starting point S as the parent node for each route in the second route set, and recording them as N1 and N2; the target starting point S is the starting point of the cable;
[0125] The line angle determination module is used to calculate the angle between the SN1 line and the N1 N2 line to obtain the target angle θ;
[0126] Angle judgment module, used to delete node N1 if the target angle θ is 0, and update node N2 to the target starting point S, and return to the adjacent node determination module; if the target angle θ is not 0, enter the line obstacle point existence judgment module;
[0127] The line obstacle point existence judgment module is used to calculate the SN2 line and determine whether there is an obstacle point on the SN2 line. If there is an obstacle point on the SN2 line, the node N1 is updated to the target starting point S and returns to the adjacent node determination module; if there is no obstacle point on the SN2 line, the shortest distance judgment module is entered;
[0128] The shortest distance judgment module is used to obtain the shortest distance d between the SN2 line and the obstacle point. If d is greater than or equal to the preset distance D, the node N1 is deleted, and the node N2 is updated to the target starting point S, and the module returns to the adjacent node determination module; if d is less than D, the node remains unchanged, the node N2 is updated to the target starting point S, and the module returns to the adjacent node determination module;
[0129] The node loop module is used to repeat the above adjacent node determination module to the shortest distance judgment module until all nodes of the route are judged to obtain a corrected route of the route.
[0130] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A cable path planning method based on meta-heuristic algorithm, characterized in that: The method comprises: Obtain an obstacle map in the target area, segment the obstacle map to obtain a grid planning map, map the cable planning point and the cable starting point to the grid planning map to obtain a target planning map, and generate an initial comparison route from the starting point to the cable planning point according to the target planning map; Acquire data from a preset database, obtain a first route set by combining the target planning map with a preset algorithm, and obtain a second route set by screening the first route set with the initial comparison route; For each route in the second route set, the route is corrected to obtain a corrected route, and the route with the shortest corrected route is taken as the final cable path.
2. A cable path planning method based on meta-heuristic algorithm according to claim 1, characterized in that: Generating an initial comparison route from the starting point to the cable planning point according to the target planning diagram includes: Step 1, record the starting point as the current node, calculate the movement probability of the next feasible node of the current node according to the preset requirements, and determine the target node according to the movement probability; Step 2, selecting a node according to the roulette wheel, and updating the selected node to a temporary node, and determining whether the temporary node is a target node; Step 3: If the temporary node is not the target node, reselect the node using the roulette wheel, and save the selected information in a preset database; Step 4: If the temporary node is the target node, return to step 1 until the target node is the cable planning point.
3. A cable path planning method based on meta-heuristic algorithm according to claim 2, characterized in that: Calculate the moving probability of the next feasible node of the current node according to the preset requirements, and determine the target node according to the moving probability, including: Obtain all moving directions of the current node to obtain a moving direction set, obtain a target moving direction, and calculate the angle between each moving direction and the target moving direction to obtain an initial moving deviation angle; the target moving direction is the direction from the current node to the cable planning point; If the initial movement deviation angle is an acute angle or a right angle, the area corresponding to the movement direction is recorded as the initial movement area. According to the initial movement deviation angle corresponding to each initial movement area, the movement probability corresponding to each initial movement area is determined, and the movement area with the largest movement probability is obtained and recorded as the target area; Determining whether the target moving area is a movable area according to the target planning map, if the target moving area is not a movable area, assigning the moving probability corresponding to the target moving area to the initial moving area adjacent to the target moving area, and updating the target area according to the moving probability; If the target moving area is a movable area, the target moving area is recorded as a target node.
4. A cable path planning method based on meta-heuristic algorithm according to claim 2, characterized in that: Acquiring data from a preset database and obtaining a first route set by combining the target planning map with a preset algorithm includes: Using the data in the preset database as the initial pheromone distribution; An ant colony algorithm is executed according to the target planning map and the initial pheromone distribution to obtain a first route set.
5. The cable path planning method based on meta-heuristic algorithm according to claim 1, characterized in that: For each route in the second route set, modifying the route to obtain a modified route includes: Step 1: for each route in the second route set, take the target starting point S of the route as the parent node, obtain two adjacent nodes after the target starting point S and record them as N1 and N2; the target starting point S is the starting point of the cable; Step 2: Calculate the angle between the SN1 line and the N1 N2 line to obtain the target angle θ; Step 3: If the target angle θ is 0, delete node N1 and update node N2 as the target starting point S, and return to step 1; if the target angle θ is not 0, proceed to step 4; Step 4: Calculate the SN2 line and determine whether there is an obstacle point on the SN2 line. If there is an obstacle point on the SN2 line, update the node N1 to the target starting point S and return to step 1; if there is no obstacle point on the SN2 line, proceed to step 5; Step 5, obtaining the shortest distance d between the SN2 line and the obstacle point. If d is greater than or equal to the preset distance D, the node N1 is deleted, and the node N2 is updated to the target starting point S, and the process returns to step 1; if d is less than D, the node remains unchanged, and the node N2 is updated to the target starting point S, and the process returns to step 1; Step 6: Repeat the above steps 1 to 5 until all nodes of the route are judged to obtain a corrected route of the route.
6. A cable path planning system based on meta-heuristic algorithm, characterized in that: The system comprises: An initial comparison route determination module is used to obtain an obstacle map in a target area, segment the obstacle map to obtain a grid planning map, map the cable planning point and the cable starting point to the grid planning map to obtain a target planning map, and generate an initial comparison route from the starting point to the cable planning point according to the target planning map; A route screening module, used to obtain data from a preset database, obtain a first route set by combining the target planning map with a preset algorithm, and obtain a second route set by screening the first route set with the initial comparison route; The route correction module is used to correct each route in the second route set to obtain a corrected route, and use the shortest corrected route as the final cable path.
7. A cable path planning system based on meta-heuristic algorithm according to claim 6, characterized in that: The initial comparison route determination module includes: A target node determination module is used to record the starting point as the current node, calculate the movement probability of the next feasible node of the current node according to preset requirements, and determine the target node according to the movement probability; A roulette node selection module is used to select a node according to the roulette wheel, update the selected node to a temporary node, and determine whether the temporary node is a target node; A roulette wheel node selection update module, used for re-selecting a roulette wheel node if the temporary node is not the target node, and saving the selection information in a preset database; The target node updating module is used to return to the target node determining module if the temporary node is the target node, until the target node is the cable planning point.
8. A cable path planning system based on meta-heuristic algorithm according to claim 7, characterized in that: The target node determination module includes: An initial movement deviation angle determination module is used to obtain all movement directions of the current node to obtain a movement direction set, obtain a target movement direction, and calculate the angle between each movement direction and the target movement direction to obtain an initial movement deviation angle; the target movement direction is the direction from the current node to the cable planning point; A movement probability determination module is used to record the area corresponding to the movement direction as the initial movement area if the initial movement deviation angle is an acute angle or a right angle, determine the movement probability corresponding to each initial movement area according to the initial movement deviation angle corresponding to each initial movement area, and obtain the movement area with the largest movement probability as the target area; A movement probability updating module, used for determining whether the target movement area is a movable area according to the target planning map; if the target movement area is not a movable area, distributing the movement probability corresponding to the target movement area to the initial movement area adjacent to the target movement area, and updating the target area according to the movement probability; The target node judgment module is used to record the target moving area as a target node if the target moving area is a movable area.
9. The cable path planning system based on meta-heuristic algorithm according to claim 7, characterized in that: The route screening module includes: The pheromone initialization module is used to use the data in the preset database as the initial pheromone distribution; The route generation module is used to execute an ant colony algorithm according to the target planning map and the initial pheromone distribution to obtain a first route set.
10. The cable path planning system based on meta-heuristic algorithm according to claim 6, characterized in that: The route correction module comprises: An adjacent node determination module is used for obtaining two adjacent nodes after the target starting point S of each route in the second route set, which are recorded as N1 and N2, with the target starting point S being the starting point of the cable; The line angle determination module is used to calculate the angle between the SN1 line and the N1 N2 line to obtain the target angle θ; An angle judgment module, used for deleting node N1 if the target angle θ is 0, updating node N2 as the target starting point S, and returning to the adjacent node determination module; if the target angle θ is not 0, entering the line obstacle point existence judgment module; The line obstacle point existence judgment module is used to calculate the SN2 line and determine whether there is an obstacle point on the SN2 line. If there is an obstacle point on the SN2 line, the node N1 is updated to the target starting point S, and the module returns to the adjacent node determination module; if there is no obstacle point on the SN2 line, the module enters the shortest distance judgment module; The shortest distance judgment module is used to obtain the shortest distance d between the SN2 line and the obstacle point. If d is greater than or equal to the preset distance D, the node N1 is deleted, and the node N2 is updated to the target starting point S, and the module returns to the adjacent node determination module; if d is less than D, the node remains unchanged, the node N2 is updated to the target starting point S, and the module returns to the adjacent node determination module; The node loop module is used to repeat the above-mentioned adjacent node determination module to the shortest distance judgment module until all the nodes of the route are judged to obtain a corrected route of the route.
Citation Information
Patent Citations
Cable route planning methods, apparatus, equipment and storage media
CN112749458B
Adaptive information feedback particle swarm robot path selecting method based on multiple subgroups and system thereof
CN107450563A
Smart city power transmission line planning method based on artificial intelligence
CN114418215A
Robot operation track planning method and device, computer equipment and storage medium
CN115016451A
Cable laying model construction method and system, electronic equipment and readable storage medium
CN118747412A