A cable path planning method and system based on meta-heuristic algorithm
Through the cable path planning method based on metaheuristic algorithm, multiple candidate paths are generated using obstacle map segmentation and ant colony algorithm, and the routes are screened and corrected, which solves the problems of time-consuming and unstable quality of traditional cable path planning, and achieves efficient and stable cable path planning.
Patent Information
- Application Number
- CN202411891996.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The existing cable path planning mainly relies on manual design, which consumes time and has uneven quality of planning results. It is difficult to meet actual construction and use requirements in scenarios where obstacle distribution is complex and spatial constraints are strictly restricted. The traditional methods may fall into local optimal solutions, resulting in high path complexity and instability.
A cable path planning method based on metaheuristic algorithm is adopted. By obtaining the obstacle map of the target area and segmenting it into a grid planning map, multiple candidate paths are generated by combining preset databases and ant colony algorithms, filtering and correcting the routes to avoid local optimal solutions, and optimizing path selection.
Improve the efficiency and stability of path planning, ensure the diversity and adaptability of path selection, reduce bending and detouring, avoid local optimal solutions, and ensure low complexity and high stability of the final path.
Smart Images

Figure CN119830495B_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 route layout planning involves solving cable route planning problems based on the spatial constraints of a specific task environment, comprehensively considering optimization objectives, laying constraints, and other conditions to find a relatively reasonable overall design outcome. The power supply scheme and design of residential buildings in residential communities are important components of residential design, impacting the aesthetics of residential buildings, reducing construction costs, and protecting residents' lives and property. However, current practical power supply design still faces many problems. Traditional cable route planning relies primarily on manual design, where designers manually plan routes based on their experience. This method is often time-consuming and labor-intensive, and due to differences in designer experience, the quality of planning results varies. Especially in scenarios with complex obstacle distribution and strict spatial constraints, the designed route may not be optimized enough to meet actual construction and usage requirements.
[0003] Patent CN112749458B discloses a cable path planning method, apparatus, device, and storage medium. This solution adjusts the weight of the priority path according to the priority and sets the required path. Then, based on the preset cable type, the shortest path of the cable is calculated. Then, a path search is performed according to predetermined rules and priorities. 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 this solution 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 the local optimal solutions, rather than convergence to a single solution, which may lead to frequent adjustments of the solution, 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 metaheuristic algorithm is first proposed, the method comprising:
[0006] Obtain an obstacle map within 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] Obtaining data from a preset database, combining the target planning map with a preset algorithm to obtain a first route set, and filtering the first route set with the initial comparison route to obtain a second route set;
[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 used 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: Select a node according to the roulette wheel, update the selected node to a temporary node, and determine whether the temporary node is the 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 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 areas 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 the first route set by combining the target planning map with a preset algorithm includes:
[0020] Use the data in the preset database as the initial pheromone distribution;
[0021] An ant colony algorithm is executed according to the target planning graph 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 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;
[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: 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, update node N2 to the target starting point S, and return to step 1.
[0028] Step 6: Repeat steps 1 to 5 above 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 configured to obtain an obstacle map within a target area, segment the obstacle map to obtain a grid planning map, map the cable planning points and the cable starting points 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 based on the target planning map;
[0031] a route screening module, configured 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 configured 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 is used to re-select a roulette wheel node if the temporary node is not the target node, and save 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 configured 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 configured 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 based on the initial movement deviation angle corresponding to each initial movement area, and obtain the movement area with the highest movement probability as the target area;
[0041] a movement probability updating module, configured 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, assigning the movement probability corresponding to the target movement area to the initial movement areas adjacent to the target movement area, and updating the target area according to the movement probability;
[0042] The target node judgment module is configured 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, configured to obtain, for each route in the second route set, two adjacent nodes after the target starting point S of the route as a parent node, and record them as N1 and N2; the target starting point S is 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 lines to obtain the target angle θ;
[0049] An angle determination module is configured to, if the target angle θ is 0, delete node N1 and update node N2 as the target starting point S, and return to the adjacent node determination module; if the target angle θ is not 0, enter the route obstacle presence determination module;
[0050] The route obstacle point existence judgment module is used to calculate the SN2 route and determine whether there is an obstacle point on the SN2 route. If there is an obstacle point on the SN2 route, the node N1 is updated to the target starting point S, and the process returns to the adjacent node determination module. If there is no obstacle point on the SN2 route, the process enters the shortest distance judgment module.
[0051] The shortest distance determination module is configured to obtain the shortest distance d between the SN2 line and the obstacle point. If d is greater than or equal to a preset distance D, node N1 is deleted, node N2 is updated as the target starting point S, and the process returns to the adjacent node determination module. If d is less than D, the node remains unchanged, node N2 is updated as the target starting point S, and the process 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 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 metaheuristic algorithm. The method comprises the following steps: obtaining an obstacle map within a 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; obtaining data from a preset database, combining the target planning map with a preset algorithm to obtain a first route set, screening the first route set with the initial comparison route to obtain a second route set; and correcting each route in the second route set to obtain a corrected route. The route with the shortest corrected route is taken 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 with reference to 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 provide a clear and complete description of the technical solutions in the embodiments of the present invention, in conjunction with the accompanying drawings. Obviously, the described embodiments represent only a portion of the embodiments of the present invention, not all of them. The term "and / or" herein simply describes an association relationship between associated objects, indicating that three possible relationships exist. For example, "A" and "B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, references to "first," "second," and so on in the present invention are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined as "first" or "second" may explicitly or implicitly include at least one of these features. Furthermore, the technical solutions of the various embodiments may be combined, but only if they are achievable by a person of ordinary skill in the art. If a combination of technical solutions contradicts or is unachievable, such combination shall be deemed non-existent and outside the scope of protection claimed 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 metaheuristic algorithm provided in an embodiment of the present invention. The method comprises the following steps:
[0061] S101, obtaining an obstacle map within the target area, segmenting the obstacle map to obtain a grid planning map, mapping the cable planning points and the cable starting points 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 based on the target planning map;
[0062] S102, obtaining data from a preset database, combining a preset algorithm with a target planning map to obtain a first route set, 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, ensuring the diversity of path selection, so that the most suitable path can be selected from multiple feasible paths. The first path set is then screened through an initial comparison route so that all 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 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.
[0065] In one implementation, by converting the obstacle map into a grid planning diagram, complex continuous space problems can be discretized and the path search process can be simplified. The grid diagram 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, making it possible to select the most suitable path from multiple feasible paths. By screening the first route set through initial comparison routes, the path selectivity is further improved, which 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 accessible 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., and is 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., and is determined by technical personnel; the first route set is screened using the initial comparison route to obtain the second route set. Specifically, the length of the path in the first route set is compared with the length of the initial comparison route. If the length of the path in 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, each path is modified to adapt to changes in complex obstacle environments. Path modification not only optimizes the original route, reducing possible bends and detours, but also better avoids new obstacles. By selecting the shortest corrected 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 multi-path generation and screening methods, it is possible to avoid falling into local optimal solutions and find a better global solution as much as possible. Even in complex environments, the final path can be made less complex and more stable.
[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 probability of moving to the next feasible node of the current node according to the preset requirements, and determine the target node based on the movement probability;
[0072] Step 2: Select a node according to the roulette wheel, 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 a new node and the selected 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, a roulette wheel is used to select nodes centered on the current node, and then nodes are selected to move in eight directions: front, back, left, right, left front, right front, left back, and right back. The probability of moving in each of these eight directions is one-eighth. A preset database is used to store the number of times each node's corresponding temporary node is selected, that is, selection information. Based on the number of times each node's corresponding temporary node is selected in each direction, the probability of selecting each direction in the other seven directions excluding the direction where the target node is located can be determined. This selection probability is used as the pheromone distribution of the subsequent ant algorithm, and this 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 node's status, continuously optimizing the path and enhancing decision-making capabilities by continuously updating information.
[0077] In one implementation, the target node is used for judgment, and the number of times the target node is selected according to the roulette wheel is determined. The selection results when the target node is not selected according to the roulette wheel are recorded as pheromones for the subsequent ant algorithm to select the path at this point, providing a reference for subsequent selections.
[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, and 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 recorded as the target area.
[0081] Determine 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, distribute the moving probability corresponding to the target moving area to the initial moving area adjacent to the target moving area, and update the target area 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 deviation angle, the algorithm can accurately determine the proximity of the current direction to the target direction, ensuring that the selected path is consistent with the direction of the target cable planning point, reducing path deviation and invalid searches; when the target area is immovable, the selection right is transferred to the adjacent area through probability distribution, which can flexibly adjust the path search direction. 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, based on the initial movement deviation angle corresponding to each initial movement area, the movement probability corresponding to each initial movement area is determined by calculating the sum of all initial movement deviation angles to obtain a total angle, dividing the total angle by each initial movement deviation angle to obtain a probability value corresponding to each initial movement deviation angle, calculating the sum of all probability values to obtain a total probability value, and dividing the probability value corresponding to each initial movement area by the total probability value to obtain the movement probability corresponding to the initial movement area; the preset algorithm is the 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 the result is used as the probability of the initial moving area.
[0087] In one implementation, the algorithm effectively avoids selecting dead ends or unreachable paths by continuously updating the probabilities of regions. Regions that have not been passed through have their selection probabilities reduced, thereby reducing the computational burden and accelerating path search. By considering the initial deviation angle and probability distribution, the algorithm can perform precise searches within local areas while adjusting its direction based on the global goal, avoiding local optimal solutions and more efficiently finding the final cable planning point.
[0088] In one implementation, by determining the path direction and adjusting the probability at each step, the algorithm can gradually optimize the path, ensuring that each choice is efficient and meaningful, thereby reducing ineffective path searches and improving planning efficiency. By assigning movement probabilities and adjusting the target area, 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] Use 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 choosing 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, the ant colony algorithm (ACO) continuously adjusts the initial pheromone distribution over iterations, guiding the ants to converge more quickly to the global optimal path. Even in complex or incompletely understood environments, the ACO mechanism can still gradually find a better solution, rather than just staying at a 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 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, update node N2 to the target starting point S, and return to step 1.
[0101] Step 6: Repeat steps 1 to 5 above until all nodes of the route are judged to obtain a corrected route of the route.
[0102] In one implementation, node-by-node adjustments and corrections are made to ensure that each path segment meets optimal conditions, taking into account not only the shortest distance but also the straightness of the path, obstacle avoidance, and path feasibility. 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 the 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 for 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 comparing the shortest distance d with the preset distance D, the algorithm ensures that the path will not be too close to obstacles, thereby improving the safety of the path. For cable planning tasks, avoiding obstacles and maintaining a sufficient safety distance are very important. 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 structural diagram 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 within the target area, segment the obstacle map to obtain a grid planning map, map the cable planning points and the cable starting points 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 based on the target planning map;
[0107] A route screening module is 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 use 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 graph. 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 path set is then screened through an initial comparison route so that all 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 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.
[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] The 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 the target node;
[0113] A roulette wheel node selection update module is used to reselect a roulette wheel node if the temporary node is not the target node, and save the selection information to 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 configured 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 based on the initial movement deviation angle corresponding to each initial movement area, and obtain the movement area with the highest movement probability as the target area;
[0118] A movement probability update 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 areas 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 the 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] An adjacent node determination module is configured to obtain, for each route in the second route set, two adjacent nodes after the target starting point S of the route as a parent node, and record 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 lines to obtain the target angle θ;
[0126] Angle judgment module, which is used to delete node N1 if the target angle θ is 0, 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 obstacle point determination 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, 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 determination module.
[0128] The shortest distance determination 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, node N1 is deleted and 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, 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 the 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 should not be considered to limit the scope 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 within 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; Obtaining data from a preset database, combining the target planning map with a preset algorithm to obtain a first route set, and filtering the first route set with the initial comparison route to obtain a second route set; 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; 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: Select a node according to the roulette wheel, update the selected node to a temporary node, and determine whether the temporary node is the 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; Calculate the probability of moving to the next feasible node of the current node according to the preset requirements, and determine the target node according to the movement 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 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 areas 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.
2. A cable path planning method based on meta-heuristic algorithm according to claim 1, 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: Use the data in the preset database as the initial pheromone distribution; An ant colony algorithm is executed according to the target planning graph and the initial pheromone distribution to obtain a first route set.
3. 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 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; Step 2: Calculate the angle between the SN1 line and the N1N2 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: 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, update node N2 to the target starting point S, and return to step 1. Step 6: Repeat steps 1 to 5 above until all nodes of the route are judged to obtain a corrected route of the route.
4. A cable path planning system based on meta-heuristic algorithm, characterized in that: The system comprises: An initial comparison route determination module is configured to obtain an obstacle map within a target area, segment the obstacle map to obtain a grid planning map, map the cable planning points and the cable starting points 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 based on the target planning map; a route screening module, configured 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; a route correction module, configured 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; 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 is used to re-select a roulette wheel node if the temporary node is not the target node, and save the selection information in a preset database; a target node updating module, configured 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; The target node determination module includes: An initial movement deviation angle determination module is configured 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 configured 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 based on the initial movement deviation angle corresponding to each initial movement area, and obtain the movement area with the highest movement probability as the target area; a movement probability updating module, configured 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, assigning the movement probability corresponding to the target movement area to the initial movement areas adjacent to the target movement area, and updating the target area according to the movement probability; The target node judgment module is configured to record the target moving area as a target node if the target moving area is a movable area.
5. The cable path planning system based on meta-heuristic algorithm according to claim 4, 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.
6. The cable path planning system based on meta-heuristic algorithm according to claim 4, characterized in that: The route correction module includes: an adjacent node determination module, configured to obtain, for each route in the second route set, two adjacent nodes after the target starting point S of the route as a parent node, and record them as N1 and N2; the target starting point S is the starting point of the cable; The line angle determination module is used to calculate the angle between the SN1 line and the N1N2 line to obtain the target angle θ; An angle determination module is configured to, if the target angle θ is 0, delete node N1 and update node N2 as the target starting point S, and return to the adjacent node determination module; if the target angle θ is not 0, enter the route obstacle presence determination module; The route obstacle point existence judgment module is used to calculate the SN2 route and determine whether there is an obstacle point on the SN2 route. If there is an obstacle point on the SN2 route, the node N1 is updated to the target starting point S, and the process returns to the adjacent node determination module. If there is no obstacle point on the SN2 route, the process enters the shortest distance judgment module. The shortest distance determination module is configured to obtain the shortest distance d between the SN2 line and the obstacle point. If d is greater than or equal to a preset distance D, node N1 is deleted, node N2 is updated as the target starting point S, and the process returns to the adjacent node determination module. If d is less than D, the node remains unchanged, node N2 is updated as the target starting point S, and the process 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 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