Water supply network flow prediction method based on time-varying-time-invariant feature extraction

By proposing a water supply network flow prediction method based on time-varying and time-invariant feature extraction, this method uses Fourier transform and multi-head attention mechanism to separate time-varying and time-invariant signals, and combines gated recurrent units for prediction. This solves the problem that existing models cannot identify the differences in flow data features, and improves the accuracy and performance of water supply network flow prediction.

CN119577425BActive Publication Date: 2025-11-04HEFEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411626628.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-11-04
Estimated Expiration
2044-11-14

AI Technical Summary

Technical Problem

Existing water supply network flow prediction models cannot effectively identify the differences between time-varying and time-invariant characteristics of flow data, leading to mutual interference during the learning process and limiting model performance.

Method used

A method for predicting water supply network flow based on time-varying and time-invariant feature extraction is adopted. Through data processing and flow index construction, signal separation, feature extraction and flow prediction modules, Fourier transform and multi-head attention mechanism are used to separate time-varying and time-invariant signals, and prediction is performed in combination with gated cyclic unit.

Benefits of technology

It improves the accuracy and model performance of water supply network flow prediction, can more accurately capture time-varying and time-invariant features, enhances the model's fitting and generalization capabilities, and adapts to the long-term and short-term dependencies of water supply network flow data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577425B_ABST
    Figure CN119577425B_ABST
Patent Text Reader

Abstract

The application discloses a water supply pipe network flow prediction method based on time-invariant feature extraction, relates to the technical field of water supply pipe network flow prediction, and discloses a water supply pipe network flow prediction model based on time-invariant feature extraction. A signal separation module obtains high-frequency signals and low-frequency signals based on time-domain signals, obtains time-invariant signals and time-varying signals based on the high-frequency signals and the low-frequency signals; then, a feature extraction module obtains time-invariant features and time-varying features based on the time-invariant signals and the time-varying signals; and a flow prediction module obtains predicted water supply pipe network flow based on the time-invariant features and the time-varying features. Through separate processing of the time-varying and time-invariant features, the respective characteristics of the time-varying features and the time-invariant features can be more accurately captured; fast Fourier transform and inverse transform are used to extract frequency domain signals from time domain signals, and the frequency domain signals are divided into time-varying signals and time-invariant signals, thereby improving the performance of the model and the accuracy of water supply pipe network flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water supply network flow prediction technology, and in particular to a water supply network flow prediction method based on time-varying and time-invariant feature extraction. Background Technology

[0002] With the acceleration of urbanization and continuous population growth, urban water supply systems face unprecedented challenges. In particular, the water supply network, as a crucial component of the urban water supply system, directly impacts the quality of life for urban residents and the smooth operation of industrial production. During peak water supply periods or in emergencies, problems such as insufficient water supply, unstable water pressure, and even pipe bursts and leaks occur frequently, severely affecting the normal operation of the city. Therefore, predicting flow changes at various nodes in the pipeline network in advance is of great significance for optimizing water supply scheduling, valve on / off control, valve opening adjustment, pressure regulation, and pump energy conservation.

[0003] Currently, the main methods for predicting the flow of water supply networks include: time series analysis, which is a method based on historical data and uses statistical analysis to predict future flow, assuming that future flow changes are correlated with historical data; grey model prediction, which generates a grey model by accumulating limited data to predict future flow, with higher accuracy for data closer to the current time point, thus grey model prediction is better than time series analysis; and neural network prediction, which can learn and mine patterns behind data and has strong nonlinear mapping capabilities.

[0004] However, existing traffic prediction models cannot effectively identify the differences between time-varying and time-invariant characteristics of traffic data, leading to mutual interference during the learning process and limiting model performance. Summary of the Invention

[0005] To overcome the problem that existing flow prediction models cannot effectively identify the differences between time-varying and time-invariant features of flow data, thus limiting model performance, this invention proposes a flow prediction method for water supply networks based on time-varying and time-invariant feature extraction.

[0006] To achieve the above objectives, the present invention adopts the following technical solution, including:

[0007] A water supply network flow prediction model based on time-varying and time-invariant feature extraction includes a data processing and flow index construction module, a signal separation module, a feature extraction module, and a flow prediction module.

[0008] The data processing and flow index construction module acquires historical flow data of the water supply network, extracts time-domain features based on the historical flow data of the water supply network, and then constructs flow indexes based on the time-domain features to obtain time-domain signals.

[0009] The signal separation module acquires the frequency domain signal based on the time domain signal, and uses a filter to sort and filter the frequency domain signal in descending order to obtain the high-frequency and low-frequency signals. Based on the high-frequency and low-frequency signals, the time-invariant signal x is obtained. inv and time-varying signal x var ;

[0010] The feature extraction module is based on the time-invariant signal x inv and time-varying signal x var Time-invariant features and time-varying features are obtained respectively;

[0011] The flow prediction module obtains the predicted flow of the water supply network based on time-invariant and time-varying characteristics.

[0012] Preferably, the signal separation module obtains the frequency domain signal based on the time domain signal. Specifically, it obtains the frequency domain signal using the Fourier transform method based on the time domain signal, as shown in the following formula:

[0013]

[0014] Where x(t) represents the time-series signal, i.e., the time domain signal, X(ω) represents the frequency domain representation of the time-series signal, i.e., the frequency domain signal, t represents time, ω represents angular frequency, i is the imaginary unit, and f(x) represents the Fourier transform of the time-series signal.

[0015] Preferably, the acquisition of time-invariant and time-varying signals based on high-frequency and low-frequency signals specifically involves converting the frequency domain signal into a quadratic time-series signal using an inverse Fourier transform, as follows:

[0016]

[0017] Where x'(t) represents a quadratic time-series signal, including the time-invariant signal x inv and time-varying signal x var The details are as follows:

[0018]

[0019] Among them, f -1 (.) indicates the inverse Fourier transform, and Filter(.) indicates the filtering operation.

[0020] Preferably, the feature extraction module is based on the time-invariant signal x. inv Time-invariant features are obtained, including:

[0021] S411: Use encoder E to separate the time-invariant signal x inv Mapping to the hidden layer yields the latent representation z. inv The formula is:

[0022] z inv =E(x) inv ) = W e ·x inv

[0023] S412: Reconstruct the latent representation using decoder D to obtain time-invariant features. The formula is:

[0024]

[0025] Among them, W e W is the encoder's weight coefficient. d These are the weight coefficients of the decoder.

[0026] Preferably, the feature extraction module is based on the time-varying signal x. var To obtain time-varying features, specifically including:

[0027] S421: Based on the time-varying signal, a self-attention mechanism is used to calculate the attention score, and then a weighted sum is obtained to obtain the output AttHead of each attention head. j The formula is as follows:

[0028]

[0029] Where, d k K is the dimension of the key vector. T This indicates that matrix K is transposed, 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: Concatenate the outputs of all attention heads together and apply a linear transformation to obtain the time-varying feature MultiHead(Q,K,V), as shown in the formula:

[0031] MultiHead(Q,K,V)=(AttHead1,AttHead2,…,AttHead h )·W m

[0032] Among them, W m is the weighting coefficient for the linear transformation of the multi-head splicing, and h is the total number of attention heads.

[0033] Preferably, the formulas for calculating query Q, key K, and value V in the self-attention mechanism are as follows:

[0034]

[0035] Where Linear(.) represents performing a linear transformation, W q W k W v These are their respective weighting coefficients.

[0036] Preferably, in the feature extraction module, a loss function L is used. inv Update network parameters, loss function 1L inv The calculation formula is:

[0037]

[0038] Where Φ(·) represents the Gaussian kernel function that maps the samples to a high-dimensional feature space, n represents the total number of samples, s is the sample number, H represents the Hilbert space, and || || H denoted by the norm in Hilbert space.

[0039] Preferably, in the traffic prediction module, a loss function of type L is used. MSE The loss function of the flow prediction module is L, which maps the predicted results to the actual flow values ​​in the water supply network. MSE The calculation formula is:

[0040]

[0041] in, For the predicted flow rate, y s This represents the actual traffic volume.

[0042] Preferably, the global loss function L of this model all The calculation formula is:

[0043] L all =L inv +L MSE .

[0044] A method for predicting water supply network flow based on time-varying and time-invariant feature extraction is proposed. The method inputs the historical flow data of the water supply network to be measured into the 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 this invention are:

[0046] (1) This invention extracts time-domain features from historical flow data of water supply network to obtain time-domain signals and frequency-domain signals. Then, it 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. Then, it obtains the predicted flow of water supply network through the flow prediction module, thereby improving the performance of the model and increasing the accuracy of water supply network flow prediction.

[0047] (2) By processing time-varying and time-invariant features separately, the present invention can more accurately capture the characteristics of time-varying and time-invariant features respectively.

[0048] (3) This 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) This invention utilizes a multi-head attention mechanism to establish complex relationships between different time points and different features, enabling the model to pay more attention to key factors in time changes, thereby improving the expressive power of time-varying features and helping to capture more refined change patterns, laying the groundwork for accurate prediction by subsequent models.

[0050] (5) The present invention inputs the extracted time-varying and time-invariant features into a gated recurrent unit (GRU) for prediction, which can handle the long-short-term dependencies in time series data (water supply network flow data), and improve 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 and time-varying features into the GRU for prediction allows the GRU to simultaneously consider long-term dependencies and invariant feature information in traffic data, thereby better capturing patterns and regularities in sequence data. By inputting time-varying features into the GRU, the model can learn the temporal correlation and dynamic patterns of the sequence data, thus better modeling the sequence data. At the same time, adding time-invariant feature training improves the model's expressive power and generalization ability. Attached Figure Description

[0052] Figure 1 This is a diagram illustrating the method architecture of the present invention;

[0053] Figure 2 This is a schematic diagram of the gated recurrent unit (GRU) structure;

[0054] Figure 3 A graph showing the change in water supply flow in a certain residential community over a week;

[0055] Figure 4 This is a comparison chart of the actual and predicted values ​​of the test data for the model of this invention. Detailed Implementation

[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] like Figure 1-4 As shown, this invention proposes a method for predicting water supply network flow based on time-varying-time-invariant feature extraction. It is implemented using a water supply network flow prediction model based on time-varying-time-invariant feature extraction, which includes:

[0058] The system includes a data processing and flow indicator construction module, a signal separation module, a feature extraction module, and a flow prediction module.

[0059] The data processing and flow index construction module is used to process historical flow data of water supply network and construct flow index; the signal separation module is used to separate high and low frequency signals of the time domain signal of historical flow data of water supply network; the feature extraction module is used to extract features from time-varying signals and time-invariant signals; and the flow prediction module is used to predict the flow of water supply network.

[0060] The data processing module first acquires historical flow data of the water supply network. Based on the historical flow data of the water supply network, it extracts time-domain features using peak-to-peak value and Z-score standardization methods. Then, it constructs flow indicators to obtain time-domain signals. The standardized data has the characteristics of a mean of 0 and a standard deviation of 1, making the comparison between datasets more objective and accurate.

[0061] The signal separation module uses Fourier transform to obtain the frequency domain signal based on the time domain signal. Then, it uses a filter to sort and filter the frequency domain signal in descending order to obtain high-frequency and low-frequency signals. Finally, it performs inverse Fourier transform on the high-frequency and low-frequency signals to obtain time-invariant and time-varying signals, respectively. Figure 1 The peak-to-peak value signal is the instantaneous domain signal.

[0062] The frequency domain signal is obtained by using the Fourier transform method based on the time domain signal, as shown in the following formula:

[0063]

[0064] Where x(t) represents an aperiodic time-series signal, i.e., a time-domain signal, X(ω) represents the frequency domain representation of the aperiodic time-series signal, i.e., a frequency-domain signal, t represents time, ω represents angular frequency, i is the imaginary unit, and f(x) represents the Fourier transform of the time-series signal. The physical meaning of the Fourier transform is that any aperiodic 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 and low-frequency signals. For an input sequence of a time-domain signal 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 they are sorted to separate the high-frequency and low-frequency components.

[0066] Next, the inverse Fourier transform is used to convert several sine and cosine functions with different frequency values, i.e., frequency domain signals, into quadratic time-series signals, as shown in the following formula:

[0067]

[0068] x'(t) represents a quadratic time-series signal, including the time-invariant signal x. inv and 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 This indicates the inverse Fourier transform, and Filter(.) indicates the filtering operation.

[0072] The feature extraction module takes as input the time-varying and time-invariant signals decomposed in the signal separation module. By simultaneously learning these two aspects of time-series signals, the model can more comprehensively model the dynamic and static characteristics of the data, thereby improving its ability to fit real data. Therefore, this module needs to extract features at a deeper level. Considering that time invariance helps the model generalize better to unseen data, meaning that the model performs similarly at different time points, it helps reduce overfitting and improve the model's generalization ability. Time-varying characteristics, on the other hand, can better capture the trend of traffic data changing over time. This module utilizes an encoding-decoding structure to learn invariant features in invariant signals and uses an attention mechanism to learn time-varying features in time-varying signals, then integrates these features into the traffic prediction module, enabling the prediction model to more comprehensively understand and utilize the characteristics of the data.

[0073] The first task of the feature extraction module is to learn time-invariant features based on time-invariant signals using an encoder-decoder structure, specifically:

[0074] S411: Use encoder E to separate the time-invariant signal x inv Mapping to the hidden layer yields the latent representation z. inv The formula is:

[0075] z inv =E(x) inv ) = W e ·x inv

[0076] Among them, W e These are the encoder's weight coefficients.

[0077] S412: Reconstruct the latent representation using decoder D to obtain time-invariant features. The formula is:

[0078]

[0079] Among them, W d These are the weight coefficients of the decoder. The decoder attempts to reconstruct the original input data from the latent representation, while simultaneously learning time-invariant features by minimizing the reconstruction loss between the output data and the input data.

[0080] The second task involves learning time-varying features based on time-varying signals using a multi-head attention mechanism, specifically including:

[0081] S421: Based on the time-varying signal, a self-attention mechanism is used to calculate the attention score, and the output AttHead of each attention head is obtained by weighted summation. j The formula is as follows:

[0082]

[0083] Where, d k K is the dimension of the key vector. T This indicates that matrix K is transposed, softmax(.) is the normalized exponential function, j refers to the attention head number, 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.

[0084] S422: Concatenate the outputs of all attention heads together and apply a linear transformation to obtain the time-varying feature MultiHead(Q,K,V), as shown in the formula:

[0085] MultiHead(Q,K,V)=(AttHead1,AttHead2,…,AttHead h )·W m

[0086] Among them, W m Here, h represents the weighting coefficients for the linear transformation of the multi-head splicing, and h is the total number of attention heads. In this embodiment, h is set to 3, and d... k The value is 30, which is an empirical value chosen based on experiments.

[0087] The formulas for calculating query Q, key K, and value V in the self-attention mechanism are as follows:

[0088]

[0089] Where Linear(.) represents performing a linear transformation, W q W k W v These are their respective weight coefficients. Through the multi-head self-attention mechanism, the model can establish connections between different time steps and learn the importance of different time steps.

[0090] The flow prediction module, also known as the water supply network flow prediction module, uses a gated circulation unit (GRU) to predict the flow of the water supply network.

[0091] GRU achieves efficient capture and processing of input sequence data by incorporating certain gating mechanisms and memory units. The core structure of the GRU model integrates two key types of gating mechanisms: the Update Gate and the Reset Gate. These gating structures allow the GRU network to decide how to update the hidden states 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 time input x. i And the hidden state h from the previous moment i-1 Let i be the time step, the hidden state of the previous time step contains relevant information from the previous time step, and the output is the node output y at the current time step. i And the hidden state h of the node at the current moment. i It contains a reset door, an update door, and candidate hidden states. 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 updated gate controls the previously hidden state h i -1 The degree of influence on the current state is determined by the output value of the update gate, which is between 0 and 1. If the output of the update gate is close to 0, the network ignores the past hidden state and resets the hidden state based on the current input; if the output of the update gate is close to 1, the network retains the past hidden state and makes a partial update based on the current input.

[0092] In the flow prediction module, the inputs are time-invariant and time-varying features, and the output is the predicted water supply network flow. By inputting both time-invariant and time-varying features into the GRU for prediction, the GRU can simultaneously consider long-term dependencies and invariant feature information in the sequence data, thus better capturing patterns and regularities. By inputting time-varying features into the GRU, the model can learn the temporal correlations and dynamic patterns of the sequence data, thereby better modeling the sequence data. However, in some cases, using only time-varying features may lead to information loss or degraded model performance, especially in processing long sequences or tasks requiring consideration of global information. Therefore, incorporating time-invariant features into the training can avoid this information loss and improve the model's expressive power and generalization ability.

[0093] During the testing phase, the test set data first passes through the signal separation module, which decomposes it into time-varying and time-invariant signals. Then, it passes through the trained feature extraction module, which extracts time-varying and time-invariant features respectively. Finally, the time-varying and time-invariant features are fed into the trained traffic prediction module to obtain the final prediction result.

[0094] In this 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 involves using the maximum mean difference (MMD) to optimize the extraction process of time-invariant features during the training process of the time-invariant features in the feature extraction module. This is achieved by narrowing the data distribution output by the decoder to be closer to the data distribution input by the decoder. The advantage of MMD is that it eliminates the need for hypothesis analysis on the distribution data and is independent of the specific dimensions of the samples. The loss function of the feature extraction module is L. inv for:

[0095]

[0096] Where Φ(·) represents the Gaussian kernel function that maps samples to a high-dimensional feature space, n represents the total number of samples, s is the sample number, H represents the Hilbert space, and |||| H denoted by the norm in Hilbert space.

[0097] The second part involves using a loss function L2 after the flow prediction module predicts the flow of the water supply network. This improves the model's prediction accuracy. MSE The learning module establishes a mapping relationship between the predicted flow rate and the actual flow rate in the water supply network. The loss function of the flow prediction module is L. MSE for:

[0098]

[0099] For the predicted flow rate, y s This represents the actual traffic volume.

[0100] The global loss function L of this model all for:

[0101] L all =L inv +L MSE

[0102] The following section, using specific experiments, elaborates on the practicality, effectiveness, and inventiveness of the invention.

[0103] This section introduces the dataset and experimental setup used in this invention, and quantifies the experimental results through visualization. The experiment used traffic data from Haida Community for various time periods in 2023 as the dataset. A total of 8760 traffic data points from Haida Community for each time period in 2023 were collected. Figure 3 The graph specifically depicts the fluctuations in water supply flow in the community over a week. While the 24-hour flow data shows some fluctuation, a certain pattern emerges when comparing the daily flow data curves, known as pseudo-periodicity. The cause of this fluctuation and periodicity is closely related to residents' water usage habits. Observing the water usage pattern graph, two peaks can be seen in the daily water flow, corresponding to 6:00-8:00 and 17:00-19:00 respectively. These times coincide with residents' daily routines, resulting in morning and evening peak water usage. At other times, due to a lack of normal water usage activity, the fluctuations in flow are not very pronounced.

[0104] The experiment divided the dataset into 365 samples for training. Each sample was input with data from 24 time steps to predict one output value; that is, 365 input samples were used to predict 365 output values. After testing the prediction model with test data, a comparison chart of the actual and predicted values ​​was obtained. The results are as follows. Figure 4 As shown, the water supply network flow prediction model based on time-varying and time-invariant feature extraction accurately predicted the flow rate and fitted the flow curve. Here, `real` represents the actual flow rate, and `forecast` represents the predicted flow rate.

[0105] For the prediction results, the present invention uses mean squared error (MSE) and coefficient of determination (R²) in the experiments. 2 () is used as the evaluation criterion for experimental results.

[0106] Mean Squared 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 predictions are to the true values, and the better the model's performance. It quantifies the model's effectiveness in fitting data. The formula is as follows:

[0107]

[0108] Among them, y s This represents the actual traffic value. Here, s represents the predicted flow rate, s represents the sample number, and n represents the total number of samples.

[0109] R 2 It measures the degree to which a model explains the variability of data. Its value ranges from 0 to 1, when RA = 1. 2 The closer R² is to 1, the better the model fits the data, and the higher the explanatory power of the independent variable for the dependent variable; when R² is closer to 1, the better the model fits the data, and the higher the explanatory power of the independent variable for the dependent variable. 2 The closer the value is to 0, the worse the model fits the data. The formula is shown below:

[0110]

[0111] in, This represents the average value of the approximate model response.

[0112] The evaluation of the results of the above experiments is shown in Table 1 below.

[0113] Table 1 Evaluation Indicators

[0114]

[0115] Table 1 shows the test results of the water supply network flow prediction model based on time-varying-time-invariant feature extraction. The performance was evaluated, and it can be seen that both MSE and R... 2 The models all exhibited excellent performance. This indicates that the prediction model of this invention has high accuracy and reliability in predicting the flow rate of water supply networks.

[0116] In summary, this invention introduces a method for effectively identifying the differences between time-varying and time-invariant features in water supply network flow data, and proposes a water supply network flow prediction model based on time-varying and time-invariant feature extraction. First, the original signal is subjected to Fourier transform through frequency domain analysis to extract frequency domain features. Then, by separating high-frequency components, a time-varying signal reflecting signal changes and a time-invariant signal maintaining stable features are obtained. Feature extraction and training are then performed on these two types of signals respectively, thereby improving the prediction accuracy and generalization ability of the water supply network prediction model.

[0117] Of course, those skilled in the art will recognize 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 characteristics of the invention. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0118] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

[0119] The technologies, shapes, and structures not described in detail in this invention are all known technologies.

Claims

1. A method for predicting water supply network flow based on time-varying-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 to obtain the predicted future flow of the water supply network. The model includes a data processing and traffic indicator construction module, a signal separation module, a feature extraction module, and a traffic prediction module; The data processing and flow index construction module acquires historical flow data of the water supply network, extracts time-domain features based on the historical flow data of the water supply network, and then constructs flow indexes based on the time-domain features to obtain time-domain signals. The signal separation module obtains a frequency domain signal based on a time domain signal, uses a filter to sort and filter the frequency domain signal in descending order, obtains a high-frequency signal and a low-frequency signal, and obtains a time-invariant signal x based on the high-frequency signal and the low-frequency signal inv and a time-varying signal x var ; The feature extraction module obtains time-invariant features and time-varying features based on a time-invariant signal x inv and a time-varying signal x var , respectively. The flow prediction module obtains the predicted water supply network flow based on time-invariant and time-varying characteristics. The feature extraction module is based on the time-invariant signal x. inv Time-invariant features are obtained, including: S411: Use encoder E to separate the time-invariant signal x inv Mapping to the hidden layer yields the latent representation z. inv ; S412: Reconstruct the latent representation using decoder D to obtain time-invariant features. The feature extraction module is based on the time-varying signal x. var To obtain time-varying features, including: S421: Based on the time-varying signal, a self-attention mechanism is used to calculate the attention score, and then a weighted sum is obtained to obtain the output AttHead of each attention head. j ; S422: Concatenate the outputs of all attention heads together and use a linear transformation to obtain the time-varying feature MultiHead(Q,K,V).

2. The method for predicting water supply network flow based on time-varying-time-invariant feature extraction as described in claim 1, characterized in that, The signal separation module obtains the frequency domain signal based on the time domain signal. Specifically, it uses the Fourier transform method to obtain the frequency domain signal based on the time domain signal, as shown in the following formula: Where x(t) represents the time-series signal, i.e., the time domain signal, X(ω) represents the frequency domain representation of the time-series signal, i.e., the frequency domain signal, t represents time, ω represents angular frequency, i is the imaginary unit, and f(x) represents the Fourier transform of the time-series signal.

3. The method for predicting water supply network flow based on time-varying-time-invariant feature extraction as described in claim 2, characterized in that, The process of acquiring time-invariant and time-varying signals based on high-frequency and low-frequency signals specifically involves converting the frequency domain signal into a quadratic time-series signal using an inverse Fourier transform, as follows: Where x'(t) represents a quadratic time-series signal, including the time-invariant signal x inv and time-varying signal x var The details are as follows: x inv =f -1 (Filter(f(x))) x var =x’(t)-x inv Among them, f -1 (.) indicates the inverse Fourier transform, and Filter(.) indicates the filtering operation.

4. The method for predicting water supply network flow based on time-varying-time-invariant feature extraction as described in claim 1, characterized in that, Latent representation z inv The formula is: z inv =E(x inv )=W e ·x inv Time-invariant features The formula is: Among them, W e W is the encoder's weight coefficient. d These are the weight coefficients of the decoder.

5. The method for predicting water supply network flow based on time-varying-time-invariant feature extraction as described in claim 1, characterized in that, AttHead output of each attention head j The formula is: Where, d k K is the dimension of the key vector. T This indicates that matrix K is transposed, 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. The formula for the time-varying feature MultiHead(Q,K,V) is: MultiHead(Q,K,V)=(AttHead1,AttHead2,…,AttHead h )·W m Among them, W m is the weighting coefficient for the linear transformation of the multi-head splicing, and h is the total number of attention heads.

6. The method for predicting water supply network flow based on time-varying-time-invariant feature extraction as described in claim 5, characterized in that, The formulas for calculating query Q, key K, and value V in the self-attention mechanism are as follows: Where Linear(.) represents performing a linear transformation, W q W k W v These are their respective weighting coefficients.

7. The method for predicting water supply network flow based on time-varying-time-invariant feature extraction as described in claim 1, characterized in that, In the feature extraction module, through the loss function L... inv Update network parameters, loss function 1L inv The calculation formula is: Where Φ(·) represents the Gaussian kernel function that maps the samples to a high-dimensional feature space, n represents the total number of samples, s is the sample number, H represents the Hilbert space, and || || H denoted by the norm in Hilbert space.

8. The method for predicting water supply network flow based on time-varying-time-invariant feature extraction as described in claim 7, characterized in that, In the traffic prediction module, a loss function of type L is used. MSE The loss function of the flow prediction module is L, which maps the predicted results to the actual flow values ​​in the water supply network. MSE The calculation formula is: in, For the predicted flow rate, y s This represents the actual traffic volume.

9. The method for predicting water supply network flow based on time-varying-time-invariant feature extraction as described in claim 8, characterized in that, The global loss function L of this model all The calculation formula is: L all L inv +L MSE 。

Citation Information

Patent Citations

  • Industrial internet prediction method and system based on frequency domain and long and short term feature fusion

    CN115907154A

  • Lithium ion battery life prediction method and system based on deep learning

    CN117113056A