Mechanism-data double-driven urban drainage network water level prediction method and device
By combining training data generated by SWMM with a spatiotemporal graph convolutional network model, and by combining dual-drive training and physical rule constraints, the problems of spatiotemporal dependence and computational efficiency of urban drainage pipe networks are solved, achieving high-precision, real-time water level prediction and improving the interpretability and extrapolation reliability of the model.
Patent Information
- Application Number
- CN202611313792.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies cannot simultaneously account for the spatiotemporal dependence of urban drainage networks, have low computational efficiency, and the prediction results may violate physical laws, making it difficult to meet the requirements of real-time performance and accuracy.
High-quality training data is generated using the Rainstorm Flood Management Model (SWMM). Combined with the Spatiotemporal Graph Convolutional Network (SGM) model, a SGM model is constructed through a dual-drive training strategy and physical rule constraints. This enables cross-domain migration and adaptation from simulated data to the actual pipe network. Furthermore, mass conservation, hydraulic gradient, and water level non-negativity constraints are applied to achieve global situational awareness.
It achieves high-precision, high-efficiency, and physically consistent water level prediction, and can complete the prediction of the water level of the entire pipeline network within seconds, improving the interpretability and extrapolation reliability of the model and meeting the needs of real-time flood control and disaster reduction decision-making.
Smart Images

Figure CN123159596A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of urban drainage network monitoring and artificial intelligence technology, specifically to a mechanism-data dual-driven method and device for predicting water levels in urban drainage networks. Background Technology
[0002] Urban drainage networks are critical infrastructure for ensuring the normal operation of cities. Real-time and accurate prediction of water levels within these networks is of paramount importance for urban flooding early warning, intelligent pump station scheduling, and flood control and disaster reduction decision-making. Failure to predict the risk of rising water levels in the network in a timely manner can lead to poor drainage, road overflows, and in severe cases, even widespread urban flooding, threatening people's lives and property.
[0003] To achieve water level prediction, existing technologies mainly fall into two categories. The first category is data-driven methods based on time series analysis, such as using Long Short-Term Memory (LSTM) networks or Recurrent Neural Networks (RNNs) to learn and predict historical water level data from monitoring points. However, these methods typically treat each monitoring point as an independent sequence, ignoring the inherent spatial topology of the drainage network as a physical system. In reality, water level changes at upstream nodes in the network directly affect downstream nodes through pipe connections; ignoring this spatial dependency significantly limits the model's prediction accuracy.
[0004] The second category is mechanistic modeling methods based on physical process simulation, such as stormwater and flood management models. These models are based on fluid dynamics equations and can accurately simulate the hydraulic dynamics in pipe networks, possessing high physical interpretability. However, urban drainage pipe network mechanistic models also have inherent limitations; their calculation processes are complex, and a single simulation often takes several minutes or even hours, making it difficult to meet the needs of real-time early warning and rapid response.
[0005] In recent years, some studies have attempted to use Graph Neural Networks (GCNs) to process the topology of pipe networks. However, traditional GCNs are mainly used to process static graph data and lack the ability to model dynamic evolution processes over time, failing to effectively capture the delays and attenuations in hydraulic state propagation over time. For example, CN120197504A, applied for by Wuhan University, discloses a multi-objective prediction method for urban drainage systems based on SWMM and GraphSAGE-GRU, but it adopts a single-stage training strategy, does not introduce a cross-domain transfer mechanism of pre-training-fine-tuning, and does not impose physical rule constraints to ensure the physical consistency of the prediction results. CN120873424A, applied for by Zhejiang University, discloses a drainage pipe network overflow prediction method based on the Phy-STNN model, which embeds a differentiable physical layer at the output of GNN-LSTM to apply continuity equation constraints, but it does not adopt a dual-drive training strategy of pre-training-fine-tuning, nor does it involve the ability to infer the state of the entire pipe network from a few monitoring points. The Southern University of Science and Technology's application CN116777229B discloses a pre-training-fine-tuning groundwater level prediction method based on analytical solutions. However, it is applied to the field of seepage in porous media of underground aquifers, uses a pure DNN model, lacks the ability to model the topological spatial structure of the pipeline network, and does not involve physical rule constraints.
[0006] In summary, existing technical approaches either cannot simultaneously take into account the spatiotemporal dependence of pipeline networks, or have low computational efficiency that cannot meet real-time requirements, or lack physical rule constraints that lead to unreliable prediction results under unseen operating conditions. There is an urgent need for an innovative method that can integrate the advantages of mechanistic models and data models. Summary of the Invention
[0007] To address the problems in the aforementioned technologies, such as the inability of models to account for spatiotemporal dependencies, the potential for prediction results to violate physical laws, and low computational efficiency, this application provides a mechanism-data dual-driven method and apparatus for predicting water levels in urban drainage networks. This method generates high-quality training data using a stormwater flood management model (SWMM), learns the hydraulic laws of the network using a spatiotemporal graph convolutional network model, and achieves high-precision, high-efficiency, and physically consistent water level prediction through a dual-driven training strategy, physical rule constraints, and the ability to make inferences with fewer measurements.
[0008] To achieve the above objectives, this application provides a mechanism-data dual-driven method for predicting water levels in urban drainage networks, comprising: Using the Rainstorm Flood Management Model (SWMM) as a mechanistic model, simulated water level time series data covering various pipe network nodes under multiple operating conditions are generated in batches by setting different rainfall and inflow boundary conditions. The pipe connection relationship of the pipeline network is parsed from the .inp configuration file of the SWMM mechanism model, and a normalized adjacency matrix representing the physical connection between pipeline network nodes is constructed as graph structure data. A spatiotemporal graph convolutional network model is constructed. The network structure of the spatiotemporal graph convolutional network model includes a graph convolutional layer for aggregating the spatial information of neighboring nodes and a temporal convolutional layer for capturing the temporal evolution of the nodes themselves. The spatiotemporal graph convolutional network model includes at least one spatiotemporal graph convolutional block. The internal structure of the spatiotemporal graph convolutional block includes a first temporal convolutional layer, the graph convolutional layer and a second temporal convolutional layer in sequence, and residual connections are set for the spatiotemporal graph convolutional block. A dual-drive training strategy is implemented, which includes: (i) a pre-training stage: using the simulated water level time series data generated by the SWMM mechanism model as training data to pre-train the spatiotemporal graph convolutional network model, so that it learns the universal spatiotemporal evolution law of pipeline hydraulics; (ii) a fine-tuning stage: using a small amount of measured monitoring data obtained from the actual pipeline network to fine-tune the pre-trained spatiotemporal graph convolutional network model, so as to achieve cross-domain migration and adaptation from the simulated data domain to the actual pipeline network data domain. During the training of the spatiotemporal graph convolutional network model, physical rule constraints are applied to the loss function of the model, or physical rule post-processing corrections are performed on the prediction results after obtaining the water level prediction value. The physical rule constraints include: mass conservation constraints, hydraulic gradient constraints, and water level non-negativity constraints. After the spatiotemporal graph convolutional network model is trained, historical water level input data from a subset of monitoring points in the pipeline network is obtained. The input data is then fed into the trained model. Through the spatial information propagation capability of the spatiotemporal graph convolutional network model, the predicted water level values for all nodes in the pipeline network or other unmonitored nodes besides the aforementioned monitoring points are obtained through a single forward inference.
[0009] The above technical solution effectively solves the problem of scarce high-quality, multi-condition labeled data in actual engineering by generating high-quality training data rich in physical laws in batches through the SWMM mechanism model; by parsing the topology from the .inp configuration file to construct a normalized adjacency matrix, it realizes the automatic extraction of pipeline spatial structure from existing model assets; by using TGT sandwich structure spatiotemporal graph convolutional blocks in conjunction with residual connections, it collaboratively models the spatiotemporal dependencies of the pipeline network within a unified framework; through the "pre-training-fine-tuning" dual-drive training strategy, the model first masters universal hydraulic laws on simulated data, and then adapts to specific pipeline networks with measured data; by simultaneously applying three physical rule constraints, it effectively avoids the model from producing prediction results that violate physical laws under unseen conditions; by utilizing the model's spatial information propagation capability to infer the state of the entire pipeline network from some monitoring points, it realizes global situational awareness "from point to surface". The above steps constitute a synergistic and efficient technical closed loop, and its overall technical effect is greater than the sum of the individual effects of each step.
[0010] In the pre-training phase, the SWMM mechanism model generates simulated water level time series data by setting no fewer than 50 different simulation scenarios. Each scenario contains different rainfall process curves and / or different node inflow time series to cover a variety of hydraulic conditions from regular rainfall to extreme rainstorms.
[0011] In the fine-tuning stage, some of the bottom-level network parameters of the spatiotemporal graph convolutional network model obtained in the pre-training stage are frozen, and only some of the upper-level network parameters are fine-tuned and updated based on the measured monitoring data. The bottom-level network parameters retain the general hydraulic feature representation ability learned from the simulation data in the pre-training stage, and the upper-level network parameters are adapted to the unique hydraulic characteristics and systematic deviations of a specific actual pipe network.
[0012] The construction of the normalized adjacency matrix includes: adding a self-loop to each network node based on the pipeline connection relationship parsed from the .inp configuration file; and normalizing the adjacency matrix using a symmetric normalization method to balance the influence of different node degrees on graph convolution calculation and ensure the numerical stability of model training.
[0013] The mass conservation constraint is as follows: for any confluence node in the pipeline network, the difference between the total inflow of its upstream connecting pipe and the total outflow of its downstream connecting pipe within a specified time period does not exceed a preset threshold. The hydraulic gradient constraint is as follows: in a gravity flow drainage pipeline network, the predicted water level of the upstream node along the flow direction is not lower than the predicted water level of the downstream node. The water level non-negativity constraint is as follows: the predicted water level value of any node is not less than zero. Introducing the above three physical rule constraints as soft constraints into the model can effectively avoid the model from producing prediction results that violate basic physical laws, enhancing the model's credibility and physical interpretability. Especially in unseen working conditions where training data coverage is incomplete, the physical rule constraints provide domain knowledge guidance for the model, significantly improving the reliability of extrapolation.
[0014] The graph convolutional layer employs Chebyshev polynomial approximation to implement graph convolution operations, controlling the spatial neighborhood perception range by setting the polynomial order. The temporal convolutional layer uses two-dimensional convolution and gated activation via gated linear units to capture the temporal evolution and long-range dependence of node water levels without changing the time series length. This combination of TGT sandwich block structure and residual connections effectively extracts spatiotemporal features through sequential operations of temporal convolution, graph convolution, and temporal convolution, while residual connections help alleviate the gradient vanishing problem in deep network training, ensuring the model's training efficiency and performance.
[0015] The input data consists of water level observation sequences from a subset of monitoring points within a preset time window. The spatiotemporal graph convolutional network model uses graph convolutional layers to propagate spatial information between nodes on the graph structure data. This allows the features of unmonitored nodes to indirectly acquire spatial context through multi-level neighborhood aggregation, thereby inferring the future water level status of all nodes in the entire pipeline network based on the known states of the subset of monitoring points. This "measuring more with less" capability has high practical value. It allows the use of limited, cost-effective monitoring point data to infer and predict the state of the entire pipeline network or other key unmonitored points, achieving "point-to-area" global situational awareness and greatly improving the economic efficiency and information value of the monitoring system.
[0016] This application also provides a mechanism-data dual-driven urban drainage network water level prediction device, comprising: a data generation module for batch generating simulated water level time series data using a stormwater flood management model (SWMM) as the mechanism model; a topology encoding module for parsing pipe connection relationships from the SWMM's .inp configuration file and constructing a normalized adjacency matrix; a model building module for constructing a spatiotemporal graph convolutional network model containing TGT spatiotemporal graph convolutional blocks and residual connections; a pre-training module for pre-training the model using simulated data generated by SWMM as training data; a fine-tuning module for fine-tuning the pre-trained model using a small amount of measured monitoring data; a physical constraint module for applying three physical rules: mass conservation, hydraulic gradient, and water level non-negativity; and a prediction module for acquiring historical water level input data from some monitoring points and obtaining future water level predictions for the entire network through model inference. These modules can be implemented by software programs and executed by the processor in the device.
[0017] Beneficial effects Compared with the prior art, this application has the following beneficial effects: 1. It resolves the contradiction between data scarcity and model performance. By using the SWMM (Sudden Rainstorm Flood Management Model) to generate training data in batches covering multiple operating conditions (no fewer than 50 scenarios), it provides sufficient and high-quality data for the training of deep learning models, overcoming the bottleneck of insufficient real-world pipeline monitoring data (especially extreme event data), and ensuring that the data-driven model can learn universal hydraulic laws with strong generalization ability.
[0018] 2. Cooperative modeling of spatiotemporal dependencies is achieved. The spatiotemporal graph convolutional network model adopted in this application can capture the spatial topological influence between pipeline nodes through Chebyshev graph convolution operations within a unified framework, and simultaneously capture the self-evolution law and long-range dependency of water level at each node through TGT gated temporal convolution operations. Compared with models that only consider a single dimension of time or space, the prediction results are more consistent with the physical reality of hydraulic processes and have higher accuracy.
[0019] 3. Significantly improved prediction efficiency, meeting real-time requirements. Compared with the SWMM mechanism model, which often requires tens of minutes or even hours of computation time, the data model trained in this application can complete a prediction of the future state of the entire pipeline network within seconds or even milliseconds, realizing a leap from "post-event simulation" to "pre-event early warning," and winning valuable time for flood control and disaster reduction decision-making and real-time control.
[0020] 4. Enhanced model interpretability, reliability, and extrapolation safety. By simultaneously applying three physical constraints—mass conservation, hydraulic gradient, and non-negative water level—and employing a dual-drive training strategy of "simulated pre-training + experimental fine-tuning," the model's predictions are not only data-driven but also constrained by physical laws, and can adapt to the actual conditions of specific sites. In particular, the combined effect of the three physical constraints effectively prevents the model from generating predictions that violate fundamental physical laws when the model encounters extreme conditions not covered by training data, significantly improving the model's extrapolation reliability.
[0021] 5. A technological closed loop of synergistic efficiency across the entire chain has been achieved. The six core components of this application—SWMM batch data generation, .inp topology automatic parsing, TGT spatiotemporal graph convolutional block modeling, pre-training-fine-tuning cross-domain transfer, joint constraints of three physical rules, and partial monitoring for inference of the entire pipeline network—constitute a synergistic technological closed loop. Specifically: SWMM batch pre-training enables STGCN to implicitly grasp the hydraulic laws of the pipeline network, providing a high-quality initial parameter space for subsequent fine-tuning; on this basis, experimental fine-tuning adapts to specific pipeline networks, compensating for the distribution differences between simulated data and real operating conditions; the three physical constraints provide domain knowledge supervision during fine-tuning and after prediction, preventing overfitting and ensuring extrapolation safety; the normalized adjacency matrix based on .inp parsing provides a physically accurate graph structure foundation for the spatial information propagation of STGCN; finally, STGCN's spatial information propagation capability allows the inference of the water level status of the entire pipeline network with only partial monitoring point data input, achieving "measuring more with less". The aforementioned links are interdependent and mutually reinforcing, and the overall technical effect is greater than the sum of the individual effects of each link, forming an innovative technical solution that lacks guidance in existing technologies. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the overall process of a water level prediction method provided in an embodiment of this application.
[0023] Figure 2 This is a schematic diagram of the adjacency matrix construction process in an embodiment of this application.
[0024] Figure 3 This is a schematic diagram of the network architecture of a spatiotemporal graph neural network model provided in an embodiment of this application.
[0025] Figure 4 This is a schematic diagram of a dual-drive training strategy provided in an embodiment of this application.
[0026] Figure 5 This is a schematic diagram of the convolution operation in the embodiments of this application.
[0027] Figure Labels S101: Mechanism model data generation step; S102: Graph structure data construction step; S103: Spatiotemporal graph neural network model construction step; S104: Model training step; S105: Fast prediction step; S701: Mechanism model data generation; S702: Pre-training stage; S703: Actual measurement and monitoring data; S704: Fine-tuning stage. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this application clearer, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0029] This application belongs to the field of urban drainage network monitoring and artificial intelligence technology, specifically involving a method and related device for predicting water levels in urban drainage networks that deeply integrates physical mechanisms with data-driven models. Currently, water level prediction in urban drainage networks is crucial for flood warning and flood control. However, existing technologies have many limitations. For example, time-series-based models (such as LSTM) typically ignore the inherent spatial topology between network nodes and cannot effectively simulate the hydraulic transmission effect from upstream to downstream. While graph-based models (such as GCN) can capture spatial dependencies, they often lack a detailed characterization of the dynamic evolution process over time. More importantly, purely data-driven models rely entirely on historical data. When training data coverage is incomplete or encounters unseen operating conditions, their prediction results may violate basic physical laws, such as mass conservation or energy conservation, leading to unreliable and untrustworthy predictions. On the other hand, while traditional urban drainage network mechanism models (such as the storm flood management model SWMM) have high physical completeness and accurate results, their calculation process is complex, and a single simulation can take several minutes or even hours, making it difficult to meet the business needs of real-time early warning and rapid decision-making.
[0030] To address the aforementioned issues, this application aims to provide a mechanism-data dual-driven method for predicting water levels in urban drainage networks. Its core idea lies in combining the prior physical knowledge of the urban drainage network mechanism model with the data learning capabilities of the spatiotemporal graph convolutional network model. High-quality, large-scale training data rich in physical laws is generated through the SWMM mechanism model to train the data model, enabling it to implicitly grasp hydraulic laws while learning data features. Simultaneously, by introducing explicit physical rule constraints, the physical consistency of the prediction results is further guaranteed. This method not only solves the problem of prediction results potentially deviating from physical reality due to the lack of physical constraints in pure data models, but also overcomes the bottleneck of low computational efficiency in pure mechanism models. Ultimately, it achieves a new paradigm for high-precision, high-efficiency, and physically interpretable water level prediction, providing strong technical support for smart urban water management.
[0031] Reference Figure 1 This document illustrates the complete flowchart of a mechanism-data dual-driven method for predicting urban drainage network water levels, as provided in an embodiment of this application. The method mainly includes a mechanism model data generation step S101, a graph structure data construction step S102, a spatiotemporal graph neural network model construction step S103, a model training step S104, and a rapid prediction step S105. The model training step S104 includes a pre-training phase and a fine-tuning phase, and applies physical rule constraints. Through the synergistic effect of this series of steps, an effective transformation from physical mechanism to data intelligence is achieved, ultimately resulting in accurate and rapid prediction of urban drainage network water levels.
[0032] Specifically, in step S101 of generating mechanistic model data, the SWMM (Sudden Rainfall and Flood Management Model) is used as the mechanistic model. By systematically setting different rainfall and inflow boundary conditions, simulated water level time series data covering various pipe network nodes under multiple operating conditions are generated in batches. SWMM is an industry-recognized physical model capable of accurately simulating the entire process of rainfall-runoff-confluence, and its simulation results have high reliability. To enable the subsequent data model to learn the hydraulic response characteristics of the pipe network under different rainfall scenarios and inflow conditions, a sufficiently diverse dataset needs to be generated. In this embodiment, no fewer than 50 different simulation scenarios are set, each scenario containing different rainfall process curves and / or different node inflow time series, thereby simulating various normal and extreme operating conditions. For each scenario, the SWMM mechanistic model runs and outputs the water level values of all nodes in the pipe network at continuous time steps, forming simulated water level time series data. In this way, without relying on long-term accumulated, often incomplete or noisy, measured data, a large number of clean and physically rich training samples can be efficiently obtained, laying a solid data foundation for subsequent model training.
[0033] After obtaining the simulation data, the process proceeds to step S102, which involves constructing the graph structure data. The purpose of this step is to digitize and structure the physical connections of the pipeline network for use by the spatiotemporal graph convolutional network model. (Refer to...) Figure 2The pipeline connectivity relationships of the network are directly parsed from the .inp configuration file of the SWMM mechanism model. Based on these connections, an N×N adjacency matrix is constructed, where N is the total number of nodes in the network. To account for the influence of node information in subsequent graph convolution calculations, self-loops are added to each network node. To avoid data scaling issues caused by different node degrees during graph convolution and to ensure the stability of model training, a symmetric normalization method is used to normalize the adjacency matrix, constructing a normalized adjacency matrix as the final graph structure data. Through this step, the static topology of the network is encoded into a standardized mathematical object, enabling the model to understand and utilize the spatial proximity and connectivity between nodes. This is the foundation for achieving high-precision spatial modeling and subsequent "measuring more with less" spatial information propagation.
[0034] The next step is step S103, which involves constructing the spatiotemporal graph neural network model. To simultaneously handle the topological dependencies of pipeline network data in the spatial dimension and the dynamic evolution in the temporal dimension, this application constructs a spatiotemporal graph convolutional network model. (Refer to...) Figure 3 The model employs a stacked architecture. The input data format is typically [B, T_in, N, F], where B is the batch size, T_in is the number of time steps, N is the number of nodes in the network, and F is the feature dimension of each node. The input data first undergoes feature dimension transformation and enhancement through an input convolutional layer, preparing for subsequent deep processing. Subsequently, the data flows through one or more core spatiotemporal graph convolutional blocks. Each spatiotemporal graph convolutional block contains a first temporal convolutional layer, a graph convolutional layer, and a second temporal convolutional layer, with residual connections set for each block. The graph convolutional layer uses Chebyshev polynomial approximation to implement graph convolution operations, controlling the spatial neighborhood perception range by setting the polynomial order. The temporal convolutional layer uses two-dimensional convolution and gated activation via gated linear units (GLUs) to capture the temporal evolution and long-range dependence of node water levels without changing the time series length. Finally, the output layer maps the data from the high-dimensional feature space back to the target prediction dimension.
[0035] In model training step S104, a dual-drive training strategy is executed. (Refer to...) Figure 4 The strategy includes a pre-training phase S702 and a fine-tuning phase S704, and applies physical rule constraints throughout the training process.
[0036] In the pre-training phase S702, the large amount of simulated water level time series data S701 generated by the SWMM mechanism model in step S101 is used as training data to fully pre-train the spatiotemporal graph convolutional network model constructed in step S103, enabling it to learn the universal spatiotemporal evolution laws of pipeline hydraulics. Specifically, the simulated data is divided into training, validation, and test sets. Supervised learning is adopted, using a historical sequence from the simulated data as model input and a subsequent sequence as the prediction target. The network parameters of the model are continuously adjusted by minimizing the difference between the model's predicted values and the true target values. Through multiple rounds of iterative training on the training set, the model can gradually learn and fit the complex hydraulic dynamic laws hidden behind a large amount of simulated data. The training uses the Adam optimizer, employing mean squared error as the basic loss function, and an early stopping mechanism is set to prevent overfitting.
[0037] After completing the pre-training phase, the model enters the fine-tuning phase (S704). A small amount of measured monitoring data from the actual target pipeline network is acquired (S703), and this data is used to fine-tune the pre-trained spatiotemporal graph convolutional network model. During fine-tuning, some of the low-level network parameters obtained in the pre-training phase are frozen, and only some high-level network parameters are updated based on the measured monitoring data. The low-level network parameters retain the general hydraulic feature representation capabilities learned from the simulated data in the pre-training phase, while the high-level network parameters are adapted to the unique hydraulic characteristics and systematic biases of the specific actual pipeline network. Through this dual-driven training strategy of "simulation pre-training + measured fine-tuning," cross-domain transfer and adaptation from the simulated data domain to the actual pipeline network data domain is achieved, enabling the model to better adapt to the actual operating conditions of the specific pipeline network and further improve prediction accuracy and robustness.
[0038] Throughout the model training step S104, physical rule constraints are also applied. Specifically, the following three physical rule constraints are added to the loss function of the model training: (1) Mass conservation constraint - For any confluence node in the pipeline network, the difference between the total inflow of the upstream connecting pipe and the total outflow of the downstream connecting pipe in a specified period does not exceed a preset threshold. This constraint is achieved by adding a penalty term to the loss function, so that the total inflow and outflow tend to be physically consistent; (2) Hydraulic gradient constraint - In the gravity flow drainage pipeline network, the predicted water level of the upstream node along the water flow direction is not lower than the predicted water level of the downstream node. When the prediction result violates this constraint, a penalty term proportional to the degree of gradient violation is added to the loss function; (3) Water level non-negativity constraint - The predicted water level value of any node is not less than zero. A square penalty is applied to the negative water level prediction value. The three physical rules mentioned above serve as soft constraints to guide the optimization direction of the model, effectively avoiding prediction results that violate physical common sense that may be generated by pure data models. Especially in the case of unseen working conditions where the training data coverage is incomplete, the physical rules constraints provide domain knowledge guidance for the model, significantly enhancing the reliability of the model output and the safety of extrapolation.
[0039] Once the model training is complete, the rapid prediction step S105 can be initiated. At this point, the trained spatiotemporal graph convolutional network model can be viewed as a lightweight, real-time "digital twin" proxy model. In practical applications, historical water level input data from a subset of pre-defined monitoring points in the pipeline network is obtained—that is, the water level observation sequence of the pre-defined monitoring points within a pre-defined time window in the past—and this input data is fed into the trained model. The model performs multi-order spatial information propagation between nodes on the normalized adjacency matrix through graph convolutional layers. Specifically, through Chebyshev graph convolution operations, each node aggregates the information of its neighboring nodes within its K-order neighborhood, allowing the features of unmonitored nodes to indirectly obtain spatial context information from a subset of monitoring points through multi-order neighborhood aggregation. Thus, based on the known state of the pre-defined monitoring points, the predicted water level values for all nodes or unmonitored nodes in the pipeline network at future times are obtained through a single forward inference. Compared to the SWMM mechanism model, which often takes tens of minutes, the inference process of this model is typically completed within seconds or even milliseconds. By utilizing the spatial information propagation capability of the model, this method achieves global situational awareness with "few measurements"—by pre-setting only a small number of monitoring points in the pipeline network (e.g., 10% to 30% of the nodes), it is possible to infer and predict the future water level evolution trend of the entire pipeline network system, which greatly improves the economic benefits and information value of the monitoring system.
[0040] This application also provides a mechanism-data dual-driven urban drainage network water level prediction device, which is used to implement the aforementioned method. The device can be one or more servers, an embedded system, or a cloud computing platform. Internally, it is divided into multiple modules, including: a data generation module for batch generating simulated water level time series data covering various operating conditions using the SWMM mechanism model; a topology encoding module for parsing pipe connection relationships from the SWMM .inp configuration file and constructing a normalized adjacency matrix; a model building module for constructing a spatiotemporal graph convolutional network model containing TGT spatiotemporal graph convolutional blocks and residual connections; a pre-training module for pre-training the model using the simulated data generated by SWMM as training data; a fine-tuning module for fine-tuning the pre-trained model using a small amount of measured monitoring data, freezing some low-level network parameters and only updating high-level parameters; a physical constraint module for simultaneously applying three physical rule constraints—mass conservation, hydraulic gradient, and water level non-negativity—to the loss function; and a prediction module for obtaining historical water level input data from some monitoring points and inferring the predicted future water level of the entire network through the model's multi-order spatial information propagation mechanism. These modules can be implemented through software programs and executed by the processor in the device.
[0041] To further verify the technical effectiveness of this application, an experiment was conducted using a real urban drainage network as an example. This network comprises 293 nodes and 292 pipes. First, 50 sets of simulated water level time series data were generated using the SWMM mechanism model, each set containing 288 time steps (5-minute step size). These data were divided into training, validation, and test sets. The normalized adjacency matrix was constructed based on the pipe connection relationships parsed from the .inp file of SWMM. The pre-training of the spatiotemporal graph convolutional network model was performed on GPU-equipped hardware using the Adam optimizer, employing mean squared error as the basic loss function, and incorporating three physical constraint penalties: mass conservation, hydraulic gradient, and non-negativity of water level. The batch size was 32, and the pre-training process consisted of 100 rounds with an early stopping mechanism. After pre-training, the model was fine-tuned using a small amount of real-world monitoring data, freezing the underlying network parameters and only fine-tuning the upper-layer parameters.
[0042] Experimental results demonstrate that the proposed method exhibits extremely high prediction accuracy and efficiency. For a prediction task involving 293 nodes across the entire pipeline network, the mean absolute error (MAE) is as low as 2.5 cm over the next 30 minutes. More importantly, after training, the model performs a prediction of the water level for the entire pipeline network over the next 30 minutes, with the entire inference process taking less than 1 second. Compared to the Storm Flood Management Model (SWMM), which requires approximately 3600 seconds to complete a single simulation, this represents an efficiency improvement of over 3600 times.
[0043] Compared with other existing data-driven models, this application also demonstrates significant advantages. On the same test set, the traditional LSTM model, failing to consider spatial topology, has a MAE of 0.045 meters; the static GCN model, due to insufficient temporal modeling capabilities, has an MAE of 0.038 meters. In contrast, the mechanism-data dual-driven method proposed in this application achieves an MAE of only 0.025 meters, significantly outperforming the aforementioned comparative models. This fully demonstrates that by deeply integrating the urban drainage network mechanism model with the spatiotemporal graph convolutional network model, and supplementing it with physical rule constraints and a dual-driven training strategy, this application effectively overcomes the shortcomings of existing technologies, achieving high-precision and high-efficiency prediction of urban drainage network water levels while ensuring physical consistency.
Claims
1. A mechanism-data dual-driven method for predicting water levels in urban drainage pipe networks, characterized in that, include: Using the Rainstorm Flood Management Model (SWMM) as a mechanistic model, simulated water level time series data covering various pipe network nodes under multiple operating conditions are generated in batches by setting different rainfall and inflow boundary conditions. The pipe connection relationship of the pipeline network is parsed from the .inp configuration file of the SWMM mechanism model, and a normalized adjacency matrix representing the physical connection between pipeline network nodes is constructed as graph structure data. A spatiotemporal graph convolutional network model is constructed. The network structure of the spatiotemporal graph convolutional network model includes a graph convolutional layer for aggregating the spatial information of neighboring nodes and a temporal convolutional layer for capturing the temporal evolution of the nodes themselves. The spatiotemporal graph convolutional network model includes at least one spatiotemporal graph convolutional block. The internal structure of the spatiotemporal graph convolutional block sequentially includes a first temporal convolutional layer, the graph convolutional layer, and a second temporal convolutional layer. The first temporal convolutional layer and the second temporal convolutional layer are the temporal convolutional layers, and residual connections are set for the spatiotemporal graph convolutional block. The dual-drive training strategy is implemented, wherein the dual-drive training strategy includes: (i) Pre-training phase: The simulated water level time series data generated by the SWMM mechanism model are used as... The training data is used to pre-train the spatiotemporal graph convolutional network model, enabling it to learn the universal spatiotemporal evolution law of pipeline hydraulics. (ii) Fine-tuning stage: Using a small amount of measured monitoring data obtained from the actual pipeline network, the pre-trained spatiotemporal graph convolutional network model is fine-tuned to achieve cross-domain migration and adaptation from the simulated data domain to the actual pipeline network data domain. During the training of the spatiotemporal graph convolutional network model, physical rule constraints are applied to the loss function of the model, or physical rule post-processing corrections are performed on the prediction results after obtaining the water level prediction value. The physical rule constraints include: mass conservation constraints, hydraulic gradient constraints, and water level non-negativity constraints. After the spatiotemporal graph convolutional network model is trained, historical water level input data from a subset of monitoring points in the pipeline network is obtained. The input data is then fed into the trained model. Through the spatial information propagation capability of the spatiotemporal graph convolutional network model, the predicted water level values for all nodes in the pipeline network or other unmonitored nodes besides the aforementioned monitoring points are obtained through a single forward inference.
2. The method according to claim 1, characterized in that, The process of generating simulated water level time series data in batches by setting different rainfall and inflow boundary conditions includes: Set up no fewer than 50 different simulation scenarios, each scenario containing different rainfall process curves and / or different nodal inflow time series, to cover a variety of hydraulic conditions from regular rainfall to extreme rainstorms; The SWMM mechanism model is run for each scenario and outputs the water level values of all nodes in the pipeline network at continuous time steps, forming the simulated water level time series data.
3. The method according to claim 1, characterized in that, The construction of the normalized adjacency matrix includes: Based on the pipe connection relationships parsed from the .inp configuration file, a self-loop is added to each pipe network node; A symmetric normalization method is used to normalize the adjacency matrix to balance the impact of different node degrees on graph convolution calculation and ensure the numerical stability of model training.
4. The method according to claim 1, characterized in that: The physical rule constraints specifically include: The mass conservation constraint is: for any confluence node in the pipeline network, the difference between the total inflow of its upstream connecting pipeline and the total outflow of its downstream connecting pipeline within a specified time period shall not exceed a preset threshold. The hydraulic gradient constraint is: in a gravity flow drainage network, the predicted water level at the upstream node along the flow direction is not lower than the predicted water level at the downstream node. The non-negative water level constraint is that the predicted water level value of any node is not less than zero.
5. The method according to claim 1, characterized in that, The graph convolutional layer uses Chebyshev polynomial approximation to implement graph convolution operations, and controls the spatial neighborhood perception range by setting the polynomial order. The first and second temporal convolutional layers are implemented using two-dimensional convolution and gating activation is performed through gated linear units to capture the temporal evolution pattern and long-range dependence of the node's own water level without changing the length of the time series.
6. The method according to claim 1, characterized in that, The fine-tuning phase includes: Freeze some of the low-level network parameters of the spatiotemporal graph convolutional network model obtained in the pre-training stage, and only fine-tune and update some of the high-level network parameters based on the measured monitoring data; The underlying network parameters retain the general hydraulic feature representation capabilities learned from the simulation data during the pre-training stage, while the upper network parameters adapt to the unique hydraulic characteristics and systematic deviations of a specific actual pipe network.
7. The method according to claim 1, characterized in that: The input data is the water level observation sequence of the monitoring points within a preset time window in the past. The spatiotemporal graph convolutional network model propagates spatial information between nodes on the graph structure data through graph convolutional layers, enabling the features of unmonitored nodes to indirectly obtain spatial context through multi-level neighborhood aggregation, thereby inferring the future water level status of all nodes in the entire pipeline network based on the known status of the partial monitoring points.
8. The method according to claim 1, characterized in that, The input data comes from historical water level data of some preset monitoring points in the pipeline network, and the water level prediction value is the future water level prediction value of all nodes in the pipeline network or other nodes other than the preset monitoring points.
9. A mechanism-data dual-driven urban drainage network water level prediction device, characterized in that, include: The data generation module is used to generate simulated water level time series data for various network nodes covering multiple operating conditions by setting different boundary conditions using a preset urban drainage network mechanism model. The topology coding module is used to obtain the topology information of the urban drainage network and construct graph structure data based on the topology information to represent the spatial connection relationship between network nodes. The model building module is used to build a spatiotemporal graph neural network model. The spatiotemporal graph neural network model includes at least one spatiotemporal graph convolutional block. The internal structure of the spatiotemporal graph convolutional block includes a first temporal convolutional layer, a graph convolutional layer and a second temporal convolutional layer in sequence, and residual connections are set for the spatiotemporal graph convolutional block. The model training module is used to pre-train the spatiotemporal graph neural network model using simulated water level time series data generated by the mechanism model as training data, and after the pre-training, to fine-tune the pre-trained spatiotemporal graph neural network model using measured monitoring data obtained from the actual pipeline network; wherein, during the training process, physical rule constraints are applied to the model, and the physical rule constraints include at least two of the following: mass conservation constraints, hydraulic gradient constraints, and water level non-negativity constraints. The prediction module is used to acquire input data representing the current or historical state of the pipeline network after the spatiotemporal graph neural network model has been trained, and to feed the input data into the trained model so as to obtain the predicted water level value of at least one node in the pipeline network at a future time through model inference.
Citation Information
Patent Citations
Urban drainage system multi-target prediction method based on SWMM and graph convolutional neural network
CN120197504A
Drainage pipe network overflow prediction method based on Phy-STNN model
CN120873424A
