Medium and long term runoff intelligent forecasting method

By combining a physically constrained recurrent neural network with online adaptive correction via a sliding window, the problems of accuracy and consistency in medium- and long-term runoff forecasting have been solved, achieving dynamic adaptability and efficient forecasting, thereby improving the operational efficiency of water conservancy projects and regional water security.

CN122020134AActive Publication Date: 2026-05-12HOHAI UNIV +1
View PDF 4 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HOHAI UNIV
Filing Date
2026-04-14
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing medium- and long-term runoff forecasting methods suffer from limited forecast accuracy, insufficient physical consistency, and a lack of online adaptive capabilities.

Method used

By constructing an organic integration of a physically constrained recurrent neural network and a sliding window for online adaptive correction, and combining meteorological, hydrological and underlying surface data, a sequence of feature vectors is generated. The network is then trained using a physically constrained loss function, and water balance and monotonicity constraints are introduced. The correction is performed by combining historical forecast deviations within the sliding window.

Benefits of technology

It achieves high accuracy, physical consistency and dynamic adaptability in medium- and long-term runoff forecasting, improves the scientific nature and practicality of forecasts, and solves the problems of the fixed nature and poor physical interpretability of traditional models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122020134A_ABST
    Figure CN122020134A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of hydrological forecasting, and discloses a medium-and-long-term runoff intelligent forecasting method, which comprises the following steps: collecting drainage basin data, preprocessing, extracting features, generating a feature vector sequence, and dividing a training set; constructing a physical constraint recurrent neural network module, and training based on a total loss function of physical constraint loss; constructing a sliding window online self-adaptive correction module, and initializing a sliding window to store actually measured runoff values and initial runoff forecast values at the latest O moments; inputting the feature vector at the current moment into a trained physical constraint recurrent neural network module to generate a preliminary runoff forecast value, calculating a historical average deviation according to a window state and correcting the historical average deviation to obtain a final forecast result; and finally, forming a new sample pair by the actually measured runoff value and the initial runoff forecast value, adding the new sample pair into the window, and removing the oldest sample to realize dynamic updating of the window. According to the invention, medium and long term runoff intelligent forecasting with high precision, high physical consistency and on-line adaptive capability is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hydrological forecasting technology, specifically to a medium- and long-term intelligent runoff forecasting method. Background Technology

[0002] Medium- and long-term runoff forecasting is a core technical support for the scientific regulation of water resources and flood control and disaster reduction. Its forecast accuracy directly affects the operational efficiency of water conservancy projects and regional water security. Currently, runoff forecasting methods are mainly divided into three categories: The first category is physical hydrological models, which describe hydrological physical processes based on partial differential equations such as the Saint-Venant equations. These models have clear physical meaning but suffer from difficulties in parameter calibration, high computational resource consumption, and weak real-time forecasting capabilities. The second category is data-driven models, mainly including machine learning models such as LSTM, SVM, and RF. While these models can effectively uncover nonlinear relationships in data, they have the following limitations: LSTM models excel at capturing temporal dependencies but are prone to overfitting and lack physical interpretability; SVM models have strong generalization ability in small sample data but struggle to adapt to the nonlinear characteristics of complex hydrological processes; RF models can handle high-dimensional data redundancy, but prediction results are easily affected by parameters such as the number of decision trees. The third category is hybrid models, which combine physical models with data-driven methods. However, existing hybrid models remain fixed after training and lack adaptability to climate change and the nonstationarity of hydrological processes.

[0003] In summary, existing technologies suffer from problems such as limited forecast accuracy, insufficient physical consistency, and lack of online adaptive capabilities. Summary of the Invention

[0004] To address the aforementioned shortcomings in existing technologies, this invention provides a medium- to long-term runoff intelligent forecasting method. By organically integrating a physically constrained recurrent neural network with online adaptive correction via a sliding window, it improves the accuracy, physical consistency, and dynamic adaptability of medium- to long-term runoff forecasts, thus solving the problems of limited accuracy, insufficient physical consistency, and lack of online adaptive capability in existing technologies.

[0005] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows: A medium- to long-term runoff intelligent forecasting method includes the following steps: A medium- to long-term intelligent runoff forecasting model was constructed, including a physically constrained recurrent neural network module and a sliding window online adaptive correction module; Meteorological, hydrological and underlying surface data of the target watershed are collected, data preprocessing and feature extraction are performed, feature vector sequences are generated, and training set, validation set and test set are divided according to time order; Input the feature vector sequence of the training set into the physical constraint recurrent neural network module, construct the total loss function based on physical constraint loss, train the physical constraint recurrent neural network module, and generate the trained physical constraint recurrent neural network module; In the online adaptive correction module of the sliding window, a fixed-size sliding window is initialized to store the measured runoff values ​​and corresponding preliminary runoff forecast values ​​for the most recent O times. The feature vector at the current moment is input into the trained physical constraint recurrent neural network module to generate the preliminary runoff forecast value at the current moment, and the average deviation of the historical forecast within the sliding window is calculated according to the state of the sliding window. Based on the average deviation of historical forecasts within the sliding window, the preliminary runoff forecast value at the current moment is corrected to generate the corrected runoff forecast value, which is then used as the intelligent forecast result for medium- and long-term runoff at the current moment. The measured runoff value at the current moment is combined with the preliminary runoff forecast value at the current moment to form a new sample pair, which is then added to the sliding window to perform the sliding window update, ultimately realizing intelligent updating and forecasting of medium- and long-term runoff.

[0006] Further, the process of collecting meteorological, hydrological, and underlying surface data of the target watershed, performing data preprocessing and feature extraction to generate a feature vector sequence, and dividing the data into training, validation, and test sets according to time sequence is as follows: Meteorological, hydrological and underlying surface data of the target watershed are collected, and after outlier removal, missing value completion and normalization, preprocessed meteorological, hydrological and underlying surface data are generated. Precipitation, temperature, evaporation, and measured runoff are extracted from the preprocessed meteorological, hydrological, and underlying surface data to generate a basic meteorological and hydrological feature vector, namely:

[0007] in, For the first The basic meteorological and hydrological feature vector at any given time. For the first Rainfall at any given time For the first Temperature at any given moment For the first Evaporation rate at any given time For the first The measured runoff at any given time. It is a four-dimensional real vector space; Measured runoff at several time points is extracted from preprocessed meteorological, hydrological, and underlying surface data to generate a hysteresis feature vector, i.e.:

[0008] in, For the first The lagged feature vector at time 1. , , The first Time, Number Time, Number The measured runoff at any given time. It is a six-dimensional real vector space; Based on the preprocessed meteorological, hydrological, and underlying surface data, physical feature vectors are extracted, including anterior rainfall characteristics and soil moisture index characteristics, namely:

[0009]

[0010]

[0011] in, For the first The physical feature vector at time t. For the first The timing of rainfall events influences its characteristics. For the first Characteristics of soil moisture index at any given time. It is a two-dimensional real vector space. The recession coefficient reflects the rate of soil moisture recession. For the first The timing of rainfall events influences its characteristics. To accumulate time steps, The attenuation coefficient is... The attenuation coefficient is the first Power of 1 For the first Rainfall at any given time; The basic meteorological and hydrological feature vectors, lagging feature vectors, and physical feature vectors are concatenated to generate a feature vector sequence, namely:

[0012]

[0013] in, It is a sequence of feature vectors. , , They are respectively time 1, time 2, and time 3. The feature vector at time step, For transpose operation, for 3D real vector space; The feature vector sequence is divided into training set, validation set and test set according to time order.

[0014] Furthermore, the process of inputting the feature vector sequence of the training set into the physical constraint recurrent neural network module, constructing a total loss function based on physical constraint loss, training the physical constraint recurrent neural network module, and generating the trained physical constraint recurrent neural network module is as follows: The feature vector sequence of the training set Input to a physically constrained recurrent neural network, where, , , These are the time steps 1, 2, and 3 within the training set, respectively. The feature vector at time step; In a physically constrained recurrent neural network, physical constraint losses are introduced, including prediction loss, water balance loss, and monotonicity constraint loss. A total loss function based on these physical constraint losses is constructed, namely:

[0015]

[0016]

[0017]

[0018]

[0019] in, This is the total loss function value. To predict losses, the difference between measured runoff values ​​and the initial runoff forecasts output by the physically constrained recurrent neural network is used. For water balance loss, For monotonicity-constrained loss, These are the weighting coefficients for water balance constraints. The weighting coefficients for the monotonicity constraints. This represents the total number of moments. For the first Measured runoff value at time t. For the first The initial runoff forecast value output by the physical constraint recurrent neural network at the given time. This represents the change in soil water storage. For the first Rainfall at any given time For the first Evaporation rate at any given time For the first The depth of the flow at any moment The duration is the length of the time period. For the drainage area, To perform the maximum value operation, The partial derivative of the preliminary runoff forecast value output by the physically constrained recurrent neural network with respect to precipitation; The physically constrained recurrent neural network performs forward propagation through a gated recurrent mechanism to generate preliminary runoff forecasts, namely:

[0020]

[0021]

[0022]

[0023]

[0024] in, For the first The door is constantly being updated. It is the sigmoid activation function. , , These are the weight matrices for the update gate, reset gate, and candidate hidden state, respectively. , , These are the biases for updating the door, resetting the door, and the candidate hidden state, respectively. For the first The door to reset time. , The first Time, Number The hidden state at all times The hyperbolic tangent activation function is used. For the first The feature vector input at time step 1, For the first The candidate hidden state at time step. For element-wise multiplication, This is the output layer weight matrix. For output layer bias terms; By updating the weight parameters and bias terms of the physical constraint recurrent neural network through backpropagation, the total loss function is minimized, and finally a trained physical constraint recurrent neural network is generated.

[0025] Furthermore, based on the state of the sliding window, the process of calculating the average deviation of historical forecasts within the sliding window is as follows: Determine if the sliding window is empty; if so, calculate the average deviation of historical forecasts within the sliding window. If the value is 0, then determine whether the sliding window is filled. If it is, use the equal-weighted average method to calculate the average deviation of historical forecasts within the sliding window, i.e.:

[0026] in, For the first The average deviation of historical forecasts within the time-lapse window. The size of the sliding window; Otherwise, the exponentially weighted average method is used to calculate the average deviation of historical forecasts within the sliding window, i.e.:

[0027] in, This represents the total number of moments within the current window. This is the attenuation factor.

[0028] Furthermore, the formula for calculating the corrected runoff forecast is as follows:

[0029] in, For the first Time-corrected runoff forecast values.

[0030] Furthermore, a new sample pair is formed by combining the current measured runoff value with the current preliminary runoff forecast value, and then added to the sliding window to perform sliding window updates. The process of intelligent updating and forecasting of medium- and long-term runoff is as follows: The measured runoff value at the current moment is combined with the preliminary runoff forecast value at the current moment to form a new sample pair. And add a sliding window to generate an updated sliding window, namely:

[0031] in, For the updated sliding window; Determine if the updated sliding window size exceeds the preset upper limit value O. If so, remove the oldest sample pair within the updated sliding window and generate a new updated sliding window.

[0032] in, For the updated sliding window, For the first The measured runoff value at time [time]. For the first Preliminary runoff forecast values ​​for the specified time.

[0033] The present invention has the following beneficial effects: 1. The medium- and long-term runoff intelligent forecasting method proposed in this invention achieves a balance between forecast accuracy, physical consistency, dynamic adaptability, and model efficiency by organically integrating a physically constrained recurrent neural network with online adaptive correction via a sliding window.

[0034] 2. At the physical constraint level, this invention introduces water balance and monotonicity constraints, forcing the model output to follow hydrological laws, thus solving the problem of poor interpretability of traditional data-driven models; 3. At the feature mining level, this invention integrates meteorological and hydrological features, runoff lag, API, SMI and other multi-dimensional features, which enhances the model's ability to characterize hydrological processes. 4. At the time series modeling level, this invention uses a GRU network to mine nonlinear time series dependencies, combined with a sliding window online correction mechanism, and uses historical forecast bias to dynamically correct preliminary results, effectively eliminating systematic errors; 5. In terms of dynamic adaptation, the sliding window of this invention adopts a "new addition and old removal" mechanism, which enables the model to track changes in hydrological conditions and solves the problem of traditional models remaining unchanged after training. 6. In terms of model efficiency, this invention adopts a simplified gating structure of GRU to reduce computational consumption and improve real-time forecast efficiency. Attached Figure Description

[0035] Figure 1 This is a flowchart illustrating a medium- to long-term intelligent runoff forecasting method proposed in this invention. Detailed Implementation

[0036] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0037] like Figure 1 As shown, a medium- to long-term runoff intelligent forecasting method includes the following steps: Step 1: Construct a medium- and long-term intelligent runoff forecasting model, including a physically constrained recurrent neural network module and a sliding window online adaptive correction module.

[0038] In this embodiment, this step achieves high-precision, highly physically consistent medium- to long-term runoff forecasts by setting up two core modules: a physically constrained recurrent neural network module and a sliding window online adaptive correction module. These two modules are interconnected to achieve this. The logical relationship between the two modules is as follows: the physically constrained recurrent neural network module is responsible for generating a preliminary runoff forecast sequence guided by physical laws; the sliding window online adaptive correction module dynamically adjusts the current preliminary runoff forecast result based on recent historical forecast errors. The former ensures physical consistency, while the latter endows the model with online learning capabilities, thus together forming a complete technical solution. The physically constrained recurrent neural network module is a recurrent neural network (GRU) incorporating physical constraints.

[0039] Step 2: Collect meteorological, hydrological and underlying surface data of the target watershed, perform data preprocessing and feature extraction, generate feature vector sequences, and divide them into training set, validation set and test set according to time order.

[0040] In this embodiment, this step involves constructing a feature vector sequence and dividing the training set so that subsequent steps can train the physical constraint recurrent neural network module; the specific operations are as follows: Meteorological, hydrological, and underlying surface data of the target watershed are collected, and after outlier removal, missing value completion, and normalization, preprocessed meteorological, hydrological, and underlying surface data are generated.

[0041] In this step, meteorological data for the target watershed includes precipitation, temperature, and evaporation at different scales; hydrological data includes measured runoff at different scales; and underlying surface data includes topography, soil type, and vegetation cover, etc., for use in watershed characteristic analysis and are not directly used as time series input. Outlier removal employs the 3σ criterion to remove outliers exceeding... The data points are selected to eliminate the influence of measurement errors or extreme records; missing value imputation: KNN interpolation (k=5) is used to fill in missing values ​​based on the features of similar samples, thus ensuring the continuity of the time series; normalization processing: Z-score standardization is used. , For standardized data, For the original data, The mean, The standard deviation is used to eliminate the influence of dimensions, so that the training of the recurrent neural network can be physically constrained in subsequent steps.

[0042] Precipitation, temperature, evaporation, and measured runoff are extracted from the preprocessed meteorological, hydrological, and underlying surface data to generate a basic meteorological and hydrological feature vector, namely:

[0043] In the formula, For the first The basic meteorological and hydrological feature vector at any given time; For the first Rainfall at any given time; For the first Temperature at any given moment; For the first Evaporation rate at any given time; For the first Measured runoff at any given time; It is a four-dimensional real vector space.

[0044] In this step, standardized precipitation, temperature, evaporation, and measured runoff are selected as basic meteorological and hydrological characteristics.

[0045] Measured runoff at several time points is extracted from preprocessed meteorological, hydrological, and underlying surface data to generate a hysteresis feature vector, i.e.:

[0046] In the formula, For the first The lagged feature vector at time step; , , The first Time, Number Time, Number Measured runoff at any given time; It is a six-dimensional real vector space.

[0047] In this step, in order to extract the runoff values ​​of the first p time periods to reflect the temporal dependence of runoff, the present invention sets the value of p to 6. In practical applications, it can be set according to the requirements, and the present invention does not limit it.

[0048] Based on the preprocessed meteorological, hydrological, and underlying surface data, physical feature vectors are extracted, including anterior rainfall characteristics and soil moisture index characteristics, namely:

[0049]

[0050]

[0051] In the formula, For the first The physical feature vector at time; For the first The characteristics of rainfall in the early stages of a given time, in mm; For the first Characteristics of soil moisture index at any given time; It is a two-dimensional real vector space; The recession coefficient reflects the rate of soil moisture recession, and its value ranges from 0.8 to 0.98. For the first The characteristics of rainfall in the early stages of a given time period; The cumulative time step is typically set to 5-15. This is the attenuation coefficient, with a value ranging from 0.85 to 0.95. The attenuation coefficient is the first Power; For the first Rainfall at any given time, in mm.

[0052] In this step, a physical feature vector is constructed based on the precipitation sequence of the preprocessed data, thereby reflecting the hydrological and physical state of the watershed.

[0053] The basic meteorological and hydrological feature vectors, lagging feature vectors, and physical feature vectors are concatenated to generate a feature vector sequence, namely:

[0054]

[0055] in, It is a sequence of feature vectors. , , They are respectively time 1, time 2, and time 3. The feature vector at time step, For transpose operation, for 3D real vector space, The value is 12.

[0056] The feature vector sequence is divided into training set, validation set and test set according to time order.

[0057] In this step, the feature vector sequence is divided into training, validation, and test sets according to the complete time series. The training set is used to train the physically constrained recurrent neural network (RCN) module and learn the network weights. The validation set is used during the training of the RNN module for early stopping detection and hyperparameter optimization, but does not participate in the final prediction. The test set is used to evaluate the final forecast performance and simulate real-time prediction scenarios. In practical applications, when dividing the feature vector sequence into training, validation, and test sets according to time sequence, the training set should have more samples, while the validation and test sets can have fewer. For example, if feature vector sequences of a target watershed are collected from 1956 to 2025, the feature vector sequences from 1956 to 2018 can be used as the training set, the 2019-2020 set as the validation set, and the 2021-2025 set as the test set. It should be noted that dividing the three datasets in time sequence ensures that future data will not be leaked into the training process, reflecting actual prediction scenarios.

[0058] Step 3: Input the feature vector sequence of the training set into the physical constraint recurrent neural network module, construct the total loss function based on physical constraint loss, train the physical constraint recurrent neural network module, and generate the trained physical constraint recurrent neural network module.

[0059] In this embodiment, this step is the training process of the physically constrained recurrent neural network module, and its operation is as follows: The feature vector sequence of the training set Input to a physically constrained recurrent neural network, where, , , These are the time steps 1, 2, and 3 within the training set, respectively. The eigenvector at time step 1.

[0060] In a physically constrained recurrent neural network, physical constraint losses are introduced, including prediction loss, water balance loss, and monotonicity constraint loss. A total loss function based on these physical constraint losses is constructed, namely:

[0061]

[0062]

[0063]

[0064]

[0065] In the formula, This represents the total loss function value. To predict losses, it is used to measure the difference between measured runoff values ​​and preliminary runoff forecasts output by the physically constrained recurrent neural network; This is to account for water balance losses, and is used to ensure that the physical constraint recurrent neural network satisfies the water balance principle. The monotonicity constraint loss is used to ensure a positive correlation between rainfall and runoff response; The weighting coefficients for water balance constraints can be determined through a validation set grid search in practical applications. The weight coefficients for the monotonicity constraint can be determined through a grid search on the validation set in practical applications. This represents the total number of time points. For the first The measured runoff value at time t, in meters. 3 / s; For the first The initial runoff forecast value output by the physically constrained recurrent neural network at the given time, in meters. 3 / s; This represents the change in soil water storage, expressed in mm. , For the first Characteristics of soil moisture index at any given time; For the first Rainfall at any given time; For the first Evaporation rate at any given time; For the first The runoff depth at any given time, in mm, is calculated using the formula... The watershed area can be obtained through calculation. The unit is m 2 ; The duration of the time period; The drainage area; This is for retrieving the maximum value. This is the partial derivative of the initial runoff forecast value output by the physically constrained recurrent neural network with respect to precipitation.

[0066] In this step, the evaporation rate The calculation process is as follows: First, utilize soil moisture index characteristics Construct the stress function, i.e.:

[0067] In the formula, The value of the stress function; The critical soil moisture index is a characteristic that distinguishes whether soil moisture limits evapotranspiration. It is obtained through calibration using historical measured data from the target watershed. Specifically, this involves collecting long-term measured precipitation, measured runoff, and meteorological data from the target watershed, and calculating the potential evapotranspiration at each time point. Characteristics of soil moisture index With the goal of minimizing the watershed water balance error, the actual evapotranspiration is fitted to obtain the result. equal to potential evapotranspiration Minimum time The value is... .

[0068] Then, based on the stress function, evapotranspiration Then it is: , For the first The potential evapotranspiration at any given time was calculated using the FAO Penman-Monteith formula, based on meteorological data such as measured temperature, wind speed, relative humidity, and sunshine duration in the target watershed.

[0069] Furthermore, the advantages of designing a total loss function based on physical constraint loss are: (1) It enables a deep integration of physical knowledge and data-driven approaches, improving the model's prediction accuracy; traditional data-driven models rely solely on prediction loss. Learning mapping relationships purely from historical data easily leads to statistically correlated but physically contradictory patterns; however, this invention introduces water balance losses... and monotonicity constraint loss By embedding hydrophysical laws into the loss function in a differentiable form, the model learns both data features and physical laws during training, achieving a deep integration of physical knowledge and data-driven approaches.

[0070] (2) Ensure that the forecast structure conforms to the principle of water balance; water balance loss Forced model output to satisfy This design ensures the accuracy of the model's predicted runoff depth. With precipitation Evaporation Changes in soil water storage The quantitative relationship between them conforms to the principle of water balance, which physically constrains the rationality of the forecast results and avoids physical paradoxes such as "no runoff with precipitation" or "runoff with no precipitation" that may occur in traditional models.

[0071] (3) Ensure the correct direction of rainfall and runoff response; monotonicity constraint loss By penalizing the partial derivatives of the forecast values ​​with respect to precipitation, the model is forced to satisfy: This means that when precipitation increases, the runoff forecast should not decrease; this design fundamentally solves the anti-physical phenomenon that may occur in traditional models, such as "the more rainfall, the less runoff", and ensures the correctness of the forecast results in the physical direction.

[0072] Ultimately, this total loss function design achieves a dynamic balance between physical consistency and forecast accuracy.

[0073] The physically constrained recurrent neural network performs forward propagation through a gated recurrent mechanism to generate preliminary runoff forecasts, namely:

[0074]

[0075]

[0076]

[0077]

[0078] In the formula, For the first The update gate at each moment controls the proportion of hidden states from the previous moment that are retained in the current moment; It is the sigmoid activation function; , , These are the weight matrices for the update gate, reset gate, and candidate hidden state, respectively. , , These are the biases for updating the gate, resetting the gate, and the candidate hidden state, respectively. For the first The time reset gate is used to control the degree to which the hidden state of the previous time step is ignored; , The first Time, Number The hidden state at any given moment; It is the hyperbolic tangent activation function; For the first The feature vector input at each time step; For the first The candidate hidden state at each moment; This is an element-wise multiplication operation; This is the output layer weight matrix; This is the output layer bias term.

[0079] By updating the weight parameters and bias terms of the physical constraint recurrent neural network through backpropagation, the total loss function is minimized, and finally a trained physical constraint recurrent neural network is generated.

[0080] In this step, when training the physical constraint recurrent neural network, the present invention generates a trained physical constraint recurrent neural network when the total loss function is minimized; however, in practical applications, a validation set can also be introduced to validate the trained physical constraint recurrent neural network, that is, an early stopping mechanism is adopted, and training is stopped when the validation set loss no longer decreases for 10 consecutive rounds, and the physical constraint recurrent neural network here is taken as the trained physical constraint recurrent neural network.

[0081] Step 4: In the sliding window online adaptive correction module, initialize a fixed-size sliding window to store the measured runoff values ​​and corresponding preliminary runoff forecast values ​​for the most recent O times.

[0082] In this embodiment, this step initializes a sliding window of a fixed size. This is used to store the measured runoff values ​​and corresponding preliminary runoff forecast values ​​for the most recent O times; the window size in this invention is O=100. Furthermore, the sliding window is empty at the start of the prediction. .

[0083] Step 5: Input the feature vector of the current moment into the trained physical constraint recurrent neural network module to generate the preliminary runoff forecast value of the current moment, and calculate the average deviation of the historical forecast within the sliding window according to the state of the sliding window.

[0084] In this embodiment, corresponding to the current time , to feature vector The input is fed into the trained physical constraint recurrent neural network module to obtain the preliminary runoff forecast value for the current time, i.e.:

[0085] In the formula, This is a pre-trained physical constraint recurrent neural network module. Then, based on the state of the sliding window, the average deviation of historical forecasts within the sliding window is calculated, specifically: Determine if the sliding window is empty; if so, calculate the average deviation of historical forecasts within the sliding window. If the value is 0, then determine whether the sliding window is filled. If it is, use the equal-weighted average method to calculate the average deviation of historical forecasts within the sliding window, i.e.:

[0086] in, For the first The average deviation of historical forecasts within the time-lapse window. This is the size of the sliding window.

[0087] Otherwise, the exponentially weighted average method is used to calculate the average deviation of historical forecasts within the sliding window, i.e.:

[0088] in, This represents the total number of moments within the current window. This is the attenuation factor, with a value range of 0-1.

[0089] Step 6: Based on the average deviation of historical forecasts within the sliding window, correct the preliminary runoff forecast value at the current moment, generate the corrected runoff forecast value, and use it as the intelligent forecast result for medium- and long-term runoff at the current moment. Specifically, the formula for calculating the corrected runoff forecast is as follows:

[0090] in, For the first Time-corrected runoff forecast values.

[0091] In this embodiment, the principle of the correction mechanism is as follows: recent historical forecast bias reflects the systematic error of the model under the current hydrological conditions. By adding the mean of this bias, this systematic bias can be effectively eliminated.

[0092] Step 7: Combine the current measured runoff value with the current preliminary runoff forecast value to form a new sample pair, add it to the sliding window, and perform a sliding window update to ultimately achieve intelligent updating and forecasting of medium- and long-term runoff. Specifically: The measured runoff value at the current moment is combined with the preliminary runoff forecast value at the current moment to form a new sample pair. And add a sliding window to generate an updated sliding window, namely:

[0093] in, This is the updated sliding window.

[0094] In this embodiment, the measured runoff value at the current time is unknown at the forecast time, but becomes known after the monitoring data is obtained.

[0095] Determine if the updated sliding window size exceeds the preset upper limit value O. If so, remove the oldest sample pair within the updated sliding window and generate a new updated sliding window.

[0096] in, For the updated sliding window, For the first The measured runoff value at time [time]. For the first Preliminary runoff forecast values ​​for the specified time. Among them, The set difference operator, i.e., from the updated sliding window. Remove the oldest sample pair within the updated sliding window. This results in a sliding window that is updated again.

[0097] In summary, the medium- to long-term runoff intelligent forecasting method proposed in this invention achieves a balance between forecast accuracy, physical consistency, dynamic adaptability, and model efficiency through the organic integration of physically constrained recurrent neural networks and sliding window online adaptive correction. Specifically, this is reflected in the following aspects: (1) Physical constraints ensure forecast reliability: Water balance loss and rainfall-runoff monotonicity constraints are introduced into the recurrent neural network to force the model output to follow the basic laws of hydrology. This design fundamentally solves the defects of poor physical interpretability and forecast results that are prone to contradict physical laws in traditional data-driven models, and significantly improves the credibility and scientificity of forecast results.

[0098] (2) Multi-dimensional feature enhancement process characterization: Integrating basic meteorological and hydrological features, runoff lag features, and two types of physical features such as the previous impact rainfall (API) and soil moisture index (SMI), we can fully explore various driving factors of runoff changes, enhance the model's ability to characterize watershed hydrological processes, and lay a data foundation for high-precision forecasting.

[0099] (3) Co-optimization of time-series modeling and online correction: Using GRU gated cyclic units as the core network, the nonlinear time-series dependencies of hydrological processes are effectively explored; on this basis, a sliding window online adaptive error correction mechanism is introduced to dynamically correct the preliminary forecast values ​​using recent historical forecast biases. Through the co-optimization of preliminary forecasts and online correction, systematic errors in the model are effectively eliminated, and the numerical accuracy of medium- and long-term runoff forecasts is significantly improved.

[0100] (4) Dynamic update mechanism adapts to non-stationarity: The sliding window adopts a real-time update mechanism of "adding new and moving old", which enables the model to dynamically track the changes in current hydrological conditions. This solves the defects of existing hybrid models that remain unchanged after training and cannot adapt to climate change and hydrological process non-stationarity, and realizes dynamic intelligent forecasting of medium and long-term runoff.

[0101] (5) Simplified network structure improves computational efficiency: GRU is used as the basic network, which simplifies the gating structure compared with LSTM. While maintaining the ability to model time series, it reduces the consumption of computing resources, improves the efficiency of real-time forecasting, and facilitates the deployment of applications on edge computing devices.

[0102] (6) Training strategy to ensure generalization ability: adopt a time-sequential dataset partitioning method or combine it with the early stopping mechanism of the validation set to effectively avoid model overfitting and ensure that the model has good generalization ability on unseen data to meet the needs of actual engineering applications.

[0103] In summary, this invention achieves synergistic optimization in terms of physical constraint mechanisms, multi-dimensional feature fusion, temporal modeling capabilities, online adaptive correction, dynamic update mechanisms, computational efficiency, and generalization capabilities, thereby comprehensively improving the scientific rigor and practicality of medium- and long-term runoff forecasting.

[0104] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

[0105] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.

Claims

1. A method for intelligent forecasting of medium- and long-term runoff, characterized in that, Includes the following steps: A medium- to long-term intelligent runoff forecasting model was constructed, including a physically constrained recurrent neural network module and a sliding window online adaptive correction module; Meteorological, hydrological and underlying surface data of the target watershed are collected, data preprocessing and feature extraction are performed, feature vector sequences are generated, and training set, validation set and test set are divided according to time order; Input the feature vector sequence of the training set into the physical constraint recurrent neural network module, construct the total loss function based on physical constraint loss, train the physical constraint recurrent neural network module, and generate the trained physical constraint recurrent neural network module; In the online adaptive correction module of the sliding window, a fixed-size sliding window is initialized to store the measured runoff values ​​and corresponding preliminary runoff forecast values ​​for the most recent O times. The feature vector at the current moment is input into the trained physical constraint recurrent neural network module to generate the preliminary runoff forecast value at the current moment, and the average deviation of the historical forecast within the sliding window is calculated according to the state of the sliding window. Based on the average deviation of historical forecasts within the sliding window, the preliminary runoff forecast value at the current moment is corrected to generate the corrected runoff forecast value, which is then used as the intelligent forecast result for medium- and long-term runoff at the current moment. The measured runoff value at the current moment is combined with the preliminary runoff forecast value at the current moment to form a new sample pair, which is then added to the sliding window to perform the sliding window update, ultimately realizing intelligent updating and forecasting of medium- and long-term runoff.

2. The intelligent forecasting method for medium- and long-term runoff according to claim 1, characterized in that, The process of collecting meteorological, hydrological, and underlying surface data for the target watershed, performing data preprocessing and feature extraction to generate a feature vector sequence, and then dividing the data into training, validation, and test sets according to time sequence is as follows: Meteorological, hydrological and underlying surface data of the target watershed are collected, and after outlier removal, missing value completion and normalization, preprocessed meteorological, hydrological and underlying surface data are generated. Precipitation, temperature, evaporation, and measured runoff are extracted from the preprocessed meteorological, hydrological, and underlying surface data to generate a basic meteorological and hydrological feature vector, namely: in, For the first The basic meteorological and hydrological feature vector at any given time. For the first Rainfall at any given time For the first Temperature at any given moment For the first Evaporation rate at any given time For the first The measured runoff at any given time. It is a four-dimensional real vector space; Measured runoff at several time points is extracted from preprocessed meteorological, hydrological, and underlying surface data to generate a hysteresis feature vector, i.e.: in, For the first The lagged feature vector at time 1. , , The first Time, Number Time, Number The measured runoff at any given time. It is a six-dimensional real vector space; Based on the preprocessed meteorological, hydrological, and underlying surface data, physical feature vectors are extracted, including anterior rainfall characteristics and soil moisture index characteristics, namely: in, For the first The physical feature vector at time t. For the first The timing of rainfall events influences its characteristics. For the first Characteristics of soil moisture index at any given time. It is a two-dimensional real vector space. The recession coefficient reflects the rate of soil moisture recession. For the first The timing of rainfall events influences its characteristics. To accumulate time steps, The attenuation coefficient is... The attenuation coefficient is the first Power of 1 For the first Rainfall at any given time; The basic meteorological and hydrological feature vectors, lagging feature vectors, and physical feature vectors are concatenated to generate a feature vector sequence, namely: in, It is a sequence of feature vectors. , , They are respectively time 1, time 2, and time 3. The feature vector at time step, For transpose operation, for 3D real vector space; The feature vector sequence is divided into training set, validation set and test set according to time order.

3. The intelligent forecasting method for medium- and long-term runoff according to claim 1, characterized in that, The process of inputting the feature vector sequence of the training set into the physical constraint recurrent neural network module, constructing a total loss function based on physical constraint loss, training the physical constraint recurrent neural network module, and generating the trained physical constraint recurrent neural network module is as follows: The feature vector sequence of the training set Input to a physically constrained recurrent neural network, where, , , These are the time steps 1, 2, and 3 within the training set, respectively. The feature vector at time step; In a physically constrained recurrent neural network, physical constraint losses are introduced, including prediction loss, water balance loss, and monotonicity constraint loss. A total loss function based on these physical constraint losses is constructed, namely: in, This is the total loss function value. To predict losses, the difference between measured runoff values ​​and the initial runoff forecasts output by the physically constrained recurrent neural network is used. For water balance loss, For monotonicity-constrained loss, These are the weighting coefficients for water balance constraints. The weighting coefficients for the monotonicity constraints. This represents the total number of moments. For the first Measured runoff value at time t. For the first The initial runoff forecast value output by the physical constraint recurrent neural network at the given time. This represents the change in soil water storage. For the first Rainfall at any given time For the first Evaporation rate at any given time For the first The depth of the flow at any moment The duration is the length of the time period. For the drainage area, To perform the maximum value operation, The partial derivative of the preliminary runoff forecast value output by the physically constrained recurrent neural network with respect to precipitation; The physically constrained recurrent neural network performs forward propagation through a gated recurrent mechanism to generate preliminary runoff forecasts, namely: in, For the first The door is constantly being updated. It is the sigmoid activation function. , , These are the weight matrices for the update gate, reset gate, and candidate hidden state, respectively. , , These are the biases for updating the door, resetting the door, and the candidate hidden state, respectively. For the first The door to reset time. , The first Time, Number The hidden state at all times The hyperbolic tangent activation function is used. For the first The feature vector input at time step 1, For the first The candidate hidden state at time step. For element-wise multiplication, This is the output layer weight matrix. For output layer bias terms; By updating the weight parameters and bias terms of the physical constraint recurrent neural network through backpropagation, the total loss function is minimized, and finally a trained physical constraint recurrent neural network is generated.

4. The intelligent forecasting method for medium- and long-term runoff according to claim 1, characterized in that, The process of calculating the average deviation of historical forecasts within the sliding window, based on the state of the sliding window, is as follows: Determine if the sliding window is empty; if so, calculate the average deviation of historical forecasts within the sliding window. If the value is 0, then determine whether the sliding window is filled. If it is, use the equal-weighted average method to calculate the average deviation of historical forecasts within the sliding window, i.e.: in, For the first The average deviation of historical forecasts within the time-lapse window. The size of the sliding window; Otherwise, the exponentially weighted average method is used to calculate the average deviation of historical forecasts within the sliding window, i.e.: in, This represents the total number of moments within the current window. This is the attenuation factor.

5. The intelligent forecasting method for medium- and long-term runoff according to claim 4, characterized in that, The formula for calculating the corrected runoff forecast is as follows: in, For the first Time-corrected runoff forecast values.

6. The intelligent forecasting method for medium- and long-term runoff according to claim 5, characterized in that, The process of combining the current measured runoff value with the current preliminary runoff forecast value to form a new sample pair, which is then added to the sliding window to perform sliding window updates, ultimately achieving intelligent updating and forecasting of medium- and long-term runoff, is as follows: The measured runoff value at the current moment is combined with the preliminary runoff forecast value at the current moment to form a new sample pair. And add a sliding window to generate an updated sliding window, namely: in, For the updated sliding window; Determine if the updated sliding window size exceeds the preset upper limit value O. If so, remove the oldest sample pair within the updated sliding window and generate a new updated sliding window. in, For the updated sliding window, For the first The measured runoff value at time [time]. For the first Preliminary runoff forecast values ​​for the specified time.