CN-121980968-A - Hydrologic flow long sequence prediction method and system for improving state space model
Abstract
The invention provides a hydrologic flow long-sequence prediction method and a hydrologic flow long-sequence prediction system for an improved state space model, which comprise the steps of collecting multisource data of a river basin to be predicted, constructing a time sequence sample pair by a sliding window method, wherein the time sequence sample pair comprises an input sequence and a target sequence, constructing a HydroMamba model according to the time sequence sample pair, training a HydroMamba prediction model, searching for an optimal super-parameter combination, realizing flow prediction and result reduction by adopting an autoregressive mechanism based on a HydroMamba model after training, realizing high calculation efficiency, capturing long-distance weather-hydrologic hysteresis effect which is difficult to capture by a state space model by utilizing continuous state equation discretization of the state space model, processing the bias distribution of hydrologic data by logarithmic transformation, combining an anti-overfitting target function, and remarkably improving the prediction performance of the model on unseen data.
Inventors
- ZHAO HAORAN
- WU JIANMING
Assignees
- 浙江远算科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260403
Claims (10)
- 1. A method for improving a state space model for long sequence prediction of hydrologic traffic, the method comprising: collecting multisource data of a river basin to be predicted, wherein the multisource data comprises daily scale weather driving factors, hydrologic monitoring data and time characteristic data; Performing data cleaning processing, nonlinear distribution correction processing, time feature coding processing and data normalization processing on the multi-source data to obtain processed multi-source data; constructing a time sequence sample pair by the processed multi-source data through a sliding window method, wherein the time sequence sample pair comprises an input sequence and a target sequence; Constructing HydroMamba a model according to the time sequence sample pair, training the HydroMamba model, and searching for an optimal super-parameter combination; Based on the HydroMamba model after training, an autoregressive mechanism is adopted to realize flow prediction and result restoration.
- 2. The method for predicting a long sequence of hydrologic traffic in an improved state space model according to claim 1, wherein said processed multi-source data is passed through a sliding window method to construct a pair of time-series samples, said pair of time-series samples including an input sequence and a target sequence, comprising: defining core parameters, wherein the core parameters comprise a historical sequence length, a future prediction length and a sliding step length; determining an input window and a target window based on a t-th sample in the time sequence, wherein t is greater than or equal to the sum of the length of the historical sequence and the length of the future prediction; Determining a total time sequence length; Calculating the total number of constructed samples according to the total time sequence length, the historical sequence length and the future prediction length; Dividing the total number of the constructed samples according to a preset proportion to obtain a training set, a verification set and a test set; Determining an input sequence according to the input window, and determining a target sequence according to the target window; determining an input feature vector and a target vector for each time step; The end time of the input sequence is t-1, and the start time of the target sequence is t.
- 3. The method of claim 1, wherein the HydroMamba model comprises an input embedding layer, a Mamba stacked coding layer, and an output mapping layer, wherein constructing HydroMamba model from the time-ordered sample pairs comprises: Defining an input characteristic vector, a linear projection matrix and an embedded layer bias term after tau time standardization in the input embedded layer; According to the input feature vector standardized at the tau moment, the linear projection matrix and the embedded layer bias term, respectively calculating a high-dimensional feature vector embedded at the tau moment and an embedded input sequence; The Mamba stacked coding layers comprise k MambaBlock formed by series connection, the input of the kth MambaBlock is the output of the previous layer, and the initial input is the embedded input sequence; And in the output mapping layer, converting the encoded high-dimensional characteristics into flow prediction values, and outputting a prediction sequence according to the flow prediction values.
- 4. A method of predicting a long sequence of hydrologic traffic in an improved state space model as claimed in claim 3 wherein normalizing, state space modeling and residual connection processing is performed on individual ones of said MambaBlock to obtain an output signature of said MambaBlock, comprising: Normalizing the single MambaBlock to obtain a normalized feature vector; Projecting the normalized feature vector to obtain a projected parameter matrix; dynamically updating the state vector through a structured state space model by the projected parameter matrix; Converting the state vector into an output characteristic of Mamba modules; and adding the output characteristics of the Mamba module with the original input characteristics of the MambaBlock to obtain the output characteristics of the MambaBlock.
- 5. A method of hydrologic traffic long sequence prediction for an improved state space model according to claim 3, characterized in that in the output mapping layer, the encoded high dimensional features are converted into traffic predictors, comprising: Carrying out RMSNorm processing on the coding features to obtain normalized coding features; Regularizing the normalized coding features by adopting a Dropout mechanism to obtain regularized coding features; And mapping the regularized coding features into the flow prediction value.
- 6. The method for long sequence prediction of hydrologic traffic for improved state space model according to claim 1, wherein training said HydroMamba model and searching for optimal hyper-parameter combinations comprises: acquiring a history input window and a guide sequence; Constructing a combined input matrix according to the historical input window and the guide sequence; Acquiring a lower triangular causal convolution mask in the selective scanning process of the Mamba module; calculating basic loss and overfitting penalty items; Constructing a composite loss function according to the basic loss and the overfitting penalty term; Minimizing the composite loss function by an Adam optimizer; and searching the optimal super-parameter combination by adopting a Bayes optimization framework.
- 7. The method for predicting the long sequence of hydrologic flow for improving a state space model according to claim 1, wherein based on the HydroMamba model after training, the flow prediction and the result recovery are realized by adopting an autoregressive mechanism, comprising: Taking the data of the previous N days at the time t to be predicted as initial input; Determining a target time of the kth prediction; Splicing the initial input with the meteorological factors and the historical predicted values of the current prediction step to obtain updated feature vectors; inputting the updated feature vector into a HydroMamba model after training to obtain a standardized predicted value at the current moment; updating the flow predicted value at the previous moment into a standardized predicted value at the current moment; after cycling for M times, obtaining a standardized prediction sequence for the future M days; Performing inverse standardization processing on the standardized predicted value at the current moment to obtain converted flow; performing inverse Log1p transformation on the transformed flow to obtain a real-scale flow predicted value; Calculating an average absolute error according to the real scale flow predicted value; when the Nash efficiency coefficient is larger than or equal to a first preset threshold value and the average absolute error is smaller than or equal to a second preset threshold value, the prediction result meets engineering application requirements.
- 8. The method for predicting a long sequence of hydrological traffic in an improved state space model according to claim 1, wherein the multi-source data is subjected to a data cleaning process, a nonlinear distribution correction process, a time feature encoding process and a data normalization process to obtain the processed multi-source data, comprising: performing data integrity verification, missing data completion and abnormal value processing on the multi-source data; converting the original measured flow into a converted flow; Converting the yearly product day into a periodic numerical characteristic through sine-cosine coding; And carrying out normalization processing on the original characteristic data to obtain normalized characteristic data.
- 9. A hydrological traffic long sequence prediction system for improving a state space model, the system comprising: The system comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is used for acquiring multi-source data of a river basin to be predicted, and the multi-source data comprises a daily scale weather driving factor, hydrologic monitoring data and time characteristic data; The processing module is used for carrying out data cleaning processing, nonlinear distribution correction processing, time feature coding processing and data normalization processing on the multi-source data to obtain processed multi-source data; the time sequence sample pair construction module is used for constructing a time sequence sample pair from the processed multi-source data through a sliding window method, wherein the time sequence sample pair comprises an input sequence and a target sequence; the model construction and training module is used for constructing HydroMamba models according to the time sequence sample pairs, training the HydroMamba models and searching for optimal super-parameter combinations; and the prediction module is used for realizing flow prediction and result reduction by adopting an autoregressive mechanism based on the HydroMamba model after training.
- 10. An electronic device comprising a memory, a processor, the memory having stored thereon a computer program executable on the processor, characterized in that the processor implements the method of any of the preceding claims 1 to 8 when the computer program is executed.
Description
Hydrologic flow long sequence prediction method and system for improving state space model Technical Field The invention relates to the technical field of hydrological weather prediction and artificial intelligence intersection, in particular to a hydrological flow long-sequence prediction method and a hydrological flow long-sequence prediction system for improving a state space model. Background The runoff prediction has important significance in the scenes such as flood control and drought resistance scheduling, water resource optimal allocation and the like. The current mainstream hydrologic flow prediction method can be divided into two major types of physical process driving models and data driving models, but both types of methods have significant technical bottlenecks. The physical process driving model is used for constructing a physical deduction relation by depending on high-precision hydrologic geographic parameters (such as terrain gradient, soil permeability and the like), and the problems of high calculation complexity, high difficulty in calibrating key parameters, weak adaptability to extreme hydrologic scenes and the like exist. While the data driving model with deep learning as a core reduces the dependence on physical parameters, different architectures still have the limitations that the RNN/LSTM series model has basic time sequence modeling capability, but has low parallel computing efficiency and long sequence memory forgetting problem, when the hydrologic data with a long history window over 60 days are processed, the prediction precision and stability are obviously reduced, the other main stream model solves the parallel computing problem through a self-attention mechanism, but the computing complexity of the mechanism increases secondarily along with the increase of the sequence length, the occupation of the video memory and the computing time consumption are greatly improved, and the global correlation modeling mode is not natural enough for capturing continuous hydrodynamic characteristics in the hydrologic process. Disclosure of Invention Therefore, the invention aims to provide the hydrologic flow long-sequence prediction method and the hydrologic flow long-sequence prediction system for improving the state space model, which have high calculation efficiency, can capture long-distance weather-hydrologic hysteresis effect which is difficult to capture by a traditional circulation model by utilizing the discretization of a continuous state equation of the state space model, and remarkably improve the prediction performance of the model on unseen data by carrying out logarithmic transformation on the deviational distribution of hydrologic data and combining an objective function of anti-overfitting, and have high practical application value. In a first aspect, an embodiment of the present invention provides a method for predicting a long sequence of hydrologic traffic of an improved state space model, the method comprising: collecting multisource data of a river basin to be predicted, wherein the multisource data comprise daily scale weather driving factors, hydrologic monitoring data and time characteristic data; Performing data cleaning processing, nonlinear distribution correction processing, time feature coding processing and data normalization processing on the multi-source data to obtain processed multi-source data; constructing a time sequence sample pair by the processed multi-source data through a sliding window method, wherein the time sequence sample pair comprises an input sequence and a target sequence; Constructing HydroMamba a model according to the time sequence sample pair, training the HydroMamba model, and searching for an optimal super-parameter combination; Based on the HydroMamba model after training, an autoregressive mechanism is adopted to realize flow prediction and result restoration. Further, the processed multi-source data is constructed into time sequence sample pairs through a sliding window method, wherein the time sequence sample pairs comprise an input sequence and a target sequence, and the method comprises the following steps: defining core parameters, wherein the core parameters comprise a historical sequence length, a future prediction length and a sliding step length; determining an input window and a target window based on a t-th sample in the time sequence, wherein t is greater than or equal to the sum of the length of the historical sequence and the length of the future prediction; Determining a total time sequence length; calculating the total number of constructed samples according to the total time sequence length, the historical sequence length and the future prediction length; Dividing the total number of the constructed samples according to a preset proportion to obtain a training set, a verification set and a test set; Determining an input sequence according to the input window, and determining a target sequence according to the targ