Method for predicting node pressure of urban water supply network
A data-driven transformer model predicts urban water supply node pressures using spatiotemporal embeddings, addressing the limitations of hydraulic models and sensor reliance, enabling accurate pressure forecasting across the network.
Patent Information
- Application Number
- CN202411056687.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-08-02
AI Technical Summary
Existing methods for predicting node pressure in urban water supply networks are labor-intensive, require continuous maintenance, and lack the ability to predict future pressures without relying on hydraulic models, especially for nodes without sensors.
A data-driven model using a transformer framework constructs spatiotemporal embeddings from sensor data, incorporating time and space features to predict node pressures without relying on hydraulic models, utilizing Hezen-Williams formula for pipeline weights and Node2Vec for graph representation, with attention mechanisms to generalize to sensorless nodes.
The model effectively predicts node pressures in urban water supply networks, reducing time complexity and enhancing generalization by abstracting sensor data into spatiotemporal vectors, accurately forecasting pressures at nodes without sensors.
Smart Images

Figure CN119129798A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of municipal engineering and urban water supply pipe network, and in particular relates to a method for predicting node pressure of an urban water supply pipe network. Background Art
[0002] Predicting the water demand pressure at urban water supply and use nodes in the future can assist the urban water supply system in planning water supply scheduling and water plant water production plans in advance to meet future urban water demand.
[0003] The traditional approach is to create a hydraulic model of the urban water supply network, predict the water demand of each node, and feed the prediction results into the calibrated hydraulic model to obtain the future demand pressure, so as to arrange pump and valve scheduling to meet future water demand. However, creating a hydraulic physical model of the urban water supply network is time-consuming and labor-intensive, requiring detailed GIS information of the network and professional node water demand / pipeline friction coefficient calibration, which brings high modeling costs; the network model needs to be constantly revised as the city develops, requiring continuous maintenance and management costs.
[0004] With the large-scale deployment of sensors, data-driven modeling based on data has become possible. Data-driven modeling is a modeling method based on data analysis and mining. It does not rely on a priori assumptions or theories, but builds models through the characteristics and laws of the data itself. At present, there are many data-based methods for predicting urban water supply in time or space: (1) interpolation methods such as Kriging interpolation and inverse distance weighted interpolation; (2) traditional machine learning methods such as multi-layer perceptron and BP neural network algorithm. (3) Graph machine learning methods, such as graph Chebyshev neural network, graph convolutional neural network and other graph neural network methods. The interpolation method assumes that the pressure is linearly distributed on the pipeline and that spatially similar nodes have similar pressures.
[0005] Patent document CN113704942A discloses a method, device and computer system for estimating the pressure of unknown nodes in a water supply network. The method includes: defining the topological structure of a water supply network graph, constructing a graph Laplace matrix of the water supply network, obtaining the pressure monitoring point information of the water supply network, obtaining the characteristic graph frequency basis of the water supply network based on the graph Laplace matrix and the pressure monitoring point information, obtaining the pressure monitoring value of the pressure monitoring point of the water supply network at the time to be solved, calculating the characteristic graph frequency coefficient of the water supply network at the time to be solved based on the pressure monitoring value and the characteristic graph frequency basis, and reconstructing the pressure of each node in the water supply network based on the characteristic graph frequency coefficient and the characteristic graph frequency basis to obtain the pressure value of each unknown node in the water supply network at the time to be solved. This method can only estimate the pressure information of non-sensor nodes at a specific time, but cannot predict future times. In addition, the graph Laplace matrix decomposition process is very time-consuming, and it is difficult to apply it to large-scale actual water supply networks.
[0006] Patent document CN117610826A discloses a method and system for predicting water demand, which includes: firstly, preprocessing the data according to the historical monitoring sequence of water demand obtained by the sensor to obtain the water demand time series, and then performing sequence decomposition analysis through the Prophet model, and then adding holiday factors to obtain the forecast graphs of water demand by day, week, month, and trend; then, extracting the nonlinear components of the residual sequence formed by the predicted value and the original sequence through the GRU model; finally, adding the predicted values of the two models to obtain the final water demand forecast value. This method lacks consideration of graph information, so it can only predict the future demand of the location where the sensor is arranged in the time series, and lacks the ability to predict the location without the sensor. And this method has not completely gotten rid of the dependence on the hydraulic model of the pipe network. Summary of the invention
[0007] The object of the present invention is to provide a method for predicting the node pressure of a city water supply network, which method does not need to rely on a hydraulic model to construct a complete data-driven model for predicting water supply pressure data.
[0008] In order to achieve the purpose of the present invention, the following technical solution is provided: a method for predicting the node pressure of a city water supply network, comprising the following steps:
[0009] The water consumption nodes in the urban water supply network are taken as nodes, and the connected pipes are taken as edges to construct the corresponding water supply network topology structure, and the corresponding pipe weight is assigned to each edge in the water supply network topology structure. The water consumption nodes are labeled with location information and whether sensors are provided;
[0010] Obtain node pressure data of each sensor in the urban water supply network, and intercept the node pressure data based on a preset time step to obtain corresponding pressure measurement values, and form a data set with the pressure measurement values and the labels of the water-using nodes;
[0011] A prediction model is constructed based on the transformer model framework and the water supply network topology structure. The prediction model includes a feature extraction module, a fusion module, an attention operation module and a prediction module:
[0012] The feature extraction module includes a time extraction part and a space extraction part. The time extraction part generates a corresponding time embedding vector based on the pressure data sampling time point, and the space extraction part obtains the connectivity embedding vector of the corresponding node based on the connection relationship between the nodes of the water supply network topology structure;
[0013] The fusion module is used to splice the connectivity embedding vector with the label of each node in the water supply network topology structure to obtain a spatial embedding vector of the corresponding node, and splice the spatial embedding vector with the time embedding vector to output a spatiotemporal embedding vector;
[0014] The attention operation module is used to perform temporal attention operation and spatial attention operation on the input spatiotemporal embedding vector to obtain the corresponding spatial attention score and spatial attention score and perform weighted calculation to output the final attention score;
[0015] The prediction module performs prediction based on the input final attention score to output a prediction result;
[0016] The prediction model is trained using the data set to obtain a node pressure prediction model for predicting the pressure of sensorless water nodes;
[0017] The location information and predicted time point of the target water-using node are input into the node pressure prediction model to obtain the node pressure data of the target water-using node.
[0018] The present invention abstracts the sensor data sampling time and the position of the sensor in the pipe network into a spatiotemporal embedding vector, and uses the attention mechanism to extract the spatiotemporal characteristics of the nodes from the spatiotemporal embedding vector. Thus, through the data-driven model, the pressure information of the nodes with sensors is generalized to the nodes lacking sensors, so as to realize the prediction of the final node pressure data.
[0019] Specifically, the pipeline weight is obtained by approximate calculation using the Hezen-Williams formula.
[0020] Specifically, the time extraction part is obtained by concatenating the weekly order and the daily order of the pipe network pressure change, which are represented by one-hot encoding respectively.
[0021] Specifically, the spatial extraction part uses the Node2Vec algorithm to analyze the topological structure of the water supply network to obtain the corresponding connectivity embedding vector.
[0022] Specifically, the splicing expression in the fusion module is as follows:
[0023]
[0024] in, represents an m-dimensional vector, Represents an n-dimensional vector.
[0025] Specifically, the temporal attention operation embeds information at a fixed time and performs the message passing process at the first layer at time t j The attention is calculated between the other moments t∈T, and the process is as follows:
[0026]
[0027]
[0028] Among them, <·,·> is the inner product operation of the vector; Q t (·),K t (·), and V t (·) are three ReLU nonlinear transformations; 3D is the dimension of the spatiotemporal pressure embedding vector, and the spatial attention score is obtained after SoftMax. Indicates that node v has a i The importance of represents the i-th spatial embedding vector, te t represents the time embedding vector at other moments, Indicates t j The time embedding vector of the moment, Pressure vector representing the pressure measurement.
[0029] Specifically, the spatial attention operation embeds information at a fixed time, and performs the message passing process at the first layer on the node v i The attention is calculated between other nodes v∈V. The process is as follows:
[0030]
[0031] Among them, <·,·> is the inner product operation of the vector; Q s (·),K s (·), and V s (·) are three ReLU nonlinear transformations; 3D is the dimension of the spatiotemporal pressure embedding vector; after SoftMax, the spatial attention score is obtained Indicates that time t is equivalent to node t j The importance of represents the i-th spatial embedding vector, te t represents the time embedding vector at other moments, Indicates t j The time embedding vector of the moment, Pressure vector representing the pressure measurement.
[0032] Specifically, the weighted calculation of the attention operation module adopts a gated fusion mechanism, and dynamically determines the spatial attention scores and weights of the spatial attention scores of different nodes at different times through the parameter m.
[0033] Specifically, during the training process, a random number of random positions are selected for masking in each batch by random masking to enhance the generalization ability of the model.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] A completely data-driven model that completely gets rid of the dependence on hydraulic models is adopted. Through the sensors arranged in the pipe network, the sampling time of the sensors and the position characteristics of the sensors in the pipe network are abstracted into time and space vectors from the two perspectives of time and space, respectively, which reduces the time complexity of the model. The measured values can also be located in time and space through the time and space vectors; by randomly masking (random number and random position) the pressure values collected by sensors in different time and space, the model's generalization prediction ability for unseen data is enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A flow chart of a method for predicting node pressure of a city water supply network provided in this embodiment;
[0037] Figure 2 A schematic diagram of the water supply network topology provided in this embodiment;
[0038] Figure 3 A schematic diagram of the framework of the prediction model provided in this embodiment;
[0039] Figure 4 This is a diagram of the spatiotemporal prediction effect provided in this embodiment when the prediction step length is 12. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0041] like Figure 1 As shown, a method for predicting node pressure of a city water supply network provided in this embodiment includes the following steps:
[0042] Define the topological structure of the water supply network graph: regard the water-using nodes in the water supply network as nodes in graph theory, and the pipelines as edges in graph theory. Use graph theory to describe the topological structure of the water supply network, and use the Hezen-Williams formula to approximately describe the pipeline weights, providing a basis for the subsequent Node2Vec graph embedding method.
[0043] The representation method of the topological structure of the water supply network graph is defined as follows: the location information of the pressure monitoring point in the water supply network is embedded into a space vector; the sampling time of the pressure monitoring point is embedded into a time vector.
[0044] The dimensionality of the graph matrix representation has become the main obstacle to its application in actual pipe networks. The graph representation based on random walks can greatly reduce the dimensionality of the network topology representation while retaining the local and global network structure, and can be used as an efficient graph representation method. Due to the regularity of water use, the pressure in the pipe network shows a periodic trend. Therefore, incorporating this periodicity into the prediction will help improve the accuracy of the prediction.
[0045] Define the learning method of the topological structure of the water supply network graph: Based on the space-time vector, a space-time vector attention mechanism is constructed to migrate the sensor node information to the sensor-lacking nodes to obtain the global future node information.
[0046] In the water supply network, attention mechanism is an effective method to adaptively capture the correlation between nodes and the long-range dependencies between nodes. By assigning different weights to different locations, the information of multiple known sensor nodes can be dynamically fused to the target non-sensor node.
[0047] In this example, the specific construction process is as follows:
[0048] Construct a weighted undirected graph of the urban water supply network topology, in which the water-using nodes of the network are represented as nodes of the graph, and the pipe sections of the network are represented as edges of the graph: the topological graph contains the connection status of the pipes in the water supply network and the weight coefficients of the connected pipes. The water-using nodes can be divided into nodes with pressure sensors and nodes without pressure sensors.
[0049] Among them, the topology is a weighted undirected graph, which consists of three parts: the starting node, the ending node, and the connection weight.
[0050] The weight coefficient of the connection The approximate calculation is performed using the Hezen-Williams formula. The approximate process is as follows:
[0051]
[0052] The final water supply network topology is as follows: Figure 2 shown.
[0053] The node pressure data of each sensor in the urban water supply network is obtained, and the node pressure data is intercepted based on a preset time step to obtain the corresponding pressure measurement value, and the pressure measurement value and the label of the water-using node are combined into a data set.
[0054] like Figure 3As shown, a prediction model is constructed based on the transformer model framework and the water supply network topology structure. The prediction model includes a feature extraction module, a fusion module, an attention operation module and a prediction module:
[0055] The feature extraction module includes a time extraction part and a space extraction part. The time extraction part generates a corresponding time embedding vector based on the pressure data sampling time point, and the space extraction part obtains the connectivity embedding vector of the corresponding node based on the connection relationship between the nodes of the water supply network topology structure;
[0056] The fusion module is used to splice the connectivity embedding vector with the label of each node in the water supply network topology structure to obtain a spatial embedding vector of the corresponding node, and splice the spatial embedding vector with the time embedding vector to output a spatiotemporal embedding vector;
[0057] The attention operation module is used to perform temporal attention operation and spatial attention operation on the input spatiotemporal embedding vector to obtain the corresponding spatial attention score and spatial attention score and perform weighted calculation to output the final attention score;
[0058] The prediction module makes a prediction based on the input final attention score to output a prediction result.
[0059] Furthermore, in the feature extraction module, the location information of the pressure monitoring point in the water supply network is embedded into a space vector; the sampling time of the pressure monitoring point is embedded into a time vector;
[0060] Generate a time embedding vector based on the sensor sampling time point: The sensor sampling time is represented as a dual cycle of weekly order and daily order, which are represented by one-hot encoding and concatenated together. The time is represented as a dual cycle of weekly order and daily order, which are represented by one-hot encoding and concatenated together.
[0061] The week order refers to the day of the week when the sensor is sampled;
[0062] The daily order is the number of times the sensor samples in a day.
[0063] In the spatial extraction part, the spatial embedding vector of each water-using node in the pipeline network is generated according to the topological weighted undirected graph based on the Node2Vec algorithm: Node2Vec is an algorithm framework for graph representation learning. Its goal is to learn continuous feature representations for nodes in the graph for various downstream machine learning tasks. The process of generating spatial vector embedding based on graph information is as follows:
[0064] Generate training samples from node to node. First, start from each node and perform a specific number of biased walks. The biased walk moves from one node to the next node based on the pipeline weight. The pipeline with a large weight is more likely to be selected as the next walk direction.
[0065] The generated random walk node sequence is regarded as a text corpus, and the SkipGram model is used to learn the feature vector of the node, and negative sampling is used to accelerate the training process. Specifically, for each node in the sequence, the SkipGram model attempts to use the vector representation of the node to predict its context node in the sequence, that is, the node adjacent to the given node in the random walk sequence. In this way, the node vector representation learned by the model can capture the contextual information of the node, that is, its neighboring nodes. The goal of the SkipGram model is to maximize the logarithmic probability of the occurrence of its context node given the vector representation of a given node. This goal is achieved by optimizing the following objective function:
[0066]
[0067] Where V is the node set and N(v) is the context node of node v. P(u|v) is the probability of node u appearing given the vector representation of node v, calculated using the SoftMax function:
[0068]
[0069] The concatenation expression in the fusion module is as follows:
[0070]
[0071] in, represents an m-dimensional vector, Represents an n-dimensional vector.
[0072] The temporal and spatial embedding vectors are concatenated to obtain the spatiotemporal embedding, which is then concatenated with the node pressure vector at that time to obtain the model input. For nodes without sensors, the pressure vector is assumed to be the average value of the nodes with measurements.
[0073] Specifically, for the spatiotemporal embedding vector of non-sensor nodes, it is the spatial embedding vector and the time vector The process of splicing is as follows:
[0074]
[0075] Specifically, for the spatiotemporal pressure embedding vector of the sensor node, it is the spatiotemporal embedding vector STE and the pressure vector The process of splicing is as follows:
[0076]
[0077] Based on the space-time vector, a space-time vector attention mechanism is constructed to migrate the sensor node information to the non-sensor nodes and obtain the global future node information.
[0078] Compared with the traditional attention mechanism, it is expanded into temporal attention and spatial attention to extract spatiotemporal features from the spatiotemporal embedding vector; a gated fusion mechanism is used to divide the weights of temporal and spatial attention; random masks (number of random masks and random mask positions) are added to enhance the generalization ability of the model (the model is shown in the figure).
[0079] Time attention, for the moment The node below v , spatial attention extraction embeds information at a fixed time, for the l-th layer message passing process, time t j The attention is calculated between the other moments t∈T, and the process is as follows:
[0080]
[0081]
[0082] Among them, <·,·> is the inner product operation of the vector; Q t (·),K t (·), and V t (·) represents three ReLU nonlinear transformations; 3D is the dimension of the spatiotemporal pressure embedding vector. After SoftMax, the spatial attention score is obtained. Indicates that node v has a i importance.
[0083] Spatial attention, for the moment The node below v , spatial attention extraction embeds information at a fixed time, for the l-th layer message passing process, for node v i The attention is calculated between other nodes v∈V. The process is as follows:
[0084]
[0085] Among them, <·,·> is the inner product operation of the vector; Q s (·),K s (·), and V s (·) represents three ReLU nonlinear transformations; 3D is the dimension of the spatiotemporal pressure embedding vector. After SoftMax, the spatial attention score is obtained. Indicates that time t is equivalent to node t j importance.
[0086] In addition, the weighted calculation of the attention operation module adopts a gated fusion mechanism, which dynamically determines the spatial attention scores and weights of the spatial attention scores of different nodes at different times through the parameter m.
[0087] For the lth layer, the temporal and spatial attention of all nodes are represented as and
[0088]
[0089] m=σ(H s W1+H T W2+b)
[0090] m is the "gate". W1, W2 and b are learnable parameters. ⊙ is the Hadamard product. σ(·) is the sigmoid activation function.
[0091] The prediction model is trained using the data set to obtain a node pressure prediction model for predicting the pressure of sensorless water nodes. More specifically, during the training process, a random number of random positions are selected for each batch to be masked by random masking to enhance the generalization ability of the model, that is, the pressure part of the STPE of each training batch in the training is masked, and the mask value is 0. For nodes without sensors, their pressure part is unknown, that is, the pressure part in the STPE is unknown. By training nodes with pressure sensors, and randomly masking the pressure part in the training batch during training, the generalization ability of the model is enhanced. Random masking selects a random number of random positions for each batch to be masked.
[0092] By inputting the spatiotemporal embedding vector of non-sensor nodes into the trained model, the prediction result of the lack of pressure sensors can be obtained, that is, the prediction process. The specific process includes:
[0093] Given I nodes with sensors arranged on them, we take their historical observations of J time steps as training data. The training task is to predict the future J * The pressure value of each time step The objective function is:
[0094]
[0095] Among them, Θ represents all trainable parameters of the model.
[0096] The location information and predicted time point of the target water-using node are input into the node pressure prediction model to obtain the node pressure data of the target water-using node. More specifically, after obtaining a training model with I sensor nodes arranged therein, the pressure prediction is performed by inputting all I+I * Nodes get:
[0097] Forecasting(X * ) = f Θ (X * )=Z.
[0098] In order to better illustrate the technical effect of the method provided in this example, the process of creating a water demand pressure prediction using the real public example pipeline network L Town is used as an example to further explain the implementation process of the unknown node pressure estimation method of the water supply pipeline network provided by the present disclosure. The example pipeline network used in this embodiment has a total of 782 water nodes, 2 water supply points, 1 pressure reducing valve, and 1 booster pump, and the maximum elevation difference between nodes is 71.21m. In this embodiment, the actual sampling data of the original 33 pressure monitoring points in the benchmark pipeline network is used in the model.
[0099] A weighted undirected graph of the water supply network is constructed, including the pipe segment number, starting node, ending node and weight, as shown in Table 1 (a total of 905 rows, a truncated part); based on the constructed weighted undirected graph, the Node2Vec algorithm is used to represent its sensor nodes as connectivity embedding vectors, and the embedding dimension is 256 dimensions, as shown in Table 2 (a total of 33 rows, a truncated part). The connectivity embedding and the node elevation are spliced to obtain the node space embedding vector, as shown in Table 3 (a total of 33 rows, a truncated part).
[0100] Table 1
[0101] Pipe segment number Starting Node Termination Node Weight 1 62 61 0.240 … … … 16 16 18 0.063 … … … 111 116 125 0.049 … … … 905 342 782 0.068
[0102] Table 2
[0103] Node Number Connectivity Embedding 1 -0.54878485,0.37317982,…,-0.34001064 … 16 -0.07466959,-0.26584777,…,0.45116132 … 33 -0.014847224,0.5691468,…,0.11146935
[0104] Table 3
[0105] Node Number Spatial embedding vector (a total of 2256 elements, truncated) 1 73.2105,-0.54878485,0.37317982,…,-0.34001064 … 16 28.5315,-0.07466959,-0.26584777,…,0.45116132 … 33 26.1136,-0.014847224,0.5691468,…,0.11146935
[0106] The sensor sampling time at 0:45 on Friday (assuming data is uploaded every 15 minutes) can be expressed as "week order: 5; day order: 3". By representing "5" and "3" as one-hot encoding vectors [0,0,0,0,1,0,0] (a total of 7 bits, the 5th bit is 1) and [0,0,1,,…,0] (a total of 48 bits, the 3rd bit is 1), the two one-hot encodings are concatenated together [0,0,0,0,1,0,0,0,0,1,,…,0], and the dimension is converted into the same 256-dimensional spatial embedding vector through a fully connected layer, that is, the time embedding vector at that moment is obtained.
[0107] The pressure measurements are also transformed into the same 256-dimensional shape by a fully connected layer.
[0108] Assuming that 11 of the 33 sensor nodes lack sensors and 22 are equipped with sensors, three test samples are generated and the test of this embodiment is performed. For the nodes lacking sensors, their spatiotemporal embedding vector is the concatenation of the time embedding vector and the space embedding vector; for the nodes equipped with sensors, their spatiotemporal pressure embedding vector is the concatenation of the time embedding vector, the space embedding vector and the pressure measurement vector.
[0109] The water demand pressure prediction model is trained by inputting the spatiotemporal pressure embedding vector of the sensor nodes. The model uses two encoder layers and decoder layers, and is trained using the ADAM optimizer combined with an early stopping mechanism activated after 30 epochs. This early stopping mechanism depends on the validation loss and stops training if no improvement is observed for 10 consecutive batches. The learning rate is 0.03. The batch size is 32.
[0110] The spatiotemporal embedding vectors of non-sensor nodes are input into the trained model to obtain the future water demand pressure of the nodes lacking sensors.
[0111] like Figure 4 As shown, the horizontal axis represents the index number of the available sensors in the entire pipe network system, which aims to comprehensively evaluate the model performance through the K-fold cross-validation strategy (here K = 3).
[0112] according to Figure 4 (a) Figure 4 (b) and Figure 4 (c) As can be seen, the sensors are evenly divided into three subsets. The black blocks show the locations of the sensors selected as training data, while the red blocks indicate the locations of the sensors used to test the model performance. The vertical axis reflects the model prediction ability, which is specifically expressed as the absolute average error between the spatiotemporal prediction value and the measured value of the unknown node at a certain moment in the future, and the error value is in water head (meter).
[0113] That is, the pressure value of unknown nodes under non-special hydraulic conditions can be accurately predicted through a few pressure monitoring values in the pipe network. There is still a large error in the special hydraulic condition area controlled by the pressure reducing valve or booster pump.
[0114] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0115] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for predicting node pressure of a city water supply network, characterized in that: The following steps are involved: The water consumption nodes in the urban water supply network are taken as nodes, and the connected pipes are taken as edges to construct the corresponding water supply network topology structure, and the corresponding pipe weight is assigned to each edge in the water supply network topology structure. The water consumption nodes are labeled with location information and whether sensors are provided; Obtain node pressure data of each sensor in the urban water supply network, and intercept the node pressure data based on a preset time step to obtain corresponding pressure measurement values, and form a data set with the pressure measurement values and the labels of the water-using nodes; A prediction model is constructed based on the transformer model framework and the water supply network topology structure. The prediction model includes a feature extraction module, a fusion module, an attention operation module and a prediction module: The feature extraction module includes a time extraction part and a space extraction part. The time extraction part generates a corresponding time embedding vector based on the pressure data sampling time point, and the space extraction part obtains the connectivity embedding vector of the corresponding node based on the connection relationship between the nodes of the water supply network topology structure; The fusion module is used to splice the connectivity embedding vector with the label of each node in the water supply network topology structure to obtain a spatial embedding vector of the corresponding node, and splice the spatial embedding vector with the time embedding vector to output a spatiotemporal embedding vector; The attention operation module is used to perform temporal attention operation and spatial attention operation on the input spatiotemporal embedding vector to obtain the corresponding spatial attention score and spatial attention score and perform weighted calculation to output the final attention score; The prediction module performs prediction based on the input final attention score to output a prediction result; The prediction model is trained using the data set to obtain a node pressure prediction model for predicting the pressure of sensorless water nodes; The location information and predicted time point of the target water-using node are input into the node pressure prediction model to obtain the node pressure data of the target water-using node.
2. The method for predicting node pressure of urban water supply network according to claim 1, characterized in that: The pipeline weight is obtained by approximate calculation using the Hezen-Williams formula.
3. The method for predicting node pressure of a city water supply network according to claim 1, characterized in that: The time extraction part is obtained by concatenating the weekly order and the daily order of the pipe network pressure change, which are represented by one-hot encoding respectively.
4. The method for predicting node pressure of a city water supply network according to claim 1, characterized in that: The spatial extraction part uses the Node2Vec algorithm to analyze the topological structure of the water supply network to obtain the corresponding connectivity embedding vector.
5. The method for predicting node pressure of urban water supply network according to claim 1, characterized in that: The splicing expression in the fusion module is as follows: in, represents an m-dimensional vector, Represents an n-dimensional vector.
6. The method for predicting node pressure of a city water supply network according to claim 1, characterized in that: The temporal attention operation embeds information at a fixed time for the l-th layer message passing process, at time t j The attention is calculated between the other moments t∈T, and the process is as follows: Among them, <·,·> is the inner product operation of the vector; Q t (·),K t (·), and V t (·) are three ReLU nonlinear transformations; 3D is the dimension of the spatiotemporal pressure embedding vector, and the spatial attention score is obtained after SoftMax. Indicates that node v has a i The importance of represents the i-th spatial embedding vector, te t represents the time embedding vector at other moments, Indicates t j The time embedding vector of the moment, Pressure vector representing the pressure measurement.
7. The method for predicting node pressure of a city water supply network according to claim 1, characterized in that: The spatial attention operation embeds information at a fixed time, and performs the message passing process at the first layer on the node v. i The attention is calculated between other nodes v∈V. The process is as follows: Among them, <·,·> is the inner product operation of the vector; Q s (·),K s (·), and V s (·) are three ReLU nonlinear transformations; 3D is the dimension of the spatiotemporal pressure embedding vector; after SoftMax, the spatial attention score is obtained Indicates that time t is equivalent to node t j The importance of represents the i-th spatial embedding vector, te t represents the time embedding vector at other moments, Indicates t j The time embedding vector of the moment, Pressure vector representing the pressure measurement.
8. The method for predicting node pressure of a city water supply network according to claim 1, characterized in that: The weighted calculation of the attention operation module adopts a gated fusion mechanism, and dynamically determines the spatial attention scores and weights of the spatial attention scores of different nodes at different times through the parameter m.
9. The method for predicting node pressure of a city water supply network according to claim 1, characterized in that: During the training process, a random number of random positions are selected for masking in each batch to enhance the generalization ability of the model.
Citation Information
Patent Citations
Pressure estimation method and device for unknown nodes of water supply network, and computer system
CN113704942A
Water demand prediction method and system
CN117610826A
Water supply network pressure prediction method and system based on machine learning
CN113378335A
Method, system and device for training and predicting pressure prediction model and storage medium
CN115204502A
Urban water supply pipeline leakage detecting and positioning method
CN118088945A
Cited By
Urban pipe network monitoring method and system based on artificial intelligence and geographic information
CN119646556A
Sampling energy-saving method and device for wireless sensor network of water supply system
CN120075968A
Water supply network pressure prediction method and device, electronic equipment and storage medium
CN120450901A
Water supply pump station optimal scheduling method based on graph deep learning and genetic algorithm
CN121235421A
