Three-stage combined treatment method for predicting urban water consumption
Through the band restructuring strategies of multi-scale wavelet decomposition and dynamic threshold correction, variational mode decomposition and spectrum energy equalization, combined with long and short-term memory networks, the problems of non-stationary characteristics and abnormal interference in urban water consumption prediction are solved, high-precision water consumption prediction is achieved, and accurate scheduling of smart water systems is promoted.
Patent Information
- Application Number
- CN202510383192.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-07-25
AI Technical Summary
When the existing urban water consumption prediction methods face complex non-stationary characteristics and abnormal interference, the prediction accuracy is insufficient, making it difficult to effectively separate short-term water consumption sudden changes and periodic fluctuations. The traditional static threshold method cannot adapt to the time-varying characteristics of urban water consumption, resulting in data distortion.
The dynamic threshold correction method of multi-scale wavelet decomposition is used to identify and correct outliers, and combined with the dynamic band division model of variational modal decomposition and spectral energy equalization, the fine separation of high-frequency mutation characteristics and periodic fluctuations is achieved through fast Fourier transform, and finally a long and short-term memory neural network is constructed for prediction.
The accuracy of urban water consumption prediction has been improved, and a full-process optimization system of data repair-feature decoupling-prediction fusion has been formed, which has improved the intelligent management level of smart water systems.
Smart Images

Figure CN120373527A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of intelligent water services, and in particular to a three-level joint processing method for urban water consumption prediction. Background Art
[0002] Water resources are an important factor determining the economic and social development of a region. With the growth of urban population and the rapid development of the economy in China, the demand for urban domestic water is increasing continuously. At the same time, with the rapid development of information technology, the traditional urban water service management method relying on experience and manual calculation lacks scientificity and real-time nature, and can no longer meet the current water service management requirements. Therefore, the intelligent water service management system has become an important way for current urban water resource management. Among them, accurate prediction of short-term urban water consumption is the core requirement of the intelligent water service system. Accurate short-term water demand prediction is the basis and prerequisite for ensuring the balance between supply and demand of the water supply system, optimizing water supply scheduling, and the safe operation of the pipe network. It is of great significance for urban water supply guarantee, efficient utilization of water resources, and sustainable development.
[0003] In recent years, scholars at home and abroad have carried out many studies in the field of short-term urban water consumption prediction. Common methods include time series analysis (ARIMA), support vector regression (SVR), and artificial neural network (ANN), etc., most of which are single prediction models. In the literature "Research and Application of Urban Water Consumption Prediction Model Based on Combined Neural Network", a combined neural network (PCA-IPSO-BP) water consumption prediction model optimized by principal component analysis and improved particle swarm algorithm is proposed, which improves the prediction accuracy by eliminating redundant information between factors. In the literature "Research on Monthly Domestic Water Demand Prediction Based on CNN-LSTM-Attention", a monthly domestic water demand prediction model based on CNN-LSTM-Attention is adopted. It extracts the dynamic change characteristics of data through a convolutional neural network (CNN), then uses a long short-term memory network (LSTM) to learn and train the extracted characteristics, and at the same time combines the attention mechanism to allocate different weights to the LSTM hidden layer, further improving the prediction accuracy. In the literature "Short-Term Urban Water Consumption Prediction Based on Wavelet Combined Model", a short-term water consumption prediction method combining wavelet decomposition with random forest model and ARMA model is proposed, which improves the prediction accuracy by processing different frequency components separately. In the literature "Research on Water Consumption Prediction Method Based on Improved EMD-SSA-KELM", a combined prediction model of improved empirical mode decomposition method (EMD) and sparrow search algorithm (SSA) optimized kernel extreme learning machine (KELM) is proposed, and this method effectively improves the accuracy and credibility of water consumption prediction.
[0004] Although these combination methods have made certain progress through the integration of signal decomposition and machine learning, they generally adopt a "single-stage decomposition + component prediction" architecture, that is, directly modeling and predicting after single decomposition such as wavelet packet decomposition or EMD. Although this single-stage decomposition architecture can achieve basic frequency domain division, the stripping of composite frequency domain features in the process of analyzing high-frequency components is not sufficient enough to effectively separate detailed features with significant prediction value such as short-term water use mutations (such as a sharp increase in demand during holidays) and intensified periodic fluctuations (such as a step change in water consumption in summer); in addition, the short-term mutation features retained in the high-frequency components and the periodic fluctuations show non-linear interaction in the time-frequency coupling region, and the traditional method lacks a cross-scale phase synchronization mechanism, which easily leads to lag errors in the predicted values when the water use behavior pattern switches.
[0005] On the other hand, affected by multiple factors such as equipment failures, sensor errors, data transmission conditions, and complex working environments in the urban water supply system, monitoring data generally has complex interferences such as irregular missing and sudden abnormal fluctuations. Most existing studies focus on the innovation of prediction algorithms themselves and the optimization of model combinations, but pay insufficient attention to the problem of abnormal interference in the data preprocessing stage. When using conventional quartile methods or 3σ criteria for anomaly detection, their rigid threshold strategies are difficult to adapt to the periodic fluctuation characteristics of urban water consumption, and traditional static threshold methods cannot capture time-varying characteristics such as the conversion between weekdays and holidays and climate mutations, resulting in significant distortion in the data after anomaly correction. These data quality problems are the key obstacles restricting the analysis of water use patterns and the improvement of prediction capabilities.
[0006] In view of this, a three-level joint processing method for urban water consumption prediction is proposed. Summary of the Invention
[0007] In order to solve the problem of insufficient prediction accuracy caused by many abnormal interferences and complex non-stationary characteristics in the time series of urban water consumption, the present application provides a three-level joint processing method for urban water consumption prediction.
[0008] The three-level joint processing method for urban water consumption prediction provided by the present application includes the following steps:
[0009] S1. Data repair: Using a dynamic threshold correction method based on multi-scale wavelet decomposition to correct the outliers in the time series of urban water consumption;
[0010] S2. Feature decoupling: Performing a decomposition operation on the time series after outlier correction;
[0011] S3. Prediction fusion: Constructing a long short-term memory neural network to predict and reconstruct all decomposed sub-components, and obtaining the final prediction result;
[0012] Among them, the dynamic threshold correction method based on multi-scale wavelet decomposition in step S1 includes the following steps:
[0013] S11. Discrete wavelet transform: Use the Daubechies4 (db4) wavelet basis function, and its scaling function φ j,k (t) and wavelet basis function ψ j,k (t) satisfy the orthogonality condition:
[0014]
[0015] In the formula, h = [h0, h0, h0, h0] is the low-pass filter coefficient, and g = [g0, g1, g2, g3] is the high-pass filter coefficient. The specific coefficient values are:
[0016]
[0017] When performing multi-scale decomposition on the water consumption time series signal x(t), DWT generates the approximation coefficient A j and the detail coefficient D j through recursive filtering and downsampling operations:
[0018]
[0019] Among them,
[0020]
[0021] In the formula, J is the actual decomposition layer, J max is the preset maximum decomposition layer, L is the wavelet filter length, k is the translation parameter, A j and D j respectively represent the reconstructed signals of the approximation component and the detail component of the j-th layer;
[0022] S12. Dynamic threshold construction: Based on the multi-scale decomposition result, perform single-branch reconstruction on the detail coefficient D j of the j-th layer to obtain the detail component signal Calculate the noise level using the median absolute deviation:
[0023]
[0024] Determine the anomaly criterion as τ j = α·σ j according to the significance level (taking the 3σ criterion). When , it is marked as an anomaly point;
[0025] S13. Wavelet reconstruction correction: For the detected anomaly points, use wavelet reconstruction to perform trend correction, and perform approximate signal extraction and outlier replacement respectively;
[0026] S131. Approximate signal extraction: Only retain the approximate coefficient A of the maximum decomposition layer J , and set the remaining detail coefficients to zero. Then
[0027]
[0028] S132. Replace the value of the abnormal point in the original signal with the value of the approximate signal at the corresponding moment.
[0029]
[0030] As an optimization of the above technical solution, in step S2, feature decoupling: The decomposition operation on the time series after abnormal value correction includes step S21. Variational mode decomposition;
[0031] For the original input signal x c (t), the mode function is u k (t), k = 1, 2,..., K, where K is the total number of mode components. Then its basic principle is as follows:
[0032] S211. Construction of variational problem
[0033] Through Hilbert transform, find the analytic signal and single-sided spectrum of each mode, then adjust the center frequency estimated by each mode function by introducing an exponential term, modulate the spectrum of each mode function to its corresponding base frequency band, and finally make it correspond to an estimated center frequency ω k corresponding. Finally, estimate the bandwidth according to the squared norm of the gradient of the demodulated signal, and obtain the constrained variational model as:
[0034]
[0035] In the formula: is the partial derivative of the solution function with respect to time t; δ(t) is the Dirac distribution; j is the imaginary unit; * is the convolution calculation; The superscript and subscript in are the square sum and L2 norm respectively;
[0036] S212. Solution of variational problem
[0037] By introducing the Lagrange multiplier λ and the penalty factor α, transform the constrained variational problem into an unconstrained variational problem, and obtain the augmented Lagrangian function of formula (9):
[0038]
[0039] Solve formula (9) using the alternating direction multiplier method, and update the mode center frequency and (n represents the number of iterations) Find the saddle point of the augmented Lagrangian function:
[0040]
[0041] Given the discrimination accuracy ε > 0, when the formula (10) is satisfied, the iteration ends, and K modes can be obtained.
[0042] As an optimization of the above technical solution, in the step S2, for feature decoupling: the decomposition operation on the time series after outlier correction further includes the step S22, frequency band dynamic recombination based on FFT;
[0043] The fast Fourier transform (FFT) can transform the discrete signal x[n] of length N to the frequency domain, and its mathematical expression is:
[0044]
[0045] In the formula, X[k] is the complex amplitude in the frequency domain, and j is the imaginary unit;
[0046] The frequency band dynamic recombination based on FFT innovatively proposes a spectrum recombination mechanism guided by amplitude sorting. The sorted spectrum amplitude sequence is adaptively segmented into several sub-bands according to the energy balance criterion through the dynamic frequency band division strategy, and finally realizes the refined analysis of the time-frequency characteristics and phase synchronization of non-stationary signals. The specific steps are as follows:
[0047] S221. Calculate the FFT frequency X[k] of the signal, obtain the amplitude sequence A[k] = |X[k]|, sort it in descending order, and generate the index sequence {k m}, satisfying A[k1] ≥ A[k2] ≥ … ≥ A[k N , and normalize the spectrum energy:
[0048]
[0049] S222. According to the preset number of sub-bands L, calculate the theoretical energy quota of each sub-band Accumulate the energy along the sorted spectrum sequence {k m}, and dynamically determine the segmentation points p1, p2,..., p L-1 such that the cumulative energy of the l-th sub-band first satisfies:
[0050]
[0051] Divide the spectrum into L sub-bands based on the segmentation points, and the index set of each sub-band is:
[0052]
[0053] S223. For each sub-band S lConstruct a complex spectrum that retains the original phase information:
[0054]
[0055] where ensure that the inverse transform result is a real signal;
[0056] S224. Perform an inverse FFT on X l [k], extract the real part to obtain the time-domain subcomponent.
[0057]
[0058] As an optimization of the above technical solution, in step S3, perform prediction and fusion: construct a long short-term memory neural network to predict and reconstruct all the decomposed subcomponents, and obtain the final prediction result;
[0059] The long short-term memory neural network introduces memory units and a gating mechanism, and controls the global memory cells through the forget gate, input gate, and output gate to achieve dynamic regulation of the information flow; the specific steps are as follows,
[0060] S31. First, concatenate and fuse the current input X t with the hidden state h t-1 at the transfer moment to form an enhanced feature vector [h t-1 , X t , providing a joint representation basis for subsequent gating calculations;
[0061] S32. Generate a forget gate vector f t through the sigmoid function to perform non-linear filtering on the historical memory unit C t-1 to achieve adaptive attenuation of long-term dependence;
[0062] S33. The input gate i t acts jointly with the candidate memory generation layer. The former filters the effective features of the current input, and the latter generates the information to be stored through non-linear feature space mapping
[0063] After being weighted by the gating parameters, the two are fused with the filtered historical memory to form an updated memory unit C t ;
[0064] At the same time, in S34, the output gate O t synchronously calculates its regulation coefficient, and finally generates a hidden state h t with both short-term sensitivity and long-term memory characteristics through the hyperbolic tangent transformation and gating product of the memory unit;
[0065] The calculation processes of each link are shown in equations (17) to (22):
[0066] f t = σ(W f [h t-1 , X t + b f ) #(17)
[0067] i t = σ(W i [h t-1 , X t + b i ) #(18)
[0068]
[0069] O t = σ(W o [h t-1 , X t + b0) #(21)
[0070] h t = O t ⊙ tanh(C t ) #(22)
[0071] Where: f t , i t , O t are the gating vectors of the forget gate, input gate, and output gate respectively; W is the trainable weight matrix; b is the bias parameter.
[0072] Beneficial effects:
[0073] 1. In the three - level joint processing method for urban water consumption prediction in this technical solution, first, a dynamic threshold correction method based on multi - scale wavelet decomposition is adopted. The signal is hierarchically analyzed through discrete wavelet transform (DWT), and a dynamic threshold mechanism is constructed by combining the MAD robust statistic to effectively identify and correct outliers; second, a joint model of variational mode decomposition (VMD) and dynamic frequency band division with spectral energy equilibrium is constructed, and a dynamic frequency band recombination strategy guided by amplitude sorting is proposed. Through fast Fourier transform (FFT) spectrum analysis, the energy of the high - frequency sub - components of VMD is evenly divided and inverse - transformed and reconstructed to achieve fine separation of high - frequency mutation features and periodic fluctuations and multi - band phase synchronization; finally, a long short - term memory network (LSTM) is constructed to predict and reconstruct all sub - components.
[0074] 2. The three - level joint processing method for urban water consumption prediction in this technical solution is superior to traditional models in terms of prediction accuracy, providing a reliable technical path for urban water consumption prediction and helping to improve the intelligent management level of the water service system. It innovatively combines dynamic threshold correction, frequency band recombination strategy with deep learning to form a full - process optimization system of "data repair - feature decoupling - prediction fusion", providing a new technical paradigm for complex non - stationary time series prediction and having important practical value for promoting the precise scheduling of the intelligent water service system. Brief Description of the Drawings
[0075] Figure 1 It is a schematic structural diagram of the three - level joint processing method for urban water consumption prediction in the embodiment;
[0076] Figure 2 It is a schematic structural diagram of the LSTM network in the embodiment;
[0077] Figure 3 It is the original data diagram in the embodiment;
[0078] Figure 4 It is the detection diagram of abnormal water intake values in the embodiment;
[0079] Figure 5 It is the correction diagram of abnormal water intake values in the embodiment;
[0080] Figure 6 It is the sub - component obtained by VMD decomposition in the embodiment;
[0081] Figure 7 It is the frequency - band dynamic recombination decomposition diagram of IMF4 based on FFT in the embodiment;
[0082] Figure 8 It is the comparison diagram of the predicted water intake value and the actual value in the embodiment. Detailed Embodiment
[0083] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments.
[0084] The three - level joint processing method for urban water consumption prediction includes the following steps:
[0085] S1. Data repair: Use the dynamic threshold correction method based on multi - scale wavelet decomposition to correct the abnormal values in the urban water consumption time series;
[0086] S2. Feature decoupling: Perform a decomposition operation on the time series after abnormal value correction;
[0087] S3. Prediction Fusion: Construct a long short-term memory neural network to predict and reconstruct all decomposed sub-components, and obtain the final prediction result;
[0088] Among them, the dynamic threshold correction method based on multi-scale wavelet decomposition in step S1 includes the following steps:
[0089] S11. Discrete Wavelet Transform: Discrete Wavelet Transform (DWT) is a mathematical method for signal processing and image analysis, with good time-domain and frequency-domain localization characteristics. In this technical solution, the Daubechies4 (db4) wavelet basis function is adopted, and its scaling function φ j,k (t) and wavelet basis function ψ j,k (t) satisfy the orthogonality condition:
[0090]
[0091] In the formula, h = [h0, h0, h0, h0] is the low-pass filter coefficient, and g = [g0, g1, g2, g3] is the high-pass filter coefficient. The specific coefficient values are:
[0092]
[0093] When performing multi-scale decomposition on the water consumption time series signal x(t), DWT generates the approximation coefficient A j and the detail coefficient D j through recursive filtering and downsampling operations:
[0094]
[0095] Among them,
[0096]
[0097] In the formula, J is the actual decomposition layer, J max is the preset maximum decomposition layer, L is the wavelet filter length, k is the translation parameter, A j and D j respectively represent the reconstructed signals of the approximation component and the detail component at the j-th layer;
[0098] S12. Dynamic Threshold Construction: Based on the multi-scale decomposition result, perform single-branch reconstruction on the detail coefficient D j at the j-th layer to obtain the detail component signal Calculate the noise level using the median absolute deviation:
[0099]
[0100] Determine the anomaly criterion τ according to the significance level (taking the 3σ criterion)j = α·σ j When it is the case, it is marked as an abnormal point;
[0101] S13. Wavelet reconstruction correction: For the detected abnormal points, wavelet reconstruction is used for trend correction, and approximate signal extraction and outlier replacement are carried out respectively;
[0102] S131. Approximate signal extraction: Only keep the approximate coefficient A of the maximum decomposition layer J and set the remaining detail coefficients to zero, then
[0103]
[0104] S132. Replace the value of the abnormal point in the original signal with the approximate signal value at the corresponding time.
[0105]
[0106] This method avoids the feature confusion problem caused by over-decomposition of traditional wavelet analysis through adaptive layer number control. Combining with the multi-scale joint detection mechanism, it can effectively identify transient anomalies and continuous offsets. Compared with direct interpolation or simple filtering, its reconstruction and replacement strategy can eliminate abnormal fluctuations while retaining the trend characteristics of the original data to the greatest extent, providing a more reliable data basis for subsequent analysis.
[0107] In the three-level joint processing method for urban water consumption prediction in this technical solution, in step S2, feature decoupling: The decomposition operation on the time series after outlier correction includes step S21. Variational mode decomposition;
[0108] For the original input signal x c (t), the mode function is u k (t), k = 1, 2,..., K, where K is the total number of mode components, then its basic principle is as follows:
[0109] S211. Construction of the variational problem
[0110] Through Hilbert transform, the analytic signal and single-sided spectrum of each mode are obtained, and then by introducing an exponential term to adjust the center frequency of each mode function estimate, modulating the spectrum of each mode function to its corresponding base frequency band, and finally corresponding it to the estimated center frequency ω k corresponding, and finally estimating the bandwidth according to the square norm of the gradient of the demodulated signal, the constrained variational model is obtained as:
[0111]
[0112] In the formula: To solve the partial derivative of the function with respect to time t; δ(t) is the Dirac distribution; j is the imaginary unit; * is the convolution calculation; The superscript and subscript in
[0113] S212. Solution of the variational problem
[0114] By introducing the Lagrange multiplier λ and the penalty factor α, the constrained variational problem is transformed into an unconstrained variational problem, and the augmented Lagrangian function of Equation (9) is obtained:
[0115]
[0116] Use the alternating direction multiplier method to solve Equation (9), and find the saddle point of the augmented Lagrangian function by updating the mode Center frequency and (n represents the number of iterations)
[0117]
[0118] Given the discrimination accuracy e > 0, when Equation (10) is satisfied, the iteration ends, and K modes can be obtained.
[0119] The Variational Mode Decomposition (VMD) algorithm is an adaptive and completely non - recursive signal decomposition algorithm. Compared with the EMD proposed by N.E. Huang et al. in this technical solution, VMD uses a completely non - recursive method, effectively avoiding the common mode mixing and endpoint effect problems in EMD, and improving the accuracy and reliability of analysis.
[0120] VMD can decompose a complex time series into a given number of intrinsic mode functions. At the same time, the decomposed components possess all the characteristics of the original data on the corresponding time scales. Its decomposition purpose is to seek the mode functions with the minimum sum of K estimated bandwidths. Through the mode functions of different frequencies, the overall law and local vibration mode of the signal can be understood in more detail, and the original signal can be obtained by adding the mode functions.
[0121] In the field of digital signal processing, the role of the Fourier Transform (FT) is to decompose a complex digital signal into a series of simpler components, enabling us to identify and extract valuable signal parts. Based on the Fourier principle, we know that any continuously recorded time series or signal can be represented by the combination of countless sine waves of different frequencies. The Fourier transform algorithm is based on this principle, and it uses the original signal to calculate the frequency, amplitude, and phase of each sine wave component.
[0122] In the three - level joint processing method for urban water consumption prediction in this technical solution, in step S2, feature decoupling: the decomposition operation on the time series after outlier correction further includes step S22, frequency - band dynamic recombination based on FFT.
[0123] The Fast Fourier Transform (FFT) in this technical solution is an efficient algorithm for the Discrete Fourier Transform (DFT). The Fast Fourier Transform (FFT) can transform a discrete signal x[n] of length N into the frequency domain, and its mathematical expression is:
[0124]
[0125] where X[k] is the complex amplitude in the frequency domain and j is the imaginary unit.
[0126] Although the Fast Fourier Transform (FFT) has a fundamental position in spectrum analysis, its application in the decomposition of non - stationary signals still has significant limitations. First, the fixed frequency - band division strategy is restricted by the heterogeneity of the spectrum energy distribution. When using equally - spaced frequency - band segmentation, it is difficult to balance high - frequency noise suppression and high - frequency feature analysis, resulting in the difficulty of effectively separating the trend term and the interference component. Second, the main - frequency screening mechanism based on the energy threshold will mis - remove low - energy transient features while filtering out noise, causing irreversible loss of key physical information. In addition, conventional frequency - domain decomposition methods ignore the phase - synchronization constraint, resulting in waveform mismatch in the time domain after sub - component reconstruction, seriously restricting the accuracy and reliability of FFT in complex signal feature extraction. To address the above problems, the frequency - band dynamic recombination based on FFT proposed in this technical solution innovatively proposes a spectrum recombination mechanism guided by amplitude sorting. By using a dynamic frequency - band division strategy, the sorted spectrum amplitude sequence is adaptively segmented into several sub - bands according to the energy - balance criterion, and finally, the refined analysis of the time - frequency features and phase synchronization of non - stationary signals are realized. The specific steps are as follows:
[0127] S221. Calculate the FFT frequency X[k] of the signal, obtain the amplitude sequence A[k]=|X[k]|, sort it in descending order, and generate an index sequence {k m}, satisfying A[k1]≥A[k2]≥…≥A[k N , and normalize the spectrum energy:
[0128]
[0129] S222. According to the preset number of sub - bands L, calculate the theoretical energy quota of each sub - band Accumulate the energy along the sorted spectrum sequence {k m}, and dynamically determine the segmentation points p1, p2,..., p L-1, such that the cumulative energy of the l-th sub-band first satisfies:
[0130]
[0131] Based on the segmentation points, the frequency spectrum is divided into L sub-bands, and the index sets of each sub-band are:
[0132]
[0133] S223. For each sub-band S l Construct a complex frequency spectrum that retains the original phase information:
[0134]
[0135] where Ensure that the inverse transform result is a real signal;
[0136] S224. Perform an inverse FFT on X l [k] and extract the real part to obtain the time-domain sub-component.
[0137]
[0138] In the three-level joint processing method for urban water consumption prediction in this technical solution, in step S3, prediction fusion: construct a long short-term memory neural network to predict and reconstruct all the decomposed sub-components, and obtain the final prediction result; the long short-term memory neural network (Long Short-Term Memory, LSTM) is a special recurrent neural network architecture that is optimized on the basis of the recurrent neural network (RerrentNeural Network, RNN) and solves the problem of gradient disappearance or explosion in traditional RNN during long-sequence training.
[0139] Reference Figure 2 , the core lies in that the long short-term memory neural network introduces memory units and gating mechanisms, and controls the global memory cells through the forget gate, input gate, and output gate to realize the dynamic regulation of information flow, so as to have "memory"; the specific steps are as follows.
[0140] S31. The currently input X t and the hidden state h at the migration moment t-1 are first concatenated and fused to form an enhanced feature vector [h t-1 , X t , providing a joint representation basis for subsequent gating calculations;
[0141] S32. The forget gate vector f generated by the sigmoid function t performs non-linear filtering on the historical memory unit C t-1 to achieve adaptive attenuation of long-term dependence relationships;
[0142] S33. Input gate i t Acts jointly with the candidate memory generation layer. The former filters the effective features of the current input, and the latter generates the information to be stored through non-linear feature space mapping
[0143] After being weighted by the gating parameters, the two are fused with the filtered historical memory to form the updated memory cell C t ;
[0144] Meanwhile, S34. Output gate O t Synchronously calculates its regulation coefficient, and finally generates the hidden state h with both short-term sensitivity and long-term memory characteristics through the hyperbolic tangent transformation and gating product of the memory cell t ;
[0145] The calculation processes of each link are shown in Equations (17) to (22):
[0146] f t = σ(W f [h t-1 , X t +b f ) #(17)
[0147] i t = σ(W i [h t-1 , X t +b i ) #(18)
[0148]
[0149] O t = σ(W o [h t-1 , X t +b0) #(21)
[0150] h t = O t ⊙tanh(C t ) #(22)
[0151] In the formula: f t , i t , O t are the gating vectors of the forgetting gate, input gate, and output gate respectively; W is the trainable weight matrix; b is the bias parameter
[0152] The three - level joint processing method for urban water consumption prediction in this technical solution first adopts a dynamic threshold correction method based on multi - scale wavelet decomposition. It realizes signal hierarchical analysis through discrete wavelet transform (DWT), constructs a dynamic threshold mechanism by combining the MAD robust statistic, and effectively identifies and corrects outliers. Secondly, a joint model of variational mode decomposition (VMD) and dynamic frequency band division with spectral energy balance is constructed, and a dynamic frequency band recombination strategy guided by amplitude sorting is proposed. Through fast Fourier transform (FFT) spectral analysis, the energy of the VMD high - frequency sub - components is evenly divided and inverse - transformed and reconstructed to achieve refined separation of high - frequency mutation features and periodic fluctuations and multi - band phase synchronization. Finally, a long short - term memory network (LSTM) is constructed to predict and reconstruct all sub - components.
[0153] The three - level joint processing method for urban water consumption prediction in this technical solution is superior to traditional models in prediction accuracy, provides a reliable technical path for urban water consumption prediction, and helps improve the intelligent management level of the water service system.
[0154] Embodiment
[0155] This embodiment designs experiments and evaluations on the three - level joint processing method for urban water consumption prediction in this technical solution. The original data in this embodiment selects the water intake data of a certain urban water supply plant from January 1, 2018 to March 9, 2023 for experimental analysis. The original time series is as follows Figure 3 , and the data set is divided into a training set, a validation set, and a test set according to the ratio of 70%:15%:15%.
[0156] The three - level joint processing method for urban water consumption prediction includes the following steps:
[0157] S1. Data repair: Use the dynamic threshold correction method based on multi - scale wavelet decomposition to correct the outliers in the urban water consumption time series;
[0158] Use DWT to realize signal hierarchical analysis, construct a dynamic threshold mechanism by combining the MAD robust statistic, effectively identify and correct outliers. The abnormal values detected by this method are shown in Figure 4 .
[0159] It can be intuitively compared and found from the figure that: due to the dependence on the assumption of data normal distribution, the upper and lower bounds based on the 3σ rule have obvious misjudgments in the non - stationary and non - normal water intake sequence, resulting in some real outliers not being marked; although the upper and lower quartiles have a certain robustness to outliers, they only rely on quantile information and have insufficient ability to capture pulse - type subtle outliers caused by equipment failures and sudden water use events, and are also prone to misjudging some normal fluctuation regions as outliers. In contrast, the method proposed in this paper has much better recognition ability for abnormal fluctuations than traditional methods, especially being sensitive to high - frequency mutation - type outliers.
[0160] Among them, wavelet trend reconstruction is performed on the detected abnormal points, and the reconstructed time series is as Figure 5 shown, which retains the long-term trend characteristics of the original water intake sequence to the greatest extent.
[0161] S2. Feature decoupling: Decompose the time series after outlier correction;
[0162] First, VMD is used to decompose the corrected water intake time series of the water plant, Figure 6 which are the sub-components obtained by decomposition.
[0163] Among the 4 sub-components obtained by decomposition, the high-frequency sub-component shows short-term mutation characteristics and multi-scale periodic fluctuations, and large errors may occur in the prediction.
[0164] To further extract complex detail features to improve the prediction accuracy and reduce the lag error generated during the switching of water use behavior patterns, a frequency band dynamic recombination strategy based on FFT is used to decompose IMF4 twice, and the decomposition results are shown in Figure 7 .
[0165] S3. Prediction fusion: Construct a long short-term memory neural network to predict and reconstruct all the decomposed sub-components to obtain the final prediction result;
[0166] Use LSTM as the benchmark prediction model, and verify the effectiveness of different signal decomposition strategies through five groups of comparative experiments. In the data preprocessing stage, first divide all component sequences into training set, validation set and test set according to the ratio of 70%:15%:15%; for the characteristics of time series, use the sliding window method with a fixed step size to generate samples: use the window data of 14 consecutive time steps as the model input, and the next time step data adjacent to the window as the prediction target, and the window slides backward by 1 time step each time until it reaches the boundary of the data set, so as to construct a complete supervised learning data set.
[0167] To eliminate the influence of dimension, normalize the input sequence, and use the min-max scaling method to linearly transform the water consumption data to the [0,1] interval. Its mathematical expression is:
[0168]
[0169] In the formula, X is the original time series, X min and X max are the minimum and maximum values of the sequence respectively, and X * is the normalized standardized value.
[0170] The LSTM model architecture consists of two stacked LSTM units: the first layer contains 64 neurons with sequence output function, and the second layer is configured with 32 neurons that only output the final state. Subsequently, a fully connected layer is connected for dimensional transformation, and finally, the predicted value is output through a linear activation layer. The model uses the Adam optimization algorithm for parameter update, with the initial learning rate set to 0.001, and the mean squared error (MSE) is used as the loss function. During the training process, the change in the validation set loss is continuously monitored. When this metric does not improve for 10 consecutive epochs, the training process is terminated early, and the maximum number of iterations is limited to 100. Throughout the training cycle, the model parameters with the best performance on the validation set are always retained, and finally, this parameter configuration is applied to the test set prediction task.
[0171] In this paper, the Mean Absolute Percentage Error (MAPE), Mean Absolute Error (MAE), and Root Mean Square Error (RMSE) are selected as the metrics to evaluate the performance of the model. The calculation formulas for the three metrics are as follows:
[0172]
[0173] In the formula, y i is the actual value at the i-th time step, is the predicted value at the corresponding time step, and N is the length of the time series.
[0174] Evaluate the prediction performance of the three-stage joint treatment method for urban water consumption prediction in this embodiment.
[0175] To further evaluate the prediction performance of the method in this embodiment, EEMD (reference: Short-term prediction of the intermediate point temperature of a supercritical unit based on the EEMD–LSTM method) and CEEMDAN (reference: Portfolio allocation with CEEMDAN denoising algorithm) are simultaneously introduced as secondary decomposition models to further decompose the high-frequency sub-components of VMD, and LSTM is established for prediction. Figure 8 Shows the comparison results between the predicted values and the actual values of the validation set of the water intake data.
[0176] Based on the comparative analysis of the prediction results (see Table 1 below), the VMD-FFT dynamic recombination-LSTM model proposed in this technical solution shows significant advantages. The MAPE, MAE, and RMSE of the traditional LSTM model reach 0.0259, 13353.6018, and 17944.2522 respectively, while the three indicators of the VMD-LSTM model improved by VMD decomposition are reduced by 23.55%, 23.01%, and 27.23% respectively, verifying the effectiveness of signal decomposition in analyzing non-stationary characteristics. Further, through the dynamic frequency band recombination strategy of spectrum energy balance, the method in this technical solution reaches the optimal values in both MAPE (0.0194) and RMSE (12844.8734), with a 2.02% and 1.67% improvement compared to VMD-LSTM respectively. Compared with the similar improved models VMD-EEMD-LSTM and VMD-CEEMDAN-LSTM, the method in this technical solution reduces by 1.06% and 0.79% respectively in terms of the MAE index (10112.2342), confirming the superiority of the amplitude sorting-guided frequency band recombination strategy in separating high-frequency mutation characteristics and periodic fluctuations, effectively solving the cumulative effect of cross-scale phase offset in traditional decomposition methods, and providing a better solution for the time-frequency feature decoupling of complex non-stationary sequences.
[0177] Table 1 Performance evaluation of each model
[0178]
[0179] In summary, aiming at the problems of insufficient analysis of non-stationary characteristics and distorted correction of abnormal interference in urban water consumption prediction, this technical solution proposes a three-level joint processing method for urban water consumption prediction. Through multi-scale wavelet dynamic threshold correction, the data abnormal interference is effectively suppressed. The constructed VMD-FFT dynamic frequency band recombination strategy adopts the amplitude sorting-guided spectrum energy balance method to achieve the refined separation and phase synchronization of high-frequency mutation characteristics and periodic fluctuations.
[0180] Experiments show that the MAPE, MAE, and RMSE of the VMD-FFT dynamic recombination-LSTM model reach 0.0194, 10112.2342, and 12844.8734 respectively, with a 25.10% improvement in accuracy compared to the traditional LSTM model, and all indicators are better than the comparative models such as VMD-EEMD-LSTM. This method innovatively combines dynamic threshold correction, frequency band recombination strategy with deep learning to form a full-process optimization system of "data repair-feature decoupling-prediction fusion", providing a new technical paradigm for the prediction of complex non-stationary time series, and having important practical value for promoting the precise scheduling of the intelligent water service system.
[0181] The above are all preferred embodiments of this application, and the protection scope of this application is not limited thereby. Therefore, all equivalent changes made according to the structure, shape, and principle of this application shall be covered within the protection scope of this application.
Claims
1. A three - stage combined treatment method for urban water consumption prediction, characterized in that, Including the following steps: S1. Data repair: Use the dynamic threshold correction method based on multi-scale wavelet decomposition to correct the outliers in the urban water consumption time series; S2. Feature decoupling: Decompose the time series after outlier correction; S3. Prediction fusion: Construct a long short-term memory neural network to predict and reconstruct all the decomposed sub-components, and obtain the final prediction result; Among them, the dynamic threshold correction method based on multi-scale wavelet decomposition in step S1 includes the following steps: S11. Discrete wavelet transform: The Daubechies 4 (db4) wavelet basis function is adopted, and its scaling function φ j,k (t) and wavelet basis function ψ j,k (t) satisfy the orthogonality condition: In the formula, h = [h0, h0, h0, h0] is the low-pass filter coefficient, and g = [g0, g1, g2, g3] is the high-pass filter coefficient. The specific coefficient values are: When performing multi-scale decomposition on the time-series signal x(t) of water consumption, DWT generates the approximation coefficient A through recursive filtering and downsampling operations j and the detail coefficient D j : Among them, Where J is the actual decomposition level, and J max is the preset maximum decomposition level, L is the length of the wavelet filter, k is the translation parameter, A j and D j respectively represent the reconstructed signals of the approximation component and the detail component at the j-th level; S12. Dynamic threshold construction: Based on the multi-scale decomposition results, perform single-branch reconstruction on the detail coefficients D of the j-th layer to obtain the detail component signal j and use the median absolute deviation to calculate the noise level: Determine the anomaly criterion as τ according to the significance level (taking the 3σ criterion) j = α·σ j , when , then it is marked as an anomaly point; S13. Wavelet reconstruction correction: For the detected outliers, use wavelet reconstruction for trend correction, and extract the approximate signal and replace the outliers respectively; S131. Approximate signal extraction: Only retain the approximate coefficient A of the maximum decomposition layer, and set the remaining detail coefficients to zero. Then J , S132. Replace the value of the outlier in the original signal with the approximate signal value at the corresponding moment.
2. The three - level combined treatment method for urban water consumption prediction according to claim 1, characterized in that, In step S2, feature decoupling: The decomposition operation on the time series after outlier correction includes step S21, variational mode decomposition; For the original input signal x c (t), and the mode function is u k (t), where k = 1, 2,..., K and K is the total number of modal components, the basic principle is as follows: S211. Construction of variational problem Through Hilbert transform, the analytic signal and single-sided spectrum of each mode are obtained. Then, by introducing an exponential term, the center frequency of each mode function estimate is adjusted, and the spectrum of each mode function is modulated to its corresponding base frequency band. Finally, it is corresponded to the estimated center frequency ω of an index. Finally, the bandwidth is estimated according to the square norm of the gradient of the demodulated signal, and the constrained variational model is obtained as follows: k Corresponding, finally, the bandwidth is estimated according to the square norm of the gradient of the demodulated signal, and the constrained variational model is as follows: In the formula: is the partial derivative of the solution function with respect to time t; δ(t) is the Dirac distribution; j is the imaginary unit; * is the convolution calculation; The superscript and subscript in are the square and L2 norm respectively; S212. Solution of variational problem By introducing the Lagrange multiplier λ and the penalty factor α, the constrained variational problem is transformed into an unconstrained variational problem, and the augmented Lagrangian function of formula (9) is obtained: Solve equation (9) using the alternating direction method of multipliers, and find the saddle point of the augmented Lagrangian function by updating the modal Center frequency and (where n represents the number of iterations): Given the discrimination accuracy e > 0, when formula (10) is satisfied, the iteration ends, and K modes can be obtained.
3. The three - stage combined treatment method for urban water consumption prediction according to claim 2, wherein, In step S2, feature decoupling: The decomposition operation on the time series after outlier correction further includes step S22, frequency band dynamic recombination based on FFT; The fast Fourier transform (FFT) can transform the discrete signal x[n] of length N into the frequency domain, and its mathematical expression is: In the formula, X[k] is the complex amplitude in the frequency domain, and j is the imaginary unit; The frequency band dynamic recombination based on FFT innovatively proposes a spectrum recombination mechanism guided by amplitude sorting. Through the dynamic frequency band division strategy, the sorted spectrum amplitude sequence is adaptively segmented into several sub-bands according to the energy balance criterion, and finally the refined analysis of the time-frequency characteristics of the non-stationary signal and phase synchronization are realized. The specific steps are as follows: S221. Calculate the FFT frequency X[k] of the signal, obtain the amplitude sequence A[k]=|X[k]|, sort it in descending order, and generate the index sequence {k m}, satisfying A[k1]≥A[k2]≥…≥A[k N , and normalize the spectral energy: S222. Calculate the theoretical energy quota of each sub - band according to the preset number of sub - bands L. Accumulate the energy along the sorted frequency spectrum sequence {k m}, and dynamically determine the segmentation points p1, p2,..., p L-1 such that the cumulative energy of the l - th sub - band first satisfies: Divide the spectrum into L sub-bands based on the segmentation points, and the index set of each sub-band is: S223. For each sub-band S l Construct a complex spectrum that retains the original phase information: Among them Ensure that the inverse transform result is a real signal; S224. For X l [k] Perform inverse FFT and extract the real part to obtain the time-domain sub-component.
4. The three - stage combined treatment method for urban water consumption prediction according to claim 1, characterized in that, In step S3, prediction fusion: Construct a long short-term memory neural network to predict and reconstruct all the decomposed sub-components, and obtain the final prediction result; The long short-term memory neural network introduces memory units and gating mechanisms, and controls the global memory cells through the forget gate, input gate and output gate to realize the dynamic regulation of the information flow; The specific steps are as follows, S31. The currently input X t and the hidden state h at the migration moment t-1 First, perform splicing and fusion to form an enhanced feature vector [h t-1 , X t , providing a joint representation basis for subsequent gating calculations; S32. The forgetting gate vector f generated by the sigmoid function t Performs non-linear filtering on the historical memory cell C t-1 To achieve adaptive attenuation of long-term dependence relationships; S33. Input gate i t Acts jointly with the candidate memory generation layer. The former filters the valid features of the current input, and the latter generates the information to be stored through non-linear feature space mapping The two are weighted by the gating parameter and fused with the filtered historical memory to form an updated memory cell C t ; Meanwhile, S34, output gating O t Synchronously calculates its regulation coefficient, and finally generates a hidden state h with both short-term sensitivity and long-term memory characteristics through the hyperbolic tangent transformation and gating product of the memory unit t ; The calculation process of each link is shown in formulas (17) to (22): f t = σ(W f [h t-1 , X t + b f )#(17) i t = σ(W i [h t-1 , X t + b i ) #(18) O t = σ(W o [h t-1 , X t +b0) #(21) h t = O t ⊙tanh(C t )#(22) where: f t , i t , O t are the gating vectors of the forget gate, input gate, and output gate respectively; W is a trainable weight matrix; b is a bias parameter.
Citation Information
Cited By
Method, device, equipment and medium for predicting short-term water demand of urban water supply pipe network
CN121257814A