Water consumption prediction method and system based on user mode and deep learning combined model
By combining time series decomposition and user classification with long short-term memory neural networks, the problem of insufficient consideration of user water usage patterns in existing water consumption forecasting is solved, thereby improving forecast accuracy and model applicability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 中南水务科技有限公司
- Filing Date
- 2022-12-07
- Publication Date
- 2026-07-24
AI Technical Summary
Existing water consumption forecasting methods do not fully consider user water usage patterns, resulting in insufficient forecasting performance and increased model complexity.
The trend, noise, and periodic terms are extracted by time series decomposition. Users are then classified by combining clustering and statistical regularities to obtain water usage patterns. These patterns are then fused with the periodic terms and used as features to input a long short-term memory artificial neural network for prediction.
It improves the accuracy of water consumption forecasting, alleviates the gradient vanishing problem, fully explores data information, corrects individual differences, and is suitable for time series data.
Smart Images

Figure CN115730744B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of urban water supply network technology, and in particular discloses a water consumption prediction method and system based on a joint user pattern and deep learning model. Background Technology
[0002] With social development and the improvement of people's living standards, water consumption is increasing day by day, and the problem of water shortage is becoming increasingly prominent. Scientific and accurate prediction of water consumption is of great significance for carrying out rational water supply planning.
[0003] Water consumption data is essentially a time series, therefore, water consumption forecasting methods typically employ time series analysis, which involves mining the characteristics of historical time series data to infer future trends. From the perspective of forecasting methods, current methods can be broadly categorized into statistical forecasting methods: such as basic simple averages and moving averages, and more commonly used methods like AR (Auto-regressive), MA (Moving Average), ARMA (Auto-regressive Moving Average), and ARIMA (Auto-regressive Integrated Moving Average Model), including Facebook's Prophet. Another category is machine learning algorithms: using regression models such as random forests and support vector machines for forecasting, or based on neural networks and deep learning, such as BP (back propagation) neural networks, convolutional neural networks, and long short-term neural networks.
[0004] Currently, researchers often draw on time series analysis methods for water consumption forecasting. Zhang Junya, Yasar, Mombeni, and others primarily utilize statistical time series forecasting methods such as regression analysis, ARIMA, and SARIMA (Seasonal Autoregressive Integrated Moving Average). Patent CN113947240A employs a least-squares-based forecasting method. Patent CN109146196A utilizes a dragonfly-Gaussian process coupling algorithm. Li Yanbin's "Water Consumption Prediction in Zhengzhou Based on Improved GM-LSSVR Model," Wang Zihan's "Urban Water Consumption Prediction Based on TCK-LSTM-ATT Model," Zhu Xingtong's "Urban Water Consumption Prediction Based on Improved Particle Swarm Optimized BP Network," Guo Qiang's "Inter-regional Water Demand Prediction Method Based on Bayesian BP Neural Network," and patents CN112488392A and CN114757330A, among others, disclose methods based on machine learning and deep learning, such as LSTM (Long Short-Term Memory), BP (back propagation) neural networks, and TCN (Temporal Convolutional Network), which improve the prediction models, focusing on parameter optimization and computational speed enhancement. Patent CN112036668A incorporates a periodic decomposition method to account for periodic data.
[0005] However, existing technical methods often focus on performance optimization of a particular prediction model, addressing issues such as algorithm convergence speed and real-time scheduling of predictions, while neglecting prior knowledge of user categories and failing to fully exploit the water usage characteristics of different users, thus affecting the performance of the prediction model. At the same time, many prediction methods use data such as temperature, humidity, wind direction, and precipitation as features input into the model, increasing model complexity; and since temperature, humidity, and wind direction vary from day to day and can only be obtained or predicted on that day, prediction efficiency is affected.
[0006] Therefore, the current water consumption forecasting methods do not take into account the user water consumption patterns of water consumption data very little, which is a technical problem that urgently needs to be solved. Summary of the Invention
[0007] This invention provides a water consumption prediction method and system based on a joint model of user patterns and deep learning, aiming to solve the technical problem that existing water consumption prediction methods give relatively little consideration to user water consumption patterns in water consumption data.
[0008] One aspect of the present invention relates to a water consumption prediction method based on a joint user pattern and deep learning model, comprising the following steps:
[0009] The water consumption time series was decomposed using the time series decomposition method to extract its trend, noise and periodic components.
[0010] Users are classified using clustering and statistical methods to obtain corresponding water usage patterns. The water usage patterns for the corresponding time period are then fused with the extracted periodic items to form the corrected water usage pattern items. Finally, the extracted trend items, noise items, and corrected water usage pattern items are used as features input to a long short-term memory artificial neural network deep learning method for prediction.
[0011] Furthermore, the steps for decomposing the water consumption time series using time series decomposition methods and extracting its trend term, noise term, and periodic term include:
[0012] The original water consumption time series training data were preprocessed using methods based on statistical regularities to correct outlier data;
[0013] Furthermore, for the already processed water consumption time series x t The time series decomposition algorithm is used to decompose the processed water consumption time series into trend, periodic and noise components.
[0014] For the already processed water consumption time series, the decomposition consists of three parts:
[0015] x t =T t +S t +N t
[0016] Where, x t For the already processed water consumption time series, T t This represents the trend portion of the water consumption series, indicating the direction in which water consumption changes; S t The periodic part mainly represents the periodic characteristics of water consumption; N t is the noise term, and is the random part of the water consumption time series.
[0017] Furthermore, users are classified using clustering and statistical methods to obtain corresponding water usage patterns. The water usage patterns for corresponding time periods are then fused with the extracted periodic items to obtain corrected water usage pattern items. Finally, the extracted trend items, noise items, and corrected water usage pattern items are used as features input to a long short-term memory artificial neural network deep learning method for prediction. The steps include:
[0018] Extract user water usage patterns and merge them with periodic sequences;
[0019] We use a long short-term memory artificial neural network to predict time series decomposed by a time series decomposition algorithm.
[0020] Furthermore, the selective memory function of the Long Short-Term Memory (LSTM) artificial neural network is achieved through a three-gate structure: a forget gate, an input gate, and an output gate.
[0021] The structure of the Forgotten Gate is as follows:
[0022] f t =σ(W f ·[h t-1 , x' t ]+b f )
[0023] Among them, f t The result of the forget gate calculation, σ is the sigmoid function, h t-1 x' is the water consumption value output by the previous LSTM unit. t W is the input vector containing water usage information at the current moment. f Let b be the weight matrix of the forget gate. f For the bias term of the forget gate;
[0024] The input gate structure is as follows:
[0025] i t =σ(W i ·[h t-1 , x' t ]+b i )
[0026]
[0027] Among them, i t To update information, The results of the updated cell state calculations; W i W c These are the corresponding weight matrices for the input gates; b i b c These are the corresponding bias terms for the input gate; the cell state update formula is:
[0028]
[0029] The output gate structure is as follows:
[0030] o t =σ(W o ·[h t-1 , x' t ]+b o )
[0031] h t=o t *tanh(C t )
[0032] Among them, o t The output part represents the cell state, where σ is the sigmoid function and h t-1 W represents the water consumption value output by the previous Long Short-Term Memory (LSTM) artificial neural network unit. o Let b be the weight matrix of the output gate. o For the bias term of the output gate; h t This represents the water consumption value output by the Long Short-Term Memory (LSTM) artificial neural network unit.
[0033] Another aspect of the present invention relates to a water consumption prediction system based on a joint user pattern and deep learning model, comprising:
[0034] The extraction module is used to decompose the water consumption time series using time series decomposition methods and extract its trend, noise and periodic components.
[0035] The prediction module is used to classify users and obtain corresponding water usage patterns using clustering and statistical methods. It then merges the water usage patterns of the corresponding time period with the extracted periodic items to form the corrected water usage pattern items. Finally, the extracted trend items, noise items, and corrected water usage pattern items are used as feature inputs to a long short-term memory artificial neural network deep learning method for prediction.
[0036] Furthermore, the extraction module includes:
[0037] The preprocessing unit uses methods based on statistical laws to preprocess the original water consumption time series training data and corrects abnormal data.
[0038] Decomposition unit, used for processing the already processed water consumption time series x t The time series decomposition algorithm is used to decompose the processed water consumption time series into trend, periodic and noise components.
[0039] Furthermore, within the decomposition unit, for the already processed water consumption time series, the three parts of the decomposition are:
[0040] x t =T t +S t +N t
[0041] Where, x t For the already processed water consumption time series, T t This represents the trend portion of the water consumption series, indicating the direction in which water consumption changes; S tThe periodic part mainly represents the periodic characteristics of water consumption; N t is the noise term, and is the random part of the water consumption time series.
[0042] Furthermore, the prediction module includes:
[0043] Extraction unit, used to extract user water usage patterns and fuse periodic sequences;
[0044] The prediction unit is used to predict time series decomposed by a time series decomposition algorithm using a long short-term memory artificial neural network.
[0045] Furthermore, in the prediction unit, the selective memory function of the Long Short-Term Memory artificial neural network is achieved through three gate structures: the forget gate, the input gate, and the output gate.
[0046] The structure of the Forgotten Gate is as follows:
[0047] f t =σ(W f ·[h t-1 , x' t ]+b f )
[0048] Among them, f t The result of the forget gate calculation, σ is the sigmoid function, h t-1 x' is the water consumption value output by the previous LSTM unit. t W is the input vector containing water usage information at the current moment. f Let b be the weight matrix of the forget gate. f For the bias term of the forget gate;
[0049] The input gate structure is as follows:
[0050] i t =σ(W i ·[h t-1 , x' t ]+b i )
[0051]
[0052] Among them, i t To update information, The results of the updated cell state calculations; W i W c These are the corresponding weight matrices for the input gates; b i b c These are the corresponding bias terms for the input gate; the cell state update formula is:
[0053]
[0054] The output gate structure is as follows:
[0055] o t =σ(W o ·[h t-1 , x' t ]+b o )
[0056] h t =o t *tanh(C t )
[0057] Among them, o t The output part represents the cell state, where σ is the sigmoid function and h t-1 W represents the water consumption value output by the previous Long Short-Term Memory (LSTM) artificial neural network unit. o Let b be the weight matrix of the output gate. o For the bias term of the output gate; h t This represents the water consumption value output by the Long Short-Term Memory (LSTM) artificial neural network unit.
[0058] The beneficial effects achieved by this invention are as follows:
[0059] This invention provides a water consumption prediction method and system based on a joint user pattern and deep learning model. The method decomposes the water consumption time series using time series decomposition to extract trend, noise, and periodic components. It then classifies users using clustering and statistical methods to obtain corresponding water consumption patterns. The water consumption patterns for the corresponding time periods are then fused with the extracted periodic components to form a corrected water consumption pattern. Finally, the extracted trend, noise, and corrected water consumption pattern are used as features input to a long short-term memory artificial neural network deep learning method for prediction. The water consumption prediction method and system based on a joint user pattern and deep learning model provided by this invention incorporates prior knowledge of user classification patterns into the periodic sequences extracted by time series decomposition algorithms. By fusing information from general sequences and individual sequences, it fully mines data information and corrects individual differences. The LSTM (Long Short-Term Memory) algorithm is more suitable for time series data than BP (back propagation) and CNN (Convolutional Neural Networks) networks, and achieves selective memory through a three-gate structure, alleviating the "vanishing gradient" problem during RNN (Recurrent Neural Network) training. By combining decomposition and prediction, the periodic prior knowledge in the model is fully extracted, enabling a more accurate grasp of data change trends and improving prediction accuracy. Attached Figure Description
[0060] Figure 1 This is a flowchart illustrating an embodiment of the water consumption prediction method based on a joint user pattern and deep learning model provided by the present invention.
[0061] Figure 2 for Figure 1 The diagram shows a detailed flowchart of an embodiment of the steps for decomposing a water consumption time series using a time series decomposition method to extract its trend, noise, and periodic components.
[0062] Figure 3 for Figure 1 The diagram shows a detailed flowchart of an embodiment of the steps of classifying users and obtaining corresponding water usage patterns using clustering and statistical methods, fusing the water usage patterns of the corresponding time period with the extracted periodic items to become the corrected water usage pattern items, and finally using the extracted trend items, noise items and the corrected water usage pattern items as features input to the long short-term memory artificial neural network deep learning method for prediction.
[0063] Figure 4This is a detailed flowchart illustrating an embodiment of the water consumption prediction method based on a joint user pattern and deep learning model provided by the present invention.
[0064] Figure 5 This is a functional block diagram of an embodiment of the water consumption prediction system based on a joint model of user patterns and deep learning provided by the present invention.
[0065] Figure 6 for Figure 5 A functional module diagram of one embodiment of the extraction module shown in the figure;
[0066] Figure 7 for Figure 5 The diagram shows a functional module schematic of one embodiment of the prediction module.
[0067] Explanation of icon numbers:
[0068] 10. Extraction module; 20. Prediction module; 11. Preprocessing unit; 12. Decomposition unit; 21. Extraction unit; 22. Prediction unit. Detailed Implementation
[0069] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0070] like Figure 1 and Figure 2 As shown, the first embodiment of the present invention proposes a water consumption prediction method based on a joint user pattern and deep learning model, including the following steps:
[0071] Step S100: Use time series decomposition method to decompose the water consumption time series and extract its trend term, noise term and periodic term.
[0072] The water consumption time series is decomposed using time series decomposition methods, and the trend and periodic terms of the decomposed water consumption time series are extracted.
[0073] Step S200: Use clustering and statistical methods to classify users and obtain corresponding water usage patterns, and merge the water usage patterns of the corresponding time period with the extracted periodic items to become the corrected water usage pattern items; finally, use the extracted trend items, noise items and corrected water usage pattern items as features to input the long short-term memory artificial neural network deep learning method for prediction.
[0074] Users are classified using methods such as clustering and statistical regularity to obtain the corresponding water usage patterns of the classified users; the water usage patterns of the corresponding time period are then fused with the extracted periodic items to become the corrected water usage pattern items; finally, the extracted trend items, noise items, and corrected water usage pattern items are used as features input into a deep learning and training model based on LSTM (Long Short-Term Memory) to predict water consumption results.
[0075] This embodiment provides a water consumption prediction method based on a joint user pattern and deep learning model. It decomposes the water consumption time series using time series decomposition to extract trend, noise, and periodic components. Clustering and statistical methods are used to classify users and obtain corresponding water consumption patterns. The water consumption patterns for corresponding time periods are then fused with the extracted periodic components to form a corrected water consumption pattern. Finally, the extracted trend, noise, and corrected water consumption pattern are used as features input to a Long Short-Term Memory (LSTM) artificial neural network (ANN) deep learning method for prediction. This method incorporates prior knowledge of user classification patterns into the periodic sequences extracted by the decomposition algorithm. By fusing information from general sequences and individual sequences, it fully mines data information and corrects for individual differences. The LSTM algorithm is more suitable for time series data than BP and CNN networks, and its three-gate structure enables selective memory, alleviating the "vanishing gradient" problem during RNN network training. The combined decomposition and prediction model fully extracts the periodic prior knowledge from the model, enabling a more accurate grasp of data change trends and improving prediction accuracy.
[0076] Further, please see Figure 2 , Figure 2 for Figure 1 The diagram shows a detailed flow chart of one embodiment of step S100. In this embodiment, step S100 includes:
[0077] Step S110: Preprocess the original water consumption time series training data using methods based on statistical regularities to correct abnormal data.
[0078] The water consumption time series data obtained from the system may contain noise or outliers at some single points due to monitoring instruments and communication transmission issues. These data, which deviate significantly from the normal pattern, will affect the training of the dataset and should therefore be corrected first. In this embodiment, the original water consumption time series training data is preprocessed using methods based on statistical regularities to correct the outliers. To maintain the continuity of the time series, outliers and missing values can be determined by the average value of the training set. replace.
[0079] Step S120: For the already processed water consumption time series x t The time series decomposition algorithm is used to decompose the processed water consumption time series into trend, periodic and noise components.
[0080] For the already processed water consumption time series x t It can be decomposed into three parts using time series decomposition algorithms:
[0081] x t =T t +S t +N t (1)
[0082] In formula (1), x t For the already processed water consumption time series, T t This represents the trend portion of the water consumption series, indicating the direction in which water consumption changes; S t The periodic part mainly represents the periodic characteristics of water consumption; N t The noise term represents the random portion of the water consumption time series. In this embodiment, based on prior knowledge of water consumption characteristics, the period is set to 24 hours. The number of samples within the specific period can be determined according to the sampling period of the acquired time series to ensure the flexibility of the decomposition model. For example, if the sampling period is 15 minutes, the period is set to 96.
[0083] The water consumption prediction method based on a joint user pattern and deep learning model provided in this embodiment preprocesses the original water consumption time series training data using methods such as statistical regularity, correcting abnormal data; for the preprocessed water consumption time series x t This embodiment utilizes a time-series decomposition algorithm to decompose the processed water consumption time series into trend, periodic, and noise components. The water consumption prediction method based on a joint user pattern and deep learning model provided in this embodiment incorporates prior knowledge of user classification patterns into the periodic sequences extracted by the decomposition algorithm. Through the fusion of information from general sequences and individual sequences, it fully mines data information and corrects for individual differences. The LSTM algorithm is more suitable for time-series data than BP and CNN networks, and its three-gate structure enables selective memorization, alleviating the "vanishing gradient" problem during RNN network training. By combining decomposition and prediction, the combined model fully extracts the periodic prior knowledge from the model, enabling a more accurate grasp of data change trends and improving prediction accuracy.
[0084] Preferably, see Figure 3 , Figure 3 for Figure 1 The diagram shows a detailed flow chart of one embodiment of step S200. In this embodiment, step S200 includes:
[0085] Step S210: Extract user water usage patterns and merge periodic sequences.
[0086] Based on the characteristics of urban water use, users are categorized into the required prediction categories, such as residential communities, primary and secondary schools, office buildings and companies, and shopping malls. Samples are obtained for each category, and the corresponding water use pattern characteristic curves are acquired through statistical analysis and clustering algorithms in machine learning. Depending on the actual situation, weekdays and holidays (including regular weekends and holidays) can be separated and recalculated according to the required water consumption time series sampling period. Finally, the water use pattern component M for the corresponding time period is used. t With periodic component S t The merged components become the modified water use pattern term S′. t .
[0087] Step S220: Use a long short-term memory artificial neural network to predict the time series after it has been decomposed based on the time series decomposition algorithm.
[0088] In this embodiment, LSTM (Long Short-Term Memory) is used to perform prediction after time series decomposition.
[0089] LSTM models possess the advantage of selective memory, solving the gradient explosion or vanishing gradient problems of Recurrent Neural Networks (RNNs). Their selective memory function is primarily achieved through three gate structures: the forget gate, the input gate, and the output gate.
[0090] Forget Gate:
[0091] f t =σ(W f ·[h t-1 , x' t ]+b f (2)
[0092] LSTM networks can use forgetting gates to determine which information from the water consumption sample in the cell state needs to be retained. In formula (2), σ is the sigmoid function, and h t-1 x' is the water consumption value output by the previous LSTM unit. t W is the input vector containing water usage information at the current moment. f Let b be the weight matrix of the forget gate. f This is the bias term for the forget gate.
[0093] Input gate:
[0094] it =σ(W i ·[h t-1 , x' t ]+b i (3)
[0095]
[0096] In formulas (3) and (4), i t To update information, The results of the updated neural cell state calculations; W i .
[0097] The formula for neuron update is as follows:
[0098]
[0099] Output gate:
[0100] o t =σ(W o ·[h t-1 , x' t ]+b o (6)
[0101] h t =o t tanh(C t (7)
[0102] In formulas (5) to (7), o t The output part represents the cell state, where σ is the sigmoid function and h t-1 W represents the water consumption value output by the previous Long Short-Term Memory (LSTM) artificial neural network unit. o Let b be the weight matrix of the output gate. o For the bias term of the output gate; h t This represents the water consumption value output by the Long Short-Term Memory (LSTM) artificial neural network unit.
[0103] like Figures 1 to 4 As shown in the figure, the water consumption prediction method based on a joint user pattern and deep learning model provided in this embodiment is specifically implemented as follows:
[0104] 1. Determine the input variables
[0105] The trend T obtained after decomposing the time series and fusing it with user patterns t Water usage mode component S' t and noise N t The three parts are considered as three features of an input sample, namely...
[0106] X t=[T t S' t N t (8)
[0107] In formula (8), X t T is the model input vector. t S' represents the trend obtained after time series decomposition. t N represents the water usage pattern component obtained after time series decomposition. t This is the noise obtained after time series decomposition.
[0108] 2. Normalization
[0109] To avoid errors in model prediction due to the different dimensions of the three features, and to unify the statistical distribution of the samples, a normalization function is used to scale the different features to the range of [0, 1].
[0110] 3. Determine the time window for sample partitioning to form the training dataset.
[0111] The length of the observation sequence (Train_length) and the prediction step size (Predict_length) are determined. This involves using a certain length of preceding water consumption data to predict a certain length of subsequent water consumption data. The lengths of the input and output of the training model are then divided according to these lengths, forming the training data and labels.
[0112] A sample dataset is represented as:
[0113] X' t =[X t-Train_length+1 …, X t-1 X t (9)
[0114] In formula (9), X' t This represents the sample vector, and Train_length is the length of the observation sequence.
[0115] The corresponding labels are the water consumption data at the time points before decomposition:
[0116] Y t =[x t+1 x t+2 …, x t+Predict_length (10)
[0117] In formula (10), Y t This represents the water consumption data at each time point before decomposition, and Predict_length is the prediction step size.
[0118] 4. Model Training
[0119] In the LSTM model, the number of hidden layers and their neurons, as well as the number of training iterations, are determined. The mean squared error function can be used as the loss function, and the Adam (Adaptive Momentum) algorithm can be used as the optimizer to improve computational efficiency and reduce memory requirements.
[0120] This embodiment provides a water consumption prediction method based on a joint user pattern and deep learning model. It extracts user water consumption patterns and fuses periodic sequences; then, it uses a Long Short-Term Memory (LSTM) artificial neural network to predict the time series decomposed by a time series decomposition algorithm. This method incorporates prior knowledge of user classification patterns into the periodic sequences extracted by the decomposition algorithm. By fusing information from general sequences and individual sequences, it fully mines data information and corrects for individual differences. The LSTM algorithm is more suitable for time series data than BP and CNN networks, and its three-gate structure enables selective memory, alleviating the "vanishing gradient" problem during RNN network training. By combining decomposition and prediction, the method fully extracts the periodic prior knowledge from the model, enabling a more accurate grasp of data change trends and improving prediction accuracy.
[0121] Please see Figure 5 , Figure 5 This is a functional block diagram of an embodiment of the water consumption prediction system based on a joint user pattern and deep learning model provided by the present invention. In this embodiment, the water consumption prediction system based on a joint user pattern and deep learning model includes an extraction module 10 and a prediction module 20. The extraction module 10 is used to decompose the water consumption time series using a time series decomposition method to extract its trend term, noise term, and periodic term. The prediction module 20 is used to classify users using clustering and statistical regularity methods to obtain corresponding water consumption patterns, and to fuse the water consumption patterns of the corresponding time period with the extracted periodic term to obtain the corrected water consumption pattern term. Finally, the extracted trend term, noise term, and corrected water consumption pattern term are used as features input to a long short-term memory artificial neural network deep learning method for prediction.
[0122] The extraction module 10 uses a time series decomposition algorithm to decompose the water consumption time series and extract the trend, noise and periodic components of the decomposed water consumption time series.
[0123] The prediction module 20 uses methods such as clustering and statistical regularity to classify users and obtain the corresponding water use patterns of the classified users; it then merges the water use patterns of the corresponding time period with the extracted periodic items to become the corrected water use pattern items; finally, the extracted trend items, noise items and corrected water use pattern items are used as features input into the deep learning and training model based on LSTM (Long Short-Term Memory) to predict the water consumption results.
[0124] This embodiment provides a water consumption prediction system based on a joint user pattern and deep learning model. It decomposes the water consumption time series using time series decomposition methods to extract trend and periodic components. Clustering and statistical methods are used to classify users and obtain corresponding water consumption patterns. The water consumption patterns for corresponding time periods are then fused with the extracted periodic components to form a corrected water consumption pattern. Finally, the extracted trend, noise, and corrected water consumption pattern are used as features input to a long short-term memory (LSTM) artificial neural network (ANN) deep learning method for prediction. This system incorporates prior knowledge of user classification patterns into the periodic sequences extracted by the decomposition algorithm. By fusing information from general sequences and individual sequences, it fully mines data information and corrects for individual differences. The LSTM algorithm is more suitable for time series data than BP and CNN networks, and its three-gate structure enables selective memory, alleviating the "vanishing gradient" problem during RNN network training. The combined decomposition and prediction model fully extracts the periodic prior knowledge from the model, enabling a more accurate grasp of data change trends and improving prediction accuracy.
[0125] Further, please see Figure 6 , Figure 6 for Figure 5 The diagram illustrates the functional module of an embodiment of the extraction module. In this embodiment, the extraction module 10 includes a preprocessing unit 11 and a decomposition unit 12. The preprocessing unit 11 preprocesses the original water consumption time series training data using methods based on statistical regularities, correcting abnormal data. The decomposition unit 12 is used to decompose the preprocessed water consumption time series x. t The time series decomposition algorithm is used to decompose the processed water consumption time series into trend, periodic and noise components.
[0126] The preprocessing unit 11 obtains water consumption time series data from the system. Due to factors such as monitoring instruments and communication transmission, some individual or multiple points may contain noise or outliers. These data, which significantly deviate from the normal pattern, will affect the training of the dataset and therefore should be corrected first. In this embodiment, methods based on statistical regularities are used to preprocess the original water consumption time series training data to correct the outliers.
[0127] Decomposition unit 12 is for the already processed water consumption time series x t It can be decomposed into three parts using time series decomposition algorithms:
[0128] x t =T t +S t +N t (11)
[0129] In formula (11), x t For the already processed water consumption time series, T t This represents the trend portion of the water consumption series, indicating the direction in which water consumption changes; S t The periodic part mainly represents the periodic characteristics of water consumption; N t The noise term represents the random portion of the water consumption time series. In this embodiment, based on prior knowledge of water consumption characteristics, the period is set to 24 hours. The number of samples within the specific period can be determined according to the sampling period of the acquired time series to ensure the flexibility of the decomposition model. For example, if the sampling period is 15 minutes, the period is set to 96.
[0130] The water consumption prediction system based on a joint user pattern and deep learning model provided in this embodiment preprocesses the original water consumption time series training data using methods based on statistical regularities, correcting abnormal data; for the preprocessed water consumption time series x t The system utilizes a time-series decomposition algorithm to decompose the processed water consumption time series into trend, periodic, and noise components. The water consumption prediction system based on a joint user pattern and deep learning model provided in this embodiment incorporates prior knowledge of user classification patterns into the periodic sequences extracted by the decomposition algorithm. Through the fusion of information from general sequences and individual sequences, it fully mines data information and corrects for individual differences. The LSTM algorithm is more suitable for time-series data than BP and CNN networks, and its three-gate structure enables selective memorization, alleviating the "vanishing gradient" problem during RNN network training. By combining decomposition and prediction, the system fully extracts the periodic prior knowledge from the model, enabling a more accurate grasp of data change trends and improving prediction accuracy.
[0131] Preferably, see Figure 7 , Figure 7 for Figure 5 The diagram shows a functional module of one embodiment of the prediction module. In this embodiment, the prediction module 20 includes an extraction unit 21 and a prediction unit 22. The extraction unit 21 is used to extract user water usage patterns and fuse periodic sequences. The prediction unit 22 is used to use a long short-term memory artificial neural network to predict the time series decomposed based on the time series decomposition algorithm.
[0132] Extraction unit 21 categorizes users into required prediction categories such as residential communities, primary and secondary schools, office buildings and companies, and shopping malls based on urban water usage characteristics. It then obtains samples by category and uses statistical methods and clustering algorithms in machine learning to acquire the corresponding category's water usage pattern characteristic curves. Depending on the actual situation, weekdays and holidays (including regular weekends and holidays) can be separated and recalculated according to the required water usage time series sampling period. Finally, the water usage pattern component M for the corresponding time period is used. t With periodic component S t The merged components become the modified water use pattern term S′. t .
[0133] Prediction unit 22 uses LSTM (Long Short-Term Memory) to predict the time series after it has been decomposed based on the time series decomposition algorithm.
[0134] LSTM models possess the advantage of selective memory, solving the gradient explosion or vanishing gradient problems of Recurrent Neural Networks (RNNs). Their selective memory function is primarily achieved through three gate structures: the forget gate, the input gate, and the output gate.
[0135] Forget Gate:
[0136] f t =σ(W f ·[h t-1 , x' t ]+b f (12)
[0137] LSTM networks can use forgetting gates to determine which information from water consumption samples in a cell state needs to be retained. In formula (13), is the sigmoid function, and h t-1 x' is the water consumption value output by the previous LSTM unit. t W is the input vector containing water usage information at the current moment. f Let b be the weight matrix of the forget gate. f This is the bias term for the forget gate.
[0138] Input gate:
[0139] i t =σ(W i ·[h t-1 , x' t ]+b i (13)
[0140]
[0141] In formulas (13) and (14), i t To update information, The results of the updated cell state calculations; W i .
[0142] The formula for neuron update is as follows:
[0143]
[0144] Output gate:
[0145] o t =σ(W o ·[h t-1 ,x't]+b o (16)
[0146] h t =o t *tanh(C t (17)
[0147] In formulas (15) to (17) o t The output part represents the cell state, where σ is the sigmoid function and h t-1 W represents the water consumption value output by the previous Long Short-Term Memory (LSTM) artificial neural network unit. o Let b be the weight matrix of the output gate. o For the bias term of the output gate; h t This represents the water consumption value output by the Long Short-Term Memory (LSTM) artificial neural network unit.
[0148] like Figures 1 to 4 As shown in the figure, the water consumption prediction method based on a joint user pattern and deep learning model provided in this embodiment is specifically implemented as follows:
[0149] 1. Determine the input variables
[0150] The trend T obtained after decomposing the time series and integrating it with user patterns is... t Water usage mode component S' t and noise N tThe three parts are considered as three features of an input sample, namely...
[0151] X t =[T t S' t N t (18)
[0152] In formula (18), X t T is the model input vector. t S' represents the trend obtained after time series decomposition. t N represents the water usage pattern component obtained after time series decomposition. t This is the noise obtained after time series decomposition.
[0153] 2. Normalization
[0154] To avoid errors in model prediction due to the different dimensions of the three features, and to unify the statistical distribution of the samples, a normalization function is used to scale the different features to the range of [0, 1].
[0155] 3. Determine the time window for sample partitioning to form the training dataset.
[0156] The length of the observation sequence (Train_length) and the prediction step size (Predict_length) are determined. This involves using a certain length of preceding water consumption data to predict a certain length of subsequent water consumption data. The lengths of the input and output of the training model are then divided according to these lengths, forming the training data and labels.
[0157] A sample dataset is represented as:
[0158] X' t =[X t-Train_length+1 …, X t-1 ,X] (19)
[0159] In formula (19), X' t This represents the sample dataset, where Train_length is the length of the observation sequence.
[0160] The corresponding labels are the water consumption data at the time points before decomposition:
[0161] Y t =[x t x t+1 …, x t+Predict_length (20)
[0162] In formula (20), Y t This represents the water consumption data at each time point before decomposition, and Predict_length is the prediction step size.
[0163] 4. Model Training
[0164] In the LSTM model, the number of hidden layers and their neurons, as well as the number of training iterations, are determined. The mean squared error function can be used as the loss function, and the Adam (Adaptive Momentum) algorithm can be used as the optimizer to improve computational efficiency and reduce memory requirements.
[0165] The water consumption prediction system based on a joint user pattern and deep learning model provided in this embodiment, compared with existing technologies, extracts user water consumption patterns and fuses periodic sequences; it uses a long short-term memory artificial neural network to predict time series decomposed by a time series decomposition algorithm. This system, for the periodic sequences extracted by the decomposition algorithm, incorporates prior knowledge of user classification patterns, and fully mines data information and corrects individual differences through the fusion of general and individual sequence information. The LSTM algorithm is more suitable for time series data than BP and CNN networks, and achieves selective memory through a three-gate structure, alleviating the "gradient vanishing" problem during RNN network training. By combining decomposition and prediction, the system fully extracts periodic prior knowledge from the model, enabling a more accurate grasp of data change trends and improving prediction accuracy.
[0166] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and modifications.
Claims
1. A water consumption prediction method based on a joint user pattern and deep learning model, characterized in that, Includes the following steps: The water consumption time series was decomposed using the time series decomposition method to extract its trend, noise and periodic components. Users are classified using clustering and statistical methods to obtain corresponding water usage patterns. The water usage patterns for the corresponding time period are then merged with the extracted periodic items to form the corrected water usage pattern items. Finally, the extracted trend term, noise term, and corrected water usage pattern term are used as features input to the long short-term memory artificial neural network deep learning method for prediction.
2. The water consumption prediction method based on a joint user pattern and deep learning model as described in claim 1, characterized in that, The steps of decomposing the water consumption time series using the time series decomposition method and extracting its trend term, noise term, and periodic term include: The original water consumption time series training data were preprocessed using statistical methods to correct outlier data. For the already processed water consumption time series, the time series decomposition algorithm is used to decompose it into trend, periodic and noise components.
3. The water consumption prediction method based on a joint user pattern and deep learning model as described in claim 2, characterized in that, For the already processed water consumption time series, the decomposition consists of three parts: in, This is the trend part of the water consumption series, indicating the trend of water consumption changing in a certain direction; The periodic part indicates the periodic characteristics of water consumption; is the noise term, and is the random part of the water consumption time series.
4. The water consumption prediction method based on a joint user pattern and deep learning model as described in claim 3, characterized in that, The steps of classifying users and obtaining corresponding water usage patterns using clustering and statistical methods, fusing the water usage patterns of corresponding time periods with the extracted periodic items to form a corrected water usage pattern item, and finally using the extracted trend item, noise item, and corrected water usage pattern item as features input to a long short-term memory artificial neural network deep learning method for prediction include: Extract user water usage patterns and merge them with periodic sequences; We use a long short-term memory artificial neural network to predict time series decomposed by a time series decomposition algorithm.
5. The water consumption prediction method based on a joint user pattern and deep learning model as described in claim 4, characterized in that, The selective memory function of the Long Short-Term Memory (LSTM) artificial neural network is achieved through a three-gate structure: a forget gate, an input gate, and an output gate. The structure of the forgetting gate is as follows: in, The result of the forgetting gate calculation. For the sigmoid function, This is the water consumption value output by the previous LSTM unit. The input vector is the water usage information at the current moment. Here is the weight matrix for the forget gate. For the bias term of the forget gate; The gate structure of the input gate is as follows: in, To update information, The results are calculated to update the cell state. 、 These are the corresponding weight matrices for the input gates; 、 These are the corresponding bias terms for the input gate; the cell state update formula is: The output gate has the following structure: in, The output section representing the cell state, For the sigmoid function, This is the water consumption value output by the previous Long Short-Term Memory (LSTM) artificial neural network unit. , This is the bias term for the output gate; This represents the water consumption value output by the Long Short-Term Memory (LSTM) artificial neural network unit.
6. A water consumption prediction system based on a joint user pattern and deep learning model, characterized in that, include: Extraction module (10) is used to decompose the water consumption time series using the time series decomposition method and extract its trend term, noise term and periodic term; The prediction module (20) is used to classify users and obtain corresponding water use patterns by using clustering and statistical regularity methods, and to merge the water use pattern of the corresponding time period with the extracted periodic item to become the corrected water use pattern item. Finally, the extracted trend term, noise term, and corrected water usage pattern term are used as features input to the long short-term memory artificial neural network deep learning method for prediction.
7. The water consumption prediction system based on a joint user pattern and deep learning model as described in claim 6, characterized in that, The extraction module (10) includes: The preprocessing unit (11) is used to preprocess the original water consumption time series training data using statistical regularity methods and correct abnormal data; The decomposition unit (12) is used to decompose the already processed water consumption time series using a time series decomposition algorithm, and decompose the already processed water consumption time series into trend items, periodic items and noise items.
8. The water consumption prediction system based on a joint user pattern and deep learning model as described in claim 7, characterized in that, In the decomposition unit (12), for the already processed water consumption time series, the three parts of the decomposition are: in, This is the trend part of the water consumption series, indicating the trend of water consumption changing in a certain direction; The periodic part indicates the periodic characteristics of water consumption; is the noise term, and is the random part of the water consumption time series.
9. The water consumption prediction system based on a joint user pattern and deep learning model as described in claim 6, characterized in that, The prediction module (20) includes: Extraction unit (21) is used to extract user water usage patterns and fuse periodic sequences; The prediction unit (22) is used to predict the time series after decomposition based on the time series decomposition algorithm by using a long short-term memory artificial neural network.
10. The water consumption prediction system based on a joint user pattern and deep learning model as described in claim 9, characterized in that, In the prediction unit (22), the selective memory function of the long short-term memory artificial neural network is realized through three gate structures: the forget gate, the input gate, and the output gate. The structure of the forgetting gate is as follows: in, The result of the forgetting gate calculation. For the sigmoid function, This is the water consumption value output by the previous LSTM unit. The input vector is the water usage information at the current moment. Here is the weight matrix for the forget gate. For the bias term of the forget gate; The gate structure of the input gate is as follows: in, To update information, The results are calculated to update the cell state. 、 These are the corresponding weight matrices for the input gates; , These are the corresponding bias terms for the input gate; the cell state update formula is: The output gate has the following structure: in, The output section representing the cell state, For the sigmoid function, The water consumption value output by the previous Long Short-Term Memory artificial neural network unit. , This is the bias term for the output gate; This represents the water consumption value output by the Long Short-Term Memory (LSTM) artificial neural network unit.