Water supply network flow prediction method based on time varying-time invariant feature extraction
By extracting the time-varying and time-varying characteristics in the flow data of the water supply pipeline network and using the multi-head attention mechanism and GRU for prediction, the problem of the existing models being unable to effectively identify the characteristics of traffic data is solved, and the accuracy of traffic prediction and the generalization ability of the model are improved.
Patent Information
- Application Number
- CN202411626628.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-14
AI Technical Summary
The existing water supply pipeline flow prediction model cannot effectively identify the time-varying and time-invariant characteristics of flow data, resulting in mutual influence in the learning process and restricting model performance.
A water supply pipeline flow prediction method based on time-varying-time-invariant feature extraction is adopted. Through data processing and flow index building blocks, signal separation modules, feature extraction modules and flow prediction modules, time-varying signals and time-varying signals are extracted, and feature extraction and flow prediction are used to use multi-head attention mechanisms and gated cycle units (GRUs).
By separating time-varying and time-varying features, the model can capture the characteristics of their respective characteristics more accurately, improve the accuracy and generalization ability of the water supply pipeline flow prediction, and enhance the model's expression ability and prediction accuracy.
Smart Images

Figure CN119577425A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of water supply network flow prediction, and in particular to a water supply network flow prediction method based on time-varying-time-invariant feature extraction. Background Art
[0002] With the acceleration of urbanization and the continuous growth of population, urban water supply systems are facing unprecedented challenges. In particular, as an important part of the urban water supply system, the water supply network has a direct relationship with the quality of life of urban residents and the smooth progress of industrial production. During the peak period of water supply or in emergencies, problems such as insufficient water supply, unstable water pressure, and even pipe bursts and leakages often occur, seriously affecting the normal operation of the city. Therefore, predicting the flow changes at each node on the network in advance is of great significance for optimizing water supply scheduling, valve switch control, valve opening adjustment, pressure regulation, and water pump energy saving.
[0003] At present, the main methods for predicting the flow of water supply networks in advance are time series methods, which is a method based on historical data and uses statistical analysis to predict future flow. It assumes that there is a certain correlation between future flow changes and historical data. The gray model prediction method generates by accumulating limited data and establishes a gray model to predict future flow. The closer the data is to the current time point, the higher the accuracy will be. Therefore, the prediction effect of the gray model will be better than that of the time series method. The neural network prediction method can autonomously learn and mine the laws behind the data and has strong nonlinear mapping capabilities.
[0004] However, existing traffic prediction models cannot effectively identify the differences between the time-varying and time-invariant features of traffic data, which leads to mutual influence during the learning process and restricts model performance. Summary of the invention
[0005] In order to overcome the problem that the flow prediction model in the above-mentioned prior art cannot effectively identify the differences between the time-varying and time-invariant characteristics of flow data, which restricts the model performance, the present invention proposes a water supply network flow prediction method based on time-varying and time-invariant feature extraction.
[0006] To achieve the above object, the present invention adopts the following technical solutions, including:
[0007] A water supply network flow prediction model based on time-varying and time-invariant feature extraction, comprising a data processing and flow index building module, a signal separation module, a feature extraction module and a flow prediction module;
[0008] The data processing and flow index construction module obtains the historical flow data of the water supply network, extracts the time domain characteristics based on the historical flow data of the water supply network, and then constructs the flow index for the time domain characteristics to obtain the time domain signal;
[0009] The signal separation module obtains the frequency domain signal based on the time domain signal, and uses filters to sort and filter the frequency domain signal in descending order to obtain high-frequency signals and low-frequency signals. Based on the high-frequency signal and the low-frequency signal, the time-invariant signal x is obtained. inv And the time-varying signal x var ;
[0010] The feature extraction module is based on the time-invariant signal x inv and the time-varying signal x var , respectively obtain time-invariant features and time-varying features;
[0011] The flow prediction module obtains the predicted water supply network flow based on time-invariant characteristics and time-varying characteristics.
[0012] Preferably, the signal separation module obtains the frequency domain signal based on the time domain signal. Specifically, the frequency domain signal is obtained based on the time domain signal using the Fourier transform method. The formula is as follows:
[0013]
[0014] Among them, x(t) represents the time series signal, that is, the time domain signal, X(ω) represents the representation of the time series signal in the frequency domain, that is, the frequency domain signal, t represents time, ω represents angular frequency, i is an imaginary unit, and f(x) represents the Fourier transform of the time series signal.
[0015] Preferably, the method of obtaining the time-invariant signal and the time-varying signal based on the high-frequency signal and the low-frequency signal is specifically: converting the frequency domain signal into a secondary time series signal by inverse Fourier transform, and the process is as follows:
[0016]
[0017] Among them, x'(t) represents the secondary time series signal, including the time-invariant signal x inv and the time-varying signal x var , as follows:
[0018]
[0019] Among them, f -1 (.) indicates inverse Fourier transform, and Filter(.) indicates filtering operation.
[0020] Preferably, the feature extraction module is based on the time-invariant signal x inv , obtain time-invariant features, including:
[0021] S411: Use encoder E to separate the time-invariant signal x inv Mapped to the hidden layer, the potential representation z is obtained inv , the formula is:
[0022] z inv =E(x inv )=W e ·x inv
[0023] S412: Use decoder D to reconstruct the potential representation and obtain time-invariant features The formula is:
[0024]
[0025] Among them, W e is the weight coefficient of the encoder, W d is the weight coefficient of the decoder.
[0026] Preferably, the feature extraction module is based on the time-varying signal x var , obtain time-varying features, including:
[0027] S421: Based on the time-varying signal, the self-attention mechanism is used to calculate the attention score and weighted sum to obtain the output AttHead of each attention head j , the formula is as follows:
[0028]
[0029] Among them, d k is the dimension of the key vector, K T represents the transposition of the matrix K, softmax(.) is the normalized exponential function, j refers to the number of the attention head, Q is the query of the self-attention mechanism, K is the key of the self-attention mechanism, and V is the value of the self-attention mechanism;
[0030] S422: The outputs of all attention heads are concatenated together and linear transformation is used to obtain the time-varying feature MultiHead(Q, K, V), the formula is:
[0031] MultiHead(Q,K,V)=(AttHead1,AttHead2,…,AttHead h )·W m
[0032] Among them, W m is the weight coefficient of linear transformation of multi-head splicing, and h is the total number of attention heads.
[0033] Preferably, the calculation formulas for the query Q, key K, and value V in the self-attention mechanism are as follows:
[0034]
[0035] Among them, Linear(.) means linear transformation, W q , W k , W v are their weight coefficients respectively.
[0036] Preferably, in the feature extraction module, the loss function L inv Update network parameters, loss function L inv The calculation formula is:
[0037]
[0038] Among them, Φ(·) represents the Gaussian kernel function that maps samples to high-dimensional feature space, n represents the total number of samples, s is the sample number, H represents the Hilbert space, || || H represents the norm in Hilbert space.
[0039] Preferably, in the traffic prediction module, a loss function L is used. MSE The mapping relationship between the learning prediction results and the actual value of the water supply network flow, the loss function of the flow prediction module is L MSE The calculation formula is:
[0040]
[0041] in, is the traffic prediction value, y s is the actual flow value.
[0042] Preferably, the global loss function L of the model is all The calculation formula is:
[0043] L all =L inv +L MSE .
[0044] A water supply network flow prediction method based on time-varying and time-invariant feature extraction inputs historical flow data of the water supply network to be measured into a water supply network flow prediction model based on time-varying and time-invariant feature extraction to obtain the predicted future flow of the water supply network.
[0045] The advantages of the present invention are:
[0046] (1) The present invention extracts time domain features from historical flow data of a water supply network to obtain time domain signals and frequency domain signals, and then extracts features from the frequency domain signals again to obtain time-varying signals and time-invariant signals as well as time-varying features and time-invariant features, and then obtains the predicted water supply network flow through a flow prediction module, thereby improving the performance of the model and the accuracy of water supply network flow prediction.
[0047] (2) The present invention can more accurately capture the characteristics of the time-varying features and the time-invariant features by processing the time-varying features and the time-invariant features separately.
[0048] (3) The present invention uses fast Fourier transform (FFT) and its inverse transform to extract frequency domain signals from time domain signals and divide them into time-varying signals and time-invariant signals, which can effectively separate high-frequency noise from low-frequency signals.
[0049] (4) The present invention uses a multi-head attention mechanism to establish complex associations between different time points and different features, so that the model pays more attention to the key factors in time changes, thereby improving the expressive power of time-varying features, helping to capture more subtle change patterns, and paving the way for subsequent models to make accurate predictions.
[0050] (5) The present invention inputs the extracted time-varying and time-invariant features into a gated recurrent unit (GRU) for prediction, which can process the long-term and short-term dependencies in time series data (water supply network flow data), thereby improving the model's fitting ability and prediction accuracy for water supply network flow data.
[0051] (6) In the traffic prediction module, inputting both time-invariant features and time-varying features into the GRU for prediction allows the GRU to simultaneously consider the long-term dependencies and invariant feature information in the traffic data, thereby better capturing the patterns and regularities in the sequence data. By inputting time-varying features into the GRU, the model can learn the temporal correlation and dynamic patterns of the sequence data, thereby better modeling the sequence data. At the same time, adding training for time-invariant features improves the model's expressiveness and generalization capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a diagram of the method architecture of the present invention;
[0053] Figure 2 Schematic diagram of the gated recurrent unit (GRU) structure;
[0054] Figure 3 This is a graph showing the change in water supply flow in a certain community in a certain week;
[0055] Figure 4 This is a comparison chart of the actual value and predicted value of the test data of the model of the present invention. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] like Figure 1-4 As shown, the present invention proposes a water supply network flow prediction method based on time-varying-time-invariant feature extraction, which is implemented by a water supply network flow prediction model based on time-varying-time-invariant feature extraction. The water supply network flow prediction model based on time-varying-time-invariant feature extraction includes:
[0058] Data processing and flow index building module, signal separation module, feature extraction module and flow prediction module.
[0059] The data processing and flow index construction module is used to process the historical flow data of the water supply network and construct flow indicators; the signal separation module is used to separate the high and low frequency signals of the time domain signals of the historical flow data of the water supply network; the feature extraction module is used to extract features of time-varying signals and time-invariant signals; the flow prediction module is used to predict the flow of the water supply network.
[0060] The data processing module first obtains the historical flow data of the water supply network, extracts the time domain features based on the historical flow data of the water supply network using the peak-to-peak value and Z-score standardization method, and then constructs the flow index to obtain the time domain signal; the standardized data has the characteristics of a mean of 0 and a standard deviation of 1, making the comparison between data sets more objective and accurate.
[0061] The signal separation module uses the Fourier transform method to obtain the frequency domain signal based on the time domain signal, and then uses the filter to sort and filter the frequency domain signal in order from large to small to obtain high-frequency signals and low-frequency signals. Then, the inverse Fourier transform is used based on the high-frequency and low-frequency signals to obtain time-invariant signals and time-varying signals. Figure 1 The peak-to-peak signal is the time domain signal.
[0062] The frequency domain signal is obtained by Fourier transform method based on the time domain signal. The formula is as follows:
[0063]
[0064] Among them, x(t) represents a non-periodic time series signal, that is, a time domain signal, X(ω) represents the representation of the non-periodic time series signal in the frequency domain, that is, a frequency domain signal, t represents time, ω represents angular frequency, i is an imaginary unit, and f(x) represents the Fourier transform of the time series signal. The physical meaning of Fourier transform is that any non-periodic function can be represented by several sine and cosine functions with different frequency values.
[0065] The filter is used to sort and filter the frequency domain signal in descending order to obtain high-frequency signals and low-frequency signals. For an input sequence of time domain signals of length T, the fast Fourier transform (FFT) of each sliding window is pre-calculated to obtain the frequency domain signal, the average amplitude of each spectrum is calculated, and then sorted to separate the high-frequency part and the low-frequency part.
[0066] Then, several sine and cosine functions with different frequency values, that is, frequency domain signals, are converted into quadratic time series signals through inverse Fourier transform. The formula is as follows:
[0067]
[0068] x'(t) represents the secondary time series signal, including the time-invariant signal x inv and the time-varying signal x var , the process is as follows:
[0069] x inv =f -1 (Filter(f(x)))
[0070] x var =x'(t)-x inv
[0071] Among them, f -1 represents inverse Fourier transform, and Filter(.) represents filtering operation.
[0072] The inputs of the feature extraction module are the time-varying and time-invariant signals decomposed in the signal separation module. By learning these two aspects of time series signals at the same time, the model can more comprehensively model the dynamic and static characteristics of the data, thereby improving the ability to fit real data. Therefore, this module needs to extract features at a deeper level. Considering that time invariance helps the model better generalize to unseen data, it means that the performance of the model at different time points is similar, which helps to reduce overfitting and improve the generalization ability of the model. Time variability can better capture the trend of traffic data changing over time. This module uses the encoding and decoding structure to learn the invariant features in the invariant signal, and uses the attention mechanism to learn the time-varying features in the time-varying signal, and then integrates them into the traffic prediction module, so that the prediction model can more comprehensively understand and utilize the characteristics of the data.
[0073] The first part of the feature extraction module is to learn the time-invariant features based on the time-invariant signal using the encoding-decoding structure, specifically:
[0074] S411: Use encoder E to separate the time-invariant signal x inv Mapped to the hidden layer, the potential representation z is obtained inv , the formula is:
[0075] z inv =E(x inv )=W e ·x inv
[0076] Among them, W e is the weight coefficient of the encoder.
[0077] S412: Use decoder D to reconstruct the potential representation and obtain time-invariant features The formula is:
[0078]
[0079] Among them, W d is the weight coefficient of the decoder. The decoder attempts to reconstruct the original input data from the latent representation and learns time-invariant features by minimizing the reconstruction loss between the output data and the input data.
[0080] The second part of the task is based on time-varying signals, using a multi-head attention mechanism to learn time-varying features, including:
[0081] S421: Based on the time-varying signal, the self-attention mechanism is used to calculate the attention score, and the weighted sum is used to obtain the output AttHead of each attention head j , the formula is as follows:
[0082]
[0083] Among them, d k is the dimension of the key vector, K T It means transposing the matrix K, softmax(.) is the normalized exponential function, j refers to the number of the attention head, Q is the query Query of the self-attention mechanism, K is the key Key of the self-attention mechanism, and V is the value Value of the self-attention mechanism.
[0084] S422: The outputs of all attention heads are concatenated together and linear transformation is used to obtain the time-varying feature MultiHead(Q, K, V), the formula is:
[0085] MultiHead(Q,K,V)=(AttHead1,AttHead2,…,AttHead h )·W m
[0086] Among them, W m is the weight coefficient of the linear transformation of multi-head splicing, and h is the total number of attention heads. In this embodiment, h is set to 3, d k The value is 30, which is an empirical value selected based on experiments.
[0087] The calculation formula for query Q, key K, and value V in the self-attention mechanism is as follows:
[0088]
[0089] Among them, Linear(.) means linear transformation, W q , W k , W v are their weight coefficients respectively. Through the multi-head self-attention mechanism, the model can establish associations between different time steps and learn the importance of different time steps.
[0090] The flow prediction module is the water supply network flow prediction module, which uses a gated recurrent unit (GRU) to predict the water supply network flow.
[0091] GRU achieves efficient capture and processing of input sequence data by combining certain gating mechanisms and memory units. The core structure of the GRU model incorporates two key types of gating mechanisms, namely Update Gate and Reset Gate. These two gating structures allow the GRU network to decide how to update the hidden state when processing sequence data, thereby better capturing long-term dependencies. The structure of GRU is as follows: Figure 2 As shown, the input is the current input x i And the hidden state h at the last moment i-1 , i is the time step, the hidden state of the last moment contains the relevant information of the last moment, and the output is the node output y at the current moment i And the hidden state h of the node at the current moment i , which contains the reset gate, update gate and candidate hidden state The reset gate determines whether to reset the past hidden state h at the current time step i. i-1 The reset gate determines which past information should be ignored, allowing the network to adapt to new inputs more quickly. The update gate determines whether to update the hidden state h at the current time step i. i , the update gate controls the past hidden state h i -1 The output value of the update gate is between 0 and 1. If the output of the update gate is close to 0, the network will ignore the past hidden state and reset the hidden state according to the current input; if the output of the update gate is close to 1, the network will retain the past hidden state and partially update it according to the current input.
[0092] In the flow prediction module, the input is time-invariant features and time-varying features, and the output is the predicted water supply network flow. In the flow prediction module, inputting the time-invariant features and time-varying features together into the GRU for prediction allows the GRU to simultaneously consider the long-term dependencies and invariant feature information in the sequence data, thereby better capturing the patterns and regularities in the sequence data. By inputting the time-varying features into the GRU, the model can learn the temporal correlations in the sequence data and the dynamic patterns of the sequence, thereby better modeling the sequence data. However, in some cases, using only time-varying features may lead to information loss or degradation of model performance, especially in processing long sequences or tasks that require consideration of global information. Therefore, adding training of time-invariant features can avoid this information loss and improve the expressiveness and generalization capabilities of the model.
[0093] During the testing phase, the test set data first passes through the signal separation module to decompose it into time-varying and time-invariant signals, and then passes through the trained feature extraction module to extract time-varying features and time-invariant features respectively. Finally, the time-varying features and time-invariant features are entered into the trained traffic prediction module together to obtain the final prediction results.
[0094] In the present invention, the loss function of the water supply network flow prediction model based on time-varying-time-invariant feature extraction consists of two parts. The first part is to use the data distribution of the decoder output to be close to the data distribution of the decoder input during the training of the time-invariant features of the feature extraction module, and use the maximum mean difference (MMD) to optimize the extraction process of the time-invariant features. The advantage of MMD is that it does not require hypothesis analysis of the distribution data and does not depend on the specific dimensions of the sample. inv for:
[0095]
[0096] Among them, Φ(·) represents the Gaussian kernel function that maps samples to high-dimensional feature space, n represents the total number of samples, s is the sample number, H represents the Hilbert space, |||| H represents the norm in Hilbert space.
[0097] The second part is to use the loss function L2 to improve the prediction accuracy of the model after the flow prediction module predicts the flow of the water supply network. MSE , the mapping relationship between the learning prediction results and the true value of the water supply network flow, the loss function of the flow prediction module is L MSE for:
[0098]
[0099] is the traffic prediction value, y s is the actual flow value.
[0100] The global loss function L of the model all for:
[0101] L all =L inv +L MSE
[0102] The practicality, effectiveness and creativity of the above invention are described below in combination with specific experiments.
[0103] In this section, the data set and experimental settings used in the present invention are introduced, and the experimental results of the present invention are quantified in a visual way. The experiment of the present invention uses the traffic values of Haida Community in each period of 2023 as the data set for the experiment. There are 8760 data of traffic values of Haida Community in each period of 2023, as shown in Figure 3 The specific changes in the water supply flow of the community in a week are specifically depicted. From the figure, it can be seen that although there are certain fluctuations in the 24-hour flow data every day, there is a certain regularity when comparing the daily flow data curve, which is called pseudo-periodicity. The reasons for such volatility and periodic changes are closely related to the water use habits of residents. By observing the water use pattern diagram, it can be seen that there are two humps in the daily water flow, corresponding to 6:00-8:00 and 17:00-19:00 respectively. Such time points also coincide with the daily routines of residents, and there are morning and evening peaks in water use. At other times, due to the lack of normal water use activities, the fluctuation characteristics of the flow are not very obvious.
[0104] The experiment divides the data set into 365 samples for training. Each sample inputs 24 time steps of data to predict an output value, that is, 365 input samples are used to predict 365 output values. After testing the prediction model with test data, a comparison chart of the true value and the predicted value is obtained. The results are as follows: Figure 4 As shown in the figure, the water supply network flow prediction model based on time-varying and time-invariant feature extraction predicts the flow value well and fits the flow curve. Among them, real is the actual flow value and forecast is the predicted flow value.
[0105] For the prediction results, the experiment of the present invention uses the mean square error (MSE) and the coefficient of determination (R 2 ) is used as the evaluation criterion for the experimental results.
[0106] The mean square error (MSE) calculates the average of the squared errors between the model's predicted values and the true values. The smaller the MSE value, the closer the model's predicted values are to the true values, and the better the model's performance. It can quantify the model's effect in fitting data. The formula is as follows:
[0107]
[0108] Among them, y s is the actual flow value, is the traffic prediction value, s is the sample number, and n is the total number of samples.
[0109] R 2 It measures the degree to which the model explains the variability in the data. Its value ranges from 0 to 1. When R 2 The closer it is to 1, the better the model fits the data and the higher the degree of explanation of the independent variable on the dependent variable. 2 The closer it is to 0, the worse the model fits the data. The formula is as follows:
[0110]
[0111] in, is the average value of the approximate model response.
[0112] The evaluation of the results of the above experiments is shown in the evaluation index table in Table 1 below.
[0113] Table 1 Evaluation index table
[0114]
[0115] As shown in Table 1, the test results of the water supply network flow prediction model based on time-varying and time-invariant feature extraction were evaluated. It can be seen that both MSE and R 2 , the model showed excellent performance. This shows that the prediction model of the present invention has high accuracy and reliability in predicting the flow of water supply network.
[0116] In summary, the present invention introduces a method for effectively identifying the differences in time-varying and time-invariant features of water supply network flow data, and proposes a water supply network flow prediction model based on time-varying-time-invariant feature extraction. First, the original signal is Fourier transformed by frequency domain analysis to extract frequency domain features. Then, by separating the high-frequency components, a time-varying signal reflecting the signal change and a time-invariant signal maintaining stable features are obtained. Then, feature extraction and training are performed on these two signals respectively, thereby improving the prediction accuracy and generalization ability of the water supply network prediction model.
[0117] Of course, it is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, but also includes the same or similar structures that can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any reference numerals in the claims should not be regarded as limiting the claims involved.
[0118] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
[0119] The techniques, shapes, and structural parts not described in detail in the present invention are all well-known techniques.
Claims
1. A water supply network flow prediction model based on time-varying and time-invariant feature extraction, characterized in that: It includes data processing and flow index building module, signal separation module, feature extraction module and flow prediction module; The data processing and flow index construction module obtains the historical flow data of the water supply network, extracts the time domain characteristics based on the historical flow data of the water supply network, and then constructs the flow index for the time domain characteristics to obtain the time domain signal; The signal separation module obtains the frequency domain signal based on the time domain signal, and uses filters to sort and filter the frequency domain signal in descending order to obtain high-frequency signals and low-frequency signals. Based on the high-frequency signal and the low-frequency signal, the time-invariant signal x is obtained. inv And the time-varying signal x var ; The feature extraction module is based on the time-invariant signal x inv and the time-varying signal x var , respectively obtain time-invariant features and time-varying features; The flow prediction module obtains the predicted water supply network flow based on time-invariant characteristics and time-varying characteristics.
2. A water supply network flow prediction model based on time-varying and time-invariant feature extraction as claimed in claim 1, characterized in that: The signal separation module obtains the frequency domain signal based on the time domain signal. Specifically, the frequency domain signal is obtained based on the time domain signal using the Fourier transform method. The formula is as follows: Among them, x(t) represents the time series signal, that is, the time domain signal, X(ω) represents the representation of the time series signal in the frequency domain, that is, the frequency domain signal, t represents time, ω represents angular frequency, i is an imaginary unit, and f(x) represents the Fourier transform of the time series signal.
3. A water supply network flow prediction model based on time-varying and time-invariant feature extraction as claimed in claim 2, characterized in that: The method of obtaining the time-invariant signal and the time-varying signal based on the high-frequency signal and the low-frequency signal is specifically: converting the frequency domain signal into a secondary time series signal by inverse Fourier transform, and the process is as follows: Among them, x'(t) represents the secondary time series signal, including the time-invariant signal x inv and the time-varying signal x var , as follows: Among them, f -1 (.) indicates inverse Fourier transform, and Filter(.) indicates filtering operation.
4. A water supply network flow prediction model based on time-varying and time-invariant feature extraction as claimed in claim 1, characterized in that: The feature extraction module is based on the time-invariant signal x inv , obtain time-invariant features, including: S411: Use encoder E to separate the time-invariant signal x inv Mapped to the hidden layer, the potential representation z is obtained inv , the formula is: z inv =E(x inv )=W e ·x inv S412: Use decoder D to reconstruct the potential representation and obtain time-invariant features The formula is: Among them, W e is the weight coefficient of the encoder, W d is the weight coefficient of the decoder.
5. A water supply network flow prediction model based on time-varying and time-invariant feature extraction as claimed in claim 1, characterized in that: The feature extraction module is based on the time-varying signal x var , obtain time-varying features, including: S421: Based on the time-varying signal, the self-attention mechanism is used to calculate the attention score and weighted sum to obtain the output AttHead of each attention head j , the formula is as follows: Among them, d k is the dimension of the key vector, K T represents the transposition of the matrix K, softmax(.) is the normalized exponential function, j refers to the number of the attention head, Q is the query of the self-attention mechanism, K is the key of the self-attention mechanism, and V is the value of the self-attention mechanism; S422: The outputs of all attention heads are concatenated together and linear transformation is used to obtain the time-varying feature MultiHead(Q, K, V), the formula is: MultiHead(Q,K,V)=(AttHead1,AttHead2,...,AttHead h )·W m Among them, W m is the weight coefficient of linear transformation of multi-head splicing, and h is the total number of attention heads.
6. A water supply network flow prediction model based on time-varying and time-invariant feature extraction as claimed in claim 5, characterized in that: The calculation formula for query Q, key K, and value V in the self-attention mechanism is as follows: Among them, Linear(.) means linear transformation, W q , W k , W v are their weight coefficients respectively.
7. A water supply network flow prediction model based on time-varying and time-invariant feature extraction as claimed in claim 1, characterized in that: In the feature extraction module, the loss function L inv Update network parameters, loss function L inv The calculation formula is: Among them, Φ(·) represents the Gaussian kernel function that maps samples to high-dimensional feature space, n represents the total number of samples, s is the sample number, H represents the Hilbert space, |||| H represents the norm in Hilbert space.
8. A water supply network flow prediction model based on time-varying and time-invariant feature extraction as claimed in claim 7, characterized in that: In the traffic prediction module, the loss function L is used. MSE The mapping relationship between the learning prediction results and the actual value of the water supply network flow, the loss function of the flow prediction module is L MSE The calculation formula is: in, is the traffic prediction value, y s is the actual flow value.
9. A water supply network flow prediction model based on time-varying and time-invariant feature extraction as claimed in claim 8, characterized in that: The global loss function L of the model all The calculation formula is: L all =L inv +L MSE .
10. A water supply network flow prediction method based on time-varying and time-invariant feature extraction, characterized in that: The historical flow data of the water supply network to be measured is input into a water supply network flow prediction model based on time-varying and time-invariant feature extraction as described in any one of claims 1 to 9 to obtain the predicted future flow of the water supply network.
Citation Information
Patent Citations
Drainage system control method based on robust reinforcement learning
CN113050430A
Traffic flow prediction method based on adjacency DBSCAN fused time-varying multi-graph convolutional network
CN115828121A
Industrial internet prediction method and system based on frequency domain and long and short term feature fusion
CN115907154A
Water supply network abnormity diagnosis method based on bispectrum and convolutional neural network
CN116975763A
Lithium ion battery life prediction method and system based on deep learning
CN117113056A
Cited By
Flood forecasting method based on time-varying parameters
CN120805418A
A flood forecasting method based on time-varying parameters
CN120805418B
Traffic flow prediction method based on time-frequency domain joint modeling
CN121354346A