Building ducting multipoint routing method and related apparatus

By combining the grid method with improved K-means and A* algorithms, intelligent layout of building pipelines at multiple points was achieved, solving the problems of construction collisions and low design efficiency, and improving construction efficiency and space utilization.

CN115758647BActive Publication Date: 2026-05-29SHENZHEN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN UNIV
Filing Date
2022-12-05
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The layout problems between multiple points in building pipeline design lead to frequent construction collisions, low design efficiency, serious material waste, and existing algorithms are difficult to adapt to the complexity of the building environment and the needs of large-area layout.

Method used

A grid method is used for 3D modeling, combined with an improved K-means algorithm to divide multiple source points, and an improved A* algorithm is used for path finding to optimize pipeline paths. By taking into account obstacles and height constraints, intelligent arrangement of multiple points is achieved.

Benefits of technology

It improves the efficiency of pipe layout, reduces the workload of designers, detects collision problems in advance, saves time, and improves the utilization rate of building space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115758647B_ABST
    Figure CN115758647B_ABST
Patent Text Reader

Abstract

The application provides a building pipeline multi-point path searching method and related equipment, and the method comprises the following steps: three-dimensional modeling of a plurality of source points, a terminal point and a building environment of a pipeline is respectively performed by using a grid method; the plurality of source points of the pipeline are divided by using an improved K-means algorithm according to the layout distribution of obstacles; the divided plurality of source points are searched by using an improved A* algorithm and converged to the terminal point of the pipeline. The application has the beneficial effect that the building scene can be effectively divided, and then the automatic arrangement of the pipeline between the plurality of points is completed, and the pipeline arrangement efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of building pipeline routing technology, and in particular to a multi-point routing method and related equipment for building pipelines. Background Technology

[0002] Currently, building piping design primarily relies on designers using CAD and other software for design and modification. Different types of pipes are designed by different personnel, and construction workers then construct according to the drawings. However, during construction, collisions often occur in the pipe layouts designed by different personnel, requiring design modifications, which wastes time and affects the construction schedule. On the other hand, designers often design the positions of tees and crosses based on experience, but manual operation is not only inefficient and slow but also has a low success rate, making it difficult to achieve a good pipe layout. This leads to increased material waste and reduced utilization of building space.

[0003] With technological advancements, increasingly sophisticated 3D design software can mitigate the problem of inaccurate pipeline positioning during construction, leading to greater emphasis on pipeline layout in theoretical research. However, most studies on pipeline layout problems focus on those with a single starting point and ending point, achieving some success, such as widely used graph search algorithms, genetic algorithms, and ant colony algorithms. These algorithms effectively address basic pathfinding problems in terms of speed and path shortest distance, demonstrating significant application value in solving problems involving multiple points.

[0004] Existing research on intelligent layout of pipelines at multiple points is more focused on fields such as ships, aerospace engines, and integrated electronic products. While pipeline layout in buildings is related to pipeline layout technology in other fields, the constraints and environmental models for automatic pipeline layout in other fields are different due to the different environments, large building areas, and complex conditions within the building space. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a method and related equipment for multi-point path finding of building pipelines.

[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a multi-point path finding method for building pipelines, comprising the following steps.

[0007] S10. Use the grid method to perform three-dimensional modeling of the pipeline's multiple source points, endpoints, and the built environment;

[0008] S20. Based on the layout and distribution of obstacles, the multi-source points of the pipeline are divided using an improved K-means algorithm;

[0009] S30. The divided multi-source points are used to find paths through the improved A* algorithm and merge to the end point of the pipeline.

[0010] Furthermore, step S10 specifically includes,

[0011] S11. Based on the pipe diameter and the minimum space between pipes, the pipe layout space is converted into a grid space, and each grid cell in the grid space is represented by a corresponding three-dimensional coordinate.

[0012] S12. Divide the built environment into two categories: impassable obstacles and passable obstacles;

[0013] S13. The specific location information of the obstacle is described by using the coordinates formed by the vertices and heights of the obstacle in the building.

[0014] Furthermore, in step S11, the formula for calculating the size of the grid space is: ;

[0015] in, B The size of the grid cell. D The outer diameter of the pipe. d This represents the minimum distance from the pipe to the obstacle.

[0016] Furthermore, step S20 specifically includes,

[0017] S21. Initialization n Pipeline source point P ={ P 1 , P 2 , ..., P n , n ≥1}, number of cluster centers k , k ≥1, set the cost to disallow wall penetration. s ;

[0018] S22, Randomly generated k The initial cluster centers C ={ C 1 , C 2 ,..., C k},make i =0;

[0019] S23. Calculate the distance cost set from each source point to each cluster center point. D ={ D 1 , D2 ,..., D n},in, D n ={ D n1 , D n2 ,..., D nk} is the first n The distance cost from each source point to each cluster center point D n1 It is the first n Source point P n To the first cluster center C 1 Distance cost;

[0020] S24, Distance Cost D n The minimum value in D nmin It means that if D nmin ≥ s ,Right now P n and C k If pathfinding fails, proceed to step S25; otherwise, proceed to step S26.

[0021] S25, will D nmin Store in an empty array F In the middle, if i ≤ k Let the cluster center point C i = P n , i = i +1, then proceed to step S23; otherwise, let k = k +1, C i = P n , i = i +1, then proceed to step S23;

[0022] S26. Recalculate the cluster centers based on the source points assigned to the clusters. C and each source point P Reassigned to the nearest cluster center C;

[0023] S27. If the cluster classification changes, proceed to step S23; otherwise, output the center point. C Center point C Corresponding clusters and k value.

[0024] Furthermore, step S30 specifically includes,

[0025] S31. Select the heuristic function for the A* algorithm's evaluation function to ensure the search path follows a direction consistent with the pipeline design; the calculation formula for the evaluation function f(n) of each node is as follows:

[0026]

[0027] in, f(n) It is a node n The overall priority is determined by selecting the node with the highest overall priority when choosing the next node to be traversed. g(n) It is a node n The cost of being far from the starting point; h(n) It is a node n The estimated cost to reach the destination, i.e., the heuristic function of the A* algorithm;

[0028] In steps S32 and S31 g(n) The calculation formula is:

[0029]

[0030] in, , These are the current cost and the execution cost, respectively. The current cost includes the path cost from the current node to the starting point, and the execution cost includes the path cost from the current node to the ending point. Each time a new node is explored during the search, the execution cost of the action from the current node to the next node needs to be added to the current cost.

[0031] Based on the fundamental rule of laying pipes close to the top during pipe layout, that is, pipes are preferentially laid above the z-axis, the height cost is added when calculating the next execution cost. The formula for calculating the height cost is:

[0032]

[0033] in, z It is the next node z Coordinates: Each time a new node is explored during the search, the height cost of the next node needs to be added to the execution cost.

[0034] S33. Using the improved A* algorithm, the pathfinding is spread from the starting point to the ending point set. When the pathfinding reaches a certain point in the ending point set, the starting point and ending point sets are changed, and finally multi-point pathfinding is achieved.

[0035] Furthermore, in step S31, based on the constraints of pipeline production and installation, the heuristic function uses Manhattan distance, which is defined as follows:

[0036]

[0037] in, (x n , y n , z n ) The coordinates of the current node. (x g , y g , z g ) The coordinates of the target node.

[0038] Furthermore, step S33 specifically includes,

[0039] S331, Give a starting point s A terminal set e Give an impassable obstacle a cost denoted as s 1. The cost of a passable obstacle is denoted as... s 2, and s 1≥ s 2;

[0040] S332, Create the nodes to be traversed. open_set Nodes that have already been visited close_set Priority sequence p And set the action set Action =[(0, 0, 1), (0, 0, -1), (0, 1, 0), (0, -1, 0), (1, 0, 0), (-1,0, 0)];

[0041] S333, Starting Point s Add to open_set In the middle, the priority of the starting point s is set to 0, that is, the highest priority;

[0042] S334, if the priority sequence p If not empty, then from open_set The node with the highest priority is selected as the current node. C Otherwise, return a pathfinding failure message and set the path cost to [value]. s 1;

[0043] S335, If node C At the end of the series e In the middle, then from the nodeC Start tracing the parent node step by step until the starting point. s Output the path and path cost;

[0044] S336, If node C Not at the End e In the middle, the nodes C from open_set Delete and add close_set middle;

[0045] S337, According to the action set Action traverse nodes C The six adjacent nodes in the orthogonal directions;

[0046] S338, if neighboring nodes m exist close_set If it is in the middle, then skip it; if the node m Not here open_set In the middle, then set nodes m The parent node is C ,Will( f(n) , n Add to priority sequence p Then the nodes m Join open_set In the middle, update the current node C Return to step S334.

[0047] The present invention also provides a multi-point path finding device for building pipelines, comprising,

[0048] The 3D modeling module is used to perform 3D modeling of the pipeline's multiple sources, endpoints, and the surrounding environment using a grid method.

[0049] The pipeline segmentation module is used to segment the multi-source points of pipelines using an improved K-means algorithm based on the layout and distribution of obstacles.

[0050] The multi-point pathfinding module is used to find paths from the divided multiple source points using an improved A* algorithm, and then merge them to the end point of the pipeline.

[0051] The present invention also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the multi-point path finding method for building pipelines as described above.

[0052] The present invention also provides a storage medium storing a computer program, which, when executed by a processor, can implement the multi-point path finding method for building pipelines as described above.

[0053] The beneficial effects of this invention are as follows: By combining the A* algorithm and the K-means clustering algorithm, and improving upon traditional algorithms according to actual needs, it can effectively divide the building scene, thereby completing the automatic layout of pipes between multiple points and improving pipe laying efficiency; the clustering algorithm can automatically divide the three-dimensional environment according to set parameters, which can narrow the path finding range and speed up the path finding search. It realizes intelligent layout of multiple pipes, eliminating the need for designers to manually determine the positions of tees, etc., thus reducing the workload of designers; intelligent pipe layout can detect collision problems between pipes in advance, thereby reducing rework, saving time, and improving the utilization rate of building space. Attached Figure Description

[0054] The specific structure of the present invention will now be described in detail with reference to the accompanying drawings.

[0055] Figure 1 This is a flowchart of a multi-point path finding method for building pipelines according to an embodiment of the present invention;

[0056] Figure 2 This is a block diagram of a multi-point path finding device for building pipelines according to an embodiment of the present invention;

[0057] Figure 3 This is a diffusion connection diagram of the start-to-end set in an embodiment of the present invention;

[0058] Figure 4 This is a diagram showing the endpoint transformation and connection in an embodiment of the present invention;

[0059] Figure 5 This is a diagram showing the endpoint transformation and connection in an embodiment of the present invention;

[0060] Figure 6 This is a diagram illustrating the effect of a single-point to multi-point connection according to an embodiment of the present invention.

[0061] Figure 7 This is a rendering of a multi-point connection model according to an embodiment of the present invention;

[0062] Figure 8 This is a Revit rendering of a multi-point connection according to an embodiment of the present invention;

[0063] Figure 9 This is a schematic block diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0065] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0066] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0067] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0068] like Figure 1 As shown, the first embodiment of the present invention is: a method for multi-point path finding of building pipelines, including the following steps:

[0069] S10. Use the grid method to perform three-dimensional modeling of the pipeline's multiple source points, endpoints, and the built environment;

[0070] S20. Based on the layout and distribution of obstacles, the multi-source points of the pipeline are divided using an improved K-means algorithm.

[0071] S30. The divided multi-source points are used to find paths through the improved A* algorithm and merge to the end point of the pipeline.

[0072] Specifically, step S10 includes:

[0073] S11. Based on the pipe diameter and the minimum space between pipes, the pipe layout space is converted into a grid space, and each grid cell in the grid space is represented by a corresponding three-dimensional coordinate.

[0074] In step S11, the formula for calculating the size of the grid space is: B = D + 2d;

[0075] Where B is the size of the grid cell, D is the outer diameter of the pipe, and d is the minimum distance from the pipe to the obstacle;

[0076] S12. Divide the built environment into two categories: impassable obstacles and passable obstacles;

[0077] During modeling, impassable obstacles and the map are built simultaneously. When the pipeline layout encounters an impassable obstacle, it can only choose to detour. If detour is not possible, a pathfinding failure cost is returned. s1. Passable obstacles have a cost per pass given at initialization. s 2. When the pipe encounters a passable obstacle, it determines whether it can pass through based on the set conditions;

[0078] S13. The specific location information of the obstacle is described by using the coordinates formed by the vertices and heights of the obstacle in the building.

[0079] For example, the coordinate set of a structural wall can be represented as: data =[ z , a x , a y , b x , b y , c x , c y , d x , d y , h ],in, z The coordinates of the bottom of the obstacle. h The height of the obstacle. a = ( a x , a y () represents the coordinates of a vertex of an obstacle. The pipe path can be represented using the coordinate set corresponding to each grid cell, such as: path = [( x 1 , y 1 , z 1 ), ( x 2 , y 2 , z 2 ),... , ( x n , y n , z n )];in, Ensure that the Manhattan distance between pipeline paths is 1.

[0080] Specifically, step S20 includes:

[0081] S21. Initialization n The source of the pipeline P ={P 1 , P 2 , ..., P n , n ≥1}, number of cluster centers k , k ≥1, set the cost to disallow wall penetration. s ;

[0082] S22, Randomly generated k The initial cluster centers C ={ C 1 , C 2 ,..., C k},make i =0;

[0083] S23. Calculate the distance cost set from each source point to each cluster center point. D ={ D 1 , D 2 ,..., D n},in, D n ={ D n1 , D n2 ,..., D nk} is the first n The distance cost from each source point to each cluster center point D n1 It is the first n Source point P n To the first cluster center C 1 Distance cost;

[0084] S24, Distance Cost D n The minimum value in D nmin It means that if D nmin ≥ s ,Right now P n and C k If pathfinding fails, proceed to step S25; otherwise, proceed to step S26.

[0085] S25, willD nmin Store in an empty array F In the middle, if i ≤ k Let the cluster center point C i = P n , i = i +1, then proceed to step S23; otherwise, let k = k +1, C i = P n , i = i +1, then proceed to step S23;

[0086] S26. Recalculate the cluster centers based on the source points assigned to the clusters. C and each source point P Reassigned to the nearest cluster center C;

[0087] S27. If the cluster classification changes, proceed to step S23; otherwise, output the center point. C Center point C Corresponding clusters and k value.

[0088] The traditional K-means algorithm determines the initial cluster centroids by randomly selecting them. k Using a single point as the initial cluster center, this method is sensitive to initial values. After direct clustering, subsequent algorithms will fail to find paths when encountering insurmountable obstacles, thus failing to achieve automatic pipeline layout. To address these issues, this invention proposes a method that can adaptively adjust the selection of initial center values, avoiding the inability to find paths after clustering. The elbow method is then used to determine the final number of center points, which reduces the possibility of the algorithm getting trapped in local optima to some extent.

[0089] Specifically, step S30 includes:

[0090] S31. Select the heuristic function for the A* algorithm's evaluation function to ensure the search path follows a direction consistent with the pipeline design; the calculation formula for the evaluation function f(n) of each node is as follows:

[0091]

[0092] in, f(n) It is a node n The overall priority is determined by selecting the node with the highest overall priority when choosing the next node to be traversed. g(n) It is a node n The cost of being far from the starting point; h(n) It is a node n The estimated cost to reach the destination, i.e., the heuristic function of the A* algorithm;

[0093] In steps S32 and S31 g(n) The calculation formula is:

[0094]

[0095] in, , These are the current cost and the execution cost, respectively. The current cost includes the path cost from the current node to the starting point, and the execution cost includes the path cost from the current node to the ending point. Each time a new node is explored during the search, the execution cost of the action from the current node to the next node needs to be added to the current cost.

[0096] Based on the fundamental rule of laying pipes close to the top during pipe layout, that is, pipes are preferentially laid above the z-axis, the height cost is added when calculating the next execution cost. The formula for calculating the height cost is:

[0097]

[0098] in, z It is the next node z Coordinates: Each time a new node is explored during the search, the height cost of the next node needs to be added to the execution cost.

[0099] S33. Using the improved A* algorithm, the pathfinding is spread from the starting point to the ending point set. When the pathfinding reaches a certain point in the ending point set, the starting point and ending point sets are changed, and finally multi-point pathfinding is achieved.

[0100] Furthermore, in step S31, based on the constraints of pipeline production and installation, the heuristic function uses Manhattan distance, which is defined as follows:

[0101]

[0102] in, (x n , y n , z n ) The coordinates of the current node. (x g , y g , z g ) The coordinates of the target node.

[0103] Furthermore, step S33 specifically includes,

[0104] S331, Give a starting point s A terminal set e Give an impassable obstacle a cost denoted as s 1. The cost of a passable obstacle is denoted as... s 2, and s 1≥ s 2;

[0105] S332, Create the nodes to be traversed. open_set Nodes that have already been visited close_set Priority sequence p And set the action set Action =[(0, 0, 1), (0, 0, -1), (0, 1, 0), (0, -1, 0), (1, 0, 0), (-1,0, 0)];

[0106] S333, Starting Point s Add to open_set In the middle, the priority of the starting point s is set to 0, that is, the highest priority;

[0107] S334, if the priority sequence p If not empty, then from open_set The node with the highest priority is selected as the current node. C Otherwise, return a pathfinding failure message and set the path cost to [value]. s 1;

[0108] S335, If node C At the end of the series e In the middle, then from the node C Start tracing the parent node step by step until the starting point. s Output the path and path cost;

[0109] S336, If node C Not at the End e In the middle, the nodes C from open_set Delete and add close_set middle;

[0110] S337, According to the action set Action traverse nodes C The six adjacent nodes in the orthogonal directions;

[0111] S338, if neighboring nodes m exist close_set If it is in the middle, then skip it; if the node m Not here open_setIn the middle, then set nodes m The parent node is C ,Will( f(n) , n Add to priority sequence p Then the nodes m Join open_set In the middle, update the current node C Return to step S334.

[0112] Store the endpoint in the endpoint set. Starting from the starting point, use the A* algorithm to propagate the path, selecting the node with the minimum cost to reach the endpoint set as the next node. Continue this process until the next node is in the endpoint set, at which point the pathfinding ends. Figure 3 As shown. Then store the connected paths in an array, converting other unconnected endpoints to starting points, and repeat the above steps until all are connected, as shown. Figures 4-6 As shown; after the connection is completed, the following is obtained: Figure 7 , Figure 8 The effect, among which, Figure 7 This is the effect after the program runs. Figure 8 This is the effect of importing into a real-world scene drawing.

[0113] This invention combines the A* algorithm and the K-means clustering algorithm, improving upon traditional algorithms to meet specific needs. This effectively divides building scenes, enabling automatic pipe layout across multiple points and improving pipe arrangement efficiency. The clustering algorithm automatically divides the 3D environment based on set parameters, narrowing the pathfinding range and accelerating the pathfinding search. It achieves intelligent layout of multiple pipes, eliminating the need for designers to manually determine the positions of tees and other components, thus reducing their workload. Intelligent pipe layout can also detect collisions between pipes in advance, reducing rework, saving time, and improving the utilization of building space.

[0114] like Figure 2 As shown, another embodiment of the present invention is: a multi-point path finding device for building pipelines, comprising,

[0115] 3D modeling module 10 is used to perform 3D modeling of the pipeline's multiple source points, endpoints, and the built environment using a grid method;

[0116] The pipeline segmentation module 20 is used to segment the multi-source points of the pipeline using an improved K-means algorithm based on the layout and distribution of obstacles.

[0117] The multi-point pathfinding module 30 is used to find paths from the divided multi-source points using an improved A* algorithm and merge them to the end point of the pipeline.

[0118] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned multi-point path finding device for building pipelines can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.

[0119] The aforementioned multi-point path finding device for building pipelines can be implemented as a computer program, which can, for example... Figure 9 It runs on the computer device shown.

[0120] Please see Figure 9 , Figure 9 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a terminal or a server. The terminal can be an electronic device with communication functions, such as a smartphone, tablet, laptop, desktop computer, personal digital assistant, or wearable device. The server can be a standalone server or a server cluster composed of multiple servers.

[0121] See Figure 9 The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0122] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a multi-point routing method for building pipelines.

[0123] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0124] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a multi-point routing method for building pipelines.

[0125] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0126] The processor 502 is used to run a computer program 5032 stored in a memory to implement the multi-point path finding method for building pipelines as described above.

[0127] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may 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 any conventional processor.

[0128] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0129] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the multi-point routing method for building pipes as described above.

[0130] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0131] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0132] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0133] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0134] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0135] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for multi-point path finding in building pipelines, characterized in that: Including steps, S10. Use the grid method to perform three-dimensional modeling of the pipeline's multiple source points, endpoints, and the built environment; Step S10 specifically includes, S11. Based on the pipe diameter and the minimum space between pipes, the pipe layout space is converted into a grid space, and each grid cell in the grid space is represented by a corresponding three-dimensional coordinate. S12. Divide the built environment into two categories: impassable obstacles and passable obstacles; S13. The specific location information of the obstacle is described by using the coordinates formed by the vertices and height of the obstacle in the building; S20. Based on the layout and distribution of obstacles, the multi-source points of the pipeline are divided using an improved K-means algorithm; Step S20 specifically includes, S21. Initialization n The source of the pipeline P ={ P 1 , P 2 , ..., P n , n ≥1}, number of cluster centers k , k ≥1, set the cost to disallow wall penetration. s ; S22, Randomly generated k The initial cluster centers C ={ C 1 , C 2 ,..., C k },make i =0; S23. Calculate the distance cost set from each source point to each cluster center point. D ={ D 1 , D 2 ,..., D n }, in, D n ={ D n1 , D n2 ,..., D nk } is the first n The distance cost from each source point to each cluster center point D n1 It is the first n Source point P n To the first cluster center C 1 Distance cost; S24, Distance Cost D n The minimum value in D nmin It means that if D nmin ≥ s ,Right now P n and C k If pathfinding fails, proceed to step S25; otherwise, proceed to step S26. S25, will D nmin Store in an empty array F In the middle, if i ≤ k Let the cluster center point C i = P n , i = i +1, then proceed to step S23; otherwise, let k = k +1, C i = P n , i = i +1, then proceed to step S23; S26. Recalculate the cluster centers based on the source points assigned to the clusters. C and each source point P Reassigned to the nearest cluster center C; S27. If the cluster classification changes, proceed to step S23; otherwise, output the cluster centers. C Cluster center C Corresponding clusters and k value; S30. The divided multi-source points are used to find paths through the improved A* algorithm and merge to the end point of the pipeline.

2. The multi-point routing method for building pipelines as described in claim 1, characterized in that: In step S11, the formula for calculating the size of the grid space is: ; in, B The size of the grid cell. D The outer diameter of the pipe. d This represents the minimum distance from the pipe to the obstacle.

3. The multi-point routing method for building pipelines as described in claim 1, characterized in that: Step S30 specifically includes, S31. Select the heuristic function for the A* algorithm's evaluation function to ensure the search path follows a direction consistent with the pipeline design; the calculation formula for the evaluation function f(n) of each node is as follows: in, f(n) It is a node n The overall priority is determined by selecting the node with the highest overall priority when choosing the next node to be traversed. g(n) It is a node n The cost of moving away from the starting point; h(n) It is a node n The estimated cost to reach the destination, i.e., the heuristic function of the A* algorithm; In steps S32 and S31, g(n) The calculation formula is: in, , These are the current cost and the execution cost, respectively. The current cost includes the path cost from the current node to the starting point, and the execution cost includes the path cost from the current node to the ending point. Each time a new node is explored during the search, the execution cost of the action from the current node to the next node needs to be added to the current cost. Based on the fundamental rule of laying pipes close to the top during pipe layout, that is, pipes are preferentially laid above the z-axis, the height cost is added when calculating the next execution cost. The formula for calculating the height cost is: in, z It is the next node z Coordinates: Each time a new node is explored during the search, the height cost of the next node needs to be added to the execution cost. S33. Using the improved A* algorithm, the pathfinding is spread from the starting point to the ending point set. When the pathfinding reaches a certain point in the ending point set, the starting point and ending point sets are changed, and finally multi-point pathfinding is achieved.

4. The multi-point routing method for building pipelines as described in claim 3, characterized in that: In step S31, based on the constraints of pipeline production and installation, the heuristic function uses Manhattan distance, which is defined as follows: in, (x n , y n , z n ) The coordinates of the current node. (x g , y g , z g ) The coordinates of the target node.

5. The multi-point routing method for building pipelines as described in claim 3, characterized in that: Step S33 specifically includes, S331, Give a starting point s A terminal set e Give an impassable obstacle a cost denoted as s 1. The cost of a passable obstacle is denoted as... s 2, and s 1≥ s 2; S332, Create the nodes to be traversed. open_set Nodes that have already been visited close_set Priority sequence p And set the action set Action =[(0, 0, 1), (0, 0, -1), (0, 1, 0), (0, -1, 0), (1, 0, 0), (-1, 0,0)]; S333, Starting Point s Add to open_set In the middle, the priority of the starting point s is set to 0, that is, the highest priority; S334, if the priority sequence p If not empty, then from open_set The node with the highest priority is selected as the current node. C Otherwise, return a pathfinding failure message and set the path cost to [value]. s 1; S335, if node C At the end set e In the middle, then from the node C Start tracing the parent node step by step until the starting point. s Output the path and path cost; S336, If node C Not at the End e In the middle, the nodes C from open_set Delete and add close_set middle; S337, According to the action set Action traverse nodes C The six adjacent nodes in the orthogonal directions; S338, if neighboring nodes m exist close_set If it is in the middle, then skip it; if the node m Not here open_set In the middle, then set nodes m The parent node is C ,Will( f(n) , n Add to priority sequence p Then the nodes m Join open_set In the middle, update the current node C Return to step S334.

6. A multi-point path finding device for building pipelines based on the multi-point path finding method for building pipelines according to any one of claims 1-5, characterized in that: include, The 3D modeling module is used to perform 3D modeling of multiple sources, endpoints, and built environments of pipelines using a grid method. Obstacles in the built environment are divided into two types: impassable obstacles and passable obstacles. The pipeline segmentation module is used to segment the pipelines to be laid out based on the layout distribution of different types of obstacles using an improved K-means algorithm. The multi-point pathfinding module is used to find the path of the pipeline from the multiple source points after division using the improved A* algorithm, obtain the pipeline layout path in the divided area, and then call the improved A* algorithm to merge the pipeline paths in each divided area to the pipeline endpoint.

7. A computer device, characterized in that: The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the multi-point routing method for building pipelines as described in any one of claims 1 to 5.

8. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, can implement the multi-point routing method for building pipelines as described in any one of claims 1 to 5.