Water service pipe network grouping and statistics method based on topology merging and pipe breakage influence analysis

CN123012222APending Publication Date: 2026-10-30SOUTHWEST MUNICIPAL ENGINEERING DESIGN & RESEARCH INSTITUTE OF CHINA +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611107133.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

依赖人工经验与图形界面操作的方式效率极为低下(数千条管线的城市管网往往需要数人数天),且结果因人而异,无法标准化

Benefits of technology

[0021]本发明通过基于预设容差的节点归并处理,将距离不超过容差的多个节点映射为同一标准节点,有效消除了不同数据源之间因采集精度、坐标处理方式差异导致的坐标漂移问题,使本应在物理上连通的管线在数据层面恢复连通。相比现有技术中依赖人工目视检查或忽略坐标偏差的处理方式,本发明实现了拓扑关系的自动化修正,确保了后续环状与枝状管网识别、断管影响分析的准确性基础,适配多源、多精度数据的融合处理需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012222A_ABST
    Figure CN123012222A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of smart city water management, and particularly relates to a water management network grouping and statistical method based on topology merging and pipe breakage influence analysis, comprising: loading pipe network line segment data and water source point data, merging and processing pipe line nodes based on a preset tolerance, and constructing an undirected topology graph according to a standard node sequence after merging; matching water source point coordinates with standard nodes in the undirected topology graph, marking effective water source nodes, identifying global connected components based on the undirected topology graph and marking water source accessibility of each connected component; and simulating pipe breakage piece by piece based on the undirected topology graph, for the current pipe line, respectively starting from both end nodes to perform connectivity search after excluding the edge corresponding to the current pipe line, and judging the pipe network type of the current pipe line and calculating the influence pipe network length according to whether both end nodes can still reach the effective water source; the present application realizes topology automatic correction, loop branch automatic identification, influence range quantification and intelligent grouping and statistics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart city water management technology, and in particular to a grouping and statistical method for water pipe networks based on topology merging and pipe breakage impact analysis. Background Technology

[0002] In the process of digital management of urban water supply networks, pipeline data usually comes from surveying, GIS database construction, pipeline surveys, or subsequent operation and maintenance updates. Due to differences in data acquisition accuracy, coordinate processing methods, line segment interruption habits, and data maintenance batches, there are often slight coordinate deviations (e.g., coordinate drift on the order of 0.001 meters) between the endpoints of different pipeline segments. This causes pipelines that should be physically connected to appear disconnected at the data level, seriously affecting the correct identification of subsequent topological relationships.

[0003] Existing methods for analyzing the impact of pipe breaks have many shortcomings. Relying on manual experience and graphical interfaces is extremely inefficient (it often takes several people several days to simulate a city's pipe network of thousands of pipelines), and the results vary from person to person, making standardization impossible. While graph-based connectivity analysis can output qualitative results indicating whether a source has been lost, it cannot automatically and quantitatively calculate the total length of the affected pipe network, nor can it search for the complete affected subgraph downstream of branched pipe networks and accumulate the lengths. More importantly, when grouping statistics by business fields such as road, pipe material, and diameter, existing technologies cannot handle the mixed situation of ring and branched pipe networks. The affected range of branched pipe networks has an inclusion relationship (upstream failure necessarily includes downstream), and simple accumulation inevitably leads to double counting, resulting in inflated statistical values. Furthermore, for large-scale pipe networks with tens of thousands of pipelines, a complete pipe break simulation using a serial calculation mode may take several days.

[0004] Therefore, there is an urgent need for a water pipe network analysis method that can automatically perform topology merging and correction, efficiently simulate pipe breaks in parallel, automatically identify ring and dendritic structures and quantify their impact lengths, and intelligently merge overlapping impact ranges and avoid duplicate metering during the grouping and statistical stage. Summary of the Invention

[0005] The purpose of this invention is to propose a grouping and statistical method for water pipe networks based on topology merging and pipe breakage impact analysis, which at least solves one of the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A grouping and statistical method for water pipe networks based on topology merging and pipe break impact analysis includes the following steps:

[0008] Load pipeline segment data and water source data, merge pipeline nodes based on preset tolerance, map nodes whose distance does not exceed the tolerance to the same standard node, and construct an undirected topology graph based on the merged standard node sequence.

[0009] Match the coordinates of the water source points with the standard nodes in the undirected topology graph, mark the valid water source nodes, identify the global connected components based on the undirected topology graph, and mark the water source reachability of each connected component.

[0010] Based on the undirected topology graph, the pipeline is simulated to be disconnected one by one. For the current pipeline, a connectivity search is performed starting from the two end nodes and after excluding the edges corresponding to the current pipeline. The network type of the current pipeline is determined based on whether the two end nodes can still reach a valid water source, and the affected network length is calculated.

[0011] A further improvement is that the method also includes the following steps: dividing the pipelines into different combinations according to the grouping field selected by the user; for combinations containing non-loop pipelines, calculating the impact of the unit on the user's pipeline length after merging the affected pipeline sets with inclusion relationships.

[0012] A further improvement is that the method for merging pipeline nodes based on a preset tolerance, mapping nodes whose distance does not exceed the tolerance to the same standard node, and constructing an undirected topology graph based on the merged standard node sequence includes: traversing all nodes on the pipeline path, calculating the Euclidean distance between any two nodes, merging nodes whose distance does not exceed the tolerance to the same standard node, constructing the mapping relationship from the original nodes to the standard nodes, and converting the path point sequence of each pipeline into a standard node sequence; traversing adjacent standard node pairs, calculating the pipeline length as the edge weight, recording the bidirectional connection relationship in the adjacency list, and storing the edge length and the pipeline number to which it belongs, and recording the start point, end point, total length, and all standard node sequences of each pipeline.

[0013] A further improvement is that the specific method for matching the coordinates of the water source point with the standard nodes in the undirected topology graph includes: for each water source point coordinate, traversing all standard nodes to calculate the Euclidean distance; when the minimum distance does not exceed the tolerance, the corresponding standard node is marked as a valid water source node; otherwise, the water source point is marked as an invalid water source.

[0014] A further improvement is that the specific method for identifying globally connected components and marking the water source reachability of each connected component based on the undirected topology graph includes: using a breadth-first search algorithm to traverse all nodes in the undirected topology graph, assigning a connected component number to each node, and recording whether each connected component contains a valid water source node.

[0015] A further improvement is that the specific execution method of the breadth-first search algorithm includes: creating an empty queue, enqueuing the starting node and marking it as visited; looping through the following operations until the queue is empty: taking the head node from the queue as the current node, traversing all nodes adjacent to the current node in the undirected topology graph, enqueuing each unvisited adjacent node and marking it as visited; when the queue is empty, all visited nodes constitute a connected component.

[0016] A further improvement is that the specific method for determining the network type of the current pipeline and calculating the affected network length based on whether the nodes at both ends can still reach the effective water source includes: when both nodes at both ends can reach the effective water source, the current pipeline is determined to be a ring network, and the affected network length is taken as the length of the current pipeline itself; when only one node at one end can reach the effective water source, the current pipeline is determined to be a branch network, and the affected subgraph is searched in the undirected topology graph starting from the unreachable node at one end, and the length of the current pipeline and the sum of the lengths of all pipelines in the subgraph are taken as the affected network length.

[0017] A further improvement is that the specific method for calculating the user pipe length affected by the unit after merging the affected pipeline sets with inclusion relationships includes: extracting the set of affected pipeline numbers of all non-loop pipelines in the group; selecting the pipeline with the largest set size from the remaining set as a representative, and identifying other pipelines with inclusion relationships with the representative set and grouping them into the same sub-group; taking the influence length of the pipeline with the largest affected pipeline set size in the sub-group as the representative value of the sub-group, and accumulating the representative values ​​of all sub-groups to obtain the total influence length of the non-loop portion; adding the sum of the influence lengths of all loop pipelines in the group to the total influence length of the non-loop portion to obtain the user pipe length affected by the unit.

[0018] A further improvement is that the simulated pipeline disconnection adopts a multi-process parallel processing architecture: all pipeline indices are divided into batches, each batch is assigned to an independent process to perform disconnection simulation, each process independently performs end-to-end connectivity judgment and subgraph search based on the undirected topology graph, and the main process collects and merges the results of each batch.

[0019] A further improvement is that the method further includes: adding analysis fields based on the original pipeline network data and writing the results back, wherein the analysis fields include at least one of whether it is a ring network, the length of the affected network, the combination sequence number, and the length of the user's pipe affected by the unit.

[0020] The beneficial effects of this invention are as follows:

[0021] This invention utilizes node merging based on a preset tolerance to map multiple nodes within the tolerance range to the same standard node. This effectively eliminates coordinate drift caused by differences in acquisition accuracy and coordinate processing methods between different data sources, restoring the connectivity of pipelines that should be physically connected at the data level. Compared to existing technologies that rely on manual visual inspection or ignore coordinate deviations, this invention achieves automated correction of topology relationships, ensuring the accuracy of subsequent identification of ring and branched pipe networks and analysis of the impact of pipe breaks, and adapting to the fusion processing needs of multi-source, multi-precision data.

[0022] This invention simulates the disconnection of pipelines one by one, performing connectivity searches from both ends of the network after excluding the current edge. It automatically distinguishes between ring networks and branch networks based on whether a valid water source can still be reached from either end. Compared to existing connectivity analysis methods that only qualitatively determine "whether a source has been lost," this invention can not only automatically identify the network structure type but also quantitatively calculate the affected network length after each pipeline failure and record the set of affected pipeline numbers, achieving a leap from qualitative judgment to quantitative analysis.

[0023] This invention solves the problem of duplicate measurement caused by simple summation when grouping mixed loop and branched pipelines. It employs a greedy merging strategy during the grouping and statistical phase to merge affected pipeline sets with inclusion relationships for combinations containing non-loop pipelines. The pipeline length with the largest affected range in each sub-combination is used as the representative value for accumulation. Compared to the existing method of simply adding the affected lengths of all pipelines within a group, this invention ensures the authenticity and reliability of the unit's impact on the user's pipe length index, avoiding decision-making bias caused by inflated values. Attached Figure Description

[0024] Figure 1 This is a flowchart of a water pipe network grouping statistical method based on topology merging and pipe breakage impact analysis according to the present invention;

[0025] Figure 2 This is a schematic diagram of an undirected topological graph and an adjacency list. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. The described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0028] Please refer to the attached document. Figure 1 This invention proposes a grouping and statistical method for water supply networks based on topology merging and pipe breakage impact analysis, which is applied to a digital management platform for urban water supply networks. The platform connects to multiple data sources such as pipeline surveying data, GIS databases, and water source data.

[0029] Specifically, the method includes the following steps:

[0030] Step S1: Load pipeline segment data and water source data, merge pipeline nodes based on preset tolerance, map nodes whose distance does not exceed the tolerance to the same standard node, and construct an undirected topology graph based on the merged standard node sequence.

[0031] Step S2: Match the coordinates of the water source points with the standard nodes in the undirected topology graph, mark the valid water source nodes, identify the global connected components based on the undirected topology graph, and mark the water source reachability of each connected component.

[0032] Step S3: Simulate the disconnection of pipelines one by one based on the undirected topology graph. For the current pipeline, start from the two end nodes and perform connectivity search after excluding the edges corresponding to the current pipeline. Determine the network type of the current pipeline based on whether the two end nodes can still reach the effective water source and calculate the affected network length.

[0033] Step S4: Divide the pipelines into different combinations according to the grouping field selected by the user. For combinations that include non-loop pipelines, calculate the impact of the unit on the user's pipeline length after merging the affected pipeline sets with inclusion relationships.

[0034] The method steps of the present invention will be described in detail below:

[0035] Specifically, in step S1, the pipeline segment data is in JSON format, containing field definitions, field aliases, and a set of linear elements. Each linear element contains path coordinates (longitude, latitude, or projected coordinates) and several attribute fields, such as the road it is located on, pipeline diameter, pipeline material, and road surface type. The water source point data is in JSON format, containing a set of water source point elements, with each water source point containing coordinate information.

[0036] The specific method for merging pipeline nodes based on a preset tolerance, mapping nodes whose distance does not exceed the tolerance to the same standard node, and constructing an undirected topology graph based on the merged standard node sequence includes the following steps:

[0037] Define topology capture tolerance parameters The default value is 0.001 meters, which users can customize according to data precision. It's understandable that tolerance represents the allowable range of coordinate deviation; when the distance between two nodes is less than or equal to the tolerance, the system considers them to represent the same physical node. In urban pipeline network data, coordinate drift ranging from 0.001 meters to 0.05 meters often exists between different batches of survey data. Setting an appropriate tolerance can eliminate these differences.

[0038] Iterate through all nodes along the pipeline path (including endpoints and vertices) and extract the coordinates of all nodes. For any two nodes... and Calculate the Euclidean distance between the two. The Euclidean distance is a measure of the straight-line distance between two points, and its calculation formula is as follows:

[0039]

[0040] in, , The planar coordinates of the first node. , This refers to the planar coordinates of the second node. In water supply network data, coordinates are typically expressed in a projected coordinate system (such as CGCS2000 projected coordinates), with the unit being meters. Therefore, the Euclidean distance... The unit is meters, which can be directly compared with tolerance. Compare them.

[0041] like If the two nodes do not represent the same physical topology node, they are merged into a single standard node. In the implementation, a node mapping table is constructed to map each original coordinate to the merged standard node coordinates (using the average of the coordinates of all nodes before merging or the coordinates of the first node). For each pipeline, its path points are expanded into a continuous sequence of points, which are then merged sequentially to obtain a standard node sequence.

[0042] For example, the endpoint coordinates of pipeline A are (100.0001, 200.0001), and the starting coordinates of pipeline B are (100.0000, 200.0000). The Euclidean distance between them is... The distance between the two nodes is less than the tolerance of 0.001 meters, so they are merged into the same standard node (100.0000, 200.0000). This merging process eliminates the false breakpoints caused by coordinate drift, restoring the connectivity of physically connected pipelines at the data level, thus laying the foundation for constructing the correct topology.

[0043] Subsequently, the adjacent standard node pairs are traversed, the pipeline length is calculated as the edge weight, the bidirectional connection relationship is recorded in the adjacency list, the edge length and the pipeline number are stored, and the start point, end point, total length and all standard node sequences of each pipeline are recorded.

[0044] It is understandable that, such as Figure 2 As shown, the undirected topology graph is a graph data structure used to represent the physical connectivity between pipelines in a water supply network. In this undirected topology graph, nodes represent merged standard nodes (i.e., pipeline intersections or endpoints), and edges represent pipeline segments connecting two adjacent standard nodes. The undirected topology graph is stored using an adjacency list data structure, a storage method suitable for sparse graphs. Each node maintains a list storing the numbers of all its adjacent nodes and their corresponding edge information (length, pipeline number). Compared to adjacency matrices, adjacency lists offer higher space and traversal efficiency in sparse graph scenarios where the number of edges is much less than the square of the number of nodes. The water supply network topology graph is a typical sparse graph (the degree of each node is usually no more than 4).

[0045] Furthermore, although the flow direction of water in a water supply network is physically affected by water pressure, at the topological level, the connectivity of pipelines is undirected. As long as there are physical connections between pipelines, water can flow in any direction. Therefore, this invention uses the construction of an undirected topological graph to accurately represent the physical topological structure of the pipeline network.

[0046] Specifically, in step S2, since the water source point data may contain invalid points that are not accurately connected to the pipeline network (e.g., water source coordinates are drifted or fall in blank areas of the pipeline network), verification is required. For each water source point coordinate, all merged standard nodes are traversed, and the Euclidean distance is calculated. If the minimum distance does not exceed the tolerance... If the standard node is valid, it will be marked as a valid water source node; otherwise, it will be considered an invalid water source and will not participate in subsequent connectivity analysis.

[0047] Understandably, the verification step ensures that subsequent analysis only checks the accessibility of water sources actually connected to the pipe network, thus avoiding analysis errors caused by invalid water sources.

[0048] In this embodiment, the specific method for identifying globally connected components and marking the water source reachability of each connected component based on the undirected topology graph includes:

[0049] A breadth-first search algorithm is used to traverse all nodes in the undirected topology graph, assign a connected component number to each node, and record whether each connected component contains a valid water source node.

[0050] It is understood that Breadth-First Search (BFS) is a graph traversal algorithm. Its basic idea is to start from the starting node, first visit all adjacent nodes of the starting node, then visit the adjacent nodes of these adjacent nodes in turn, expanding outwards layer by layer until all reachable nodes have been traversed. The BFS algorithm uses a queue as an auxiliary data structure. A queue is a first-in, first-out (FIFO) data structure used to store nodes to be visited.

[0051] The specific execution method of the breadth-first search algorithm described in this embodiment includes: creating an empty queue, enqueuing the starting node and marking it as visited; performing the following operations in a loop until the queue is empty: taking the head node from the queue as the current node, traversing all nodes adjacent to the current node in the undirected topology graph, enqueuing each unvisited adjacent node and marking it as visited; when the queue is empty, all visited nodes constitute a connected component.

[0052] By initiating a BFS traversal for each unvisited node, all connected components in the undirected topology graph can be identified. During the traversal, a connected component number is assigned to each node, and all nodes within the same connected component have the same component number. Simultaneously, it is recorded whether each connected component contains a valid water source node. In this step, the output of BFS is the connected component number corresponding to each node (e.g., node number 1001 corresponds to component number C01), and a Boolean flag indicating whether each component contains a water source (e.g., component C01 is marked as True for water source). This information is stored in the form of a node-component mapping table for quick querying in step S3 to determine whether a connected component containing a pipeline contains a water source.

[0053] A connected component is a set of interconnected nodes in an undirected graph. In a water supply network, all pipelines within the same connected component are connected to each other through nodes, and water can flow freely along the pipelines within the component. Once a connected component contains a valid water source, all pipelines within that component are capable of supplying water. Conversely, a component that does not contain a water source is essentially an isolated network and does not have the function of supplying water.

[0054] Understandably, this step can distinguish between areas with and without water sources, avoid subsequent misjudgments of invalid connected areas, and can also skip pipeline analysis in areas without water sources in advance, thus improving computational efficiency.

[0055] Specifically, in step S3, for a single pipeline, its starting point, ending point, and length are first obtained. If the connected component containing the pipeline does not contain a valid water source, it is skipped directly (areas without water sources do not require analysis). The two endpoints refer to the two standard nodes corresponding to the starting and ending points of the current pipeline in the undirected topology graph.

[0056] When both ends of the pipeline can reach a valid water source, it indicates that the pipeline is in a ring-shaped water supply structure, and its disconnection will not cause a unilateral loss of water source in a topological sense. It is determined to be a ring network, and the affected network length is taken as the current pipeline's own length.

[0057] When only one end node is reachable from a valid water source, it indicates that the pipeline has a branched structure, and its breakage will cause the downstream area to lose its water supply. It is determined to be a branched network (i.e., a non-loop network). Starting from the unreachable end node, an affected subgraph is searched in the undirected topology graph. The length of the affected network is the sum of the current pipeline length and the lengths of all pipelines in the subgraph. The affected subgraph refers to the subgraph formed by all nodes and edges reachable from the unreachable end node without passing through the current pipeline, using a breadth-first search. All pipelines in this subgraph will lose their water supply after a break.

[0058] Specifically, in this embodiment, the specific search process of the affected subgraph is as follows: starting with the unreachable node, perform a breadth-first search in the undirected topology graph, exclude the edge corresponding to the current pipeline (i.e., do not allow passing through this edge), collect all reachable nodes and the edges passed through, mark the pipelines corresponding to these edges as affected pipelines, and accumulate their lengths.

[0059] It should be noted that when excluding edges corresponding to the current pipeline during the search process, a skipping strategy is used instead of physical deletion. That is, during the BFS traversal, when expanding adjacent nodes from the current node, if the target edge happens to be an excluded edge, the edge is skipped and not added to the traversal queue. The excluded edge is uniquely identified between the two endpoints of the current pipeline, and its identifier is the pipeline number. This strategy avoids the need for restoration operations after actually deleting edges in the undirected topology graph, improving computational efficiency. After the search of the affected subgraph is completed, the information of all reachable nodes and edges is collected into a set of affected pipeline numbers and a list of affected pipeline lengths.

[0060] Taking a branched terminal pipeline as an example, the pipeline starts on a ring trunk and ends at a terminal user node, with a length of 12 meters. After disconnecting the pipeline, a breadth-first search is performed starting from the starting point. Due to the existence of other parallel paths, the starting point can still reach a valid water source. However, a breadth-first search is performed starting from the ending point. Since this pipeline is the only connecting path, the ending point cannot reach any valid water source, thus classifying it as a branched network. Searching the affected subgraph from the ending point (excluding the current pipeline itself) yields three downstream pipelines with lengths of 23 meters, 15 meters, and 8 meters, respectively, for a total subgraph length of 46 meters. Therefore, the affected network length = its own length of 12 meters + subgraph length of 46 meters = 58 meters. The set of affected pipeline numbers is also recorded.

[0061] Taking a ring-shaped pipeline as an example, the pipeline connects to two different nodes of the ring-shaped main pipe at both ends, and its own length is 24 meters. After disconnecting the pipeline, a breadth-first search is performed from both ends. Since there are backup paths for the ring structure, both ends can reach the effective water source through other paths, and it is determined to be a ring network. The affected network length is its own length of 24 meters.

[0062] In actual implementation, there may be situations where neither of the two nodes can reach a valid water source. This usually occurs when the connected component of the pipeline itself does not contain a water source, but this situation has already been filtered out in step S3. If this situation occurs in the pipe break simulation due to data anomalies, the system will mark it as an invalid result and record the anomaly log.

[0063] After the judgment is completed, the judgment result (whether it is a ring network) and the affected network length are written into the attributes of the current pipeline.

[0064] In a preferred embodiment of the present invention, the simulated pipeline disconnection adopts a multi-process parallel processing architecture. Specifically, the number of CPU cores of the current device is detected, all pipeline indices are evenly divided into batches, each batch is assigned to an independent process, and the disconnection simulation is executed independently in each process. Each process independently performs end-to-end connectivity judgment and subgraph search based on the undirected topology graph, and the main process collects and merges the results of each batch.

[0065] Understandably, parallel architectures can make full use of multi-core CPU resources and improve processing efficiency.

[0066] Specifically, in step S4, the grouping field refers to the business attribute field selected by the user for classifying pipelines, such as the road (for statistics by road), pipeline diameter (for statistics by pipe diameter), pipeline material (for statistics by cast iron, PE, etc.), and road surface type (for statistics by asphalt, cement, etc.). The user can select one or more fields for combined grouping.

[0067] The term "unit-affected user pipeline length" refers to the total length of user pipeline affected if a pipeline failure occurs within a certain combination (e.g., "Zhongshan Road | DN200 | Cast Iron | Asphalt"). This indicator is a key quantitative basis for water supply network operation and maintenance decisions. The larger the value, the wider the impact of the failure of that pipeline combination, and the higher its priority should be given in network renovation and emergency repair plans.

[0068] Specifically, users select one or more grouping fields through the interface. The system iterates through all pipelines and generates a combination key based on the selected field values. The combination key is generated by concatenating the values ​​of each selected field into a string using the pipe symbol "|". For example, for pipeline P, if its "Road Location" field value is "Zhongshan Road", "Pipeline Diameter" field value is "DN200", "Pipeline Material" field value is "Cast Iron", and "Road Type" field value is "Asphalt", then the combination key is "Zhongshan Road|DN200|Cast Iron|Asphalt". For pipelines with empty field values, the system converts the empty value of that field into the special string "NULL" for concatenation and uniformly classifies it into the null value group. The pipeline index is then assigned to the corresponding group dictionary, and pipelines with empty field values ​​are uniformly classified into the null value group.

[0069] For each group, first cache the loop attributes, affected length values, and affected pipeline number set for all pipelines within the group. Then distinguish the following cases:

[0070] If all pipelines in the group are in a ring network, then the length of the pipeline that a unit affects the user is equal to the sum of the lengths of the pipelines that affect the user in the group.

[0071] If a group contains non-ringed pipe networks (i.e., branched pipe networks), then potentially overlapping sets of affected pipes need to be merged to avoid duplicate metering. A greedy merging strategy is specifically adopted:

[0072] Extract the affected pipeline numbers of all non-loop pipelines within the group. Each set records all pipeline numbers actually affected after the pipeline is disconnected. The inclusion relationship is determined as follows: for two sets A and B, if all elements in A belong to B, then A is said to be a subset of B, and B is a superset of A; an inclusion relationship exists between them. In a water supply network, the impact range of an upstream branch pipeline failure necessarily includes the impact range of a downstream branch pipeline. Therefore, the affected pipeline number set of downstream pipelines is a subset of the upstream pipeline set. For example, if the affected set of pipeline P1 is {P1, P2, P3}, and the affected set of pipeline P2 is {P2}, then the set of P2 is a subset of the set of P1; an inclusion relationship exists between them.

[0073] Understandably, the basic principle of the greedy merging strategy is as follows: among the affected sets with overlapping relationships, only the pipeline impact length corresponding to the set with the largest coverage is retained as the representative value, because the failure of this pipeline already covers the entire impact range of the failures of its subset pipelines. By selecting the set with the largest current size as the representative each time, it can be ensured that the final selected representative set can cover other sets to the maximum extent, while maintaining the uniqueness of the merging result. The "largest set" refers to the set with the largest number of elements (i.e., pipeline numbers).

[0074] In this embodiment, the specific method for calculating the user pipe length affected by the unit after merging the affected pipeline sets with inclusion relationships includes: extracting the set of affected pipeline numbers of all non-loop pipelines in the group; selecting the pipeline with the largest set size from the remaining set as a representative, and identifying other pipelines with inclusion relationships with the representative set and grouping them into the same sub-group; taking the influence length of the pipeline with the largest affected pipeline set size in the sub-group as the representative value of the sub-group, and accumulating the representative values ​​of all sub-groups to obtain the total influence length of the non-loop portion; adding the sum of the influence lengths of all loop pipelines in the group to the total influence length of the non-loop portion to obtain the user pipe length affected by the unit.

[0075] For example, a group contains 12 pipelines, including 8 ring networks with a total affected length of 158 meters; and 4 non-ring networks (branch networks), with the following affected pipeline lengths and affected pipeline numbers: Pipeline P1 has an affected length of 45 meters, affected set {P1, P2, P3}; Pipeline P2 has an affected length of 20 meters, affected set {P2}; Pipeline P3 has an affected length of 38 meters, affected set {P3, P4}; Pipeline P4 has an affected length of 15 meters, affected set {P4}. Simply adding these together (45 + 20 + 38 + 15 = 118 meters) would result in P2 and P4 being counted twice.

[0076] This invention employs a greedy merging strategy: The largest set {P1, P2, P3} is selected as the representative set. Since the set of P2 is a subset of P1, it is grouped into the same sub-group, with a maximum influence length of 45 meters. The sets of P3 and P4 have an inclusion relationship, so they are grouped into the same sub-group, with a maximum influence length of 38 meters. The total influence length of the non-cyclic portion = 45 + 38 = 83 meters. Finally, the unit influence length of this group = 158 meters for the cyclic portion + 83 meters for the non-cyclic portion = 241 meters.

[0077] In this embodiment, a unique combination number (incrementing from 1) is generated for the group, and the combination number and the influence of the unit on the user pipe length are written into the attribute of the corresponding pipeline.

[0078] In a preferred embodiment of the present invention, the method further includes adding analysis fields based on the original pipeline network data and writing the results back. The analysis fields include at least one of whether it is a ring network, the length of the affected network, the combination number, and the length of the user's pipe affected by the unit.

[0079] Specifically, four new analysis fields are added to the original pipeline network data fields: "Whether it is a ring network" (string type, value is "ring" or "branch"), "Affected pipeline length" (double-precision floating-point type, unit: meters), "Combination sequence number" (integer type, starting from 1 and incrementing), and "Unit affects user pipe length" (double-precision floating-point type, unit: meters). At the same time, the field alias information is updated, and the complete data structure is saved in JSON format to a specified path to ensure that the analysis results can be directly used for GIS display, CIM system integration, or subsequent operation and maintenance decisions.

[0080] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A grouping and statistical method for water pipe networks based on topology merging and pipe break impact analysis, characterized in that, Includes the following steps: Load pipeline segment data and water source data, merge pipeline nodes based on preset tolerance, map nodes whose distance does not exceed the tolerance to the same standard node, and construct an undirected topology graph based on the merged standard node sequence. Match the coordinates of the water source points with the standard nodes in the undirected topology graph, mark the valid water source nodes, identify the global connected components based on the undirected topology graph, and mark the water source reachability of each connected component. Based on the undirected topology graph, the pipeline is simulated to be disconnected one by one. For the current pipeline, a connectivity search is performed starting from the two end nodes and after excluding the edges corresponding to the current pipeline. The network type of the current pipeline is determined based on whether the two end nodes can still reach a valid water source, and the affected network length is calculated.

2. The water supply network grouping and statistical method based on topology merging and pipe break impact analysis as described in claim 1, characterized in that, The method further includes the following steps: dividing the pipelines into different combinations according to the grouping field selected by the user; for combinations containing non-loop pipelines, calculating the impact of the unit on the user's pipeline length after merging the affected pipeline sets with inclusion relationships.

3. The water supply network grouping and statistical method based on topology merging and pipe break impact analysis as described in claim 1, characterized in that, The specific method for merging pipeline nodes based on a preset tolerance, mapping nodes whose distance does not exceed the tolerance to the same standard node, and constructing an undirected topology graph based on the merged standard node sequence includes: traversing all nodes on the pipeline path, calculating the Euclidean distance between any two nodes, merging nodes whose distance does not exceed the tolerance to the same standard node, constructing the mapping relationship from the original nodes to the standard nodes, and converting the path point sequence of each pipeline into a standard node sequence; traversing adjacent standard node pairs, calculating the pipeline length as the edge weight, recording the bidirectional connection relationship in the adjacency list, and storing the edge length and the pipeline number to which it belongs, and recording the start point, end point, total length, and all standard node sequences of each pipeline.

4. The water supply network grouping and statistical method based on topology merging and pipe break impact analysis as described in claim 1, characterized in that, The specific method for matching the coordinates of the water source point with the standard nodes in the undirected topology graph includes: for each water source point coordinate, traversing all standard nodes to calculate the Euclidean distance; when the minimum distance does not exceed the tolerance, the corresponding standard node is marked as a valid water source node; otherwise, the water source point is marked as an invalid water source.

5. The water supply network grouping and statistical method based on topology merging and pipe break impact analysis according to claim 1, characterized in that, The specific method for identifying globally connected components and marking the water source reachability of each connected component based on the undirected topology graph includes: using a breadth-first search algorithm to traverse all nodes in the undirected topology graph, assigning a connected component number to each node, and recording whether each connected component contains a valid water source node.

6. The water supply network grouping and statistical method based on topology merging and pipe break impact analysis according to claim 5, characterized in that, The specific execution method of the breadth-first search algorithm includes: creating an empty queue, enqueuing the starting node and marking it as visited; and performing the following operations in a loop until the queue is empty: taking the head node from the queue as the current node, traversing all nodes adjacent to the current node in the undirected topology graph, enqueuing each unvisited adjacent node and marking it as visited; when the queue is empty, all visited nodes constitute a connected component.

7. The water supply network grouping and statistical method based on topology merging and pipe break impact analysis according to claim 1, characterized in that, The specific method for determining the network type of the current pipeline and calculating the affected network length based on whether the nodes at both ends can still reach the effective water source includes: when both nodes at both ends can reach the effective water source, the current pipeline is determined to be a ring network, and the affected network length is taken as the length of the current pipeline itself; when only one node at one end can reach the effective water source, the current pipeline is determined to be a branch network, starting from the unreachable node at one end, the affected subgraph is searched in the undirected topology graph, and the sum of the current pipeline length and the lengths of all pipelines in the subgraph is taken as the affected network length.

8. A water supply network grouping and statistical method based on topology merging and pipe break impact analysis as described in claim 2, characterized in that, The specific method for calculating the unit's impact on the user's pipe length after merging the affected pipeline sets with inclusion relationships includes: extracting the set of affected pipeline numbers for all non-loop pipelines within the group; selecting the pipeline with the largest set size from the remaining set as a representative, identifying other pipelines with inclusion relationships with the representative set and grouping them into the same sub-group; taking the impact length of the pipeline with the largest affected pipeline set size in the sub-group as the representative value of the sub-group, and summing the representative values ​​of all sub-groups to obtain the total impact length of the non-loop portion; adding the sum of the impact lengths of all loop pipelines within the group to the total impact length of the non-loop portion to obtain the unit's impact on the user's pipe length.

9. A water supply network grouping and statistical method based on topology merging and pipe break impact analysis as described in claim 1, characterized in that, The simulated pipeline disconnection adopts a multi-process parallel processing architecture: all pipeline indices are divided into batches, and each batch is assigned to an independent process to perform disconnection simulation. Each process independently performs end-to-end connectivity judgment and subgraph search based on the undirected topology graph. The main process collects and merges the results of each batch.

10. A water supply network grouping and statistical method based on topology merging and pipe break impact analysis according to claim 2, characterized in that, The method further includes: adding analysis fields based on the original pipeline network data and writing the results back. The analysis fields include at least one of whether it is a ring network, the length of the affected network, the combination number, and the length of the user's pipe affected by the unit.