Calculation method and device for time sequence operation and maintenance early warning based on pipe network space topological structure
By using a time-series operation and maintenance early warning method based on the spatial topology of the pipeline network and integrating pipeline network data through a spatiotemporal graph neural network, the problems of low prediction accuracy and insufficient spatiotemporal dynamic capture in the existing technology are solved. This method achieves high-precision water level prediction and operation and maintenance early warning, and improves the reliability of the prediction model and the efficiency of operation and maintenance decision-making.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-07
AI Technical Summary
The existing monitoring and prediction of urban wastewater systems suffer from inaccurate spatial data and a lack of robust verification mechanisms for temporal data, resulting in low prediction accuracy and difficulty in simultaneously capturing spatiotemporal dynamics.
A time-series operation and maintenance early warning method based on the spatial topology of the pipeline network is adopted. The pipeline network topology data and liquid level data are integrated through a spatiotemporal graph neural network model. The directed adjacency matrix is dynamically constructed by using an asymmetric attention mechanism and a multi-scale temporal convolution design, combined with graph convolution and temporal convolution, to predict the water level. The missing data is also learned and supplemented through federated communication.
It achieves high-precision water level prediction and operation and maintenance early warning, can accurately identify potential risk nodes, improve the spatial learning ability and temporal accuracy of the prediction model, and provide precise operation and maintenance decision support.
Smart Images

Figure CN121810262A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sewage pipe network technology, specifically to a calculation method and device for time-series operation and maintenance early warning based on the spatial topology of pipe networks. Background Technology
[0002] Efficient and accurate numerical calculation methods for urban pipe networks are of great value for urban water resource allocation, management, and flood control. The deployment of pipe network liquid level monitoring facilities brings more monitoring data, making it possible to make full use of historical monitoring data for efficient liquid level time-series prediction, to explore spatial topological connections between monitoring points, and to establish key investigation mechanisms.
[0003] Current monitoring and forecasting of urban wastewater systems face limitations in both time and space: At the spatial level, the deployment of monitoring points relies on expert experience and is constrained by on-site conditions. Outdated or inaccurate geographic information system (GIS) data leads to a mismatch with the actual infrastructure, affecting the reliability of the diagnosis. In terms of time dimension, the data lacks a sound verification mechanism, real-time early warnings rely heavily on simplified threshold rules, and the upstream and downstream dependencies of the pipeline are not fully considered. Manual analysis of large-scale data is inefficient and has limited accuracy.
[0004] While existing physical models such as the Rainwater Management Model (SWMM) and the Integrated Watershed Model (InfoWorks ICM) are widely used, their prediction accuracy is limited due to constraints on data accuracy and regional applicability. Existing data-driven methods suffer from problems such as imperfect integration of spatial topological dependencies and difficulty in simultaneously capturing spatiotemporal dynamics. Summary of the Invention
[0005] To address the aforementioned problems in the prior art, this invention provides a calculation method and apparatus for time-series operation and maintenance early warning based on pipeline network spatial topology, which solves the problems of low prediction accuracy and difficulty in simultaneously capturing spatiotemporal dynamics in existing pipeline network early warning methods.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: On the one hand, a calculation method for time-series operation and maintenance early warning based on pipeline network spatial topology is provided, including the following steps: S1. Obtain the pipeline topology data and pipeline liquid level data sequence of the target pipeline area within a preset time, and perform preprocessing such as cleaning and completion on the acquired data. S2. Apply a sliding window to the preprocessed data to obtain several continuous pipeline data segments, which then form the model input data. S3. Input the model input data into the pre-trained spatiotemporal graph neural network model and output the water level prediction sequence of each node in the future period. S4. Use water level prediction sequences for operation and maintenance early warning.
[0007] Furthermore, the pipeline network data includes pipeline network topology data and pipeline network liquid level data, and the model input data includes four-dimensional data tensors. ,in, Time scale; This represents the total number of nodes, where each node is a level gauge that collects liquid level data from the pipeline network. The size of the sliding window; The feature number of the pipeline network data; The method for predicting water level prediction sequences using a spatiotemporal graph neural network model includes the following steps: S31. Calculate the historical water level characteristics of each node in the model input data and initialize them randomly to obtain the node embedding matrix. and will In the input dynamic graph construction module, the initial association weights between nodes are calculated using an asymmetric attention mechanism: in, Let the initial association weights be those between node i and node j; A fusion embedding matrix for incorporating external hydraulic properties; , and They are respectively The row vectors of the i-th, j-th, and k-th rows; For transpose; For hydraulic embedding matrix; It is the hyperbolic tangent function; and All are trainable parameter matrices; The external hydraulic property matrix is represented by f, where f is the dimension of the hydraulic properties. S32. Perform Top-k filtering on all initial association weights to obtain the directed adjacency matrix. ; S33, will and Input graph convolution module, output node feature matrix ,calculate The expression is: in, The convolution weight matrix is the training graph. The weight vector is used to filter information in the p-th step of graph convolution propagation. The weight vector for filtering information at step p in graph convolution propagation; P is the total number of steps in graph convolution propagation. The retention factor; S34, will Based on four-dimensional data tensors The time sequence is concatenated with the corresponding pipeline network data segments to generate a time series feature matrix. and will The input is fed into the temporal convolution module to obtain multi-scale temporal features. ; S35, will Input the prediction module to obtain the water level prediction sequence. .
[0008] Furthermore, step SD further includes: S341. Load trainable temporal convolution kernels of different scales into the temporal convolution module and configure the dilation factor sequence; S342. For each layer of the temporal convolution module, calculate the filter convolution output and gated convolution output of trainable temporal convolution kernels at different scales. The expressions for the filter convolution output and the gated convolution output are as follows: , ( ) in, and These are the filter convolution output and gated convolution output of the m-th scale trainable temporal convolution kernel in the l-th layer of the temporal convolution module, respectively. For the first The temporal feature matrix of the layer; and These are the parameter matrices of the trainable filter convolution kernel and the gated convolution kernel at the l-th layer and the m-th scale, respectively. is the dilation factor of the l-th layer in the temporal convolution module; l is the network layer index of the temporal convolution module. This represents the total number of layers in the temporal convolutional module. This is dilated convolution; S343. By fusing the filter convolution output and gated convolution output of each scale-trainable temporal convolution kernel in each layer of the temporal convolution module through a gating mechanism, the gated output of each scale-trainable temporal convolution kernel is obtained, and its expression is: in, This is the gated output for the l-th layer and the m-th scale; This is element-wise multiplication; S344. Concatenate the gated outputs of all scales in each layer of the temporal convolutional module to obtain the feature matrix of the current layer, and use the feature matrix output of the last layer of the temporal convolutional module as the multi-scale temporal feature. .
[0009] Furthermore, Input the prediction module to obtain the water level prediction sequence. The expression is: in, and These are the weights of the first and second convolutional layers in the prediction module, respectively. This is the output of the first convolutional layer; It is a 1×1 convolution.
[0010] Furthermore, Input the prediction module to obtain the water level prediction sequence. The expression is: in, and These are the weights of the first and second convolutional layers in the prediction module, respectively. To select multi-scale temporal features; This is the output of the first convolutional layer; For four-dimensional data tensors The random walk embedding matrix constructed from the spatial association features of the nodes; This is a splicing symbol; It is a 1×1 convolution.
[0011] Furthermore, the pre-training method for the spatiotemporal graph neural network model is as follows: Sa, the four-dimensional data tensors obtained through historical pipeline data are divided into training set, validation set and test set in chronological order; Sb. The spatiotemporal graph neural network model is trained using the training set. During training, the parameters of the spatiotemporal graph neural network model are updated by constructing a composite loss function combined with the gradient descent algorithm. The expression of the composite loss function is: in, T and Q represent the time scale, number of nodes, and sliding window size, respectively. For nodes In time The predicted water level; for The corresponding actual water level; As weight; For time The predicted sequence; for The corresponding historical sequence; , They are respectively and The mean of the corresponding sequence; For multi-scale regularization terms; and These are the node-level weight matrix and the inter-node parameter matrix, respectively. and All of these are optimizations of hyperparameters; and These are the L1 norm and the L2 norm, respectively. Sc. The trained spatiotemporal graph neural network model is validated and tested using the validation set and the test set, respectively, to obtain the pre-trained spatiotemporal graph neural network model.
[0012] Furthermore, the method for completing the pipeline network data includes: performing federated communication learning on all liquid level sensors in the target pipeline network area to obtain the physical similarity matrix of all liquid level sensors, using a graph neural network to obtain the adjacency matrix of the physical similarity matrix, and using the adjacency matrix to complete the missing values in the pipeline network data.
[0013] Furthermore, step S4 specifically includes: generating an operation and maintenance early warning report containing over-limit warning information and key nodes of concern through the water level prediction sequence; the method for obtaining the over-limit warning information is: using the water level prediction sequence... The predicted water level value of each node at each future time step is compared with the pre-set safe water level threshold for each node. If the predicted water level of any node exceeds its corresponding safe threshold at any future time step, an over-limit warning signal is generated for that node. The method for obtaining the nodes of focus is: calculating the directed adjacency matrix. The weights between off-diagonal elements are determined, and it is determined whether each weight is greater than a preset influence threshold. If so, the two nodes corresponding to the two elements with that weight are marked as key associated objects; otherwise, no action is taken.
[0014] On the other hand, an apparatus for providing a calculation method for time-series operation and maintenance early warning based on the spatial topology of a pipeline network includes: a data acquisition module for acquiring pipeline network data through level gauges on each pipeline in the target area; a data preprocessing module for preprocessing the pipeline network data and constructing a four-dimensional data tensor; a spatiotemporal graph neural network module for obtaining the water level prediction sequence of the target area through the four-dimensional data tensor; and an early warning module for generating and displaying an operation and maintenance early warning report based on the water level prediction sequence.
[0015] Furthermore, the spatiotemporal graph neural network module includes: a dynamic graph construction module, used to obtain a directed adjacency matrix from a four-dimensional data tensor. and fusion embedding matrix ;Graph convolution module, used to pass through and Obtain the node feature matrix The temporal convolution module is used to... Obtaining multi-scale temporal features Prediction module, used to predict Obtain water level prediction sequence .
[0016] This invention discloses a calculation method and apparatus for time-series operation and maintenance early warning based on pipeline network spatial topology, the beneficial effects of which are: 1. This invention addresses the issue that existing pipeline network early warning methods rely on simplified thresholds or independent node analysis, neglecting the integrity of the pipeline network as a hydraulic system. It inputs pipeline network topology data (such as pipeline direction, diameter, slope, connection relationships, and spatial distribution information of facilities like pumping stations and discharge outlets) and pipeline network liquid level data (such as water level measurements and corresponding timestamps recorded by various level gauges in the target pipeline area) into a spatiotemporal graph neural network model. By integrating spatiotemporal information, it obtains future water level prediction sequences, achieving time-series operation and maintenance early warning based on the spatial topology of the pipeline network. This solves the problems of low prediction accuracy and difficulty in simultaneously capturing spatiotemporal dynamics in existing methods.
[0017] 2. This invention completes missing data through a federated communication learning mechanism and uses a graph neural network to obtain the adjacency matrix of the physical similarity matrix, which improves data integrity and quality. It effectively solves the shortcomings of traditional methods in handling sparse adjacency relationships, can better mine spatial information for completion operations, ensures data quality, and thus improves the spatial learning ability of the prediction model.
[0018] 3. This invention utilizes the spatiotemporal graph neural network output mechanism from steps SA to SE to dynamically construct a directed adjacency matrix and perform graph convolution and temporal convolution, achieving deep fusion learning of the spatial topology and time series of the pipeline network. Specifically, the asymmetric attention mechanism can identify directed hydraulic influences between nodes (such as the transmission effect of upstream nodes on downstream nodes), and the Top-k filtering optimizes the relationship network, enabling the model to not only capture dependencies between directly connected nodes but also model indirect associations, thereby improving the physical plausibility of the predictions.
[0019] 4. This invention, through multi-scale temporal convolution design in steps SD1 to SD4, loads convolution kernels and dilation factors of different scales and utilizes a gating mechanism to fuse the filter output, achieving refined modeling of water level changes across multiple time scales. It can simultaneously capture short-term fluctuations (such as rapid changes caused by rainfall) and long-term cycles (such as seasonal trends), avoiding the limitations of single-scale models. The gating mechanism further prevents overfitting, ensuring robust extraction of temporal features, thereby improving the accuracy and generalization ability of the predicted sequence and providing more reliable temporal dimension support for operational and maintenance early warning.
[0020] 5. This invention enhances the modeling capability of topological associations between nodes by introducing a random walk embedding matrix to optimize the spatial representation, enabling predictions to more fully consider indirect network connections. For example, for nodes that are not adjacent but indirectly affected by pipelines, the random walk can capture their implicit spatial dependencies, compensating for the shortcomings of the direct adjacency matrix. This improves the comprehensiveness of early warning, especially in complex pipeline networks, enabling more accurate identification of potential risk nodes and providing a more comprehensive basis for key investigations.
[0021] 6. This invention uses a composite loss function for model pre-training, and combines MAE loss, Pearson correlation constraints and multi-scale regularization to achieve a balanced optimization of prediction bias, dynamic similarity and overfitting suppression.
[0022] 7. This invention generates operation and maintenance reports through a two-level early warning mechanism, including threshold over-limit early warning and topology association key node identification, achieving accurate risk positioning. When an alarm is triggered when the predicted water level exceeds the limit, it can quickly identify the corresponding key nodes based on the weight of the directed adjacency matrix, providing operation and maintenance personnel with clear investigation targets. This solves the problem of existing methods relying on simplified rules, enabling early warning to not only focus on local anomalies but also consider the overall network topology, improving the pertinence and efficiency of operation and maintenance decisions. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of the calculation method for time-series operation and maintenance early warning based on pipeline spatial topology; Figure 2 This is a schematic diagram of a spatiotemporal graph neural network model. Detailed Implementation
[0024] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0025] refer to Figure 1 This embodiment provides a calculation method for time-series operation and maintenance early warning based on pipeline network spatial topology, which solves the problems of low prediction accuracy and difficulty in simultaneously capturing spatiotemporal dynamics in existing pipeline network early warning methods. The method includes the following steps: S1. Obtain pipeline data of the target pipeline area within a preset time period, and perform preprocessing such as cleaning and completion on the pipeline data.
[0026] In this embodiment, the pipeline network data includes pipeline network topology data and pipeline network liquid level data sequence.
[0027] Pipeline topology data is used to represent pipeline topology relationships. It is obtained from the sewage pipeline operation and maintenance unit in the target pipeline area. It includes pipeline direction, pipe diameter, slope, connection relationship and spatial distribution information of facilities such as pumping stations and discharge outlets. At the same time, it integrates physical prior information to provide a foundation for subsequent topology relationship modeling.
[0028] The pipeline network liquid level data sequence, i.e., liquid level monitoring values, includes data from liquid level gauges in the target pipeline network area, including the water level measurement values recorded by the liquid level gauges, timestamps, and system metadata. Preferably, but not limited to, the liquid level gauge sampling frequency is once every 5 minutes, and the time span is at least 8 months.
[0029] The method for completing pipeline network data includes: performing federated communication learning on all liquid level sensors in the target pipeline network area to obtain the physical similarity matrix of all liquid level sensors, using a graph neural network to obtain the adjacency matrix of the physical similarity matrix, and using the adjacency matrix to complete the missing values in the pipeline network data.
[0030] To address missing data, this method leverages the spatial relationships between level gauge data and employs a multi-terminal level gauge federated learning completion mechanism. This involves federating communication between level gauges distributed across different physical nodes in the network and learning a physical similarity matrix. The graph neural network then adaptively learns the adjacency matrix of the graph, accurately capturing the dependencies between level gauges. This includes not only directly connected level gauges but also those indirectly connected via pipelines. This approach effectively overcomes the shortcomings of traditional methods in handling sparse adjacency relationships, better mining spatial information for completion operations, ensuring data quality, and thus improving the spatial learning capability of the predictive model.
[0031] S2. The preprocessed pipeline network data is subjected to a sliding window to obtain several continuous pipeline network data segments, which constitute the model input data; the model input data includes a four-dimensional data tensor. ,in, Time scale; This represents the total number of nodes, corresponding to the number of level gauges in the pipeline network, i.e., the total number of monitoring nodes. A node is a level gauge that collects level data from the pipeline network. The sliding window size is the length of the sliding window used for time series analysis, i.e., the size of the historical data window considered at each time step. The feature number of the pipeline network data.
[0032] S3, will Input the pre-trained spatiotemporal graph neural network model and output the water level prediction sequence of each node over a future period.
[0033] S4. Use water level prediction sequences for operation and maintenance early warning.
[0034] In this embodiment, step S4 specifically includes: generating an operation and maintenance early warning report containing over-limit warning information and key nodes of concern through the water level prediction sequence.
[0035] The method for obtaining over-limit warning information is as follows: [The text abruptly ends here, likely due to an incomplete sentence or a formatting error.] The predicted water level value of each node at each future time step is compared with the safe water level threshold set in advance for each node. If the predicted water level of any node exceeds its corresponding safe threshold at any future time step, an over-limit warning signal is generated for that node.
[0036] The key method for obtaining nodes is: calculating the directed adjacency matrix. The weights between off-diagonal elements are determined, and it is determined whether each weight is greater than a preset influence threshold. If so, the two nodes corresponding to the two elements with that weight are marked as key associated objects; otherwise, no action is taken.
[0037] Preferably, but not limited to, the influence threshold is 0.5, that is, when the off-diagonal element When the weight between nodes is greater than 0.5, it indicates that the nodes... For nodes There is a significant hydraulic impact, which will affect the nodes. The system identifies objects that require key attention. When an alarm is triggered due to predicted water level exceeding the limit, it can quickly identify the corresponding key nodes of concern based on the weights of the directed adjacency matrix. This provides maintenance personnel with clear investigation targets, solves the problem of existing methods relying on simplified rules, and enables early warning to not only focus on local anomalies but also consider the overall network topology, thereby improving the pertinence and efficiency of maintenance decisions.
[0038] As a further embodiment, refer to Figure 2The method for outputting water level prediction sequences using a spatiotemporal graph neural network model includes the following steps: S31. Obtain the node embedding matrix by randomly initializing the historical water level features of each node in the model input data. and will In the input dynamic graph construction module, the initial association weights between nodes are calculated using an asymmetric attention mechanism, including the initial association weights between node i and node j. The calculation is expressed as: Among them, the randomly initialized node embedding matrix ; A fusion embedding matrix for incorporating external hydraulic properties; , and They are respectively The row vectors of the i-th, j-th, and k-th rows; For transpose; For hydraulic embedding matrix; It is the hyperbolic tangent function; and All are trainable parameter matrices, with initial values referenced from the four-dimensional data tensor. Setting the covariance matrix of the mid-node features accelerates training convergence; The external hydraulic attribute matrix is formed by integrating network topology data (pipeline direction, diameter, slope, etc.) and static node features (sensor elevation, historical average water level benchmark) extracted from a four-dimensional data tensor. 'f' represents the hydraulic attribute dimension, which is the total number of physical attribute types obtained from the network topology data (pipeline direction, diameter, slope, etc.) and the static node features (sensor elevation, historical average water level benchmark) extracted from the four-dimensional data tensor. For example, if the attribute includes pipe diameter, slope, pipe material, node type, and level gauge elevation, then f=5. If the pipe length attribute is added, then f=6.
[0039] In this embodiment, Initialization is based on four-dimensional data tensors The historical water level statistical characteristics of each node (such as the mean water level and standard deviation of fluctuation within different sliding windows) ensure that the initial embedding closely matches the actual monitoring data patterns. For ease of understanding, assume that N and D are 3 and 2 respectively, i.e., there are 3 nodes (level gauges), and assume that they are located upstream, midstream, and downstream of the pipeline, respectively. The combinations of historical mean water level and standard deviation of fluctuation for the 3 monitoring nodes are (1.5m, 0.1m), (1.0m, 0.3m), and (0.5m, 0.2m) respectively. From the normal distribution respectively , and Random sampling in the middle, It can be .
[0040] S32. Perform Top-k filtering on all initial association weights to obtain the directed adjacency matrix. .
[0041] S33, will and Input graph convolution module, output node feature matrix ,calculate The expression is: in, The initial values of the trainable graph convolution weight matrix are determined based on the correlation analysis between the node features in the four-dimensional data tensor and the water level prediction target, thereby improving the adaptability of the weights to the task. The information filtering weight vector at step p in graph convolution propagation has an initial distribution that references the contribution of data at different time steps in the four-dimensional data tensor to the prediction result. The weight vector for filtering information at step p in graph convolution propagation; P is the total number of steps in graph convolution propagation. The retention factor.
[0042] S34, will Based on four-dimensional data tensors The time sequence is concatenated with the corresponding pipeline network data segments to generate a time series feature matrix. and will The input is fed into the temporal convolution module to obtain multi-scale temporal features. .
[0043] Specifically, the time series feature matrix Depend on According to the temporal order of the four-dimensional data tensor in step S2 ( (time step) and sliding window features ( The corresponding window (Changes) spliced together to generate.
[0044] S35, will Input the prediction module to obtain the water level prediction sequence. .
[0045] In this embodiment, step SD specifically includes: S341. Load trainable temporal convolution kernels of different scales into the temporal convolution module and configure the dilation factor sequence.
[0046] The trainable temporal convolutional kernels include four different scales (1×2, 1×3, 1×6, 1×7), with c kernels of each scale. The trainable temporal convolutional kernels are as follows: , , and , Four trainable temporal convolutional kernels with different scales are designed based on the typical periodicity of water level changes in the four-dimensional data tensor, and the initial parameters are based on the frequency domain analysis results of the temporal features. The growth strategy of the dilation factor is based on the four-dimensional data tensor. The timing length setting ensures that the convolutional receptive field can cover the area after the L-layer is expanded. At least one complete water level fluctuation cycle.
[0047] S342. For each layer of the temporal convolution module, calculate the filter convolution output and gated convolution output of trainable temporal convolution kernels at different scales. The expressions for the filter convolution output and the gated convolution output are as follows: , ( ) in, and These are the filter convolution output and gated convolution output of the m-th scale trainable temporal convolution kernel in the l-th layer of the temporal convolution module, respectively. and These are the parameter matrices of the trainable filter convolution kernel and the gated convolution kernel at the l-th layer and the m-th scale, respectively. is the dilation factor of the l-th layer in the temporal convolution module; l is the network layer index of the temporal convolution module. This represents the total number of layers in the temporal convolutional module. This is dilated convolution; For activation functions; For the first The temporal feature matrix of the layer; when hour, .
[0048] S343. By fusing the filter convolution output and gated convolution output of each scale-trainable temporal convolution kernel in each layer of the temporal convolution module through a gating mechanism, the gated output of each scale-trainable temporal convolution kernel is obtained, and its expression is: in, This is the gated output for the l-th layer and the m-th scale; This is element-wise multiplication; S344. Concatenate the gated outputs of all scales in each layer of the temporal convolutional module to obtain the feature matrix of the current layer, and use the feature matrix output of the last layer of the temporal convolutional module as the multi-scale temporal feature. .
[0049] In this embodiment, the feature matrix of the l-th layer The expression is: in, , , and In the lth layer respectively , , , Four scales of gated output; This represents the number of channels.
[0050] As one solution in this embodiment, Input the prediction module to obtain the water level prediction sequence. The expression is: in, and These are the weights of the first and second convolutional layers in the prediction module, respectively. , , The first 1×1 convolutional layer outputs the feature dimension, and the final output dimension is 1 to correspond to the water quality prediction value. This is the output of the first convolutional layer; It is a 1×1 convolution.
[0051] As another approach in this embodiment, considering that if the target pipeline network system is large and complex, or the pipeline data quality is poor, a random walk embedding mechanism can be introduced. The random walk embedding mechanism is an existing graph representation learning technique that captures the structural relationships between nodes in the network by simulating a random walk process (e.g., starting from a node in the pipeline network and randomly traversing adjacent nodes). This allows the model to more accurately reflect the hydraulic propagation patterns in the pipeline network, such as the delay effect of upstream nodes on downstream nodes. Thus, the water level prediction sequence... The expression is: in, and These are the weights of the first and second convolutional layers in the prediction module, respectively. To select multi-scale temporal features; This is the output of the first convolutional layer; For four-dimensional data tensors The random walk embedding matrix constructed from the spatial association features of the nodes; This is a splicing symbol; It is a 1×1 convolution.
[0052] As a further embodiment, the pre-training method for the spatiotemporal graph neural network model is as follows: Sa, the four-dimensional data tensors obtained through historical pipeline data are divided into training set, validation set and test set in chronological order.
[0053] Sb. The spatiotemporal graph neural network model is trained using the training set. During training, the parameters of the spatiotemporal graph neural network model are updated by constructing a composite loss function combined with the gradient descent algorithm. The expression of the composite loss function is: in, T and Q represent the time scale, number of nodes, and sliding window size, respectively. For nodes In time The predicted water level; for The corresponding actual water level; As weight; For time The predicted sequence; for The corresponding historical sequence; , They are respectively and The mean of the corresponding sequence; For multi-scale regularization terms; and These are the node-level weight matrix and the inter-node parameter matrix, respectively. and All of these are optimizations of hyperparameters; and These are the L1 norm and L2 norm, respectively.
[0054] The first term of the composite loss function is the mean absolute error (MAE) loss, which measures the overall deviation between the predicted and actual values. The second term, constrained by the Pearson correlation coefficient, quantifies the dynamic similarity between the predicted sequence and the historical true sequence, guiding the model to learn the water level change pattern. The third term is the multi-scale regularization term, which is used to suppress model overfitting. It extends regularization from the "single node dimension" to the "pipeline network level dimension," deeply matching the actual needs of the "hierarchical operation and maintenance" of the sewage system. This breaks through the conventional understanding that the regularization term is only used for "preventing overfitting" and gives it the function of "physical consistency constraint."
[0055] Based on this composite loss function, all trainable parameters are calculated using existing gradient descent algorithms (such as Adam and SGD). The gradient of (etc.), and then based on the learning rate. pass Update parameters (where, and These are the old and updated values of the training parameter set, respectively; for The training gradient is calculated, and the model performance is evaluated in real time using a validation set (e.g., validation set MSE) during training. Training parameters (e.g., learning rate) are adjusted based on performance changes. Number of propagation steps P, k value of Top-k, network depth Repeat the parameter update and hyperparameter adjustment steps until the model's performance on the validation set stabilizes (e.g., the MSE decrease on the validation set is less than a preset threshold for multiple consecutive epochs), and then training ends.
[0056] Sc. The trained spatiotemporal graph neural network model is validated and tested using the validation set and the test set, respectively, to obtain the pre-trained spatiotemporal graph neural network model.
[0057] This embodiment also provides an apparatus for calculating a time-series operation and maintenance early warning method based on pipeline spatial topology, including: The data acquisition module is used to acquire pipeline data through level gauges on various pipelines in the target area; The data preprocessing module is used to preprocess pipeline network data and construct a four-dimensional data tensor; The spatiotemporal graph neural network module is used to obtain the water level prediction sequence of the target area through a four-dimensional data tensor. The early warning module is used to generate operation and maintenance early warning reports based on water level prediction sequences.
[0058] As a further embodiment, the spatiotemporal graph neural network module includes: The dynamic graph construction module is used to obtain the directed adjacency matrix from a four-dimensional data tensor. and fusion embedding matrix ; Graph convolution module, used to... and Obtain the node feature matrix ; The temporal convolution module is used to... Obtaining multi-scale temporal features ; Prediction module, used to predict Obtain water level prediction sequence .
[0059] In summary, the beneficial effects of this solution are as follows: This solution utilizes a spatiotemporal graph neural network to dynamically infer the directed hydraulic relationships between monitoring nodes, simultaneously performing spatiotemporal convolution calculations. This enables high-precision time-series prediction of global liquid levels over a future period. It not only fully explores the potential spatiotemporal dynamic relationships within historical monitoring data but also significantly improves the reliability and spatial learning capabilities of the prediction model by integrating prior physical information with a federated learning data completion mechanism. Ultimately, it generates an operation and maintenance report containing over-limit warnings and a list of key nodes of concern based on topological relationships. This provides clear evidence for operation and maintenance personnel to conduct accurate investigations and make efficient decisions, thereby significantly reducing the maintenance and decision-making costs of the pipeline system and improving the intelligence and efficiency of water resource management.
[0060] Although specific embodiments of the invention have been described in detail with reference to the accompanying drawings, this should not be construed as limiting the scope of protection of this invention. Various modifications and variations that can be made by those skilled in the art without inventive effort within the scope described in the claims still fall within the scope of protection of this invention.
Claims
1. A calculation method for time-series operation and maintenance early warning based on pipeline network spatial topology, characterized in that, Including the following steps: S1. Obtain the pipeline topology data and pipeline liquid level data sequence of the target pipeline area within a preset time, and perform preprocessing such as cleaning and completion on the acquired data. S2. Apply a sliding window to the preprocessed data to obtain several continuous pipeline data segments, which then form the model input data; S3. Input the model input data into the pre-trained spatiotemporal graph neural network model to predict the water level prediction sequence of each node in the future period. S4. Use water level prediction sequences for operation and maintenance early warning.
2. The calculation method for time-series operation and maintenance early warning based on pipeline spatial topology according to claim 1, characterized in that, The model input data is a four-dimensional data tensor. ,in, Time scale; This represents the total number of nodes, where each node is a level gauge that collects liquid level data from the pipeline network. The size of the sliding window; The feature number of the pipeline network data; Methods for predicting water level prediction sequences using spatiotemporal graph neural network models include: S31. Calculate the historical water level characteristics of each node in the model input data and perform random initialization to obtain the node embedding matrix. and will In the input dynamic graph construction module, the initial association weights between nodes are calculated using an asymmetric attention mechanism: in, Let the initial association weights be those between node i and node j; A fusion embedding matrix for incorporating external hydraulic properties; , and They are respectively The row vectors of the i-th, j-th, and k-th rows; For transpose; For hydraulic embedding matrix; It is the hyperbolic tangent function; and All are trainable parameter matrices; External hydraulic property matrix; S32. Perform Top-k filtering on all initial association weights to obtain the directed adjacency matrix. ; S33, will and Input graph convolution module, output node feature matrix : , , in, The convolution weight matrix is the training graph. The weight vector is used to filter information in the p-th step of graph convolution propagation. The weight vector for filtering information at step p in graph convolution propagation; P is the total number of steps in graph convolution propagation. The retention factor; S34, will Based on four-dimensional data tensors The time sequence is concatenated with the corresponding pipeline network data segments to generate a time series feature matrix. and will The input is fed into the temporal convolution module to obtain multi-scale temporal features. ; S35, will Input the prediction module to obtain the water level prediction sequence. .
3. The calculation method for time-series operation and maintenance early warning based on pipeline network spatial topology according to claim 2, characterized in that, Step S34 further includes: S341. Load trainable temporal convolution kernels of different scales into the temporal convolution module and configure the dilation factor sequence; S342. For each layer of the temporal convolution module, calculate the filter convolution output and gated convolution output of trainable temporal convolution kernels at different scales: ,( ) in, and These are the filter convolution output and gated convolution output of the m-th scale trainable temporal convolution kernel in the l-th layer of the temporal convolution module, respectively. For the first The temporal feature matrix of the layer; and These are the parameter matrices of the trainable filter convolution kernel and the gated convolution kernel at the l-th layer and the m-th scale, respectively. is the dilation factor of the l-th layer in the temporal convolution module; l is the network layer index of the temporal convolution module. This represents the total number of layers in the temporal convolutional module. This is dilated convolution; S343. By fusing the filter convolution output and gated convolution output of each scale-trainable temporal convolution kernel in each layer of the temporal convolution module through a gating mechanism, the gated output of each scale-trainable temporal convolution kernel is obtained: in, This is the gated output for the l-th layer and the m-th scale; This is element-wise multiplication; S344. Concatenate the gated outputs of all scales in each layer of the temporal convolutional module to obtain the feature matrix of the current layer, and use the feature matrix output of the last layer of the temporal convolutional module as the multi-scale temporal feature. .
4. The calculation method and apparatus for time-series operation and maintenance early warning based on pipeline network spatial topology according to claim 3, characterized in that, Will Input the prediction module to obtain the water level prediction sequence. The expression is: in, and These are the weights of the first and second convolutional layers in the prediction module, respectively. This is the output of the first convolutional layer; It is a 1×1 convolution.
5. The calculation method for time-series operation and maintenance early warning based on pipeline spatial topology according to claim 4, characterized in that, Will Input the prediction module to obtain the water level prediction sequence. The expression is: in, and These are the weights of the first and second convolutional layers in the prediction module, respectively. This is the output of the first convolutional layer; For four-dimensional data tensors The random walk embedding matrix constructed from the spatial association features of the nodes; To select multi-scale temporal features; This is a splicing symbol; It is a 1×1 convolution.
6. The calculation method for time-series operation and maintenance early warning based on pipeline network spatial topology according to claim 4, characterized in that, The pre-training method for the spatiotemporal graph neural network model is as follows: Sa, the four-dimensional data tensors obtained through historical pipeline data are divided into training set, validation set and test set in chronological order; Sb. The spatiotemporal graph neural network model is trained using a training set. During training, the parameters of the spatiotemporal graph neural network model are updated using a composite loss function combined with a gradient descent algorithm. The expression for the composite loss function is: in, T and Q represent the time scale, number of nodes, and sliding window size, respectively. For nodes In time The predicted water level; for The corresponding actual water level; As weight; For time The predicted sequence; for The corresponding historical sequence; , They are respectively and The mean of the corresponding sequence; For multi-scale regularization terms; and These are the node-level weight matrix and the inter-node parameter matrix, respectively. and All of these are optimizations of hyperparameters; and These are the L1 norm and the L2 norm, respectively. Sc. The trained spatiotemporal graph neural network model is validated and tested using the validation set and the test set, respectively, to obtain the pre-trained spatiotemporal graph neural network model.
7. The calculation method for time-series operation and maintenance early warning based on pipeline spatial topology according to claim 1, characterized in that, Methods for completing pipeline network data include: Federated communication learning is performed on all level sensors in the target pipeline area to obtain the physical similarity matrix of all level sensors. The adjacency matrix of the physical similarity matrix is obtained by using a graph neural network, and the missing values in the pipeline data are filled in by the adjacency matrix.
8. The calculation method and apparatus for time-series operation and maintenance early warning based on pipeline network spatial topology according to claim 4, characterized in that, Step S4 specifically includes: generating an operation and maintenance early warning report containing over-limit warning information and key nodes of concern through the water level prediction sequence; The method for obtaining over-limit warning information is as follows: [The text abruptly ends here, likely due to an incomplete sentence or a formatting error.] The predicted water level value of each node at each future time step is compared with the safe water level threshold set in advance for each node. If the predicted water level of any node exceeds its corresponding safe threshold at any future time step, an over-limit warning signal is generated for that node. The key method for obtaining nodes is: calculating the directed adjacency matrix. The weights between off-diagonal elements are determined, and it is determined whether each weight is greater than a preset influence threshold. If so, the two nodes corresponding to the two elements with that weight are marked as key associated objects; otherwise, no action is taken.
9. The apparatus for calculating the time-series operation and maintenance early warning method based on the spatial topology of pipeline networks according to any one of claims 1 to 8, characterized in that, include: The data acquisition module is used to acquire pipeline data through level gauges on various pipelines in the target area; The data preprocessing module is used to preprocess the pipeline network data and construct a four-dimensional data tensor; The spatiotemporal graph neural network module is used to obtain the water level prediction sequence of the target area through the four-dimensional data tensor; The early warning module is used to generate and display an operation and maintenance early warning report based on the water level prediction sequence.
10. The apparatus for calculating the time-series operation and maintenance early warning method based on pipeline spatial topology according to claim 9, characterized in that, The spatiotemporal graph neural network module includes: The dynamic graph construction module is used to obtain the directed adjacency matrix from the four-dimensional data tensor. and fusion embedding matrix ; Graph convolution module, used to... and Obtain the node feature matrix ; The temporal convolution module is used to... Obtaining multi-scale temporal features ; Prediction module, used to predict Obtain water level prediction sequence .