Water supply network hydraulic state prediction method based on gated graph neural network

By applying the GGNN-based head prediction method in the water supply pipeline network, using sensor initialization strategies and physical constraints, the problems of low prediction accuracy and reliability in traditional methods are solved, and more efficient and flexible hydraulic state prediction is achieved.

CN119692554APending Publication Date: 2025-03-25DALIAN UNIV OF TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411823284.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The traditional water supply network hydraulic prediction method relies on complex physical models and is difficult to quickly adapt to dynamic changes. Due to the high cost of sensor deployment and insufficient data coverage, the prediction accuracy and reliability are low.

Method used

The head prediction method based on the gated graph neural network (GGNN) is adopted to efficiently predict the heads of each node in the pipeline network under the conditions of sparse monitoring data through sensor initialization strategies and loose physical constraints. The specific steps include: initializing the head data of the unmonitored nodes, building a graph neural network model, training the model and adding physical constraints.

Benefits of technology

It significantly improves the accuracy and reliability of head prediction, reduces the average absolute error (MAE), improves the Nash coefficient (NSE), and is highly adaptable, and can be effectively applied in water supply networks of different sizes and configurations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119692554A_ABST
    Figure CN119692554A_ABST
Patent Text Reader

Abstract

The invention provides a water supply network hydraulic state prediction method based on a gating chart neural network, and belongs to the field of urban water supply. The method for predicting the hydraulic state of the water supply pipe network comprises the following steps of: firstly, initializing data of other pipe network nodes without sensors by utilizing water head data monitored by sensor nodes; secondly, abstracting a topological structure of the water supply pipe network, and constructing a pipe network adjacency matrix of a directed graph; and finally, on the basis of the pipe network adjacent matrix and the initialized node water head information, constructing a GGNN-based water head prediction model, and predicting water heads of all nodes in the water supply pipe network. According to the method, the accuracy of water head prediction can be improved by combining an initialization strategy based on a sensor and physical constraints; the GGNN model shows the capability of effectively adapting to various water supply pipe networks with different configurations, and the adaptability is high; the water head prediction model provides a reliable and efficient solution for real-time monitoring and pipe network management decision, and the real-time monitoring and decision support capability can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of urban water supply and relates to a method for predicting the hydraulic state of a water supply network based on a gated graph neural network (GGNN). The method aims to improve the accuracy and reliability of water head prediction in a water supply network by using intelligent graph neural network technology, and is suitable for application scenarios such as intelligent water management, leakage detection, and network optimization control. Background Art

[0002] Urban water supply networks are an important part of modern urban infrastructure, responsible for providing clean and stable drinking water to residents and industrial users. However, as the size of cities continues to expand, the complexity of water supply networks has gradually increased, resulting in significant temporal and spatial changes in water pressure in the networks. Such changes may cause problems such as rupture and leakage in the networks, seriously affecting water quality and the safety of the water supply system. Therefore, timely and accurate prediction of the hydraulic state of the water supply network is crucial to ensure the safe and efficient operation of the water supply system.

[0003] Traditional hydraulic predictions for water supply networks rely mainly on hydraulic models, but these models require precise physical parameters during calibration, such as pipe roughness and node water demand, which are difficult to measure directly. Node water demand changes over time and is affected by many factors, such as seasonal changes, residential water use habits, and industrial demand. Pipe roughness also changes with aging and sediment accumulation, posing a great challenge to the calibration of hydraulic models. In addition, the deployment cost of sensors limits the number of monitoring points, resulting in insufficient data coverage, making hydraulic state prediction based on traditional hydraulic models more difficult.

[0004] In view of the limitations of traditional methods, meta-model-based prediction methods have gradually attracted attention in recent years. Meta-models use machine learning technology to learn historical data and network structure information (such as pipe diameter, material, pipe age, etc.) to achieve the following advantages: (1) No need for complex calibration: The meta-model is data-driven, avoiding the tedious calibration of physical parameters and can quickly adapt to dynamic changes; (2) No need for complex calibration: The meta-model is data-driven, avoiding the tedious calibration of physical parameters and can quickly adapt to dynamic changes; (3) Strong adaptability: The meta-model is particularly suitable for scenarios where sensors are scarce or deployment costs are high, showing strong environmental adaptability. By using meta-models, we can reduce dependence on physical models and provide more flexible and efficient technical means for the operation and management of water supply networks.

[0005] Despite the great potential of meta-models, there are still several challenges in practical applications. During the training process of the meta-model, error estimation is usually required for all nodes in the entire pipe network, which is particularly challenging for large-scale pipe networks because these networks usually have limited sensor coverage and lack sufficient global hydraulic data. How to efficiently extract useful information from sparse data and transform it into reliable predictions remains a key issue that needs to be solved. Summary of the invention

[0006] In view of the deficiencies in the prior art, the present invention proposes a water pressure prediction method based on a gated graph neural network (GGNN) for a water supply network. By introducing a sensor initialization strategy and loose physical constraints, the present invention can efficiently predict the water head of each node in the network under sparse monitoring data conditions. The main feature of the present invention is that, in response to the data missing problem caused by sparse sensor deployment, an initialization strategy based on network topology information is proposed. This strategy not only reduces the impact of data missing on prediction accuracy, but also significantly improves the convergence speed of the model. By combining the physical constraints of hydraulics, the model can better reflect the hydraulic relationship between network nodes and improve the accuracy of the overall prediction.

[0007] In order to achieve the above-mentioned purpose, the technical solution adopted by the present invention is:

[0008] A method for predicting the hydraulic state of a water supply network based on a gated graph neural network. The method first uses the water head data monitored by the sensor nodes to initialize the data of other network nodes without sensors; secondly, the topological structure of the water supply network is abstracted, and the network adjacency matrix of the directed graph is constructed; finally, based on the network adjacency matrix and the initialized node water head information, a GGNN-based water head prediction model is constructed to predict the water heads of all nodes in the water supply network. Specifically, the following steps are included:

[0009] Step (1) initializing the water head data of unmonitored nodes;

[0010] In the water supply network, due to cost constraints, only a few sensors can be deployed on the network nodes to monitor the water head information of the nodes. It is expected that the historical data of the network nodes where the sensors are deployed will be used to monitor the water head information of the nodes. c The water head data monitored in time steps is used to predict the future T p The water head value of all nodes in the network (including nodes monitored by sensors and nodes not monitored by sensors) within a certain period of time.

[0011] In order to predict the hydraulic state of all nodes in a water supply network when sensor data is scarce, the initialization of node values ​​plays a crucial role. For nodes that are not monitored, a meaningful initial value must be assigned to ensure that the model can learn from all network nodes, not just those monitored by sensors. In previous methods, it is common practice to fill these node values ​​without sensor monitoring with default values ​​(such as zero). However, this approach does not take into account the dynamic behavior of the network and ignores the spatiotemporal correlations that should be followed during the initialization process. This approach may cause the head values ​​predicted by the model for network nodes without sensor monitoring to remain unchanged or fail to show the natural fluctuations observed in real-world systems.

[0012] In order to overcome this limitation, the present invention proposes a new initialization strategy based on the shortest path distance. The initialization strategy abstracts the water supply network into a graph structure G = (V, E), where V is the set of all network nodes (|V| = n, n represents the number of water supply network nodes), and the edge set E represents the connection relationship between nodes. In the water supply network, reservoirs, water tanks and water nodes can be represented as nodes, and the pipes, valves and pumps connecting them can be represented as edges. To this end, a distance matrix is ​​first calculated to measure the shortest path distance between each network node p without a sensor and each network node s with a sensor monitoring in the graph structure. This distance is not based on the physical distance in the real world, but on the number of edges connecting the nodes. The Dijkstra algorithm is used to determine the above shortest path distance, and the inverse of the shortest path distance is used as a weight to distribute the influence of each sensor node on the node without a sensor. The initialization of the node value is calculated as the weighted average of the sensor value, where the weight is determined by the inverse of the shortest path distance:

[0013]

[0014] Where S is the set of pipe network nodes where sensors are deployed, s represents the sth pipe network node where sensors are deployed in the set S; d p,s is the shortest distance between the network node p without sensor monitoring and the network node s with sensor monitoring; p and x s Respectively represent the history T c The water head after initialization of the network node p without sensor monitoring within the time step and the water head information monitored by the network node s with sensors arranged.

[0015] This initialization method ensures that unmonitored network nodes receive values ​​that are influenced by nearby sensor data, thereby reflecting the spatial dynamics of the water supply network and allowing the model to better capture the temporal fluctuations of hydraulic head.

[0016] Step (2) building a graph neural network model;

[0017] Step (2.1) First, each node v in the graph neural network model (including nodes monitored by sensors and nodes without sensor monitoring) is associated with an attribute feature vector x v The attribute feature vector represents the T obtained from the data initialization step in step (1). c The initial water head value in the time step (the water head value after initialization for the network node without sensor monitoring, and the water head value actually monitored for the network node with sensor monitoring) is used as the attribute feature of the node. In order to improve the expression ability of these attribute features, linear transformation is used to project the attribute features of the network node into a high-dimensional hidden space of size M:

[0018]

[0019] in, is the initial hidden state of the network node v, which serves as the initial condition for the first iteration of the subsequent graph neural network; W0 and b0 are the weights and bias terms of the neural network layer; ReLU is the linear rectifier unit activation function.

[0020] Step 2.1 allows the graph neural network model to capture nonlinear relationships between node attributes and expand the feature space, thereby facilitating more complex representations. M represents the dimensionality of the hidden state, which directly affects the representation ability of the graph neural network model. Larger M values ​​can enhance the model's ability to learn and express complex functions, thereby improving its performance on training and test sets. However, excessively large M values ​​may bring the risk of overfitting and increase the complexity of training, resulting in higher computing resource consumption and longer training time. Therefore, in practical applications, it is necessary to balance the performance of the graph neural network model and the computational cost. Taking all these factors into consideration, the present invention empirically selects M=128.

[0021] Step (2.2) For a water supply network, its abstracted graph structure can be a directed graph with direction (the direction represents the flow direction of water in the pipe) or an undirected graph without direction (the flow direction of water is not considered). The connectivity of the water supply network is represented by the adjacency matrix A, which can be used for directed and undirected edges. The element A of the adjacency matrix is uv represents the relationship between any network nodes u and v. For a directed graph, A uv Indicates whether there is flow from node u to node v and the direction of the flow. For undirected graphs, the adjacency matrix is ​​symmetric, and the elements in the adjacency matrix A indicate whether there is a pipe connection between two nodes. Edge weights can represent properties such as pipe length, diameter, or flow capacity. In order to include different types of weights, the adjacency matrix can be defined with continuous values ​​to reflect the specific characteristics of the edge:

[0022] A uv =w uv (3)

[0023] Among them, w uv A represents the weight assigned to the edge between nodes u and v. This flexibility enables the model to exploit additional information in the network topology and edge attributes. uv is the value of the uth row and vth column in the adjacency matrix A. In the present invention, binary weights (0-1) based on directed graphs are selected based on experience and data accessibility, and the configuration of weights is determined by whether there is water flow in the pipe section between node u and node v. Specifically, if the pipe section directly connects node u and node v, and the water flows from node u to node v, the weight of the directed edge is set to 1; if there is no direct connection or the water flow direction is opposite, the weight is set to 0. This method clearly expresses the water flow state and directionality of each pipe section in the pipe network.

[0024] Step (2.3) To capture the bidirectional information flow and consider both incoming and outgoing edges, the present invention extends the adjacency matrix by adding the transpose of the adjacency matrix: Expanded adjacency matrix Ensuring that the graph neural network model takes into account bidirectional information propagation along edges enhances the ability to learn from the water supply network graph structure, whether the graph structure is directed or undirected.

[0025] The initial hidden state of the node obtained in step 2.1 needs to be passed into the gated graph neural network GGNN for information update iteration, where the above step 2.1 represents the hidden state of the first iteration of the pipeline network node v. In the kth iteration of the gated graph neural network GGNN, the hidden state of each node v is Each update is done in two main steps: aggregation and propagation. The details are as follows:

[0026] In the aggregation step, each node collects information from its neighbors using the expanded adjacency matrix. Aggregate information of node v The calculation formula is:

[0027]

[0028] Wherein, N(v) represents the set of neighboring nodes of node v, and q is the node included in the set of neighboring nodes N(v) of node v; is the element of the expanded adjacency matrix corresponding to nodes v and u; is the hidden state of the neighboring node q of node v in the previous iteration; b ais the bias vector. This step allows each node to incorporate information from its neighbors, weighted by connectivity in the expanded adjacency matrix.

[0029] After aggregation, the propagation step updates the hidden state of each node using a Gated Recurrent Unit (GRU), which captures temporal dependencies and controls the flow of information. The update equation is as follows:

[0030]

[0031]

[0032] in, and are the update gate and reset gate of node v at iteration k; W r and U r are the learnable weights and biases of the neural network layer in formula (5); W z and U z are the learnable weights and biases of the neural network layer in formula (6); W and U are the learnable weights and biases of the neural network layer in formula (7), respectively; σ(·) is the sigmoid activation function; ⊙ is element-wise multiplication. This GRU propagation mechanism enables the model to selectively integrate new information from the aggregated information while retaining essential aspects of the previous hidden state. This selective update enables the model to effectively capture recent changes and historical patterns in the network.

[0033] For any node in the network, the above iterative process is performed K times, and the final hidden state of the node is output. represents the final hidden state of node v after K iterations.

[0034] Through K aggregation and propagation steps, GGNN can iteratively update and improve the node state, incorporating the previous representation of the node and the information of its neighboring nodes. This iterative process captures the dynamics and interactions in the graph structure, enabling GGNN to learn complex relationships and dependencies between nodes. The number of iterations K determines the information propagation depth of GGNN. When K = 1, each node can only learn from its immediate neighbors. As K increases, GGNN can obtain information from nodes beyond K steps, including indirect connections. The choice of K affects the learning ability and efficiency of the model. The larger the K value, the higher the computational complexity and memory usage, while the smaller the K value, the more limited the model's ability to capture necessary dependencies. Therefore, choosing an appropriate K value requires a balance between model performance and computational efficiency. According to experience, a propagation step K of 5 can achieve good results.

[0035] Step (2.4) updates the final hidden state of the v node obtained in step (2.3) The final predicted water head information of the graph neural network model is generated through linear layer transformation.

[0036]

[0037] in, is the output vector of node v. In the present invention, the graph neural network model predicts the future T p The hydraulic state within the time frame, For node v future T p The predicted water head value in time. o and b o They are the output weight matrix and bias vector of the neural network respectively; It represents the final hidden state of node v after K iterations of step 2.3 above.

[0038] Step (3) training a water head prediction model based on GGNN;

[0039] A major feature of the present invention is the addition of physical constraints during the training of the water head prediction model. These physical constraints ensure that the prediction results of the water head prediction model conform to the known physical laws of the water supply network, for example, the water head of the upstream node must be greater than the water head of the downstream node.

[0040] The core loss function of the head prediction model consists of two parts: 1) prediction loss, which is used to measure the accuracy of the head prediction of the monitoring sensor node; 2) physical penalty term, which is used to enforce the hydraulic constraint condition, that is, the head should decrease from the upstream node to the downstream node.

[0041] The prediction loss in step (3.1) is calculated as the mean absolute error (MAE) between the predicted value and the observed value of the monitoring node:

[0042]

[0043] Wherein, S is a set of pipe network nodes where sensors are arranged; s represents the sth pipe network node where sensors are arranged in the set S; and Y s They are the effects of the sensor-arranged pipe network node s on the future T p The water head predicted by the water head prediction model and the water head monitored by the sensor within a certain period of time.

[0044] The physical penalty term in step (3.2) enforces the flow condition, that is, for any pair of connected nodes i and j, the hydraulic head at node j (downstream) must be less than or equal to the hydraulic head at node i (upstream). The expression is:

[0045]

[0046] Where E is the set of edges, and are the predicted water head values ​​of nodes i and j respectively (i, j specifically refer to two nodes on any edge in the edge set E, and the water flows from node i to node j. The nodes u and v involved in step 2 above are any nodes in the pipe network). This term is intended to penalize any prediction that violates the expected water flow. Even in an undirected graph, where each node can be either upstream or downstream of other nodes, this physical constraint can still be applied. For undirected graphs, this duality helps the model learn a smooth transition of water head values ​​throughout the network.

[0047] The final loss function L in step (3.3) is total is the sum of the prediction loss and the physical penalty:

[0048] L total =L prediction +λL penalty (12)

[0049] Among them, λ is a hyperparameter used to control the relative importance of the penalty term. This calculation method ensures that the model strikes a balance between prediction accuracy and physical consistency, thereby improving the reliability of the prediction. The range of λ described in the present invention is 0.5 to 1.5.

[0050] After training using formula (12), the water head prediction model is finally obtained.

[0051] Step (3.4) The water head prediction model trained in step 3 above proposed by the present invention uses the history T of the pipe network nodes where the sensors are arranged in step 1 c The water head data monitored in time steps is used to predict the future T p All pipe network nodes in the pipe network within a certain period of time

[0052] Step (3.5) In order to evaluate the prediction accuracy and reliability of the water head prediction model, the present invention adopts two evaluation indicators: mean absolute error (MAE) and Nash coefficient (NSE). These two indicators can provide complementary information about the model performance from different perspectives.

[0053] The MAE indicator is used to measure the average magnitude of the error between the predicted head value and the actual head value, regardless of the direction of the error. The calculation formula of MAE is:

[0054]

[0055] Where N represents the total number of predictions for all nodes and time steps, and y are the predicted head and the true head value respectively. MAE is an intuitive error margin measure that can directly reflect the prediction accuracy of the model in the same unit as the predicted variable.

[0056] The Nash coefficient is a standardized statistic used to assess the accuracy of model predictions relative to the variability of observed data. Its calculation formula is:

[0057]

[0058] in, is the mean of the true head values ​​of all samples. The value range of NSE is from -∞ to 1, where NSE of 1 indicates perfect prediction, NSE of 0 indicates that the model prediction is equal to the data mean, and NSE of negative value indicates that the model prediction is not as good as the mean prediction.

[0059] By using two evaluation indicators, MAE and NSE, the present invention can comprehensively evaluate the performance of the model from different angles. MAE focuses on measuring the average magnitude of the prediction error, highlighting the actual deviation between the prediction and the true value; while NSE evaluates the consistency between the model prediction and the real data changes, reflecting the model's ability to capture the law of head changes.

[0060] The beneficial effects of the present invention include:

[0061] (1) The present invention can improve the accuracy of water head prediction: By combining the sensor-based initialization strategy and physical constraints, the present invention significantly improves the prediction accuracy of the water head prediction model in different water supply networks. This method can effectively reduce MAE and improve NSE.

[0062] (2) The present invention has strong adaptability: The GGNN model of the present invention has demonstrated the ability to effectively adapt to water supply networks of various configurations. This adaptability not only reduces the reliance on complex tuning, but also provides a unified prediction framework for networks of different scales and structures. This feature enables the GGNN model to be widely used in the management of various hydraulic networks, promoting the intelligent development of the water industry.

[0063] (3) The present invention can improve real-time monitoring and decision support capabilities: The hydraulic head prediction model of the present invention provides a reliable and efficient solution for real-time monitoring and network management decisions. It effectively improves the hydraulic prediction accuracy under sparse sensor data conditions by integrating sensor-based initialization, physical constraints, and directed graph representation. This framework provides a new tool for real-time prediction in water supply networks, which can better monitor network operation and optimize scheduling. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 Flowchart for constructing the hydraulic head prediction model;

[0065] Figure 2 The node head distribution of multiple pipe networks (ASnet, Modena and L-TOWN); Figure 2 (a) is the water head distribution diagram of each node of the ASnet pipe network; Figure 2 (b) is the water head distribution diagram of each node of the Modena pipe network; Figure 2 (c) in the figure is the water head distribution diagram of each node of the L-TOWN pipe network;

[0066] Figure 3 Prediction errors of the GGNN-based head prediction model in multiple pipe networks (ASnet, Modena and L-TOWN); Figure 3 (a) is the MAE calculated by the head prediction model in the ASnet pipe network; Figure 3 (b) is the MAE calculated by the water head prediction model in the Modena network; Figure 3 (c) in the figure is the MAE calculated by the water head prediction model in the L-TOWN pipe network; Figure 3 (d) in the figure is the NSE calculated by the head prediction model in the ASnet pipe network; Figure 3 (e) in the figure is the NSE calculated by the head prediction model in the Modena network; Figure 3 (f) in the figure is the NSE calculated by the head prediction model in the L-TOWN pipe network. DETAILED DESCRIPTION

[0067] In order to present the technical solutions and advantages of the present invention more clearly, the present invention is described in detail below with reference to the accompanying drawings and embodiments. It should be pointed out that the embodiments are only specific explanations of the present invention, but the implementation methods of the present invention are not limited thereto.

[0068] Example 1.

[0069] See attached Figure 1 The specific implementation steps of the present invention are as follows:

[0070] S1, data preparation and processing. The method of the present invention needs to construct a directed graph based on the water supply network, and initialize the water head information of the unmonitored nodes by monitoring the water head data of the network nodes where sensors are arranged, and finally construct a water head prediction model based on the gated graph neural network (GGNN). It specifically includes the following parts:

[0071] S11, adjacency matrix of the water supply network. Using the topological structure information of the water supply network, hydraulic modeling is performed through EPANET software to construct a directed graph of the network. The graph contains n nodes and the connection relationship between them, and generates an adjacency matrix A to represent the flow relationship between nodes. According to the specific connection conditions of the water supply network and the flow direction information, the corresponding directed graph is constructed, and the adjacency matrix A is calculated and obtained. The matrix is ​​used to describe the connection information between each node. In addition, in order to capture the bidirectional information flow, the adjacency matrix is ​​expanded The reverse edge information will be included.

[0072] S12, collection and processing of sensor data. Collect and organize the water head data monitored by each sensor-deployed pipe network node in the water supply network (the data is provided by sensors in the SCADA system, which provide water pressure data within a specific time interval. The water pressure collected by the sensor plus the elevation of the node itself is the water head value of the node). Finally, collect the water head information (T) sampled at 5-minute intervals for all pipe networks where sensors are deployed in the past 120 minutes. c 120 minutes), as the input data for water head prediction model training and prediction, and used to predict the next 60 minutes (T p is the water head of all nodes within 60 minutes.

[0073] S2, initialize the water head information of unmonitored nodes.

[0074] In order to solve the problem of scarce sensor data, this embodiment proposes an initialization strategy based on the shortest path to calculate the initial water head of the unmonitored node.

[0075] S21, shortest path calculation. According to the connection relationship between the pipe network nodes, the Dijkstra algorithm is used to calculate the shortest path distance between each pipe network node without sensors and all pipe network nodes with sensors. The inverse of the shortest path distance between nodes is used as a weighting coefficient to influence the initialization of the water head of the pipe network node without sensors. This method ensures that the water head information of the pipe network node without sensors can reflect its spatial position and dynamic changes.

[0076] S22, water head initialization calculation. According to formula (1), the water head data of the surrounding pipe network nodes with sensors are used for weighted averaging to initialize the water head information of the pipe network nodes without sensors. In this way, the initial water head of the pipe network nodes without sensors can be consistent with the data of the surrounding sensor nodes, ensuring that the graph neural network model can effectively learn from the information of all nodes.

[0077] S3, constructing a water head prediction model based on GGNN. Based on data preparation and initialization of node water head values, the present invention constructs a water head prediction model based on GGNN.

[0078] S31, GGNN graph neural network model construction. For each node, according to formula (2), the initialized water head information is transformed through a layer of neural network linear transformation and activation function (ReLU) to obtain the initial hidden state of all nodes. This transformation enhances the expressive power of node attribute features and helps the model capture the nonlinear relationship between nodes. The number of features M of the chanting state is 128. The extended adjacency matrix obtained in S11 and the initial hidden state of the node calculated using formula (2) are used as input, and K calculations (K=5) are performed through the iterative update rule of the GGNN model according to formulas (4)-(8). In each iteration, the hidden state of the final node is updated by aggregating the information of neighboring nodes and propagating it using a gated recurrent unit (GRU). Through a linear layer of formula (9), the updated final hidden state of the node is mapped to the predicted water head value. These predicted water head values ​​represent the water head value of each node in the water supply network in the future T p The hydraulic status within the time frame.

[0079] S32, training a GGNN-based water head prediction model. The graph neural network model in S31 is trained using formula (12). In the present invention, λ is set to 1 to indicate that prediction and physical constraints are equally important, and finally a water head prediction model is obtained. The water head prediction model uses the water head data sampled at 5-minute intervals during the 2-hour historical monitoring of the network nodes where sensors are arranged to predict the water head values ​​of all network nodes in the network within the next 60 minutes.

[0080] This embodiment has been applied to three typical water supply networks (ASnet, Modena and L-town) to verify the effect and adaptability of the model in different networks. Figure 2 The hydraulic head distribution at each node in the three water supply networks is shown, highlighting the differences between different network structures and operating conditions:

[0081] ASnet: This network is smaller, containing 50 nodes, 65 pipes, and 5 sensors. There is only one water source, and the head value ranges from 396m to 399m, with small head changes.

[0082] Modena: This network is medium-sized, with 268 nodes, 336 pipes and 10 sensors, four different water sources, and head values ​​ranging from 56m to 75m, with moderate head changes.

[0083] L-town: This network is the most complex, with 782 nodes, 905 pipes, 33 sensors, two water sources and one water tank. L-town is divided into three regional metering areas (DMAs), each of which is maintained by a pressure control valve or pump to maintain a stable pressure, so the head value ranges from 41m to 103m.

[0084] To evaluate the versatility of the hydraulic head prediction model, a synthetic data set was generated using EPANET hydraulic simulation software. The data generation process lasted for 60 days, and water quality data was collected every 5 minutes to simulate the dynamic changes in hydraulic head caused by changes in node demand. The generated data set was divided into a training set (80%) and a test set (20%).

[0085] The generalizability of the head prediction model was evaluated in three pipe networks, focusing on predicting the hydraulic head one hour in the future. To ensure consistency, all pipe networks adopted the default configuration, i.e., sensor-based initialization and directed graph structure. The hyperparameters of the graph neural network were kept consistent. Figure 3 The MAE and NSE values ​​of the three networks ASnet, Modena and L-TOWN using formulas (13) and (14) are shown. Sub-figures (a), (b) and (c) show the MAE of the three networks, respectively, and sub-figures (d), (e) and (f) show the corresponding NSE values. The results show that the head prediction model performs well in all three networks. The average MAE values ​​of ASnet, Modena and L-TOWN are 0.10m, 0.96m and 0.13m, respectively, indicating that the head prediction model has a low prediction error when compared with the actual head fluctuations of the network nodes. The average NSE values ​​are 0.90, 0.70 and 0.68, respectively, indicating that the head prediction model can accurately capture the temporal changes of the hydraulic state. It is worth emphasizing that even in networks of different sizes and configurations, the head prediction model uses the same hyperparameter settings and still achieves robust prediction results. This further demonstrates the robustness and generalization ability of the head prediction model. In practical applications, a model that can adapt to different pipe networks without a lot of parameter tuning is crucial for reliable head prediction and efficient water supply management. In summary, the head prediction model based on GGNN proposed in this paper shows good prediction performance in water supply networks of different scales and configurations. The robustness and generalization ability of the head prediction model make it of great value in practical applications, and can provide reliable technical support for real-time monitoring and efficient management of water supply networks.

[0086] The above-described embodiments merely express the implementation methods of the present invention, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A method for predicting the hydraulic state of a water supply network based on a gated graph neural network, characterized in that: The water supply network hydraulic state prediction method firstly uses the water head data monitored by the sensor node to initialize the data of other network nodes where no sensors are arranged; Secondly, the topological structure of the water supply network is abstracted, and the network adjacency matrix of the directed graph is constructed; finally, based on the network adjacency matrix and the initialized node head information, a GGNN-based head prediction model is constructed to predict the water heads of all nodes in the water supply network.

2. A method for predicting hydraulic status of a water supply network based on a gated graph neural network according to claim 1, characterized in that: The following steps are involved: Step 1, initialize the water head data of unmonitored nodes; In the water supply network, sensors are arranged on some nodes of the network to monitor the water head information of the nodes, and the historical data of the network nodes where the sensors are arranged are used to c The water head data monitored in time steps is used to predict the future T p The water head value of all network nodes in the network within the time period; an initialization strategy based on the shortest path distance is adopted, which abstracts the water supply network into a graph structure G = (V, E), where V is the set of all network nodes, |V| = n, n represents the number of water supply network nodes, and the edge set E represents the connection relationship between nodes; in the water supply network, reservoirs, water tanks and water nodes are represented as nodes, and the pipes, valves and pumps connecting them are represented as edges; to this end, a distance matrix is ​​first calculated to measure the shortest path distance between each network node p without a sensor in the graph structure and each network node s with a sensor monitoring; the Dijkstra algorithm is used to determine the shortest path distance, and the inverse of the shortest path distance is used as a weight to distribute the influence of each sensor node on the node without a sensor; Step 2: Establish a graph neural network model; Step 2.1, first, each node v in the graph neural network model is associated with an attribute feature vector x v The attribute feature vector represents the T obtained from the data initialization step in step 1. c The initial water head value within the time step is used as the attribute feature of the network node; Step 2.2, for a water supply network, its abstracted graph structure can be a directed graph with direction or an undirected graph without direction; the connectivity of the water supply network is represented by the adjacency matrix A, which is used for directed and undirected edges; the element A of the adjacency matrix uv Represents the relationship between any network nodes u and v; Step 2.3, to capture bidirectional information flow and consider both incoming and outgoing edges, expand the adjacency matrix by adding the transpose of the adjacency matrix: Expanded adjacency matrix Ensure that the graph neural network model takes into account bidirectional information propagation along the edges; The initial hidden state of the node obtained in step 2.1 needs to be passed into the gated graph neural network GGNN for information update iteration, where the above step 2.1 represents the hidden state of the first iteration of the pipeline node v; in the kth iteration of the gated graph neural network GGNN, the hidden state of each node v All will be updated through two main steps: aggregation and propagation; Finally, through K aggregation and propagation steps, GGNN can iteratively update and improve the node state, incorporating the previous representation of the node and the information of its neighboring nodes; Step 2.4: Update the final hidden state of the v node obtained in step 2.3 The final predicted water head information of the graph neural network model is generated through linear layer transformation. in, is the output vector of node v, and the graph neural network model predicts the future T p The hydraulic state within the time frame, For node v future T p The predicted water head value within the time period; W o and b o They are the output weight matrix and bias vector of the neural network respectively; It represents the final hidden state of node v after K iterations of step 2.3 above; Step 3, training the water head prediction model based on GGNN; Physical constraints are added during the training of the hydraulic head prediction model; the core loss function of the hydraulic head prediction model consists of two parts: 1) prediction loss, which is used to measure the accuracy of the hydraulic head predicted by the monitoring sensor node; 2) physical penalty term, which is used to enforce the hydraulic constraint condition, that is, the hydraulic head should decrease from the upstream node to the downstream node; Step 3.1, the prediction loss is calculated as the mean absolute error (MAE) between the predicted value and the observed value of the monitoring node; Step 3.2, the physical penalty term enforces the water flow condition, that is, for any pair of connected nodes i and j, the water head at node j (downstream) must be less than or equal to the water head at node i; Step 3.3, the final loss function L total is the sum of the prediction loss and the physical penalty: THE total =L prediction +λL penalty (12) Among them, λ is a hyperparameter used to control the relative importance of the penalty term; After training using formula (12), the water head prediction model is finally obtained; Step 3.4: The water head prediction model trained in step 3 is used to calculate the water head prediction model using the history T of the pipe network nodes where the sensors are arranged in step 1. c The water head data monitored in time steps is used to predict the future T p All pipe network nodes in the pipe network within the time period; In step 3.5, the prediction accuracy and reliability of the water head prediction model are evaluated using evaluation indicators.

3. A method for predicting hydraulic status of a water supply network based on a gated graph neural network according to claim 2, characterized in that: In step 1, the node value is initialized by calculating the weighted average of the sensor values, where the weight is determined by the inverse of the shortest path distance: Where S is the set of pipe network nodes where sensors are deployed, s represents the sth pipe network node where sensors are deployed in the set S; d p,s is the shortest distance between the network node p without sensor monitoring and the network node s with sensor monitoring; p and x s Respectively represent the history T c The water head after initialization of the network node p without sensor monitoring within the time step and the water head information monitored by the network node s with sensors arranged.

4. The method for predicting hydraulic state of a water supply network based on a gated graph neural network according to claim 2, characterized in that: In step 2.1, linear transformation is used to project the attribute features of the network nodes into a high-dimensional latent space of size M: in, is the initial hidden state of the network node v, which serves as the initial condition for the first iteration of the subsequent graph neural network; W0 and b0 are the weights and bias terms of the neural network layer; ReLU is the linear rectifier unit activation function.

5. A method for predicting hydraulic status of a water supply network based on a gated graph neural network according to claim 4, characterized in that: The M=128.

6. The method for predicting hydraulic state of a water supply network based on a gated graph neural network according to claim 2, characterized in that: In step 2.2, for a directed graph, A uv Indicates whether there is flow from node u to node v and the direction of the flow; for an undirected graph, the adjacency matrix is ​​symmetric, and the elements in the adjacency matrix A indicate whether there is a pipeline connection between two nodes; the edge weight represents the pipeline length, diameter or flow capacity attribute; in order to include different types of weights, the adjacency matrix is ​​defined with continuous values ​​to reflect the specific characteristics of the edge: A uv =w uv (3) Among them, w uv represents the weight assigned to the edge between nodes u and v; A uv is the value in the uth row and vth column of the adjacency matrix A.

7. A method for predicting hydraulic status of a water supply network based on a gated graph neural network according to claim 6, characterized in that: Based on experience and data accessibility, binary weights (0-1) based on directed graphs are selected. The configuration of weights is determined by whether there is water flow in the pipe segment between node u and node v. Specifically, if the pipe segment directly connects node u and node v, and the water flows from node u to node v, the weight of the directed edge is set to 1; if there is no direct connection or the water flows in the opposite direction, the weight is set to 0.

8. The method for predicting hydraulic status of a water supply network based on a gated graph neural network according to claim 2, characterized in that: In step 2.3, the updating steps are as follows: In the aggregation step, each node collects information from its neighbors using the expanded adjacency matrix; the aggregated information of node v The calculation formula is: Wherein, N(v) represents the set of neighboring nodes of node v, and q is the node included in the set of neighboring nodes N(v) of node v; is the element of the expanded adjacency matrix corresponding to nodes v and u; is the hidden state of the neighboring node q of node v in the previous iteration; b a is the bias vector; this step allows each node to incorporate information from its neighbors, weighted by connectivity in the expanded adjacency matrix; After aggregation, the propagation step updates the hidden state of each node using a gated recurrent unit (GRU), which captures temporal dependencies and controls the flow of information; the update equation is as follows: r v (k) =σ(W r ·a v (k) +U r ·h v (k-1) ) (5) z v (k) =σ(W z ·a v (k) +U z ·h v (k-1) ) (6) in, and are the update gate and reset gate of node v at iteration k; W r and U r are the learnable weights and biases of the neural network layer in formula (5); W z and U z are the learnable weights and biases of the neural network layer in formula (6); W and U are the learnable weights and biases of the neural network layer in formula (7); σ(·) is the sigmoid activation function; ⊙ is element-wise multiplication; For any node in the network, the above iterative process is performed K times, and the final hidden state of the node is output; for node v, represents the final hidden state of node v after K iterations.

9. The method for predicting hydraulic status of a water supply network based on a gated graph neural network according to claim 2, characterized in that: The step 3 is specifically as follows: Step 3.1, mean absolute error MAE: Wherein, S is a set of pipe network nodes where sensors are arranged; s represents the sth pipe network node where sensors are arranged in the set S; and Y s They are the effects of the sensor-arranged pipe network node s on the future T p The water head predicted by the water head prediction model and the water head monitored by the sensor within time; Step 3.2, the expression of the physical penalty term to enforce the water flow condition is: Where E is the set of edges; and are the predicted water head values ​​of nodes i and j, respectively. i and j specifically refer to two nodes on any edge in the edge set E, and the water flows from node i to node j; In step 3.3, the range of λ is 0.5 to 1.

5.

10. The method for predicting hydraulic status of a water supply network based on a gated graph neural network according to claim 2, characterized in that: In step 3.5, the evaluation indicators used include mean absolute error MAE and Nash coefficient NSE.

Citation Information

Cited By

  • Urban pipe network operation intelligent prediction method based on physical information graph neural network

    CN120197778A

  • Water supply network global water quality prediction method based on double flow-graph convolutional network

    CN120873478A

  • River and lake ecological water supplement prediction method based on intelligent perception

    CN121390420A