A method and system for detecting leaks in urban networks
Patent Information
- Application Number
- CN202611428742.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-10-27
AI Technical Summary
[0004]为了解决依赖固定模型或相关性分析而导致的适应性差、误报率高及定位不准的技术问题,本申请提供一种城市管网泄漏检测方法及系统
本申请提供了一种城市管网泄漏检测方法,包括:通过城市管网上设置的多个管网节点采集得到多源时序数据,对多源时序数据进行时滞相关性分析,得到时滞相关矩阵后,对时滞相关矩阵进行因果推理,得到初始因果图结构;依据城市管网的物理拓扑对初始因果图结构进行约束优化,得到优化因果图结构后,将优化因果图结构中出现频率超过预设频率的边确定为因果边,得到目标因果结构;依据目标因果结构构建计算图,并将预设方程所输出特征解融入计算图的图神经网络进行训练,得到节点因果推理模型;将多源时序数据传入节点因果推理模型,得到各管网节点间的实时因果关系图后,根据实时因果关系图与预设因果关系图间的图结构差异度,检测是否存在因果异常;若存在因果异常,则基于因果异常对城市管网进行路径追溯和泄漏推理,得到泄漏位置的定位信息。
Smart Images

Figure CN122986831A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of urban management technology, specifically to a method and system for detecting leaks in urban pipeline networks. Background Technology
[0002] As an important component of urban infrastructure, the safe and stable operation of urban pipe networks is crucial for ensuring social production, daily life, and the effective use of resources. Therefore, timely and accurate detection and location of pipe network leaks have significant economic and social value.
[0003] Currently, methods for detecting leaks in urban pipe networks mainly rely on techniques such as hydraulic models based on physical mechanisms, acoustic or vibration analysis based on signal processing, or time-series data analysis based on statistics and machine learning. These methods achieve leak detection and location by establishing mathematical models of the pipe network system or identifying characteristic patterns of leak signals. However, these methods usually identify anomalies based on preset fixed models or correlation assumptions, failing to dynamically learn from system operation data and explicitly characterize the stable causal dependencies between various nodes of the pipe network that reflect the real physical connections and hydraulic dynamics. As a result, when faced with complex and ever-changing actual working conditions, the models have poor adaptability, high false alarm rates, and difficulty in accurately and interpretably tracing and reasoning the source of the leak. Summary of the Invention
[0004] To address the technical problems of poor adaptability, high false alarm rate, and inaccurate location caused by relying on fixed models or correlation analysis, this application provides a method and system for detecting leaks in urban pipeline networks.
[0005] The urban pipeline network leakage detection method and system provided in this application adopts the following technical solution: A method for detecting leaks in urban pipe networks, comprising: Multi-source time-series data were collected by setting up multiple pipeline nodes in the urban pipeline network, and the target causal structure of multiple pipeline nodes was obtained by learning from the multi-source time-series data. Based on the target causal structure, a node causal inference model is obtained; After inputting multi-source time-series data into the node causal inference model to obtain the real-time causal relationship graph between each pipeline node, the model detects whether there is a causal anomaly based on the graph structure difference between the real-time causal relationship graph and the preset causal relationship graph. If a causal anomaly exists, the path tracing and leakage inference of the urban pipeline network are performed based on the causal anomaly to obtain the location information of the leakage.
[0006] Furthermore, the steps for collecting multi-source time-series data through multiple pipeline nodes set up on the urban pipeline network include: Based on the multimodal sensor arrays set at each pipeline node, pressure signals, vibration signals, sound signals and flow information at each pipeline node are collected to form initial multi-source data; The initial multi-source data is time-stamp aligned and outlier filtered to obtain a multi-source data sequence; Multi-source time-series data are obtained by performing time-domain feature extraction and frequency-domain transformation on multi-source data sequences.
[0007] Furthermore, the steps for learning from multi-source time-series data to obtain the target causal structure of multiple pipeline nodes include: Based on multi-source time-series data, the time-delay correlation between each pipeline node is analyzed to obtain the first correlation matrix; Based on the preset network node constraints, causal inference is performed on the first correlation matrix to obtain the initial causal graph structure; The initial cause-effect graph structure is constrained and optimized based on the physical topology of the urban pipeline network to obtain the optimized cause-effect graph structure. By using a sliding window, the causal stability of the optimized causal graph structure is filtered, and after obtaining the causal edges, the target causal structure is established based on the causal edges.
[0008] Furthermore, the steps for modeling the nodal causal inference model based on the target causal structure include: After mapping the causal nodes in the target causal structure to graph vertices and the causal edges in the target causal structure to directed edges, attention weighting is applied to the graph vertices and directed edges to obtain the initial computation graph. Attention weighting is applied to each directed edge in the initial computation graph to generate an attention-weighted computation graph; By integrating pre-defined node state transition constraints into the attention-weighted computation graph, a physics-enhanced computation graph is obtained. A node-based causal reasoning model is obtained by training a physical augmentation computation graph using a pre-defined graph neural network.
[0009] Furthermore, the steps of inputting multi-source time-series data into the node causal inference model to obtain the real-time causal relationship graph between each pipeline node include: Multi-source time-series data is fed into the node causal reasoning model for forward propagation calculation to obtain the real-time state embedding vector of each pipeline node; Calculate the similarity measure between pairwise real-time state embedding vectors to obtain the causal strength between pairwise network nodes; By combining each causal strength with the directed edges corresponding to each pair of network nodes to which each causal strength belongs, a real-time causal relationship graph is calculated.
[0010] Furthermore, the real-time causal graph includes a real-time causal set composed of real-time nodes and real-time edges, and the preset causal graph includes a preset causal set composed of preset nodes and preset edges. The step of detecting causal anomalies based on the graph structure differences between the real-time causal graph and the preset causal graph includes: By comparing the differences between the real-time causal set and the preset causal set, and obtaining the edge set difference record, the edge set difference record is weighted and summed with the first preset edge weight coefficient to obtain the graph structure difference degree. After weighted summation of the weights of the preset edge and the second preset edge to obtain the physical constraint difference, the graph structure difference and the physical constraint difference are fused in multiple dimensions to obtain the comprehensive difference. The overall difference score is compared with the preset overall difference score to detect whether there is a causal anomaly.
[0011] Furthermore, the steps for tracing the path and inferring the leakage location of urban pipeline networks based on causal anomalies to obtain the location information of the leakage include: The causal anomalies are analyzed to identify the anomalous causal edge representations included in the causal anomalies, thus obtaining the set of anomalous causal edges; Obtain the abnormal edges connecting the preset nodes and the abnormal causal edge set in the preset causal relationship graph, and normalize the abnormal edges to obtain the abnormal correlation degree of the preset nodes connected to the abnormal edges. The weighted sum of the abnormal correlation degree and the preset abnormal correlation weight is used to obtain the weighted abnormal correlation degree of the preset node connected to the abnormal edge; Based on the weighted anomaly correlation degree, the anomaly impact value of the preset node connected to the anomaly edge is updated to obtain the leakage location and the leakage confidence degree corresponding to the leakage location; The location information includes the location of the leak and the corresponding confidence level of the leak.
[0012] This application also provides an urban pipeline network leak detection system, including: The structure building module is used to collect multi-source time-series data through multiple pipeline nodes set up in the urban pipeline network, and to learn from the multi-source time-series data to obtain the target causal structure of multiple pipeline nodes. The modeling module is used to model the target causal structure to obtain the node causal inference model; The anomaly detection module is used to input multi-source time-series data into the node causal reasoning model, obtain the real-time causal relationship graph between each pipeline node, and detect whether there is a causal anomaly based on the graph structure difference between the real-time causal relationship graph and the preset causal relationship graph. The anomaly location module is used to perform path tracing and leakage inference on the urban pipeline network based on causal anomalies if they exist, so as to obtain the location information of the leak.
[0013] Beneficial effects achieved: This application provides a method for detecting leaks in urban pipeline networks, comprising: collecting multi-source time-series data from multiple pipeline nodes set up in the urban pipeline network; performing time-delay correlation analysis on the multi-source time-series data to obtain a time-delay correlation matrix; performing causal inference on the time-delay correlation matrix to obtain an initial causal graph structure; performing constraint optimization on the initial causal graph structure based on the physical topology of the urban pipeline network to obtain an optimized causal graph structure; identifying edges in the optimized causal graph structure that have a frequency exceeding a preset frequency as causal edges to obtain a target causal structure; constructing a computational graph based on the target causal structure; integrating the feature solutions output by the preset equations into the graph neural network of the computational graph for training to obtain a node causal inference model; inputting the multi-source time-series data into the node causal inference model to obtain a real-time causal relationship graph between each pipeline node; detecting whether there is a causal anomaly based on the graph structure difference between the real-time causal relationship graph and the preset causal relationship graph; if a causal anomaly exists, performing path tracing and leak inference on the urban pipeline network based on the causal anomaly to obtain the location information of the leak.
[0014] In this application, the time-delay correlation matrix obtained through time-delay correlation analysis is not directly used for leakage detection. Instead, causal reasoning is further performed to obtain an initial causal graph structure. This initial causal graph structure is then constrained and optimized based on the physical topology of the urban pipeline network. Edges in the optimized causal graph structure that exceed a preset frequency are identified as causal edges, thus forming the target causal structure. This process enables the system to dynamically learn physically meaningful and time-stable causal relationships between nodes from multi-source time-series data, avoiding the problem of poor adaptability of fixed models due to detachment from actual working conditions. Simultaneously, frequency filtering eliminates false edges caused by accidental spurious correlations and interference, reducing false alarms caused by the sensitivity of correlation analysis to noise. A computational graph is constructed based on the target causal structure, and the feature solutions output by the preset equations are integrated into the graph neural network of the computational graph for training. This ensures that the node causal reasoning model is constrained by physical laws on a data-driven basis, even if the data is contaminated by noise or the working conditions change. Even with the improved causal reasoning model, the node causal reasoning model can still maintain stable causal reasoning capabilities based on the characteristic solutions output by the preset equations, further suppressing false alarms. After inputting multi-source time-series data into the node causal reasoning model to obtain a real-time causal relationship graph, causal anomalies are detected based on the graph structure difference between the real-time causal relationship graph and the preset causal relationship graph. Since leakage can cause the addition, deletion, or weight mutation of causal edges between nodes, this structural difference is more fundamental and more resistant to interference than a single signal amplitude change, thus accurately identifying the real causal anomaly. Once a causal anomaly is detected, path tracing and leakage reasoning are performed on the urban pipeline network based on the causal anomaly. By using the directional propagation relationship and physical topological constraints carried in the target causal structure to backtrack along the abnormal causal path, the leakage location is determined from the source of the abnormal impact propagation. This avoids the problem of inaccurate positioning due to information mixing in complex pipeline networks caused by fixed models or correlation analysis, thus achieving the technical effect of stronger adaptability, lower false alarm rate, and more accurate positioning overall. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating the steps of a method for detecting leaks in urban pipe networks according to this application; Figure 2 This is a flowchart illustrating the steps involved in acquiring multi-source time-series data in this application. Figure 3 This is a flowchart illustrating the steps involved in obtaining the nodal causal reasoning model in this application. Figure 4 This is a flowchart illustrating the steps involved in detecting causal anomalies in this application. Figure 5 A flowchart illustrating the steps involved in determining the location information of the leak in this application; Figure 6 This is a schematic diagram of the modules of the urban pipeline leakage detection system of this application.
[0016] Explanation of reference numerals in the attached figures: 10. Structure building module; 20. Model building module; 30. Anomaly detection module; 40. Anomaly location module. Detailed Implementation
[0017] The following combination Figures 1-6 This application will be described in further detail.
[0018] 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 a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0019] It should be noted that if the embodiments of the present invention involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a specific posture. If the specific posture changes, the directional indicators will also change accordingly.
[0020] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the use of "and / or" or "and / or" throughout the text includes three parallel solutions. For example, "A and / or B" includes solution A, solution B, or a solution where both A and B are satisfied simultaneously. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0021] This application discloses a method for detecting leaks in urban pipeline networks.
[0022] Please refer to Figure 1 The urban pipeline leakage detection method proposed in this embodiment includes steps S10 to S40: Step S10: Multi-source time-series data is collected through multiple pipeline nodes set up on the urban pipeline network. Time-delay correlation analysis is performed on the multi-source time-series data to obtain the time-delay correlation matrix. Then, causal reasoning is performed on the time-delay correlation matrix to obtain the initial causal graph structure.
[0023] It should be noted that urban pipe network refers to the urban underground network system composed of facilities such as pipes, valves, and pumping stations used to transmit media such as water and gas, while pipe network node refers to the specific location point set in the urban underground network system for installing sensors and collecting data and monitoring status.
[0024] By deploying multiple pipeline nodes at key locations in the urban pipeline network to collect multi-source time-series data, and learning the target causal structure between pipeline nodes based on the multi-source time-series data, a structure that can adaptively reflect the intrinsic relationship structure of the real physical connection and dynamic hydraulic interaction of the urban pipeline network is constructed. This replaces the traditional static modeling method that relies on manual experience or fixed formulas, and lays a data-driven analytical foundation for solving the problem of poor adaptability of existing technologies.
[0025] This step extracts and quantifies directional causal dependencies between different pipeline node states from real-world, potentially noisy, and complex time-series data. Rather than relying on superficial statistical correlations, this provides a physically meaningful reasoning framework for the entire urban pipeline leak detection system. It yields a benchmark map characterizing the causal interaction patterns under the healthy state of the urban pipeline network. The generated target causal structure not only adapts to changes in different urban pipeline topologies and operating conditions, but more importantly, it captures the inherent, asymmetric influence mechanisms between parameters such as pressure and flow. This allows subsequent anomaly detection to focus on the disruption of this fundamental relationship, rather than fluctuations in individual parameters. Consequently, it significantly improves the ability to identify minute leaks and complex disturbances. Furthermore, it provides indispensable and highly reliable physical constraints and reasoning basis for ultimately tracing back to the leak source along a credible causal path when an anomaly occurs.
[0026] The specific process for processing multi-source time-series data to obtain the initial cause-effect graph structure is as follows: Based on multi-source time-series data, the time-delay correlation between the multi-dimensional feature vectors corresponding to any two different pipeline nodes is calculated. For example, for a pair of pipeline nodes (i, j), based on the extracted and constructed multi-source time-series data, the feature dimensions with clear physical meaning and sensitive to system dynamics in the fused time-domain and frequency-domain multi-dimensional feature vectors corresponding to each pipeline node are directly selected as core features. For example, the pressure mean feature representing the overall pressure level and the specific frequency band acoustic energy feature representing the energy distribution of a specific leakage frequency band are selected as core features. The selected core feature time series X(t) of pipeline node i over a historical period is taken, and the same core feature time series Y(t) of pipeline node j in the corresponding time period is taken. For each possible time offset, i.e., time delay k, the sequence X(t) and the sequence Y(t+k) are aligned and their normalized cross-correlation coefficient is calculated. This cross-correlation coefficient is obtained by dividing the covariance of the two sequences in the overlapping part by the product of their respective standard deviations. The formula is as follows: The process involves summing up all valid overlapping time points. and Let R_xy(k) and R_y(k) represent the mean and standard deviation of the sequence, respectively. By systematically traversing all possible time delays k (the range of which is usually set based on prior knowledge such as the hydraulic propagation time of the pipeline network), we find the specific time delay value that maximizes the cross-correlation coefficient R_xy(k). This value is the desired time delay. And the maximum value R_xy( The state change of node i is directly used as the time-delay correlation between node i and node j. This time-delay correlation, together with its corresponding time delay τ, characterizes the correlation pattern and strength in which the state change of node i precedes the state change of node j. This calculation process traverses all pairs of nodes and finally yields a matrix, where the elements in the i-th row and j-th column represent the state change of node i at a specific time delay. The linear correlation strength between the current state of pipeline node j and the current state of pipeline node j is the first correlation matrix. This matrix quantifies and compresses the spatiotemporal correlation patterns contained in multi-source time-series data into a matrix that intuitively expresses the strength and directionality of the influence relationship between any two pipeline nodes in the urban pipeline network (through time delay). The first correlation matrix generated by the positive and negative signs and magnitude of the data not only captures the degree of correlation between pipeline nodes, but more importantly, by introducing time delays, it reveals the temporal clues of potential causal relationships, providing preliminary correlation information driven by data for subsequent causal inference.
[0027] It should be noted that the preset pipeline node constraints refer to the restrictive conditions based on the prior physical knowledge of the urban pipeline system. These preset pipeline node constraints include known water flow direction (such as irreversible flow from water plant to user), the forced control logic of specific equipment (such as valves and pumping stations) on the flow direction, and the pipeline connection relationship determined by the pipeline geographic information system.
[0028] When performing causal inference based on the aforementioned pre-defined pipeline node constraints, the time-delay correlation between pipeline nodes reflected in the first correlation matrix is used as input. An undirected graph skeleton describing the association between multi-source time-series data corresponding to each pipeline node is constructed based on the time-delay correlation. Then, edge orientation is determined by methods such as identifying V-shaped structures. During this process, the pre-defined pipeline node constraints are imported as mandatory rules for the orientation stage. For example, when determining the direction of an edge, if the pre-defined pipeline node constraints explicitly stipulate that the flow from pipeline node A to pipeline node B is the only allowed direction, then the edge will be directly assigned the direction from A to B, while exploring the opposite direction will be prohibited. Alternatively, if the preset network node constraints indicate that there is no physical connection between two network nodes, then the connection will be removed from the skeleton in the initial stage. The final output is a directed graph that conforms to both data correlation and the hard rules of network physical flow and connection, which is the initial causal graph structure. This ensures that the preliminary causal graph structure learned from multi-source time series data has basic physical rationality and directional correctness, effectively filtering out pseudo-causal relationships that are physically impossible due to data noise or indirect correlation. This provides a causal hypothesis model that is physically reliable and can serve as a solid starting point for further optimization and stability screening in subsequent steps.
[0029] Step S20: Based on the physical topology of the urban pipeline network, the initial causal graph structure is constrained and optimized. After obtaining the optimized causal graph structure, the edges in the optimized causal graph structure that have a frequency exceeding a preset frequency are determined as causal edges, and the target causal structure is obtained.
[0030] It should be noted that the physical topology of urban pipe networks refers to the network diagram of urban pipe networks composed of actual physical components such as pipes, valves, and pumping stations and their actual connections. It describes the possible flow paths of fluids in space, and clarifies which pipe network nodes are physically directly connected and which are not directly connected. It is directly determined by engineering design drawings or geographic information systems. On the other hand, the optimized causal graph structure refers to the causal directed graph obtained after cleaning and adjusting the physical topology constraints of the pipe network. It is structurally more consistent with the possibility of physical connections of urban pipe networks.
[0031] Using the initial cause-effect graph structure as input, it is compared and verified against the known pipeline physical topology. For example, each edge in the initial cause-effect graph (e.g., the edge from pipeline node A to pipeline node B) is traversed, and it is checked whether there is a physical path between pipeline node A and pipeline node B that allows the direct or indirect transmission of information or influence in the pipeline physical topology. That is, whether they are directly connected by pipelines or connected through a series of pipelines and valves. If the two nodes are not connected at all in the pipeline physical topology, then this edge is physically impossible and belongs to a spurious correlation or indirect correlation generated by data inference. Therefore, this edge is deleted from the initial cause-effect graph; otherwise, it is retained.
[0032] After the above steps of screening and pruning, the resulting directed graph retains all physically possible edges, which is the optimized causal graph structure. This ensures that every edge in the optimized causal graph structure used to represent the causal relationships between network nodes has a physically realizable basis, providing a reasonable structural starting point for subsequent stability screening and avoiding subsequent analysis and leakage reasoning based on physically absurd causal relationships.
[0033] It should be noted that causal stability refers to the property that a causal relationship from pipeline node A to pipeline node B can be continuously and repeatedly inferred in different time periods. It measures that the causal relationship is an inherent and robust characteristic of the system, rather than a pseudo-association caused by short-term data fluctuations or accidental factors. Causal edge, on the other hand, refers to an edge that is identified as having high stability in the stability screening.
[0034] The specific screening implementation involves dividing the long-span multi-source time-series data into multiple continuous or partially overlapping sliding windows on the time axis. For example, a year's data can be divided into multiple time windows by month or week. For the data within each time window, the complete process described above is independently repeated to generate a corresponding optimized causal graph structure for each time window. Then, the frequency of each possible edge appearing in the optimized causal graph structures of all time windows is counted. Edges with a frequency exceeding a preset stability threshold, such as those appearing in more than 80% of the time windows, are identified as causal edges. Finally, a target causal structure is constructed based on these selected causal edges.
[0035] In this step, through repeated verification over time, unstable causal connections that may be physically possible but only occur at certain random times or under specific operating conditions are further filtered out from the optimized causal graph structure that has been verified for physical feasibility. This ensures that the final target causal structure only contains causal dependencies that persist over long periods of operation and reflect the inherent physical mechanisms and dynamic laws of the urban pipeline network system. This ensures that subsequent anomaly detection and leak location are based on stable causal patterns, improving robustness and accuracy.
[0036] Step S30: Construct a computation graph based on the target causal structure, and integrate the feature solutions output by the preset equation into the graph neural network of the computation graph for training to obtain a node causal reasoning model.
[0037] By integrating the feature solutions output by the preset equations into the training process of the graph neural network in the computation graph, the model, during parameter optimization, must not only fit the node state changes reflected by multi-source time-series data but also satisfy the physical operating laws described by the preset equations. This embeds physical priors into the model's message passing and state update mechanisms in the form of soft or hard constraints, enabling the graph neural network to perform directed and physically-based information aggregation and feature learning along the causal path defined by the target causal structure. The resulting node causal inference model not only retains the stable causal topology represented by the target causal structure but also possesses physical consistency due to the integration of the feature solutions output by the preset equations. This allows the model to maintain reliable causal inference capabilities under different operating conditions, noise interference, and data fluctuations, significantly improving the model's generalization performance and the physical credibility of the output results. This provides an accurate and robust inference foundation for subsequently using the model to generate real-time causal relationship graphs and detect causal anomalies.
[0038] This process involves mapping causal nodes in the target causal structure to graph vertices in the computational graph, and mapping causal edges in the target causal structure to directed edges connecting the corresponding graph vertices. This transforms the learned topology reflecting stable causal dependencies between network nodes into structured graph data that can be directly processed by a graph neural network. During this mapping process, attention weighting is applied to each graph vertex and directed edge. The attention weighting of graph vertices typically assigns static importance weights based on prior information such as the topological centrality of network nodes in the target causal structure. The attention weighting of directed edges, on the other hand, assigns initial weights reflecting the strength of causal connections based on the analyzed time-delay correlations. This forms an initial computation graph containing causal topology, orientation, and prior importance. After obtaining the initial computation graph, a graph attention mechanism is applied to each directed edge for dynamic attention weighting. Specifically, the feature representations of the graph vertices at both ends of each directed edge are transformed by a learnable shared linear transformation, and the transformed feature representations are input into a single-layer feedforward neural network to calculate the attention score. Then, the attention scores of all directed edges pointing to the same target vertex are normalized using softmax to obtain the normalized dynamic attention coefficient. The static weights of the directed edges in the initial computation graph are replaced or superimposed with this dynamic attention coefficient to generate the computation graph.
[0039] Step S40: Input multi-source time series data into the node causal inference model, obtain the real-time causal relationship graph between each pipeline node, and detect whether there is a causal anomaly based on the graph structure difference between the real-time causal relationship graph and the preset causal relationship graph.
[0040] The acquired multi-source time-series data is fed into the node causal inference model to generate a real-time causal relationship graph. Causal anomalies are detected based on the graph structure difference between this real-time causal relationship graph and the preset causal relationship graph. This transforms the criterion for leak detection from the single parameter threshold or statistical correlation index relied upon by traditional methods to the monitoring of the causal interaction topology of the urban pipeline network. This enables robust causal anomaly perception of the urban pipeline network. Using the constructed node causal inference model that can simulate the normal causal logic of the urban pipeline network, the dynamically changing multi-source time-series data is transformed into a real-time causal relationship graph reflecting the actual causal state between each pipeline node at the current moment. By calculating the degree of difference in topology between this real-time causal relationship graph and the preset causal relationship graph as a benchmark, the complex problem of "whether there is a leak" is transformed into a computable and quantifiable discrimination problem of "whether the inherent causal law of the system has been destroyed". This allows the leak detection process to effectively filter out random interference and normal operating condition fluctuations that only cause data fluctuations but do not shake the fundamental causal relationship of the system.
[0041] In step S50, if there is a causal anomaly, the path tracing and leakage inference of the urban pipeline network are performed based on the causal anomaly to obtain the location information of the leakage location.
[0042] After confirming the existence of a causal anomaly, path tracing and leakage inference are performed on the urban pipeline network based on the causal anomaly to obtain location information. This breaks through the bottleneck of the existing system that can only alarm but is difficult to locate accurately. The information that the causal structure of the system is destroyed, which is found in the detection process, is transformed into specific leakage location information in the urban pipeline network. This completes the decision-making closed loop from "perceiving the anomaly" to "locating the source", and provides a direct basis for subsequent maintenance and disposal.
[0043] In this step, the target causal structure is used as a map for directional reasoning, and a real-time causal relationship graph is used as a clue for tracing the source. By directionally tracing back the propagation path of abnormal influences in the preset causal relationship graph, the most likely source node causing the failure of these causal relationships is deduced, thereby realizing the spatial location of the leak. After this step, an interpretable and convincing leak location can be output because it does not rely on fuzzy signal strength or simple geometric interpolation, but is based on logical reasoning based on a deep understanding of the inherent causal mechanism of the urban pipeline network. This reasoning naturally includes the topological constraints of the pipeline network and the directionality of influence propagation, so that the location result is not only a coordinate, but also comes with a causal explanation chain of "why it is located here", which significantly improves the physical rationality and accuracy of the location result, effectively solves the problem of fuzzy location caused by the complexity of the urban pipeline network and signal attenuation, and finally makes the detection method have complete practical value that can directly guide operation and maintenance actions.
[0044] In one feasible implementation, refer to Figure 2As shown, step S10 may specifically include steps S11 to S13: Step S11: Based on the multi-modal sensor array set at each pipeline node, collect pressure signals, vibration signals, sound signals and flow information at each pipeline node to form initial multi-source data.
[0045] By integrating and deploying a multimodal sensor array consisting of pressure sensors, vibration sensors, acoustic sensors, and flow meters at each pipeline node, the pressure sensors continuously monitor transient and steady-state pressure changes within the pipeline. The vibration sensors detect mechanical vibrations in the pipeline wall caused by changes in fluid state or leakage. The acoustic sensors capture acoustic emission signals within a specific frequency range generated by leakage. The flow meters measure the inflow and outflow of the pipeline. These heterogeneous sensors perform synchronous or triggered data acquisition under unified time base control, thereby acquiring four types of data streams with different physical meanings and time-frequency characteristics—pressure signals, vibration signals, acoustic signals, and flow information—in parallel at each pipeline node. These data streams are aligned and integrated in the time dimension to form the initial multi-source data for the corresponding pipeline node. This provides a diversified data foundation with complementary information and mutual verification for subsequent causal learning and anomaly detection.
[0046] Because the occurrence and development of a leak event can simultaneously trigger responses with different characteristics in multiple physical dimensions such as pressure, vibration, acoustics, and flow, single-type data may be affected by other unrelated operating conditions or have blind spots in perception. However, the synchronous acquisition and fusion of multimodal data can ensure that clues to leaks are captured from different perspectives. This allows subsequent analysis to comprehensively utilize evidence from multiple aspects, such as the macroscopic trend of pressure drop, subtle changes in the vibration spectrum, the appearance of specific acoustic features, and anomalies in flow balance. This greatly enhances the completeness, robustness, and early detection capability of leak event perception, and provides multidimensional information input for reliably learning stable causal physical relationships between pipeline network nodes from the data.
[0047] Step S12: Perform timestamp alignment and outlier filtering on the initial multi-source data to obtain a multi-source data sequence.
[0048] The timestamp alignment operation aims to solve the problem of micro-time asynchrony between data in multimodal sensor arrays caused by independent sampling clocks of various sensors, different data transmission delays, or network jitter. By deploying high-precision synchronous clock modules on the pipeline node side, such as using PTP or GPS time synchronization, a unified time tag is added to each sampled data point. Then, in the data processing center, the data collected by all sensor channels (pressure, vibration, sound wave, flow) are interpolated or resampled based on this time tag, aligning them to a common time reference axis, thereby ensuring that multiple data used for analysis at any given time correspond to the same physical time.
[0049] After completing timestamp alignment, outlier filtering is then performed to identify and remove abnormal data points that deviate significantly from normal physical processes and statistical laws due to factors such as sensor momentary failures, electromagnetic pulse interference, and non-leakage-related external shocks (such as traffic vibrations). For example, for the data of each sensor, the mean and standard deviation of its data are calculated within a time window, and data points that significantly exceed several times the standard deviation range are identified as outliers. These outliers are then replaced by robust statistics within the time window (such as the median) or by linear interpolation of valid data points before and after, thereby obtaining a smooth and continuous multi-source data sequence.
[0050] Through the above two steps, the initial multi-source data, which may contain time misalignment and gross errors, is transformed into a set of multi-source data sequences that are strictly synchronized in time and reliable and clean in numerical value. This lays an accurate and consistent time-series foundation for subsequent time-domain / frequency-domain feature extraction, especially time-delay correlation analysis across pipeline nodes and across modes. It avoids false phase differences or causal inference errors caused by time asynchrony, as well as misjudgments of the true dynamics of the system caused by abnormal noise points. This ensures that the target causal structure learned from the data can truly reflect the inherent physical relationships of the urban pipeline network, rather than artifacts introduced by data acquisition defects.
[0051] Step S13: Perform time-domain feature extraction and frequency-domain transformation on the multi-source data sequence to obtain multi-source time-series data.
[0052] Temporal feature extraction involves calculating a set of statistical and shape features within a sliding time window for the temporal signals of each synchronized and aligned data sequence (pressure, vibration, sound waves, flow rate) to characterize the variation pattern of the temporal signals in the time dimension. For example, it calculates the mean (reflecting the average level), standard deviation (reflecting the intensity of fluctuations), skewness and kurtosis (reflecting the distribution shape), zero-crossing rate (reflecting the signal oscillation frequency), and short-time energy or average amplitude calculated through signal differentiation within each sliding time window. This transforms the multi-source data time series into a low-dimensional but information-condensed temporal feature vector composed of multiple temporal signals arranged in chronological order.
[0053] Simultaneously, frequency domain transformation processing is performed to convert the time-domain signal to the frequency domain, revealing the distribution and intensity of different frequency components in the signal. For example, a fast Fourier transform is used to transform the time-domain signal within the same sliding window, calculate its amplitude spectrum or power spectral density, and further extract frequency domain features such as dominant frequency, spectral centroid, spectral bandwidth, or energy proportion of specific frequency bands (e.g., frequency bands sensitive to leakage acoustic emission signals) from the spectrum, thereby obtaining the corresponding frequency domain feature time series.
[0054] Subsequently, the time-domain feature vectors and frequency-domain feature vectors within each sliding window are concatenated and fused according to timestamps to form a multi-source time-series data that corresponds to a multi-dimensional feature vector at each sampling moment. This transforms the sensor reading stream, which may contain a large amount of information unrelated to the leakage state, into a set of feature time series that more sensitively and directly reflects changes in the system state (including potential leakage states) in both the time and frequency domains. These feature time series significantly enhance the data's representational capabilities, enabling subsequent processing to focus more on signal patterns closely related to the system's physical mechanisms. This greatly improves the efficiency, robustness, and accuracy of learning stable causal structures from multi-source time-series data.
[0055] Among them, multi-source time-series data represents a multi-dimensional feature vector corresponding to each pipeline node at each moment, which includes time-domain and frequency-domain features of pressure, vibration, sound waves, and flow.
[0056] In one feasible implementation, refer to Figure 3 As shown, step S30 may specifically include steps S31 to S35: Step S31: After mapping the causal nodes in the target causal structure to graph vertices and mapping the causal edges in the target causal structure to directed edges, attention weighting is applied to the graph vertices and directed edges to obtain the initial computation graph.
[0057] Traverse all causal nodes in the target causal structure, instantiate a graph vertex for each causal node, and initialize a feature vector for the graph vertex. This feature vector contains basic attribute information such as the type of network node, so that each causal node has a unique identifier and a carrier for storing state in the computation graph.
[0058] Furthermore, it iterates through all causal edges in the target causal structure. Based on the causal node pairs connected by each causal edge and the causal direction indicated by the edge, a directed edge is created between the corresponding two graph vertices. The direction of this directed edge is consistent with the direction of the causal edge, i.e., from the graph vertex corresponding to the causal node as the cause to the graph vertex corresponding to the causal node as the effect. Thus, while completely preserving the topological connections and directional information of the target causal structure, it transforms the target causal structure into a graph data structure. After mapping, attention weighting is applied to the graph vertices and directed edges. It should be noted that this attention weighting is not the process of dynamically calculating attention coefficients during graph neural network training, but rather... The static weight initialization based on prior knowledge specifically involves calculating the attention weight of each graph vertex based on the topological centrality of each causal node in the target causal structure. This represents the basic importance of the network nodes corresponding to each causal node in the causal propagation path. Simultaneously, the time-delay correlations corresponding to each causal edge obtained from the aforementioned analysis are used as the initial attention weights of each directed edge to represent the initial strength of the causal connection represented by each causal edge. This assigns the graph vertices and directed edges an importance prior reflecting the physical structure of the network and the characteristics of causal connections. All graph vertices and directed edges carrying attention weights are combined to form a weighted directed graph, which is the initial computation graph.
[0059] Step S32: Perform dynamic attention weighting on each directed edge in the initial computation graph to generate an attention-weighted computation graph.
[0060] Based on the constructed initial computation graph, an adaptive weight calculation and update process based on graph attention mechanism is introduced for each directed edge to replace or superimpose the initial attention weights assigned by static prior knowledge in the initial computation graph.
[0061] Specifically, for each directed edge in the initial computation graph, the feature representations of the two graph vertices corresponding to the two ends of the directed edge are first obtained. In the early stage of training, these feature representations can be initialized as the feature vectors corresponding to the multi-source time-series data extracted in the previous steps. Then, the feature representations of the graph vertices corresponding to the two ends of each directed edge are linearly transformed through a learnable shared linear transformation matrix. The parameters of this shared linear transformation matrix are iteratively updated during training, thereby mapping the graph vertex feature representations of different dimensions to a unified feature space suitable for calculating the attention coefficient. After the linear transformation, the transformed source graph vertex feature representations are combined with the target graph vertex feature representations through concatenation or subtraction, and the combined result is input into a single-layer feedforward neural network, which outputs a scalar. The numerical value, which is the original attention score of the directed edge, is used to measure the importance of the information that the target graph vertex should receive from the source graph vertex under the current graph vertex feature representation state. Since the causal information represented by all directed edges connected to the same target graph vertex in the initial computation graph needs to be compared and aggregated under the same dimension, it is necessary to normalize the original attention scores corresponding to all directed edges pointing to the same target graph vertex. Specifically, the softmax function is used to calculate the original attention scores of all directed edges connected to the same target graph vertex, so that the sum of the attention coefficients of all directed edges pointing to the target graph vertex after normalization is a constant value. These normalized coefficients are the final dynamic attention weights of each directed edge.
[0062] After calculating the dynamic attention weights for all directed edges, these dynamic attention weights replace the initial attention weights assigned by the static prior in the initial computation graph, or the dynamic attention weights are weighted and superimposed with the initial attention weights to obtain a weighted computation graph in which each directed edge carries an attention weight that changes dynamically with the input data.
[0063] Step S33: Use a network neural network to perform forward propagation on the attention-weighted computation graph, calculate the predicted state value of each graph vertex, and extract the characteristic line method solution input to the hydraulic transient equation from the predicted state value to calculate the physical residual term.
[0064] The attention-weighted computation graph generated in the previous step is used as the input to the graph neural network. The initial feature representation carried by each graph vertex comes from the multi-source time-series data extracted in the previous step. The graph neural network is composed of multiple graph attention layers stacked together. In each layer, for each target graph vertex, the feature representations of all its neighboring graph vertices are weighted and aggregated according to the attention coefficient. The aggregation result is then transformed by a nonlinear activation function to obtain the updated feature representation of each target graph vertex in the current layer. After multiple iterations, the final feature representation of each graph vertex is the predicted state value of that graph vertex. This predicted state value contains physical quantity dimensions directly related to the hydraulic transient equation, such as head and flow rate.
[0065] After obtaining the predicted state values of each graph vertex, for each directed edge in the attention-weighted computation graph, the dimensions corresponding to head and flow rate in the predicted state values of the graph vertices at both ends of the directed edge are extracted. These physical quantities are substituted into the characteristic line method solution of the hydraulic transient equation for calculation. The characteristic line method transforms the hydraulic transient partial differential equation describing the transient flow in the pipeline into an ordinary differential equation along the characteristic line. Based on the head and flow rate of the upstream and downstream nodes of the pipeline, the theoretical state values that satisfy the physical laws are calculated along the positive and negative characteristic lines respectively. The difference between the theoretical state value and the predicted state value of the graph neural network is taken as the physical residual term on the directed edge. Then, the physical residual terms on all directed edges are summarized, for example, by calculating the sum of squares or norm of all physical residual terms, to obtain the physical residual terms on the entire attention-weighted computation graph.
[0066] Step S34: The norm of the physical residual term is added as a regularization term to the prediction loss function of the graph neural network to form a composite loss function.
[0067] The prediction loss function is used to measure the deviation between the predicted state value output by the graph neural network and the actual observed state value. It can take the form of mean squared error or mean absolute error. The prediction loss function is obtained by taking the difference between the predicted state value and the corresponding actual observed value of each vertex of the graph, squared the difference, and then taking the average.
[0068] Meanwhile, the physical residual term is the deviation obtained by substituting the predicted state value of the graph neural network into the characteristic line method solution of the hydraulic transient equation. Taking the norm of this physical residual term, we can use the L2 norm, which is the arithmetic square root of the sum of squares of each residual component, or the Frobenius norm, to obtain the scalar physical quantity constraint loss that characterizes the degree to which the prediction result violates the physical laws.
[0069] The norm of the physical residual term is weighted and superimposed with the prediction loss function. That is, the product of the norm of the physical residual term and the preset physical weight coefficient is added to the prediction loss function. The preset physical weight coefficient is used to balance the data fitting accuracy and the degree of satisfaction of physical laws. Its value can be adjusted according to the relative magnitude of the two losses during training. The expression after superposition is the composite loss function.
[0070] Step S35: Iteratively train the graph neural network until convergence based on the composite loss function to obtain the node causal inference model.
[0071] By using the composite loss function as the training objective, the learnable parameters of the graph neural network are iteratively optimized.
[0072] Before training begins, all learnable parameters in the graph neural network are initialized, including the shared linear transformation matrix, the weight parameters in the attention coefficient calculation network, and the weights and bias parameters in each graph attention layer. Multi-source time-series data under normal historical operating conditions are divided into multiple training batches according to time windows. Each training batch contains data samples from several time windows, and each data sample corresponds to the input feature representation of each vertex in the attention-weighted computation graph.
[0073] In each training iteration, a batch of training data samples is input into the graph neural network. The graph neural network performs forward propagation layer by layer along the attention-weighted computation graph. In the graph attention layer, the feature representations of each neighboring graph vertex are weighted and aggregated according to the dynamic attention weights, and the feature representations of each graph vertex are updated after being transformed by a nonlinear activation function. After multiple propagations, the predicted state values of each graph vertex are output.
[0074] Next, the predicted loss is calculated based on the predicted state values and the actual observed state values. The physical residual term is then calculated using the characteristic line method solution of the hydraulic transient equation, substituted with the predicted state values. Finally, the predicted loss and the physical residual term are weighted and superimposed according to the norm of the composite loss function to obtain the composite loss value for the current training batch. The gradient of the composite loss value with respect to each learnable parameter of the graph neural network is calculated using the backpropagation algorithm. An adaptive moment estimation optimizer is then used to update the parameters based on the gradient. The learning rate can be set to an initial value and decays according to a preset strategy as the training progresses, balancing the convergence speed in the early stages of training with the stability in the later stages.
[0075] Repeat the forward propagation, composite loss calculation, backpropagation, and parameter update process, traversing all training batches and looping multiple iteration cycles until the composite loss function converges. The convergence condition is that the change in the composite loss value within multiple consecutive iteration cycles is less than a preset threshold or reaches the preset maximum number of iterations. At this point, the parameters of the graph neural network no longer change significantly, indicating that the model has reached a balance between data fitting and physical law constraints. The trained graph neural network is then used as a node causal inference model.
[0076] Through the above iterative training process, the node causal reasoning model finds the optimal solution in the parameter space that simultaneously satisfies the fitting accuracy of multi-source time series data and the physical consistency of hydraulic transient equations. Its most important effect is that the model can accurately deduce the state changes of each pipeline node based on the target causal structure under complex working conditions, and generate a real-time causal relationship graph that conforms to physical laws. This provides a reliable reasoning basis for subsequent detection of causal anomalies based on the graph structure difference between the real-time causal relationship graph and the preset causal relationship graph.
[0077] In one feasible implementation, refer to Figure 4 As shown, step S40 may specifically include steps S41 to S46: Step S41: Input multi-source time series data into the node causal inference model for forward propagation calculation to obtain the real-time state embedding vector of each pipeline node.
[0078] It should be noted that the real-time state embedding vector is a fixed-dimensional numerical vector calculated internally by the node causal inference model. It is a deep feature representation of the corresponding pipeline node at the current moment, aiming to condense and encode the comprehensive information of the pipeline node reflected by multi-source time series data in the physical state and causal context.
[0079] In the specific calculation, the multi-source time-series data within the current time window, obtained through preprocessing and feature engineering, is used as input and fed into the trained node causal inference model. The input of each pipeline node first passes through the nonlinear transformation layer in the node causal inference model. Then, the node causal inference model aggregates the feature information of adjacent pipeline nodes along the directed edges in the physical augmentation computation graph according to dynamically calculated attention weights, and corrects the aggregation result in combination with physical constraints. This process iterates sequentially in multiple graph neural network layers of the node causal inference model, with each layer updating the feature representation of the pipeline node to incorporate more features. The contextual information comes from its causal neighbors; after the final layer of calculation, the final feature vector corresponding to each pipeline node is the real-time state embedding vector. In this way, multi-source time series data that may contain noise is transformed into a set of low-dimensional, dense and semantically rich real-time state embedding vectors through a node causal reasoning model that embeds stable causal topology and physical priors. These real-time state embedding vectors not only capture the state of the pipeline node itself, but also encode its local structural relationship in the causal network and the state affected by it, thus providing a direct, effective and interpretable mathematical object for the next step of calculating the causal strength between pipeline nodes.
[0080] Step S42: Calculate the similarity measure between pairwise real-time state embedding vectors to obtain the causal strength between pairwise network nodes.
[0081] It should be noted that similarity measurement is a calculation function used to quantify the degree of proximity or correlation between two real-time state embedding vectors in the middle of a mathematical space. In this embodiment, the cosine similarity algorithm is typically used. This algorithm evaluates the consistency of the directions by calculating the cosine value of the angle between two real-time state embedding vectors. Its value range is [-1, 1]. The closer the value is to 1, the more similar the directions of the two real-time state embedding vectors are and the stronger the correlation.
[0082] In this embodiment, the causal strength is a scalar value, calculated using the aforementioned similarity metric. It directly quantifies the instantaneous strength of the causal influence or association from one network node to another at a specific moment. Specifically, the calculation iterates through the real-time state embedding vectors of all network nodes obtained in step S31. For any two different network nodes i and j, their corresponding real-time state embedding vectors are taken, and the cosine similarity between them is calculated. The resulting scalar value is defined as the causal strength from network node i to network node j. This transforms the real-time state embedding vector output in step S31 into an explicit and interpretable causal strength, thus successfully decoding the internal state representation of the model into a quantitative indicator that can be used to evaluate the current causal interaction mode of the system.
[0083] Step S43: Combine each causal strength with the directed edges corresponding to the two network nodes to which each causal strength belongs to calculate the real-time causal relationship graph.
[0084] It should be clarified that the directed edges corresponding to the two network nodes to which each causal intensity belongs refer to the causal edges in the target causal structure established in step S17 that connect two specific network nodes and have a clear direction. These directed edges are abstract representations of predetermined and stable causal relationships.
[0085] First, each directed edge in the target causal structure is traversed. Each directed edge uniquely connects two specific network nodes. Based on the starting and ending network nodes connected by the directed edge, the causal strength value corresponding to the two network nodes is found and extracted from the causal strength output in step S32. This value is then used as the weight value of the directed edge in real-time calculation and assigned to the edge. After traversing all directed edges and assigning weights, a real-time causal relationship graph is generated, which retains the topological connection relationship between all network nodes and directed edges in the target causal structure, but each edge carries a real-time dynamic weight. The set of nodes contained in this real-time causal relationship graph is the real-time node (the same as the nodes in the target causal structure), and the set of weighted directed edges contained in it is the real-time edge. Together, they constitute the real-time causal set. The generated real-time causal relationship graph can accurately depict the causal interaction state of the system at the current moment, thus providing a direct, accurate, and structurally consistent input for the next step of comparing the graph structure differences with the preset stable causal set.
[0086] Step S44: Compare the differences between the real-time causal set and the preset causal set to obtain the edge set difference record. Then, perform a weighted summation of the edge set difference record and the first preset edge weight coefficient to obtain the graph structure difference degree.
[0087] It should be noted that the edge set difference record is a structured list or set used to record all topological differences found when comparing the real-time causal set with the preset causal set. Specifically, this includes newly added edges (i.e., those that exist in the real-time causal set but not in the preset causal set), missing edges (i.e., those that exist in the preset causal set but not in the real-time causal set), and edges whose weights have changed significantly (i.e., those that exist in both the real-time causal set and the preset causal set, but whose absolute difference in weight exceeds a preset threshold).
[0088] The first preset edge weight coefficient is a positive scalar value pre-assigned to each directed edge in the preset causal set. This first preset edge weight coefficient is usually calculated based on metrics in network science (such as edge betweenness centrality) and reflects the connectivity importance of the corresponding directed edge in the entire network causal topology. If a directed edge is located on many critical causal paths, its weight coefficient is higher.
[0089] Specifically, based on the preset causal set, each directed edge in it is traversed to check whether it exists in the real-time causal set and its weight value; at the same time, it is also checked whether there are any edges in the real-time causal set that are not in the preset causal set, and all the check results (including the edge identifier and change type, such as "disappeared", "significant change" or "new addition") are recorded in the edge set difference record.
[0090] Next, for each item in the edge set difference record, a basic difference score is assigned according to its change type. This score is then multiplied by the first preset edge weight coefficient corresponding to the edge involved in that item in the preset causal set. Finally, the weighted scores of all items are summed to obtain a comprehensive scalar value, namely the graph structure difference degree. By transforming the topological difference between two sets into a comprehensive numerical index, this index not only reflects the amount of change but also, by introducing the first preset edge weight coefficient, assigns different importance to changes at different locations. That is, the disappearance of an edge on a critical causal path is far more indicative of system anomaly than a change in an edge connection. Thus, the final graph structure difference degree becomes a reliable measure that can accurately reflect the overall degree of anomaly in the causal topology of the pipeline network.
[0091] Among them, the preset causal set corresponds to the target causal structure composed of causal edges established in step S17. It is a reference directed graph learned from historical normal data and used to describe the inherent causal relationship of the pipeline network system.
[0092] Step S45: After weighted summation of the weights of the preset edge and the second preset edge to obtain the physical constraint difference, multi-dimensional difference fusion of the graph structure difference and the physical constraint difference is performed to obtain the comprehensive difference.
[0093] It should be noted that the second preset edge weight is a set of positive scalar values that are pre-assigned to each directed edge in the preset causal set, and are different from the first preset edge weight coefficient. It does not reflect the structural importance of the edge in the network topology, but rather characterizes the expected stability or importance of the causal relationship represented by the edge in satisfying specific physical constraints (such as mass conservation and energy equations based on hydraulic models). If there is strong physical coupling between the network nodes connected by an edge (such as two nodes directly connected by a short pipe), its second preset edge weight is usually higher.
[0094] When calculating the physical constraint difference degree, it is based on the edge set difference record obtained in the above steps. For each edge that has changed in the edge set difference record, its corresponding change measure (such as the absolute value of the weight change or a Boolean value representing the occurrence of the change) is multiplied by the second preset edge weight corresponding to the edge in the target causal structure. Then, the products of all terms are summed, and the resulting scalar value is the physical constraint difference degree, which quantifies the degree of anomalousness of the current causal structure change in terms of physical law conformity.
[0095] Next, multi-dimensional difference fusion is performed, and the graph structure difference degree and physical constraint difference degree are normalized separately. Based on a large number of historical graph structure difference degree sample values calculated and accumulated under long-term normal operating conditions, the statistical distribution of the historical graph structure difference degree sample values is calculated, such as its mean. and standard deviation For the graph structure difference degree calculated in real time, it is expressed by the formula. The graph structure differences are standardized using Z-scores, converting them into a scalar with a mean of 0 and a standard deviation of 1, thus normalizing the graph structure difference degree. Similarly, based on a large number of historical physical constraint difference degree sample values accumulated under long-term normal operating conditions, their mean is calculated. and standard deviation For the physical constraint difference calculated in the current step, the formula is used. The physical constraint difference is standardized using the same Z-score, and the physical constraint difference is normalized.
[0096] After the above processing, the graph structure difference and physical constraint difference, two indicators that originally had different dimensions and numerical ranges, are uniformly transformed to a comparable scale with the same statistical standard (zero mean, unit variance). Then, they are linearly combined using a learnable or pre-defined weighted summation formula, for example, ,in and The preset fusion weight coefficient is used to balance the relative importance of topological changes and physical violations in the final judgment. The resulting single scalar value is the comprehensive difference degree.
[0097] Step S46: Compare the overall difference with the preset overall difference to detect whether there is a causal anomaly.
[0098] It should be noted that the preset comprehensive difference degree is a dynamic and adaptively adjustable threshold. It is determined based on multi-source time-series data under long-term normal operating conditions. A large number of historical comprehensive difference degree values are calculated by repeatedly executing steps S31 to S35, and these values are statistically analyzed (e.g., calculating their mean and standard deviation). It is usually represented as a range with a confidence interval (e.g., the mean plus three times the standard deviation). Causal anomaly refers to a state in which the real-time causal relationship graph generated in step S33 deviates significantly and continuously from the normal causal pattern defined by the target causal structure in terms of topological structure (graph structure difference degree) and / or physical law conformity (physical constraint difference degree) due to faults such as pipeline leakage.
[0099] In real-time monitoring, whenever a new comprehensive difference is calculated, it is compared with the currently maintained preset comprehensive difference. If the real-time comprehensive difference exceeds the preset comprehensive difference for multiple sampling periods, it is determined that there is a causal anomaly; otherwise, it is determined that there is no causal anomaly.
[0100] The preset comprehensive difference degree can be periodically recalculated and updated based on normal data within the latest period (when there are no abnormal alarms) to achieve adaptive adjustment. This provides a scientific, dynamic, and reliable judgment benchmark for the comprehensive difference degree calculated above, thereby transforming continuous abnormal measurement values into clear abnormal judgment results. It can effectively adapt to the natural fluctuations of the pipeline system under normal operating conditions in different seasons and time periods, minimize false alarms caused by non-leakage factors that exceed fixed thresholds, and ensure that the entire leak detection method has high sensitivity, as well as extremely high reliability and practicality. Ultimately, it achieves accurate and robust automated identification of true causal structural anomalies caused by urban pipeline leaks.
[0101] In one feasible implementation, refer to Figure 5 As shown, step S50 may specifically include steps S51 to S54: Step S51: Analyze the causal anomalies, identify the abnormal causal edge representations included in the causal anomalies, and obtain the abnormal causal edge set.
[0102] It should be noted that the edge representation of an abnormal causal relationship is a structured description of a causal edge that has experienced an anomaly. It at least includes the unique identifier of the edge in the preset stable causal relationship graph (usually composed of the numbers of its starting and ending network nodes), and may further include the anomaly type (e.g., "disappearance", "significant weakening" or "reversal") and the quantitative value of the degree of anomaly. The parsing process is based on the edge set difference records generated in steps S34 and S35 when the causal anomaly is determined in step S36, as well as the details of each edge change used when calculating the comprehensive difference degree. By traversing and analyzing these records, all specific edge change instances that contribute to the saliency graph structure difference degree or physical constraint difference degree are selected and extracted. Each edge in the edge change instance and its anomaly information are encapsulated into an abnormal causal edge representation. The final set constitutes the abnormal causal edge set.
[0103] Step S52: Obtain the abnormal edges connected to the set of abnormal causal edges in the preset causal relationship graph, and normalize the abnormal edges to obtain the abnormal correlation degree of the preset node connected to the abnormal edge.
[0104] First, traverse each edge in the set of abnormal causal edges. Based on the starting and ending network nodes defined for each edge in the preset stable causal relationship graph, extract all nodes directly connected to these abnormal edges. These nodes are the preset nodes.
[0105] Next, a normalization process is performed. This normalization process specifically refers to a computational process aimed at calculating a standardized initial value of anomaly contribution for each extracted preset node, based on the abnormal edges it is connected to. For example, for each preset node, the number of all abnormal edges directly connected to it is counted, and the anomaly intensity carried by each abnormal edge (e.g., the absolute value or type weight of the edge weight change obtained from the edge set difference record) is accumulated to obtain the initial anomaly value of the preset node. Then, the sum of the initial anomaly values of all preset nodes is used as the denominator, and the initial anomaly value of each preset node is divided to make the sum of the anomaly values of all preset nodes equal to 1. This process is called normalization. After this step, the value between 0 and 1 obtained by each preset node is the anomaly correlation degree, which quantifies the proportion of initial anomaly responsibility that the preset node should bear relative to other nodes due to the anomalies of the causal edges it is directly connected to.
[0106] Step S53: The abnormal correlation degree and the preset abnormal correlation weight are weighted and summed to obtain the weighted abnormal correlation degree of the preset node connected to the abnormal edge.
[0107] It should be noted that the preset anomaly association weight is a static weight coefficient that is pre-assigned to each node in the stable causal relationship graph and is independent of the current anomaly event. It is usually determined based on the physical and topological prior importance of the pipeline node in the pipeline network.
[0108] For example, a network node located in a critical hub position or a historically weak link can be assigned a higher weight based on the node type, historical leakage frequency, or the total volume of the pipelines it connects to. The weighted anomaly correlation degree is a modified node anomaly responsibility measure obtained by further integrating the inherent importance weight of the network node, based on the anomaly correlation degree obtained in step S42, which only reflects the current anomaly edge connection situation.
[0109] The specific weighted summation algorithm is as follows: For each preset node whose abnormal correlation degree is calculated in step S42, its abnormal correlation degree is multiplied by the preset abnormal correlation weight corresponding to that preset node to obtain the initial weighted value of that preset node; then, a general normalization process is performed on the initial weighted values of all preset nodes, which is usually to calculate the sum of the initial weighted values of all preset nodes, that is, to traverse each preset node obtained in step S42, add up all the calculated initial weighted values to obtain a total value, and for each preset node, its individual initial weighted value is divided by this total value. The resulting value is the weighted abnormal correlation degree of that preset node after the normalization process. After this division operation, the weighted summation of all preset nodes is... The sum of the anomaly correlations is exactly equal to 1, thus transforming these values into a probability distribution. This allows the weighted anomaly correlation of each node to represent its relative proportion of anomaly responsibility among all nodes, providing a standardized and comparable input for updating the anomaly impact value in subsequent steps. This makes subsequent location inference more intelligent and realistic. For example, a pipeline node that is a key hub but connects to multiple minor anomaly edges may have a higher weighted anomaly correlation than a node that is connected to a single significant anomaly edge but is insignificant in location. This mechanism makes the location process more inclined to infer the source of the leak to key locations that are more likely to trigger widespread causal anomalies once a problem occurs, significantly improving the accuracy and physical rationality of leak location inference.
[0110] Step S54: Based on the weighted anomaly correlation degree, update the anomaly impact value of the preset node connected to the anomaly edge to obtain the leak location and the leak confidence degree corresponding to the leak location. The location information includes the leak location and the leak confidence degree corresponding to the leak location.
[0111] The weighted abnormal correlation is iteratively propagated and aggregated along the opposite direction of the causal edge in the stable causal graph (i.e., against the direction of normal influence) to simulate and deduce the possible sources of abnormal influence. Specifically, firstly, the abnormal influence values of all preset nodes are initialized to 0. Then, the weighted abnormal correlation of each preset node is assigned to it as the initial abnormal influence value. Multiple rounds of iterative updates are then performed. In each round, for each preset node in the stable causal graph, all its direct downstream nodes (i.e., nodes affected by it) are checked, and the abnormal influence values of these downstream nodes in the current round are adjusted according to their... The weights (or preset propagation coefficients) of the edges between the current preset node and the current preset node are weighted and summed. A portion of the sum is then "backtracked" and added to the current preset node's own anomaly impact value. This process is performed synchronously on all preset nodes. After several iterations, the anomaly impact values of each preset node gradually converge to a stable state. At this point, the preset node with the highest anomaly impact value is presumed to be the most likely source of the initial anomaly edge, i.e., the leakage location. The relative value of the anomaly impact value of this preset node after normalization on all preset nodes is the leakage confidence level. By fusing and backpropagating local, scattered anomaly edge information to the entire causal network, the limitations of judging solely based on directly connected nodes are overcome. This allows for more accurate location of the true leakage source, which may not directly exhibit anomalies but is causing a series of downstream causal relationships to fail, and provides a quantified confidence level. Ultimately, this achieves precise, interpretable, and intelligent localization from anomalies to leakage sources.
[0112] This application also provides an urban pipeline network leak detection system, referring to... Figure 6 As shown, the urban pipeline leak detection system includes: The structure building module 10 is used to collect multi-source time series data through multiple pipeline nodes set up on the urban pipeline network, perform time-delay correlation analysis on the multi-source time series data, obtain the time-delay correlation matrix, and then perform causal reasoning on the time-delay correlation matrix to obtain the initial causal graph structure. The structure building module 10 is also used to constrain and optimize the initial causal graph structure based on the physical topology of the urban pipeline network. After obtaining the optimized causal graph structure, the edges that appear more frequently than a preset frequency in the optimized causal graph structure are identified as causal edges, and the target causal structure is obtained. Modeling module 20 is used to construct a computation graph based on the target causal structure, and to train the graph neural network of the computation graph by integrating the feature solutions output by the preset equations to obtain the node causal reasoning model; The anomaly detection module 30 is used to input multi-source time-series data into the node causal reasoning model, obtain the real-time causal relationship graph between each pipeline node, and detect whether there is a causal anomaly based on the graph structure difference between the real-time causal relationship graph and the preset causal relationship graph. The anomaly location module 40 is used to perform path tracing and leakage inference on the urban pipeline network based on the causal anomaly if there is one, so as to obtain the location information of the leakage location.
[0113] Optionally, the structural assembly module 10 is also used for: Based on the multimodal sensor arrays set at each pipeline node, pressure signals, vibration signals, sound signals and flow information at each pipeline node are collected to form initial multi-source data; The initial multi-source data is time-stamp aligned and outlier filtered to obtain a multi-source data sequence; Multi-source time-series data are obtained by performing time-domain feature extraction and frequency-domain transformation on multi-source data sequences.
[0114] Optionally, the modeling module 20 is also used for: After mapping the causal nodes in the target causal structure to graph vertices and the causal edges in the target causal structure to directed edges, attention weighting is applied to the graph vertices and directed edges to obtain the initial computation graph. Dynamic attention weighting is applied to each directed edge in the initial computation graph to generate an attention-weighted computation graph; The attention-weighted computation graph is forward-propagated using a neural network to calculate the predicted state value of each vertex. The characteristic line method solution input to the hydraulic transient equation is extracted from the predicted state value to calculate the physical residual term. The norm of the physical residual term is superimposed as a regularization term into the prediction loss function of the graph neural network to form a composite loss function. The graph neural network is iteratively trained until convergence based on the composite loss function to obtain the node causal inference model.
[0115] Optionally, the anomaly detection module 30 is also used for: Multi-source time-series data is fed into the node causal reasoning model for forward propagation calculation to obtain the real-time state embedding vector of each pipeline node; Calculate the similarity measure between pairwise real-time state embedding vectors to obtain the causal strength between pairwise network nodes; By combining each causal strength with the directed edges corresponding to each pair of network nodes to which each causal strength belongs, a real-time causal relationship graph is calculated.
[0116] Optionally, the anomaly detection module 30 is also used for: By comparing the differences between the real-time causal set and the preset causal set, and obtaining the edge set difference record, the edge set difference record is weighted and summed with the first preset edge weight coefficient to obtain the graph structure difference degree. After weighted summation of the weights of the preset edge and the second preset edge to obtain the physical constraint difference, the graph structure difference and the physical constraint difference are fused in multiple dimensions to obtain the comprehensive difference. The overall difference score is compared with the preset overall difference score to detect whether there is a causal anomaly.
[0117] Optionally, the anomaly location module 40 is also used for: The causal anomalies are analyzed to identify the anomalous causal edge representations included in the causal anomalies, thus obtaining the set of anomalous causal edges; Obtain the abnormal edges connecting the preset nodes and the abnormal causal edge set in the preset causal relationship graph, and normalize the abnormal edges to obtain the abnormal correlation degree of the preset nodes connected to the abnormal edges. The weighted sum of the abnormal correlation degree and the preset abnormal correlation weight is used to obtain the weighted abnormal correlation degree of the preset node connected to the abnormal edge; Based on the weighted anomaly correlation degree, the anomaly impact value of the preset node connected to the anomaly edge is updated to obtain the leakage location and the leakage confidence degree corresponding to the leakage location; The location information includes the location of the leak and the corresponding confidence level of the leak.
[0118] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A method for detecting leaks in urban pipe networks, characterized in that, include: Multi-source time-series data are collected by multiple pipeline nodes set up in the urban pipeline network. Time-delay correlation analysis is performed on the multi-source time-series data to obtain the time-delay correlation matrix. Causal inference is then performed on the time-delay correlation matrix to obtain the initial causal graph structure. The initial causal graph structure is constrained and optimized based on the physical topology of the urban pipeline network. After obtaining the optimized causal graph structure, the edges in the optimized causal graph structure that appear more frequently than a preset frequency are identified as causal edges, thus obtaining the target causal structure. A computational graph is constructed based on the target causal structure, and the feature solutions output by the preset equation are integrated into the graph neural network of the computational graph for training to obtain a node causal reasoning model; After the multi-source time-series data is input into the node causal reasoning model to obtain the real-time causal relationship graph between each of the network nodes, the presence of causal anomalies is detected based on the graph structure difference between the real-time causal relationship graph and the preset causal relationship graph. If the aforementioned causal anomaly exists, then path tracing and leakage inference are performed on the urban pipeline network based on the causal anomaly to obtain the location information of the leakage location.
2. The urban pipeline network leakage detection method according to claim 1, characterized in that, The steps for collecting multi-source time-series data through multiple pipeline nodes set up on the urban pipeline network include: Based on the multimodal sensor arrays installed at each of the pipeline network nodes, pressure signals, vibration signals, sound wave signals and flow information at each of the pipeline network nodes are collected to form initial multi-source data; The initial multi-source data is timestamped and outlier filtered to obtain a multi-source data sequence. The multi-source data sequence is subjected to time-domain feature extraction and frequency-domain transformation to obtain the multi-source time-series data.
3. The urban pipeline network leakage detection method according to claim 1, characterized in that, The step of training a graph neural network by integrating the feature solutions output by the preset equation into the computation graph to obtain a node causal inference model includes: After mapping the causal nodes in the target causal structure to graph vertices and the causal edges in the target causal structure to directed edges, attention weighting is applied to the graph vertices and the directed edges to obtain an initial computation graph. Dynamic attention weighting is applied to each directed edge in the initial computation graph to generate an attention-weighted computation graph; The attention-weighted computation graph is forward-propagated using the neural network to calculate the predicted state value of each vertex. The characteristic line method solution input to the hydraulic transient equation is extracted from the predicted state value to calculate the physical residual term. The norm of the physical residual term is superimposed as a regularization term into the prediction loss function of the graph neural network to form a composite loss function. The graph neural network is iteratively trained until convergence based on the composite loss function to obtain the node causal inference model.
4. The urban pipeline network leakage detection method according to claim 1, characterized in that, The step of inputting the multi-source time-series data into the node causal inference model to obtain the real-time causal relationship graph between each of the pipeline nodes includes: The multi-source time-series data is fed into the node causal reasoning model for forward propagation calculation to obtain the real-time state embedding vector of each of the pipeline nodes; Calculate the similarity measure between pairwise real-time state embedding vectors to obtain the causal strength between pairwise network nodes; The real-time causal relationship graph is obtained by combining each causal strength with the directed edges corresponding to the two network nodes to which each causal strength belongs.
5. The urban pipeline network leakage detection method according to claim 4, characterized in that, The real-time causal graph includes a real-time causal set composed of real-time nodes and real-time edges, and the preset causal graph includes a preset causal set composed of preset nodes and preset edges. The step of detecting whether there is a causal anomaly based on the graph structure difference between the real-time causal graph and the preset causal graph includes: By comparing the differences between the real-time causal set and the preset causal set, and obtaining the edge set difference record, the edge set difference record is weighted and summed with the first preset edge weight coefficient to obtain the graph structure difference degree. After weighted summation of the weights of the preset edge and the second preset edge to obtain the physical constraint difference, the graph structure difference and the physical constraint difference are fused in multiple dimensions to obtain the comprehensive difference. The overall difference is compared with a preset overall difference to detect whether the causal anomaly exists.
6. The urban pipeline network leakage detection method according to claim 5, characterized in that, The step of performing path tracing and leakage inference on the urban pipeline network based on the causal anomaly to obtain the location information of the leak includes: The causal anomalies are analyzed to identify the abnormal causal edge representations included in the causal anomalies, thereby obtaining a set of abnormal causal edges; Obtain the abnormal edges connecting the preset nodes in the preset causal relationship graph to the abnormal causal edge set, and normalize the abnormal edges to obtain the abnormal correlation degree of the preset nodes connected to the abnormal edges. The abnormal correlation degree is weighted and summed with the preset abnormal correlation weight to obtain the weighted abnormal correlation degree of the preset node connected to the abnormal edge; Based on the weighted anomaly correlation degree, the anomaly impact value of the preset node connected to the anomaly edge is updated to obtain the leakage location and the leakage confidence degree corresponding to the leakage location; The location information includes the leak location and the leak confidence level corresponding to the leak location.
7. A city pipeline leak detection system, characterized in that, include: The structure building module is used to collect multi-source time-series data through multiple pipeline nodes set up on the urban pipeline network, perform time-delay correlation analysis on the multi-source time-series data to obtain the time-delay correlation matrix, and then perform causal reasoning on the time-delay correlation matrix to obtain the initial causal graph structure. The structural component module is also used to perform constraint optimization on the initial causal graph structure based on the physical topology of the urban pipeline network. After obtaining the optimized causal graph structure, the edges in the optimized causal graph structure that have a frequency exceeding a preset frequency are determined as causal edges, and the target causal structure is obtained. The modeling module is used to construct a computational graph based on the target causal structure, and to train the graph neural network of the computational graph by integrating the feature solutions output by the preset equations to obtain a node causal reasoning model; An anomaly detection module is used to input the multi-source time-series data into the node causal reasoning model, obtain the real-time causal relationship graph between each of the pipeline nodes, and detect whether there is a causal anomaly based on the graph structure difference between the real-time causal relationship graph and the preset causal relationship graph. An anomaly location module is used to perform path tracing and leakage inference on the urban pipeline network based on the causal anomaly if the causal anomaly exists, so as to obtain the location information of the leakage location.
