Planning Method, Device, Equipment and Storage Medium for Layout Path of Water Supply Pipeline Network
Through the adaptive mutant ant colony algorithm and the improved ant colony algorithm, the blindness problem in the water supply pipeline layout path planning is solved, and more reasonable path planning is achieved and construction costs are reduced.
Patent Information
- Application Number
- CN202210281202.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-22
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-03-22
AI Technical Summary
The existing water supply pipeline layout path planning is blind, and the obstacles such as cement walls and the terrain of the construction area are not reasonably considered, resulting in unreasonable paths.
Adaptive mutant ant colony algorithm and improved ant colony algorithm are used, combined with raster maps and water supply evaluation functions, the water supply path is optimized, and the path is adjusted through obstacle impact factors and target impact factors to reduce blindness and improve the rationality of path planning.
It improves the rationality of the water supply pipeline layout path, reduces the blindness of path search, enhances the global search capability, and reduces construction costs.
Smart Images

Figure CN114722546B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of urban water supply scheduling, and particularly to a method, device, terminal device and computer-readable storage medium for planning the layout path of a water supply pipe network. Background Art
[0002] The water supply pipeline system usually takes water from a water source, sends the water resources to a water treatment plant through a main pipeline, and after purification treatment by the water treatment plant, the water is sent to the water use area through the main pipeline. Each water use area then lays its own water supply pipeline system according to its own needs and conditions, and the water supply pipeline system sends the water resources to each water use point or to each household water use point through branch pipelines. However, for the existing layout of the water supply pipe network, the path search for obstacles such as cement walls is blind, and the terrain within the pipeline construction area is not reasonably considered, resulting in an unreasonable layout path of the water supply pipe network. Summary of the Invention
[0003] Embodiments of the present invention provide a method, device, terminal device and computer-readable storage medium for planning the layout path of a water supply pipe network, which can reduce the blindness of path search, reasonably consider the terrain of the pipeline construction area, and improve the rationality of the layout path of the water supply pipe network.
[0004] Embodiments of the present invention provide a method for planning the layout path of a water supply pipe network, including:
[0005] Rasterize the layout area of the water supply pipe network to obtain a raster map of the layout area;
[0006] Perform path planning based on the number of obstacles around the optional nodes in the raster map to obtain an initial water supply path;
[0007] Perform path optimization on the initial water supply path based on a first path planning algorithm to obtain a first optimized water supply path; wherein, the first path planning algorithm is an adaptive mutation ant colony algorithm;
[0008] Evaluate the turning points of the first optimized water supply path according to a preset water supply evaluation function. When the evaluation score of any one of the turning points is less than or equal to a first threshold, then use the first path planning algorithm and a second path planning algorithm to re-search the path between the previous turning point and the next turning point of this turning point until the evaluation scores of all the turning points are greater than the first threshold, and obtain the final layout path of the water supply pipe network; wherein, the second path planning algorithm is obtained by improving the heuristic function of the ant colony algorithm by introducing an obstacle influence factor and a target influence factor.
[0009] As an improvement of the above solution, the performing path planning based on the number of obstacles around the optional nodes in the raster map to obtain an initial water supply path includes:
[0010] Determine the starting point and the ending point of the water supply network in the grid map;
[0011] Starting from the starting point, sequentially determine whether the number of obstacles around the current node is greater than the second threshold. If so, use the second path planning algorithm to select the next node; if not, select the next node according to the following formula to obtain the initial water supply path from the starting point to the ending point:
[0012]
[0013] where j is the current node, j' is the next node, N x is the total number of rows of the grid map, and amount is the number of selectable nodes among the 8 nodes adjacent to the current node.
[0014] As an improvement to the above solution, path optimization is performed on the initial water supply path based on the first path planning algorithm to obtain the initially optimized water supply path, including:
[0015] Step S31: Calculate the path length of the initial water supply path;
[0016] Step S32: Determine the mutation path length according to the path length of the initial water supply path;
[0017] Step S33: Randomly select two nodes from the initial water supply path as mutation points according to the mutation path length;
[0018] Step S34: Search for the path between the two mutation points according to the first path planning algorithm to obtain the mutation path;
[0019] Step S35: Compare the initial path of the two mutation points in the initial water supply path with the mutation path. When the mutation path is better than the initial path, update the initial path with the mutation path;
[0020] Iteratively execute steps S31 to S35 for M times, and use the initial path obtained by the last iterative update as the initially optimized water supply path; where M is a positive integer.
[0021] As an improvement to the above solution, determining the mutation path length according to the path length of the initial water supply path is specifically:
[0022] Round up the 1 / n path length of the initial water supply path to obtain the mutation path length; where n is a positive integer.
[0023] As an improvement to the above solution, searching for the path between the two mutation points according to the first path planning algorithm to obtain a mutation path includes:
[0024] Taking one of the mutation points as the source node and the other mutation point as the target node, starting from the source node, and sequentially selecting the next node according to the following formula until the mutation path from the source node to the target node is obtained:
[0025]
[0026] where s is the next node, (i, j) is the path from node i to node j, τ i,j (t) is the pheromone intensity on the path (i, j) at time t, v i,j (t) is the water flow transmission speed of the path (i, j), delay i,j (t) is the water flow transmission time of the path (i, j), (i, u) is the path from node i to node u, τ i,u (t) is the pheromone intensity on the path (i, u) at time t, v i,u (t) is the water flow transmission speed of the path (i, u), delay i,u (t) is the water flow transmission time of the path (i, u), α is the weight of the pheromone intensity, β is the weight of the water flow transmission speed, γ is the weight of the water flow transmission time delay, NodeSum(1, μ) is the number of times passing through node μ, allow k is the set of nodes that the current ant can select, and rand is a preset parameter.
[0027] As an improvement to the above solution, the heuristic function of the second path planning algorithm is specifically:
[0028]
[0029]
[0030] where η i,j is the heuristic information of the path (i, j), d i,G is the target influence factor, d i,G is used to represent the distance from node i to the end point G, ∑ obs∈P d i,obs is the obstacle influence factor, ∑ obs∈P d i,obs is used to represent the sum of the distances of all obstacles within the obstacle influence range P to node i, k1 is the weight of the target influence factor, k2 is the weight of the obstacle influence factor, allow k is the set of nodes that the current ant can select, N x is the total number of rows of the grid map, Ny is the total number of columns of the grid map
[0031] As an improvement to the above solution, the preset water supply evaluation function G(v, ω) is specifically:
[0032]
[0033] where v is the linear velocity of water flow transmission, ω is the angular velocity of water flow transmission, angle(v, ω) is the direction angle evaluation function, angle(v, ω) is used to represent the deviation of the direction angle between two turning points, vel(v, ω) is the velocity magnitude evaluation function, ξ is the weighting coefficient of the direction angle evaluation function, is the weighting coefficient of the velocity magnitude evaluation function, and σ is the smoothing coefficient.
[0034] Correspondingly, another embodiment of the present invention provides a planning device for the layout path of a water supply network, including:
[0035] A rasterization module for rasterizing the layout area of the water supply network to obtain a grid map of the layout area;
[0036] An initial path planning module for performing path planning based on the number of obstacles around the optional nodes in the grid map to obtain an initial water supply path;
[0037] A primary path optimization module for optimizing the path of the initial water supply path based on the first path planning algorithm to obtain a primary optimized water supply path; wherein, the first path planning algorithm is an adaptive mutation ant colony algorithm;
[0038] A secondary path optimization module for evaluating the turning points of the primary optimized water supply path according to the preset water supply evaluation function. When the evaluation score of any one of the turning points is less than or equal to the first threshold, the first path planning algorithm and the second path planning algorithm are used to re-search the path between the previous turning point and the next turning point of this turning point until the evaluation scores of all the turning points are greater than the first threshold, to obtain the final layout path of the water supply network; wherein, the second path planning algorithm is obtained by improving the heuristic function of the ant colony algorithm by introducing an obstacle influence factor and a target influence factor.
[0039] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the planning method for the layout path of the water supply network as described in any one of the above.
[0040] Another embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the planning method for the water supply pipeline network layout path described in any one of the above.
[0041] Compared with the prior art, the planning method, device, equipment and computer-readable storage medium for the water supply pipeline network layout path disclosed in the embodiments of the present invention, on the one hand, use the adaptive mutation ant colony algorithm to make the path search jump out of local optimization, reduce the possibility of the algorithm falling into local optimum, and improve the optimization ability and convergence speed of the algorithm; on the other hand, use a preset water supply evaluation function to evaluate the turning points of the constructed water supply path, reduce the blindness of path search, can reasonably consider the terrain of the pipeline construction area, and adjust the water supply path based on the ant colony algorithm and adaptive mutation ant colony algorithm obtained by improving the heuristic function based on the target influence factor and obstacle influence factor, so as to enhance the global search ability of path planning and improve the rationality of the water supply pipeline network layout path. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flowchart of a planning method for a water supply pipeline network layout path provided by an embodiment of the present invention;
[0043] Figure 2 is a schematic diagram of a grid map provided by an embodiment of the present invention;
[0044] Figure 3 is a schematic diagram of another grid map provided by an embodiment of the present invention;
[0045] Figure 4 is a structural block diagram of a planning device for a water supply pipeline network layout path provided by an embodiment of the present invention;
[0046] Figure 5 is a structural block diagram of a terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0048] See Figure 1 , Figure 1 is a flowchart of a planning method for a water supply pipeline network layout path provided by an embodiment of the present invention.
[0049] The planning method for the layout path of a water supply network provided by an embodiment of the present invention includes the following steps:
[0050] Step S11: rasterize the layout area of the water supply network to obtain a raster map of the layout area;
[0051] Step S12: perform path planning based on the number of obstacles around the optional nodes in the raster map to obtain an initial water supply path;
[0052] Step S13: optimize the path of the initial water supply path based on the first path planning algorithm to obtain a first optimized water supply path; wherein, the first path planning algorithm is an adaptive mutation ant colony algorithm;
[0053] Step S14: evaluate the turning points of the first optimized water supply path according to a preset water supply evaluation function. When the evaluation score of any one of the turning points is less than or equal to the first threshold, the first path planning algorithm and the second path planning algorithm are used to re-search the path between the previous turning point and the next turning point of this turning point until the evaluation scores of all the turning points are greater than the first threshold, obtaining the final layout path of the water supply network; wherein, the second path planning algorithm is obtained by improving the heuristic function of the ant colony algorithm by introducing an obstacle influence factor and a target influence factor.
[0054] It should be noted that during the layout of the water supply network, the pipeline is often easily blocked by static obstacles such as cement walls, and there is a lack of global search ability for the actual situation of the terrain and buildings in the construction area. The layout process is blind and it is difficult to meet the requirements of economy and rationality. In order to improve the use efficiency of the urban water supply network project, it is necessary to strengthen the optimization of the network layout so that, while ensuring normal water supply, the construction cost of the urban water supply network project can be reduced. The optimization principles for the layout path of the water supply network mainly include: 1. The safety principle, that is, the laid network cannot collide with obstacles; 2. The optimality principle, that is, the path of the network layout should be the shortest; 3. The time principle, that is, the time to find the optimal path should be as short as possible.
[0055] It is worth noting that the raster map method is a simple and effective modeling method, which not only has strong adaptability to obstacles but also helps to reduce the complexity of the environment; while the Cartesian coordinate system method is an intuitive modeling method that can clearly represent each point in the environment. For example Figure 2As shown in the figure, the present invention combines the advantages of two modeling methods. The layout area of the water supply network is divided from the upper left corner to the lower right corner, from left to right, and from top to bottom. The black area represents obstacles, and the grids where obstacles are located cannot be laid. The white area is the area where laying is possible. The grid map method and the Cartesian coordinate system method are integrated, so that the grid map of the layout area of the water supply network formed is beneficial to path planning and can also assist in the improvement of the algorithm.
[0056] Specifically, the coordinates (x i , y i ) of the i-th grid of the grid map satisfy the following relational expression:
[0057]
[0058] where x i is the abscissa of the i-th grid, y i is the ordinate of the i-th grid, a is the length of each grid, N x is the total number of rows of the grid map, N y is the total number of columns of the grid map, mod is the remainder function, and ceil(i / N y ) is the smallest integer function greater than or equal to i / N y .
[0059] Preferably, the nodes for pipeline laying are located at the center points of the grids.
[0060] Specifically, the grid coordinates are represented by the center points of the grids.
[0061] As an example, in step S12, path planning can be performed through path planning algorithms such as the D* algorithm, Rapidly-exploring Random Trees (RRT), and simulated evolution algorithm to obtain an initial water supply path.
[0062] As one of the optional embodiments, performing path planning based on the number of obstacles around the optional nodes in the grid map to obtain an initial water supply path includes:
[0063] Determining the starting point and the ending point of the water supply network in the grid map;
[0064] Starting from the starting point, sequentially determine whether the number of obstacles around the current node is greater than a second threshold. If so, use the second path planning algorithm to select the next node; if not, select the next node according to the following formula to obtain an initial water supply path from the starting point to the ending point:
[0065]
[0066] where j is the current node, j' is the next node, N xis the total number of rows of the grid map, and amount is the number of selectable nodes among the 8 nodes adjacent to the current node.
[0067] In the present invention, the blank grids can be divided into two cases: one is the global blank grid, that is, the blank grid without obstacles; the other is the local blank grid, that is, a part of the grid map without obstacles. Among them, during the pipeline layout process, a tabu list and a set of selectable nodes will be generated. Obstacles and the previous node (selected node) are placed in the tabu list, and blank nodes are used as selectable nodes. As Figure 3 shown, the above formula can be understood as: there are 8 nodes adjacent to the current node of the pipeline. If the number of selectable nodes is 7, the current area is regarded as a blank area, and the position of the next node is directly determined according to the orientation of the target; if the number of selectable nodes is not 7, the pseudo-random strategy and roulette are used to determine the next node, so as to improve the search efficiency. For the simple terrain where the number of obstacles around the current node is less than the second threshold in the present invention, a relatively simple algorithm is used to select the next node, which can save the path search time and effectively improve the efficiency of path search.
[0068] In some more preferred embodiments, optimizing the path of the initial water supply path based on the first path planning algorithm to obtain a primary optimized water supply path includes:
[0069] Step S31: Calculate the path length of the initial water supply path;
[0070] Step S32: Determine the mutation path length according to the path length of the initial water supply path;
[0071] Step S33: Randomly select two nodes from the initial water supply path as mutation points according to the mutation path length;
[0072] Step S34: Search for the path between the two mutation points according to the first path planning algorithm to obtain a mutation path;
[0073] Step S35: Compare the initial path of the two mutation points in the initial water supply path with the mutation path. When the mutation path is better than the initial path, the initial path is updated with the mutation path;
[0074] Iteratively execute steps S31 to S35 for M times, and use the initial path obtained by the last iterative update as the primary optimized water supply path; where M is a positive integer.
[0075] It should be noted that the basic idea of the adaptive mutation ant colony algorithm is as follows: Determine the mutation length according to the length of the initial water supply path, then randomly generate two mutation points in the initial water supply path based on the mutation length, and then execute a secondary algorithm between these two mutation points to search for other feasible paths. Finally, use the feasible path between the two newly searched mutation points to replace the original path between the two mutation points, thereby generating a new water supply path. The new solution generated in this way may enable the algorithm to jump out of the current local extreme value and accelerate the convergence speed. Therefore, by generating mutation points and performing secondary search, the possibility of the algorithm falling into local optimization can be reduced, and the optimization ability and convergence speed of the algorithm can be improved.
[0076] In some more optimal embodiments, the determination of the mutation path length according to the path length of the initial water supply path is specifically as follows:
[0077] Round the 1 / n path length of the initial water supply path to obtain the mutation path length; where n is a positive integer.
[0078] In the specific implementation process, during the path planning process, add a node usage counter NodeSum(1,N), and the initial value of each node in the counter is 0, that is, NodeSum(1,j) = 0. Each time a node is passed through, the count value of that node is incremented by 1, that is, NodeSum(1,j) = NodeSum(1,j) + 1. When the pipeline selects the next node s from the current node i at time t, the node usage counter is taken into account. With a certain probability, the pipeline laying personnel select the node with the smallest node count value, so that the unvisited nodes have the possibility of being visited, and to a certain extent, jump out of the local extreme value.
[0079] In a specific implementation manner, the search for the path between the two mutation points according to the first path planning algorithm to obtain the mutation path includes:
[0080] Take one of the mutation points as the source node and the other mutation point as the target node. Starting from the source node, select the next node in turn according to the following formula until the mutation path from the source node to the target node is obtained: [[]]
[0081]
[0082] where s is the next node, (i,j) is the path from node i to node j, τ i,j (t) is the pheromone intensity on the path (i,j) at time t, v i,j (t) is the water flow transmission speed of the path (i,j), delay i,j(t) is the water flow transmission time of path (i,j), (i,u) is the path from node i to node u, τ i,u (t) is the pheromone intensity on path (i,u) at time t, v i,u (t) is the water flow transmission speed of path (i,u), delay i,u (t) is the water flow transmission time of path (i,u), α is the weight of pheromone intensity, β is the weight of water flow transmission speed, γ is the weight of water flow transmission delay, NodeSum(1,μ) is the number of times passing through node μ, allow k is the set of nodes that the current ant can choose, and rand is a preset parameter.
[0083] Specifically, in step S35, when the path length of the mutated path is less than the path length of the initial path, it is determined that the mutated path is superior to the initial path; or, when the water flow transmission time of the mutated path is less than the water flow transmission time of the initial path, it is determined that the mutated path is superior to the initial path. It can be understood that the purpose of path optimization is mainly to reduce pipeline materials and speed up the transportation of water supply. If the optimized path (mutated path) is closer to the target point and can more effectively avoid obstacles compared with the initial path, then the layout of the water supply network can save more pipeline materials and transport water more efficiently. In this case, the optimized path can replace the initial path, that is, to determine whether the mutated path is superior to the initial path, it needs to be determined according to the specific layout requirements of the water supply network, and no specific limitation is made here.
[0084] The following uses a specific embodiment to illustrate the adaptive mutation ant colony algorithm provided in this embodiment:
[0085] Suppose a qualified path searched last time is path=(1,3,11,6,20,10), and the path length is length(path)=6. Then the length of its mutated path is defined as: L = round(length(path) / 3), that is, the length of the mutated path is an integer close to one-third of the total length, so L(path)=2, that is, the length of the mutated path is equal to 2. Suppose the number of iterations of the adaptive mutation ant colony algorithm is a constant M. Then each time, two mutation points R1 and R2 are randomly generated according to L(path), such that R2 = R1 + L. Then, the path between the mutation points R1 and R2 is searched again to obtain the mutated path. Compare the mutated path with the initial path. If the mutated path is superior to the initial path, the initial path is updated and replaced with the mutated path; otherwise, the initial path before mutation is still used, and the next iteration is performed until M iterations are completed.
[0086] Preferably, in step S34, when searching for the path between the two mutation points according to the first path planning algorithm, before selecting the next node through the first path planning algorithm, update the pheromone of the current node according to the following formula:
[0087]
[0088]
[0089] where, is the pheromone concentration of the new path (i, j) at time t + 1, is the pheromone concentration of the original path (i, j), Δτ i,j is the amount of pheromone of the unit length trajectory left by the individuals in the population on the path (i, j), ω' is a preset parameter, 0 < ω' < 1, L best is the current best laying length, Path best is the best path, and Q is a fixed constant.
[0090] Specifically, during the laying process of the water supply pipeline, the population is all the construction units that have optimized the pipeline, the pheromone is the information such as the engineering drawings during the construction process, and the pheromone concentration is the proportion of the reusable information to the original information. It can be understood that with the evolution of the surrounding environment, the effective utilization rate of the information will gradually decrease.
[0091] Exemplarily, taking the traditional ant colony algorithm as an example, the basic process of the traditional ant colony algorithm is as follows:
[0092] 1. Initialize the ant colony, determine the number of individuals in the colony, and the distribution of pheromone.
[0093] 2. Randomly obtain the direction of movement to the next node by the heuristic function, and the heuristic function is defined as follows:
[0094]
[0095]
[0096] where, η i,j is the heuristic information of the path (i, j), d i,j is the Euclidean distance from node i to node j, allow k is the set of nodes that the current ant can choose, x i is the abscissa of node i, y i is the ordinate of node i, x j is the abscissa of node j, y j is the ordinate of node j.
[0097] 3. After all the individuals in the population have completed one iteration, the pheromone on each path is updated according to the following formula:
[0098]
[0099] Among them, is the pheromone concentration of the new path (i, j), is the pheromone concentration of the original path (i, j), ρ is the evaporation coefficient of the pheromone, m is the number of individuals in the population, is the amount of pheromone per unit length left by the k-th individual in the population on the path (i, j), The calculation formula is as follows:
[0100]
[0101] Among them, Q is a constant of the amount of pheromone left by the individuals in the population, L k is the path length traveled by the k-th individual in the population in this iteration;
[0102] Assume that the current location of the k-th individual in the population is i, then its next node j is selected by the pseudo-random strategy, and the formula is as follows:
[0103]
[0104]
[0105] Among them, τ i,j is the pheromone intensity of the path (i, j), τ i,u is the pheromone intensity of the path (i, u), η i,j is the heuristic information of the path (i, j), η i,u is the heuristic information of the path (i, u), α is the weight of the pheromone intensity, is the importance factor of the heuristic function, q is a random number in the interval (0, 1), q0 is the transition probability threshold, is the probability that node j is selected, u is any node among the optional nodes; it can be understood that if the random number generated by the system is less than or equal to the transition probability threshold, the node with the largest product of the pheromone concentration and the heuristic information among the optional nodes is selected as the next node, otherwise it is selected by the probability for selection.
[0106] It should be noted that the heuristic function of the traditional ant colony algorithm only considers the distance between the current grid and the optional nodes, resulting in poor global search ability of the algorithm. To improve the global search ability of the algorithm, the distance between the optional nodes and the end point (target influence factor) is introduced into the heuristic function, so that the heuristic function takes into account both local search and global search. At the same time, the surrounding obstacle information of the current node (obstacle influence factor) is added to the heuristic function, so that the heuristic function changes with the different node environments.
[0107] Furthermore, the heuristic function of the second path planning algorithm is specifically as follows:
[0108]
[0109]
[0110] where η i,j is the heuristic information of path (i, j), d i,G is the target influence factor, d i,G is used to represent the distance from node i to the end point G, ∑ obs∈P d i,obs is the obstacle influence factor, ∑ obs∈P d i,obs is used to represent the sum of the distances of all obstacles within the obstacle influence range P to node i, k1 is the weight of the target influence factor, k2 is the weight of the obstacle influence factor, allow k is the set of nodes that the current ant can choose, N x is the total number of rows of the grid map, N y is the total number of columns of the grid map.
[0111] It can be understood that the target influence factor is the distance from the current node to the target point, which determines the direction of pipeline laying globally, such as from the water source to the water plant, and from the water plant to the water use area; the obstacle influence factor represents the sum of the distances from the obstacles to the current node within the obstacle influence range, which determines the direction of pipeline laying locally, such as a certain area during the process from the water source to the water plant. These two factors represent global search and local search respectively. Among them, in the early stage of pipeline laying, the target influence factor is larger and its weight coefficient should be relatively smaller to balance the global search and local search capabilities; in the later stage of pipeline laying, the target influence factor is smaller and its weight coefficient should be relatively larger to balance the global search and local search capabilities.
[0112] It should be noted that during the transmission of pipeline water, due to reasons such as relatively many water diversion points in the water use area and relatively complex terrain in some areas, the pressure of the pipeline water will change accordingly. In order to ensure that the water flow velocity remains stable in the next water use area, velocity sensors are installed at the nodes of the water use area and complex terrain to form a velocity monitoring system to monitor the water flow velocity, and then the initially optimized water supply path is evaluated through a preset water supply evaluation function. Among them, the evaluation criterion of the preset water supply evaluation function is: the selection of the path for the next node can help avoid obstacles as much as possible during the pipeline laying process, prevent restricting the water flow velocity, and continue to move towards the destination.
[0113] In a specific embodiment, the preset water supply evaluation function G(v, ω) is specifically:
[0114]
[0115] wherein, v is the linear velocity of water flow transmission, ω is the angular velocity of water flow transmission, angle(v, ω) is the direction angle evaluation function, angle(v, ω) is used to represent the deviation of the direction angle between two turning points, vel(v, ω) is the velocity magnitude evaluation function, ξ is the weighting coefficient of the direction angle evaluation function, is the weighting coefficient of the velocity magnitude evaluation function, and σ is the smoothing coefficient.
[0116] It should be noted that the values of ξ and depend on the deviation of the starting point angle and the length of the straight-line distance of the starting point. Normally, the values of both are 1. However, if the deviation angle is large, ξ can be appropriately taken as small. If the straight-line distance is short, then can be appropriately taken as a larger value.
[0117] It can be understood that since the transmission speed of pipeline water cannot decay too fast during the transmission process, the turning angle of the turning node cannot be too large either.
[0118] Furthermore, the direction angle evaluation function angle(v, ω) is specifically:
[0119]
[0120] The velocity magnitude evaluation function vel(v, ω) is specifically:
[0121]
[0122] [[ID=3,6]]wherein, v is the linear velocity of water flow transmission, ω is the angular velocity of water flow transmission, V i+1 is the propagation velocity when the water flow reaches the (i + 1)-th turning point, and V i is the propagation velocity of the i-th turning point.
[0123] It should be noted that in step S14, the first threshold can be set according to the actual water supply situation of the water supply pipeline. The turning points with a score greater than the first threshold should be able to meet the normal water supply demand.
[0124] See Figure 4 , which is the structural block diagram of a device for planning the layout path of a water supply network provided by an embodiment of the present invention.
[0125] The device for planning the layout path of a water supply network provided by an embodiment of the present invention includes:
[0126] A rasterization module 21, configured to rasterize the layout area of the water supply network to obtain a raster map of the layout area;
[0127] An initial path planning module 22, configured to perform path planning based on the number of obstacles around the optional nodes in the raster map to obtain an initial water supply path;
[0128] A primary path optimization module 23, configured to optimize the initial water supply path based on a first path planning algorithm to obtain a primary optimized water supply path; wherein, the first path planning algorithm is an adaptive mutation ant colony algorithm;
[0129] A secondary path optimization module 24, configured to evaluate the turning points of the primary optimized water supply path according to a preset water supply evaluation function. When the evaluation score of any one of the turning points is less than or equal to the first threshold, the first path planning algorithm and the second path planning algorithm are used to re-search the path between the previous turning point and the next turning point of this turning point until the evaluation scores of all the turning points are greater than the first threshold, so as to obtain the final layout path of the water supply network; wherein, the second path planning algorithm is obtained by improving the heuristic function of the ant colony algorithm by introducing an obstacle influence factor and a target influence factor.
[0130] As an improvement of the above solution, the initial path planning module 22 is specifically configured to:
[0131] Determine the starting point and the ending point of the water supply network in the raster map;
[0132] Starting from the starting point, sequentially determine whether the number of obstacles around the current node is greater than a second threshold. If so, use the second path planning algorithm to select the next node; if not, select the next node according to the following formula to obtain the initial water supply path from the starting point to the ending point:
[0133]
[0134] where j is the current node, j' is the next node, N xis the total number of rows of the grid map, and amount is the number of selectable nodes among the 8 nodes adjacent to the current node.
[0135] As one of the optional embodiments, the initial path optimization module 23 is specifically configured to perform the following steps:
[0136] Step S31: Calculate the path length of the initial water supply path;
[0137] Step S32: Determine the mutation path length according to the path length of the initial water supply path;
[0138] Step S33: Randomly select two nodes from the initial water supply path as mutation points according to the mutation path length;
[0139] Step S34: Search for the path between the two mutation points according to the first path planning algorithm to obtain a mutation path;
[0140] Step S35: Compare the initial path of the two mutation points in the initial water supply path with the mutation path. When the mutation path is better than the initial path, update the initial path with the mutation path;
[0141] Iteratively execute steps S31 to S35 for M times, and use the initial path obtained by the last iterative update as the initially optimized water supply path; where M is a positive integer.
[0142] Preferably, in the initial path optimization module 23, the determining the mutation path length according to the path length of the initial water supply path is specifically:
[0143] Round up the 1 / n path length of the initial water supply path to obtain the mutation path length; where n is a positive integer.
[0144] Further, in the initial path optimization module 23, the searching for the path between the two mutation points according to the first path planning algorithm to obtain a mutation path includes:
[0145] Take one of the mutation points as the source node and the other mutation point as the target node. Starting from the source node, sequentially select the next node according to the following formula until the mutation path from the source node to the target node is obtained:
[0146]
[0147] where s is the next node, (i, j) is the path from node i to node j, and τ i,j (t) is the pheromone intensity on the path (i, j) at time t, and v i,j(t) is the water flow transmission speed of path (i,j), delay i,j (t) is the water flow transmission time of path (i,j), (i,u) is the path from node i to node u, τ i,u (t) is the pheromone intensity on path (i,u) at time t, v i,u (t) is the water flow transmission speed of path (i,u), delay i,u (t) is the water flow transmission time of path (i,u), α is the weight of pheromone intensity, β is the weight of water flow transmission speed, γ is the weight of water flow transmission time delay, NodeSum(1,μ) is the number of times passing through node μ, allow k is the set of nodes that the current ant can choose, rand is a preset parameter.
[0148] Preferably, the heuristic function of the second path planning algorithm is specifically:
[0149]
[0150]
[0151] Among them, η i,j is the heuristic information of path (i,j), d i,G is the target influence factor, d i,G is used to represent the distance from node i to the end point G, ∑ obs∈P d i,obs is the obstacle influence factor, ∑ obs∈P d i,obs is used to represent the sum of the distances of all obstacles to node i within the obstacle influence range P, k1 is the weight of the target influence factor, k2 is the weight of the obstacle influence factor, allow k is the set of nodes that the current ant can choose, N x is the total number of rows of the grid map, N y is the total number of columns of the grid map.
[0152] Specifically, the preset water supply evaluation function G(v,ω) is specifically:
[0153]
[0154] Among them, v is the linear velocity of water flow transmission, ω is the angular velocity of water flow transmission, angle(v,ω) is the direction angle evaluation function, angle(v,ω) is used to represent the deviation of the direction angle between two turning points, vel(v,ω) is the speed magnitude evaluation function, ξ is the weighting coefficient of the direction angle evaluation function, is the weighting coefficient of the speed magnitude evaluation function, σ is the smoothing coefficient.
[0155] It should be noted that the relevant specific descriptions and beneficial effects of the embodiments of the device for planning the layout path of the water supply network in this embodiment can refer to the relevant specific descriptions and beneficial effects of the embodiments of the method for planning the layout path of the water supply network described above, and will not be elaborated here.
[0156] Refer to Figure 5 , which is a structural block diagram of a terminal device provided by an embodiment of the present invention.
[0157] A terminal device provided by an embodiment of the present invention includes a processor 10, a memory 20, and a computer program stored in the memory 20 and configured to be executed by the processor 10. When the processor 10 executes the computer program, it implements the method for planning the layout path of the water supply network as described in any of the above embodiments.
[0158] When the processor 10 executes the computer program, it implements the steps in the embodiments of the above method for planning the layout path of the water supply network, such as Figure 1 all the steps of the method for planning the layout path of the water supply network shown. Alternatively, when the processor 10 executes the computer program, it implements the functions of each module / unit in the embodiments of the above device for planning the layout path of the water supply network, such as Figure 4 the functions of each module of the device for planning the layout path of the water supply network shown.
[0159] Exemplarily, the computer program can be divided into one or more modules. The one or more modules are stored in the memory 20 and executed by the processor 10 to complete the present invention. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the terminal device.
[0160] The terminal device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor 10 and a memory 20. Those skilled in the art can understand that the schematic diagram is only an example of the terminal device, and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the terminal device may further include input / output devices, network access devices, a bus, etc.
[0161] The so-called processor 10 may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor 10 is the control center of the terminal device, connecting various parts of the entire terminal device through various interfaces and lines.
[0162] The memory 20 can be used to store the computer programs and / or modules. The processor 10 realizes various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory 20, and by calling the data stored in the memory 20. The memory 20 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system, application programs required for at least one function, etc.; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disks, memory, plug-in hard disks, Smart Media Cards (SMCs), Secure Digital (SD) cards, Flash Cards, at least one magnetic disk storage device, flash device, or other volatile solid-state storage devices.
[0163] Among them, if the modules / units integrated in the terminal device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above method embodiments of the present invention, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0164] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the attached drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that they have a communication connection, which can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0165] Another embodiment of the present invention provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program. Among them, when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the planning method for the water supply pipe network layout path described in any one of the above method embodiments.
[0166] In summary, a method, device, computer-readable storage medium, and terminal device for planning the layout path of a water supply network provided by an embodiment of the present invention, on the one hand, use the adaptive mutation ant colony algorithm to make the path search jump out of local optimization, reduce the possibility of the algorithm falling into local optimum, and improve the optimization ability and convergence speed of the algorithm; on the other hand, use a preset water supply evaluation function to evaluate the turning points of the constructed water supply path, reduce the blindness of path search, can reasonably consider the terrain of the pipeline construction area, and adjust the water supply path based on the ant colony algorithm and the adaptive mutation ant colony algorithm obtained by improving the heuristic function based on the target influence factor and the obstacle influence factor, so as to enhance the global search ability of path planning and improve the rationality of the layout path of the water supply network.
[0167] The above is the preferred embodiment of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.
Claims
1. A planning method for the layout path of a water supply pipe network, characterized in that Including: Rasterize the layout area of the water supply network to obtain a raster map of the layout area; Based on the number of obstacles around the optional nodes in the raster map, perform path planning to obtain an initial water supply path; Based on the first path planning algorithm, optimize the initial water supply path to obtain a preliminarily optimized water supply path; wherein, the first path planning algorithm is an adaptive mutation ant colony algorithm; including: Step S31: Calculate the path length of the initial water supply path; Step S32: Determine the mutation path length according to the path length of the initial water supply path; Step S33: Randomly select two nodes from the initial water supply path as mutation points according to the mutation path length; Step S34: Search for the path between the two mutation points according to the first path planning algorithm to obtain a mutation path; Step S35: Compare the initial path of the two mutation points in the initial water supply path with the mutation path. When the mutation path is better than the initial path, update the initial path with the mutation path; Iteratively execute steps S31 to S35 for M times, and use the initial path obtained by the last iterative update as the preliminarily optimized water supply path; where M is a positive integer; The searching for the path between the two mutation points according to the first path planning algorithm to obtain a mutation path includes: Take one of the mutation points as the source node and the other mutation point as the target node. Starting from the source node, sequentially select the next node according to the following formula until the mutation path from the source node to the target node is obtained: ; Among them, is the next node, is the node to the node path, is the pheromone intensity on the time path above, is the path the water flow transmission speed, is the path the water flow transmission time, is the node to the node path, is the pheromone intensity on the time path above, is the path the water flow transmission speed, is the path the water flow transmission time, is the weight of the pheromone intensity, is the weight of the water flow transmission speed, is the weight of the water flow transmission time delay, is the number of times passing through the node above, is the set of nodes that the current ant can choose, is a preset parameter; Evaluate the turning points of the preliminarily optimized water supply path according to a preset water supply evaluation function. When the evaluation score of any one of the turning points is less than or equal to the first threshold, re-search the path between the previous turning point and the next turning point of this turning point using the first path planning algorithm and the second path planning algorithm until the evaluation scores of all the turning points are greater than the first threshold to obtain the final layout path of the water supply network; wherein, the second path planning algorithm is obtained by improving the heuristic function of the ant colony algorithm by introducing an obstacle influence factor and a target influence factor; The heuristic function of the second path planning algorithm is specifically: ; ; Among them, is the heuristic information of the path , is the target influence factor used to represent the distance from node to the end point . is the obstacle influence factor used to represent the sum of the distances of all obstacles within the obstacle influence range to node . is the weight of the target influence factor is the weight of the obstacle influence factor is the set of nodes that the current ant can choose is the total number of rows of the grid map is the total number of columns of the grid map.
2. The planning method for the layout path of a water supply pipe network according to claim 1, characterized in that, The performing path planning based on the number of obstacles around the optional nodes in the raster map to obtain an initial water supply path includes: Determine the starting point and the ending point of the water supply network in the raster map; Starting from the starting point, sequentially determine whether the number of obstacles around the current node is greater than the second threshold. If so, select the next node using the second path planning algorithm; if not, select the next node according to the following formula to obtain the initial water supply path from the starting point to the ending point: ; Among them, is the current node, is the next node, is the total number of rows of the grid map, is the number of selectable nodes among the 8 nodes adjacent to the current node.
3. The planning method for the layout path of the water supply pipe network according to claim 1, characterized in that The specifically determining the mutation path length according to the path length of the initial water supply path is: Round the path length of the initial water supply path to obtain a mutated path length; where n is a positive integer.
4. The planning method for the layout path of a water supply pipe network according to claim 1, wherein The preset water supply evaluation function , specifically: ; Among them, is the linear velocity of water flow transmission, is the angular velocity of water flow transmission, is the direction angle evaluation function, which is used to represent the deviation of the direction angle between two turning points, is the velocity magnitude evaluation function, is the weighting coefficient of the direction angle evaluation function, is the weighting coefficient of the velocity magnitude evaluation function, is the smoothing coefficient.
5. A planning device for the layout path of a water supply network, which applies the planning method for the layout path of the water supply network described in claim 1, is characterized in that, Including: A rasterization module, configured to rasterize the layout area of the water supply network to obtain a raster map of the layout area; An initial path planning module, configured to perform path planning based on the number of obstacles around the optional nodes in the grid map to obtain an initial water supply path; A primary path optimization module, configured to optimize the initial water supply path based on a first path planning algorithm to obtain a primarily optimized water supply path; wherein, the first path planning algorithm is an adaptive mutation ant colony algorithm; A secondary path optimization module, configured to evaluate the turning points of the primarily optimized water supply path according to a preset water supply evaluation function. When the evaluation score of any one of the turning points is less than or equal to a first threshold, the first path planning algorithm and a second path planning algorithm are used to re-search the path between the previous turning point and the next turning point of this turning point until the evaluation scores of all the turning points are greater than the first threshold, to obtain a final water supply network layout path; wherein, the second path planning algorithm is obtained by improving the heuristic function of the ant colony algorithm by introducing an obstacle influence factor and a target influence factor.
6. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the method for planning the water supply network layout path as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the method for planning the water supply network layout path as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Mobile robot intelligent path planning method
CN112631294A