A pipe network segmentation method based on node splitting algorithm
By using the node explosion algorithm to segment the pipeline topology, the root node determination and depth traversal are omitted, achieving more efficient and accurate pipeline segmentation. This solves the problem of inconsistent segmentation results caused by different root node orders in the DFS depth traversal segmentation method, and improves the accuracy of simulation calculations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI THREE ZERO FOUR ZERO TECH CO LTD
- Filing Date
- 2022-02-09
- Publication Date
- 2026-05-05
AI Technical Summary
In existing pipeline topology segmentation methods, the DFS depth-first traversal segmentation technique requires specifying the root node, which leads to differences in the segmentation results depending on the order in which the root node is passed in, affecting the accuracy and efficiency of the calculation results.
The node explosion algorithm is adopted, which omits the root node determination and depth-first traversal steps. It constructs multiple subgraph topologies by breaking and deleting at specified split nodes, and inserts split nodes in each subgraph to correct the flow direction to ensure accuracy.
This improves the efficiency of topology segmentation and the accuracy of simulation calculations, and solves the problem of segmentation results differences caused by different root node orders in traditional methods.
Smart Images

Figure CN115564780B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pipeline topology segmentation technology, and in particular to a pipeline segmentation method based on a node explosion algorithm. Background Technology
[0002] Urban gas transmission and distribution systems are a crucial component of urban public infrastructure. Modern urban gas transmission and distribution systems are complex and vast networks. Reasonably dividing the massive pipeline topology and then simulating it allows for convenient and rapid management and computational simulation of this vast network. In urban gas pipeline networks, pressure regulating stations are a component for pressure regulation. Each pressure level is controlled by a pressure regulating station, and the pressure before and after regulation differs significantly, thus forming pressure levels. During simulation, excessively large differences between the inlet and outlet pressures of the pressure regulating station can lead to convergence of calculation results or even render the calculation impossible.
[0003] In existing pipeline topology segmentation methods, pressure regulating stations in the full topology are segmented using a depth-first search (DFS) approach. However, the DFS segmentation technique requires specifying a root node, which in pipeline topology can only be a gas source. Due to the different order in which gas sources are introduced, the number of subgraphs generated can vary, leading to discrepancies in the calculation results each time. Summary of the Invention
[0004] In view of this, this invention provides a network segmentation method based on a node explosion algorithm. Compared with the traditional DFS depth traversal method for segmentation, this invention eliminates the steps of determining the root node and performing depth traversal, fundamentally solving the technical problem that the traditional DFS traversal segmentation method results in different segmentation results due to the different order of the root node input, and improving the efficiency of topology segmentation and the accuracy of simulation calculation.
[0005] The embodiments of the present invention provide the following technical solutions:
[0006] A pipeline segmentation method based on a node explosion algorithm includes the following steps:
[0007] Step 101: Construct the original pipeline network topology;
[0008] Step 102, Node Destruction: The original pipeline topology is broken at the specified splitting node, and the specified splitting node is deleted to obtain multiple sub-graph topologies;
[0009] Step 103, Node interpolation: In each subgraph topology, construct edges between the specified splitting node and its neighboring nodes, and re-insert the specified splitting node into each subgraph topology;
[0010] Step 104: Correct the flow direction of all subgraph topologies after node interpolation is completed.
[0011] Furthermore, the construction of the original pipeline network topology in step 101 specifically includes: connecting the pipelines in the pipeline network according to the edge connection method in graph theory partitioning to generate the original pipeline network topology.
[0012] Furthermore, the designated segmentation node is the pressure regulating station node transmitted from the pipeline network.
[0013] Furthermore, the node explosion process in step 102 specifically includes: saving the list of all edges in the original pipeline topology, obtaining the neighbor nodes of the specified split node, disconnecting the original pipeline topology at the specified split node, and deleting the specified split node to obtain the multiple subgraph topologies.
[0014] Furthermore, after step 102, the method further includes updating the obtained multiple subgraph topologies before proceeding to step 103.
[0015] Furthermore, the node interpolation process in step 103 specifically includes: first, marking the neighboring nodes of the specified segmentation node according to the edge attributes; then, constructing an edge between the marked neighboring nodes and the specified segmentation node; and finally, inserting the constructed edge into the corresponding subgraph topology.
[0016] Furthermore, after step 103, the method further includes updating and saving the topology of all subgraphs after node interpolation is completed before proceeding to step 104.
[0017] Furthermore, step 104 specifically includes: modifying the edge directions in all subgraph topologies after node interpolation to be consistent with the edge directions in the original pipeline topology.
[0018] This invention provides a pipeline network segmentation method based on a node explosion algorithm. This method only requires the ID of the node to be segmented and all edges to perform segmentation. Compared to the traditional Depth-First Search (DFS) method, it eliminates the steps of determining the root node and performing depth-first search, fundamentally solving the technical problem of inconsistent segmentation results caused by different root node input orders in traditional DFS segmentation methods. This effectively improves the efficiency of topology segmentation. This invention can be applied to graph topologies involved in simulation calculations, such as gas pipeline network topologies and power grid topologies, especially those with nodes having multiple and significantly different values. It segments the topology into multiple smaller topologies and transforms multiple value assignments into single value assignments and boundary point assignments for calculation, improving the accuracy of simulation calculations. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of the pipeline segmentation method based on the node explosion algorithm in an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram of the original pipeline network topology constructed in an embodiment of the present invention;
[0022] Figure 3 This is a schematic diagram of the subgraph topology after node explosion in an embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram of the subgraph topology after node interpolation in an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram showing the flow direction correction of the subgraph topology in an embodiment of the present invention. Detailed Implementation
[0025] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0026] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0027] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this invention, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using other structures and / or functionalities besides one or more of the aspects set forth herein.
[0028] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. The drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0029] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.
[0030] like Figure 1 As shown, this embodiment of the invention provides a pipeline segmentation method based on a node explosion algorithm, comprising the following steps:
[0031] Step 101: Construct the original pipeline network topology;
[0032] The pipes in the pipeline network are connected according to the edge connection method in graph theory partitioning. Each edge contains a start node and an end node. The original pipeline network topology is constructed using the edges.
[0033] Step 102, Node Destruction: The original pipeline topology is broken at the specified splitting node, and the specified splitting node is deleted to obtain multiple sub-graph topologies;
[0034] The node explosion process specifically includes: saving the list of all edges in the original pipeline topology, obtaining the neighbor nodes of the specified split node, disconnecting the original pipeline topology at the specified split node, and deleting the specified split node to obtain the multiple subgraph topologies.
[0035] Preferably, the designated segmentation node is the pressure regulating station node transmitted from the pipeline network.
[0036] In the node decompression step of this embodiment, since the point to be decompressed in the pipeline topology is a pressure regulating station, the following explanation assumes that there is only one pressure regulating station in the pipeline topology. The pressure regulating station has two attributes in its monitoring data: inlet pressure and outlet pressure. These two values differ significantly, and during simulation calculations, only one value can be assigned to the pressure regulating station simultaneously. Therefore, the topology region is divided into two regions based on the pressure regulating station node. The first region is assigned the inlet pressure of the pressure regulating station, and the second region is assigned the outlet pressure. This node decompression method can accurately separate the topology, assigning the two values of the pressure regulating station to different regions for simulation calculations.
[0037] Therefore, this embodiment adopts the pipeline network technology of cutting the pressure regulating station, dividing the topology with the pressure regulating station as the node. During the calculation, the inlet pressure or flow rate of the pressure regulating station is assigned to the previous graph after the division, and the outlet pressure of the pressure regulating station is assigned to the next graph after the division, thereby solving the problem of non-convergence of calculation.
[0038] Step 103, Node interpolation: In each subgraph topology, construct edges between the specified splitting node and its neighboring nodes, and re-insert the specified splitting node into each subgraph topology;
[0039] The node interpolation process in step 103 specifically includes: first, marking the neighboring nodes of the specified segmentation node according to the edge attributes; then, constructing an edge between the marked neighboring nodes and the specified segmentation node; and finally, inserting the constructed edge into the corresponding subgraph topology.
[0040] In this embodiment, the node interpolation step is illustrated using the case of a pressure regulating station in the pipeline topology. After a node collapses, the pressure regulating station disappears, and a complete area becomes two disconnected sub-areas. These two disconnected sub-areas are missing the collapsed node. Therefore, the missing node (pressure regulating station) needs to be inserted into the corresponding positions in the two sub-areas. This ensures both the integrity of the topology and successfully separates the topology.
[0041] Step 104: Correct the flow direction of all subgraph topologies after node interpolation is completed.
[0042] Step 104 specifically includes: modifying the edge directions in all subgraph topologies after node interpolation to be consistent with the edge directions in the original pipeline topology.
[0043] This embodiment further includes updating the obtained subgraph topologies after step 102 before proceeding to step 103. After step 103, updating and saving the topologies of all subgraphs with completed node interpolation before proceeding to step 104.
[0044] Next, as Figure 2-5 The invention is further illustrated by a specific embodiment, as shown below.
[0045] The pipeline segmentation method based on the node explosion algorithm in this embodiment specifically includes the following steps:
[0046] 1. Construct the topology, such as Figure 2 As shown;
[0047] The pipes in the pipeline network are connected using the edge connection method in graph theory, and the original pipeline network topology is constructed using edges: using the Python third-party open-source library NetworkX, a graph object is created, and then each edge is added to the graph object to obtain a complete graph object. This allows operations to be performed on all nodes and all edges of the graph object.
[0048] Networkx, mentioned above, is a graph theory and complex network modeling tool developed in Python. It includes commonly used graph and complex network analysis algorithms, facilitating complex network data analysis, simulation modeling, and other tasks. Using Networkx, one can store networks in standardized and non-standardized data formats, generate various random and classic networks, analyze network structures, build network models, design new network algorithms, and perform network drawing.
[0049] The essence of the graph theory partitioning method described above is to remove specific edges and divide the graph into several subgraphs to achieve partitioning.
[0050] 2. Node cracking
[0051] In this embodiment, nodes 5 and 3 are set as the specified splitting nodes. First, the list of all edges of the original graph object is saved. Then, the neighbors of the specified splitting nodes are obtained. The neighboring nodes of nodes 5 and 3 are [2,7] and [1,9], respectively. Finally, the specified splitting nodes, namely nodes 5 and 3, are deleted according to the networkx node attributes.
[0052] 3. Update subgraph
[0053] Update the subgraphs obtained by exploding the nodes mentioned above, and save the combination of all nodes in each subgraph. In this embodiment, the node sets after deleting nodes 5 and 3 are {8, 7, 10}, {1, 2}, and {4, 6, 9}, respectively. The update results are as follows: Figure 3 As shown.
[0054] 4. Node interpolation
[0055] Construct a list tuple based on each node from step 2 and its corresponding neighbor nodes, for example, [(5,2),(5,7),(3,1),(3,9)]. Iterate through the neighbor node list tuples to check if the -1 element (the end point) is in the subgraph node set from step 3. If it is, add the edge from the new list tuple to the corresponding subgraph.
[0056] 5. Update subgraph
[0057] Update the subgraph from step 4 again to obtain all subgraphs with completed node interpolation, such as... Figure 4 As shown.
[0058] 6. Flow direction correction
[0059] Using the edge list of the original graph object saved in step 2 as a standard, change the direction of edges in the new subgraph that are inconsistent with the direction of the edge list of the original parent graph, such as... Figure 5 As shown.
[0060] In the node detonation step of this embodiment, since the point to be detonated in the pipeline topology is a voltage regulating station, such as... Figure 2 The diagram shows a simulated pipeline topology, where pressure regulating stations 5 and 3 are the nodes. The gas pipeline monitoring system contains outlet and inlet pressure data for these stations, and the difference between these two values is significant. Therefore, the simulation cannot assign both values to the pressure regulating stations simultaneously; only one value can be assigned. Thus, pressure regulating stations 5 and 3 are used as the nodes for segmentation. In this embodiment, a complete topology region (such as...) is represented... Figure 2 (As shown) Divided into three regions (as shown) Figure 5 (As shown). The previous region after segmentation is assigned the inlet pressure of the pressure regulating station, and the next region is assigned the outlet pressure of the pressure regulating station. For example... Figure 5 In neutron topology region 1, nodes 5 and 3 are assigned the inlet pressure or flow rate of pressure regulating stations 5 and 3 (the case of a given flow rate is extremely rare). In sub-topology region 2, node 5 is assigned the outlet pressure of pressure regulating station 5, and in sub-topology region 3, node 3 is assigned the outlet pressure of pressure regulating station 3. This node-breaking method can accurately separate the topology, assigning the two values of the pressure regulating stations to different regions for simulation calculations.
[0061] In the node interpolation step of this embodiment, after nodes 5 and 3 of the voltage regulating station explode, nodes 5 and 3 of the voltage regulating station will disappear, and a complete area (such as...) will be lost. Figure 2 As shown, it will become three disconnected sub-regions (e.g. Figure 3 (As shown). Furthermore, these three disconnected sub-regions are missing the exploded voltage regulating station nodes 5 and 3. The missing voltage regulating station nodes 5 and 3 need to be inserted into their corresponding positions in the three sub-regions respectively (e.g., ...). Figure 4As shown in the figure, this ensures both the integrity of the topology and the successful separation of the topology.
[0062] The pipeline segmentation method based on the node explosion algorithm in this invention, compared with the traditional DFS depth traversal method, eliminates the steps of determining the root node and depth traversal, fundamentally solving the problem that the segmentation results are affected by the different root node input order in the traditional DFS traversal segmentation, and improving the efficiency of topology segmentation.
[0063] 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 variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included 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 pipeline segmentation method based on a node explosion algorithm, characterized in that, Includes the following steps: Step 101: Construct the original pipeline network topology; Step 102, Node Destruction: The original pipeline network topology is broken at a specified splitting node, and the specified splitting node is deleted to obtain multiple subgraph topologies. This includes: saving a list of all edges in the original pipeline network topology, obtaining the neighbor nodes of the specified splitting node, breaking the original pipeline network topology at the specified splitting node, deleting the specified splitting node, obtaining the multiple subgraph topologies, and then updating the multiple subgraph topologies. The specified splitting node is the pressure regulating station node introduced into the pipeline network. The topology is split using the pressure regulating station as the node. During calculation, the inlet pressure or flow rate of the pressure regulating station is assigned to the previous graph after the split, and the outlet pressure of the pressure regulating station is assigned to the next graph after the split. Step 103, Node Interpolation: In each subgraph topology, construct edges between the specified splitting node and its neighboring nodes, and re-insert the specified splitting node into each subgraph topology. This includes: first, marking the neighboring nodes of the specified splitting node according to the edge attributes; then, constructing edges between the marked neighboring nodes and the specified splitting node; inserting the constructed edges into the corresponding subgraph topology; and then updating and saving all subgraph topologies after node interpolation. Step 104: Correct the flow direction of all subgraph topologies after node interpolation, including: modifying the edge direction in all subgraph topologies after node interpolation to be consistent with the edge direction in the original pipeline topology.
2. The pipeline segmentation method based on the node explosion algorithm according to claim 1, characterized in that, The construction of the original pipeline network topology in step 101 specifically includes: connecting the pipelines in the pipeline network according to the edge connection method in graph theory partitioning to generate the original pipeline network topology.
Citation Information
Patent Citations
Power system topology layered recognition method based on island search technology
CN107565562A
Ring loop-containing distribution network operation state determination method and device
CN110021936A