Water consumption prediction method based on combination model of gnn and lstm

By combining GNN and LSTM models, the time characteristics and complex correlations of enterprise water consumption are captured, solving the problem of insufficient accuracy in traditional water consumption prediction methods and achieving more accurate and flexible water consumption prediction to support water resource management in industrial parks.

CN118627690BActive Publication Date: 2026-06-23ZHEJIANG NENGWEI GONGZHI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG NENGWEI GONGZHI TECH CO LTD
Filing Date
2024-08-07
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Traditional water consumption forecasting methods ignore the complex relationships and mutual influences between enterprises, resulting in insufficient forecast accuracy.

Method used

By combining graph neural networks (GNN) and long short-term memory networks (LSTM), a multi-dimensional adjacency matrix is ​​constructed to capture the relationship features and time features between enterprises, and a GNN-LSTM combined model is built for prediction.

Benefits of technology

It improves the accuracy and robustness of water consumption forecasting, enhances the ability to respond to emergencies and seasonal changes, and provides more intelligent and refined decision support for water resource management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118627690B_ABST
    Figure CN118627690B_ABST
Patent Text Reader

Abstract

The water consumption prediction method based on the combination model of GNN and LSTM comprises the following steps: S1. obtaining the historical water consumption of enterprises in the park and related influence factor data, including time identification and meteorological data, and performing data preprocessing; S2. constructing a combination model based on GNN and LSTM, wherein the LSTM model is used to extract the time characteristics of the water consumption of enterprises, the GNN model is used to extract the relationship characteristics between enterprises, the GNN-LSTM superposition model is used to extract the combined characteristics, and the characteristics are spliced as input to obtain the water consumption prediction value through a full connection layer; and S3. using historical data to train the model, update the model parameters, and obtain a combination prediction model; the combination model in the application considers the influence of the complex correlation between enterprises in the industrial park on the water consumption, utilizes the space-time relationship characteristics in the data, and further improves the prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water consumption prediction technology, specifically a water consumption prediction method based on a combined GNN and LSTM model. Background Technology

[0002] With the development of industrial parks and the increase in water consumption by enterprises, accurate prediction of enterprise water demand is crucial for water resource management and sustainable development of industrial parks. Traditional water consumption prediction methods mainly rely on statistical models, time series models, and machine learning models, such as the Autoregressive Integral Moving Average (ARIMA), Support Vector Machine (SVM), and neural networks. These methods typically only consider the historical water consumption data of a single enterprise, ignoring the complex relationships and mutual influences between enterprises, resulting in insufficient prediction accuracy.

[0003] In recent years, the development of deep learning technology has provided new methods for water consumption forecasting. Long Short-Term Memory (LSTM) networks, due to their superior performance in processing time series data, have been widely applied to various forecasting tasks. However, LSTM models primarily focus on the temporal characteristics of sequence data, making it difficult to effectively capture the spatial characteristics of enterprises and the relationships between them.

[0004] Graph Neural Networks (GNNs), as a deep learning model capable of processing graph-structured data, have significant advantages in representing the relative positions of nodes and learning complex relationships between them. They utilize adjacency matrices to represent graph structure information and capture relationships between nodes through message passing mechanisms. Combining GNNs with LSTMs allows for the simultaneous utilization of both temporal and relational features in the data, improving prediction accuracy.

[0005] Enterprises within industrial parks are not only geographically connected but may also have upstream and downstream supply chain relationships, alliances, competitive relationships, and investment relationships. These relationships significantly impact water consumption. For example, upstream and downstream enterprises may have similar water usage patterns; cooperative enterprises may coordinate water usage during peak periods; competitive enterprises may experience fluctuations in water consumption due to market competition; and geographically proximate enterprises may be affected by similar unforeseen events (such as water supply network equipment failures). Therefore, this invention proposes a method for predicting enterprise water consumption combining GNN and LSTM. By introducing relational features, it more comprehensively captures the complex relationships between enterprises within industrial parks. Combined with time features, it improves the overall performance of the prediction model, achieving accurate prediction of enterprise water consumption. Summary of the Invention

[0006] The technical problem to be solved by the present invention is to provide a water consumption prediction method based on a combination model of GNN and LSTM, which can effectively solve the problems mentioned in the background art.

[0007] To solve the above problems, the technical solution adopted by this invention is: a water consumption prediction method based on a combined GNN and LSTM model, comprising the following steps:

[0008] S1. Obtain historical water consumption data and related influencing factors for the enterprise, including time stamps and meteorological data, and preprocess the acquired data;

[0009] S2. Construct a combined model based on GNN and LSTM. In the combined model, the LSTM model is used to extract the time features of enterprise water consumption, the GNN model is used to extract the relational features, and the GNN-LSTM superposition model is used to extract the combined features. The combined features are concatenated and used as input to obtain the water consumption prediction value through a fully connected layer.

[0010] S3. Use historical data to train the combined model, update the parameters of the combined model, and obtain the combined prediction model.

[0011] As a further preferred embodiment of the present invention, in S1

[0012] Time markers include year, season, month, date, weekday, weekday, and public holiday;

[0013] Meteorological data includes temperature, humidity, wind speed, and precipitation.

[0014] As a further preferred embodiment of the present invention, the data preprocessing method in step S1 includes outlier removal, missing value filling and normalization.

[0015] As a further preferred embodiment of the present invention, the process of extracting time features using an LSTM model in step S2 is as follows: Input the enterprise's water consumption and the time series of influencing factors: ,in The number of enterprises in the region. For time steps, The feature dimensions include water consumption and other relevant factors.

[0016] The extraction process is as follows: ;

[0017] The temporal feature output is a hidden state sequence. ,in For future time steps, The dimension of the hidden state features.

[0018] As a further preferred embodiment of the present invention, the process of extracting relational features using a GNN model in step S2 is as follows: Input K enterprise node features and construct a node feature matrix. , among which, the The formula for updating the node features of a layer is: ;in, For the first Layer node characteristics, For the first The weight matrix of the layer, For the first Layer bias; For activation functions; It is an adjacency matrix;

[0019] The relational feature output is as follows: .

[0020] As a further preferred embodiment of the present invention, the process of extracting combined features by the GNN-LSTM model in step S2 is as follows: Input P enterprise node features and construct a node feature matrix. ;

[0021] The extraction process is as follows ;

[0022] The combined feature output is: .

[0023] As a further preferred embodiment of the present invention, the process of constructing the adjacency matrix is ​​as follows:

[0024] A1. Construct an adjacency matrix based on geographic location:

[0025] A Gaussian kernel function is used to calculate weights based on geographical distance; the closer the distance, the greater the weight.

[0026] ;

[0027] in, Indicates enterprise and Geographical distance between them It is the bandwidth of the Gaussian kernel;

[0028] A2. Construct an adjacency matrix based on the similarity of water consumption sequences:

[0029] Water consumption sequence similarity can be obtained by calculating the Pearson correlation coefficient, and then constructing an adjacency matrix.

[0030] ;

[0031] in, and Indicates enterprise and Water consumption time series;

[0032] A3. Constructing an adjacency matrix based on business relationships: An adjacency matrix is ​​constructed based on the actual business connections between enterprises (such as supply chain relationships, cooperative relationships, competitive relationships, etc.).

[0033] ;

[0034] A4. Constructing a comprehensive adjacency matrix involves weighting and summing the three adjacency matrices mentioned above according to certain weights to construct a comprehensive adjacency matrix:

[0035] ;

[0036] in, , and These are weight parameters used to adjust the influence of different relationships, and can be optimized through grid search.

[0037] As a further preferred embodiment of the present invention, the model feature concatenation and prediction process in step S2 is as follows:

[0038] Time characteristics Relationship characteristics and combined features When pieced together, the final feature representation is formed:

[0039] ;

[0040] The concatenated features are then input into the fully connected layer for prediction.

[0041] .

[0042] As a further preferred embodiment of the present invention, the loss function for model training in step S3 is the total mean square error:

[0043] ;

[0044] The gradient is calculated using the backpropagation algorithm, the model parameters are updated using the optimizer, and the hyperparameters are adjusted. The training process is repeated until the model converges, and the hyperparameters that minimize the average value of the loss function in the last 10 iterations are selected.

[0045] Compared with existing technologies, this invention provides a water consumption prediction method based on a combined GNN and LSTM model, which has the following advantages:

[0046] This method integrates the advantages of GNN and LSTM to comprehensively capture the temporal characteristics of water consumption by enterprises in the same region and the complex relationships between enterprises.

[0047] In particular, the GNN model uses multiple dimensions such as geographical location, water consumption similarity, and actual business relationships to construct an adjacency matrix, accurately modeling the correlation between enterprises, while the LSTM model delves into the time series patterns of water consumption.

[0048] The combined model, through feature splicing and prediction via a fully connected layer, not only significantly improves the accuracy and robustness of predictions but also enhances the ability to respond to emergencies and seasonal changes, providing more intelligent and refined decision support for water resource management in the park.

[0049] Furthermore, this method, by introducing a weight adjustment mechanism based on multiple relational features, achieves optimized adjustment of the influence of different relations, making the model more adaptable and generalizable in practical applications. Simultaneously, the invention has broad applicability, such as for predicting water consumption in interconnected buildings (restaurants, entertainment venues, schools, hospitals, parks, etc.) with different functions within medium to large-scale areas. Attached Figure Description

[0050] Figure 1 This is a schematic diagram of the process of the present invention;

[0051] Figure 2 This is a schematic diagram of the prediction using the GNN-LSTM hybrid model.

[0052] Figure 3 The figure shows a comparison between the predicted and actual values ​​of the enterprise based on the hybrid model of GNN and LSTM in the example. Detailed Implementation

[0053] Furthermore, if the embodiments of the present invention involve descriptions such as "first" or "second", such descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated.

[0054] In addition, if "and / or" or "and / or" appears in the text, it means three parallel options. For example, "A and / or B" includes option A, option B, or option A and B are satisfied at the same time.

[0055] Furthermore, the technical solutions of the various embodiments can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.

[0056] As a specific embodiment 1 of the present invention: a method for predicting water consumption of enterprises in an industrial park based on a combined GNN and LSTM model is provided, such as... Figure 1 As shown, it includes the following steps:

[0057] S1. First, obtain historical water consumption data and related influencing factors for enterprises within the industrial park, including time stamps and meteorological data. Perform data preprocessing. Specifically, obtain historical water consumption data for a total of M enterprises from the industrial park's water management system, covering the past year. The data includes hourly water consumption and related influencing factor data, including meteorological data (temperature, humidity, wind speed, precipitation) and time stamps (year, season, month, date, hour, day of the week, weekday or holiday). The data preprocessing process includes using the Z-score method to remove outliers, using interpolation to fill in missing values, and using min-max scaling to normalize all data, mapping it to the range [0,1].

[0058] S2. Next, a combined model based on GNN and LSTM is constructed. The LSTM model extracts the temporal features of enterprise water consumption, the GNN model extracts the features of relationships between enterprises, and the GNN-LSTM overlay model extracts combined features. These features are then concatenated and used as input through a fully connected layer to obtain the predicted water consumption value. Specifically:

[0059] 1. The process of extracting time features using the LSTM model is as follows:

[0060] 1.1 Enter the company Water consumption and influencing factors time series: .

[0061] in, For time steps, For feature dimensions (including water consumption and other relevant factors), here is the number of time steps. =48 (hours), feature dimension F=12;

[0062] 1.2 The extraction process is as follows: ;

[0063] 1.3 The LSTM model includes a forget gate, input gate, state update gate, and output gate:

[0064] 1.31. The Gate of Oblivion: ;

[0065] 1.32. Input Gate: , ;

[0066] 1.33. Cell state update: ;

[0067] 1.34. Output Gate: ;

[0068] 1.35. Hidden state updated: ;

[0069] The output is a sequence of hidden states. ,in For future time steps, = 24, length of hidden state sequence = 128.

[0070] 2. Extract relational features using the GNN model. The specific process is as follows:

[0071] 2.1. Constructing the node matrix The enterprise nodes within this park possess the following characteristic attributes: average water consumption of the previous day, average water consumption of the past 3 hours, water consumption of the past hour, geographical location (longitude and latitude), number of employees, length of working hours, years of establishment, and energy consumption (electricity consumption and gas consumption). Therefore, the node characteristic matrix... .

[0072] 2.2. Constructing the adjacency matrix :

[0073] 2.21. Adjacency Matrix Based on Geographical Location: An adjacency matrix is ​​constructed based on the geographical distance between enterprises, and the distance weights are calculated using a Gaussian kernel function, with greater weights for closer enterprises.

[0074] ;

[0075] in, Indicates enterprise and Geographical distance between them It is the bandwidth of the Gaussian kernel, in this embodiment 1 = 1.

[0076] 2.22. Adjacency matrix for water consumption sequence similarity: An adjacency matrix is ​​constructed by calculating the Pearson correlation coefficient of the water consumption time series of enterprises;

[0077] ;

[0078] in, and Indicates enterprise and 24-hour water consumption time series.

[0079] 2.23. Adjacency Matrix of Business Relationships: Construct an adjacency matrix based on the actual business relationships between enterprises (such as supply chain relationships, cooperative relationships, competitive relationships, etc.);

[0080] ;

[0081] 2.24. Comprehensive Adjacency Matrix: The three types of adjacency matrices mentioned above are weighted and summed according to certain weights to construct a comprehensive adjacency matrix:

[0082] ;

[0083] in, , and These are weight parameters used to adjust the influence of different relationships. They can be optimized using grid search. In this embodiment, after optimization, they are: =0.2, =0.4, =0.4.

[0084] 3. Next, we extract relational features using a GNN network. The GNN has two layers, each outputting features with a dimension of 64. The final relation feature output is: .

[0085] 4. Construction of GNN-LSTM stacked model, combined model structure as follows: Figure 2 As shown: In this embodiment 1, the relational features extracted by GNN are directly applied. Inputting into the LSTM model yields combined features: .

[0086] 5. Model assembly and prediction

[0087] 5.1. Feature Concatenation: The temporal features extracted by LSTM, the relational features extracted by GNN, and the combined features extracted by GNN-LSTM are concatenated to form the final feature representation. .

[0088] 5.2. Fully Connected Layer Prediction: The concatenated features are input into the fully connected layer for prediction. The output dimension of the fully connected layer is × 24 (represents the predicted water consumption of each enterprise in the next 24 hours).

[0089] S3. After the initial model construction, historical data is used for model training. The loss function for model training is the total mean squared error: ;

[0090] The weight initialization method uses Xavier initialization, the gradient is calculated using the backpropagation algorithm, and the model parameters are updated using the Adam optimizer.

[0091] Simultaneously adjust the hyperparameters, repeat the training process until the model converges, and select the hyperparameters that minimize the average value of the loss function in the last 10 iterations.

[0092] The final hyperparameters were set as follows: GNN hidden layer size was 64, number of layers was 2, activation function was ReLU, and learning rate was 0.01; LSTM hidden layer size was 128, number of layers was 2, dropout rate was 0.3, and learning rate was 0.001; training batch size was 64, training epochs were 100; L2 regularization parameter was 0.001; geographical location weight in adjacency matrix was 0.2, water consumption similarity weight was 0.4, and business relationship weight was 0.4.

[0093] As a specific embodiment 2 of the present invention: a method for predicting water consumption of enterprises in industrial parks based on a combined GNN and LSTM model, comprising the following steps:

[0094] S1. First, obtain historical water consumption data and related influencing factors of enterprises within the park, including time stamps and meteorological data. Perform data preprocessing.

[0095] Specifically, historical water consumption data for a total of 's' enterprises is obtained from the industrial park's water management system, covering the past year. The data includes water consumption every 15 minutes, as well as relevant influencing factors, including meteorological data (temperature, precipitation) and time stamps (year, month, date, hour, day of the week, weekday or holiday).

[0096] The data preprocessing process includes removing outliers using the Z-score method, filling in missing values ​​using interpolation, and normalizing all data using min-max scaling to map them to the range [0,1].

[0097] S2. Next, we construct a combined model based on GNN and LSTM. The LSTM model is used to extract the time features of water consumption of each enterprise in the park, the GNN model is used to extract the water consumption relationship features between enterprises, and the GNN-LSTM superposition model is used to extract the combined water consumption features of the park. The features are concatenated and used as input to obtain the predicted water consumption value through a fully connected layer.

[0098] Specifically, in the process of extracting time features using the LSTM model, the input is the time series of the company's water consumption and influencing factors for the previous 24 hours. The output is a sequence of hidden states. The future time step will be 1 hour.

[0099] The process of extracting relation features using a GNN model includes:

[0100] 1. Construct a node matrix Each enterprise node in the park has the following characteristics: average water consumption in the previous week, average water consumption in the previous day, average water consumption in the past 3 hours, water consumption in the past hour, geographical location (longitude and latitude), number of employees, start time of work / operation, years of establishment, average electricity consumption in the previous day, and gas consumption.

[0101] 2. Construct the adjacency matrix The adjacency matrix includes three types: geographical adjacency matrix, water consumption sequence similarity adjacency matrix, and business relationship adjacency matrix. These three adjacency matrices are then weighted and summed with weights of 0.3, 0.3, and 0.4 respectively, resulting in a comprehensive adjacency matrix. After constructing the node feature matrix and adjacency matrix, a Generative Neural Network (GNN) is used to extract relationship features. The GNN has three layers, each outputting features with a dimension of 128, ultimately outputting the relationship features of the enterprises. .

[0102] Finally, a combined GNN-LSTM model was used to extract combined features. The enterprise node features in the GNN model were adjusted, and the water consumption sequence for the past 24 hours was added to the feature matrix. Then, the relational features extracted by the GNN are input into the LSTM model to obtain combined features. .

[0103] Feature concatenation combines the temporal features extracted by LSTM, the relational features extracted by GNN, and the combined features extracted by GNN-LSTM to form the final feature representation. .

[0104] The fully connected layer prediction inputs the stitched features into the fully connected layer for prediction, and outputs the predicted water consumption of each enterprise for the next 24 hours. .

[0105] S3. After the initial model construction, historical data collected from the park is used for model training. The loss function for model training is the total mean squared error. Xavier initialization is used for weight initialization, the gradient is calculated using the backpropagation algorithm, and the model parameters are updated using the RMSprop optimizer. Simultaneously, a grid search for hyperparameters is performed, and the model training process is repeated until the model converges. The hyperparameters that minimize the average value of the model's loss function in the last 10 iterations are selected.

[0106] The final hyperparameters were set as follows: GNN hidden layer size 128, number of layers 3, activation function ReLU, learning rate 0.005; LSTM hidden layer size 128, number of layers 4, dropout rate 0.4, learning rate 0.001; training batch size 128, training epochs 1000; L2 regularization parameter 0.001; geographical location weight in the adjacency matrix 0.3, water consumption similarity weight 0.3, business relationship weight 0.4.

[0107] The final model is then compared and validated against the actual water consumption of each enterprise. The comparison of the final model's predictions with actual water consumption is as follows: Figure 3 Enterprises 2 and 4 are upstream and downstream companies in the industry chain. It can be seen that the water usage of the two companies has similar cyclical patterns, and the method of this invention can capture the relationship between enterprises and make accurate predictions.

[0108] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

Claims

1. A water consumption prediction method based on a combined GNN and LSTM model, characterized in that, Includes the following steps: S1. Obtain historical water consumption data and related influencing factors for the enterprise, including time stamps and meteorological data, and preprocess the acquired data. S2. Construct a combined model based on GNN and LSTM. Within this combined model, the LSTM model is used to extract the time features of enterprise water consumption. The process of extracting time features using the LSTM model is as follows: Input the enterprise's water consumption and the time series of influencing factors: ,in The number of enterprises in the region. For time steps, For feature dimensions; The extraction process is as follows: ; The time feature output is a hidden state sequence. ,in For future time steps, The dimension of the hidden state features; The GNN model is used to extract relation features. The process of extracting relation features using the GNN model is as follows: Input K enterprise node features and construct a node feature matrix. , among which, the The formula for updating the node features of a layer is: ; in, For the first Layer node characteristics, For the first The weight matrix of the layer, For the first Layer bias; For activation functions; It is an adjacency matrix; The relational feature output is as follows: ; The GNN-LSTM stacked model extracts combined features, which are then concatenated and used as input to obtain the water consumption prediction value through a fully connected layer. The process of the GNN-LSTM model extracting combined features is as follows: Input P enterprise node features and construct a node feature matrix. ; The extraction process is as follows ; The combined feature output is: , The hidden state feature dimension of the GNN-LSTM branch; The process of constructing the adjacency matrix is ​​as follows: A1. Construct an adjacency matrix based on geographic location: A Gaussian kernel function is used to calculate weights based on geographical distance; the closer the distance, the greater the weight. ; in, Indicates enterprise and Geographical distance between them It is the bandwidth of the Gaussian kernel; A2. Construct an adjacency matrix based on the similarity of water consumption sequences: Water consumption sequence similarity can be obtained by calculating the Pearson correlation coefficient, and then constructing an adjacency matrix. ; in, This is an adjacency matrix representing the similarity of water consumption sequences among enterprises. Pearson coefficient, and Indicates enterprise and Water consumption time series; A3. Constructing an adjacency matrix based on business relationships: The adjacency matrix is ​​constructed based on the actual business connections between enterprises. ; A4. Constructing a comprehensive adjacency matrix involves weighting and summing the three adjacency matrices mentioned above according to preset weights to construct a comprehensive adjacency matrix: ; in, , and These are weight parameters used to adjust the influence of different relationships, and are optimized through grid search. The model feature concatenation and prediction process is as follows: Time characteristics Relationship characteristics and combined features When pieced together, the final feature representation is formed: ; The concatenated features are then input into the fully connected layer for prediction. ,in , These are the standard parameters for fully connected layers; S3. Use historical data to train the combined model, update the parameters of the combined model, and obtain the combined prediction model.

2. The water consumption prediction method based on a combined GNN and LSTM model according to claim 1, characterized in that, In S1 Time markers include year, season, month, date, weekday, weekday, and public holiday; Meteorological data includes temperature, humidity, wind speed, and precipitation.

3. The water consumption prediction method based on a combined GNN and LSTM model according to claim 1, characterized in that, The data preprocessing methods in step S1 include outlier removal, missing value imputation, and normalization.

4. The water consumption prediction method based on a combined GNN and LSTM model according to claim 1, characterized in that, The loss function for model training in step S3 is the total mean squared error: ; Where N represents the number of businesses in the region, and T′ represents the future time step. The gradient is calculated using the backpropagation algorithm, the model parameters are updated using the optimizer, and the hyperparameters are adjusted. The training process is repeated until the model converges, and the hyperparameters that minimize the average value of the loss function in the last 10 iterations are selected.