A water level prediction method and system
Through improved water level prediction methods and models, the problem of failure to fully consider the hysteresis characteristics and water level critical state in the prior art is solved, and a higher accuracy and adaptable water level prediction is achieved.
Patent Information
- Application Number
- CN202510444418.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-04-10
AI Technical Summary
The existing water level prediction technology fails to fully consider the difference in the hysteresis characteristics of the impact of meteorological variables on water level, resulting in insufficient prediction effect, especially in the identification of water level critical states.
An improved water level prediction method is proposed. By collecting historical meteorological and water level data, performing discretization treatment and sliding window analysis, the global lag data between meteorological variables and water level is extracted, and the water level critical analysis is carried out to build an improved long-term and short-term memory network model, including feature reconstruction units, lag sensing units and water level critical constraints, to capture the lag characteristics and water level critical state characteristics of meteorological variables.
Through the improved water level prediction model, the differentiated lag law of the impact of meteorological variables on water level can be more accurately captured, the attention to the critical state of water level can be improved, and the accuracy and adaptability of water level prediction can be improved.
Smart Images

Figure CN119962767B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water level prediction, and particularly relates to a water level prediction method and system. Background Art
[0002] Accurate water level prediction is the core link of the flood control and disaster reduction system. In related research, data-driven methods for water level prediction based on time series prediction networks have gradually become a research hotspot for water level prediction. However, in the process of some deep learning modeling, the original time series meteorological data is directly used as the input of the model for model training, without fully considering the differences in the lag characteristics of the impacts of different meteorological variables on the water level. For example, the immediate impact effect of short-term heavy rainfall on the water level and the delayed effect of continuous low temperature on snowmelt have completely different response mechanisms. And although the time series prediction model can capture the lag characteristics contained in the training data to a certain extent, it mostly uses a fixed network structure to process time series data and lacks the ability to perceive dynamic lag patterns. For example, during a rainstorm event, the sensitivity of the water level to short-lag rainfall factors increases significantly, while long-lag temperature factors may become the dominant factors during the snowmelt season. In the process of water level prediction, the identification of the critical state of the water level requires more attention, while the state during the stable period can reduce the attention appropriately. Some existing water level prediction technologies need to be optimized. Summary of the Invention
[0003] In view of the above background content, the present invention proposes a water level prediction method and system, aiming to solve the problem of insufficient prediction effect existing in water level prediction technology.
[0004] To achieve the above object, the technical solutions provided by the present invention are as follows. In the first aspect of the present invention, a water level prediction method is provided, including:
[0005] Collect historical meteorological record data and historical water level record data of the target basin, and perform discretization processing on multiple meteorological variables in the historical water level record data and historical meteorological record data to obtain historical water level discrete feature data and historical meteorological discrete feature data;
[0006] Perform a sliding window process on the historical water level discrete feature data and historical meteorological discrete feature data, calculate multiple mutual informations between each meteorological variable and the water level under each preset sliding window, and determine the local lag characteristics of each meteorological variable within the preset sliding window, including local lag weights under different preset lag periods. Traverse the historical water level discrete feature data and historical meteorological discrete feature data to extract the global lag data between each meteorological variable and the water level;
[0007] Perform a critical analysis of the historical water level record data, including determining multiple water level critical events in the historical water level record data, extracting critical feature parameters of each water level critical event, and constructing a critical feature sequence;
[0008] A sample data set for training a water level prediction model is constructed based on historical meteorological record data, historical water level record data, and multiple sets of global lag data. The sample data set contains multiple sets of training sample data, and the water level prediction of the target basin is realized through the trained water level prediction model;
[0009] Among them, the water level prediction model is an improved long short-term memory network model, including adding a feature reconstruction unit and a lag perception unit to the long short-term memory network model and introducing a water level critical constraint to capture the lag features of meteorological variables and the water level critical state features in the input data.
[0010] Preferably, for the water level prediction model, it further includes:
[0011] The water level prediction model includes an input layer, a feature reconstruction layer, a lag perception layer, an LSTM layer, and an output layer. The input layer is used to receive multiple sets of training sample data. The feature reconstruction layer is used to perform feature reconstruction on multiple sets of training sample data based on multiple sets of global lag data, including constructing a lag weight matrix according to multiple sets of global lag data, and performing feature reconstruction on multiple sets of training sample data respectively through the lag weight matrix to generate the lag impact aggregation feature of each meteorological variable in each set of training sample data. The lag perception layer is used to adjust the lag impact aggregation features of multiple meteorological variables according to the lag perception unit to generate the lag dynamic adjustment feature corresponding to each lag impact aggregation feature. The LSTM layer is used to splice the multiple lag dynamic adjustment features of each set of training sample data with the included historical meteorological record data to generate historical meteorological time series features, and perform time series modeling on the historical meteorological time series features through LSTM units. The output layer is used to output the water level prediction result of the water level prediction model;
[0012] Among them, the target loss function of the water level prediction model includes the water level prediction loss based on the water level critical constraint and the lag gradient matching loss, and the target loss function is:
[0013] ;
[0014] In the formula, represents the total loss of the water level prediction model, represents the predicted value output by the water level prediction model, represents the predicted value The corresponding true value in the sample data set, represents the th lag weighted feature of the meteorological variable, represents the partial derivative of the predicted value of the water level prediction model with respect to the th lag weighted feature of the meteorological variable, represents the predicted value The corresponding true value Regarding the partial derivative of the lag-weighted feature of the nth meteorological variable, where represents the total number of time steps, represents the water level critical constraint weight under the water level critical constraint, represents a hyperparameter, represents the total number of meteorological variables.
[0015] Preferably, feature reconstruction is performed on multiple sets of training sample data based on multiple sets of global lag data, including:
[0016] According to the local lag features of each meteorological variable under each preset sliding window, generate the local lag weight vector of each meteorological variable in each set of training sample data. The time length of the training sample data is the same as the preset sliding window. Generate the lag weight matrix of each set of training sample data based on multiple local lag weight vectors. Through the local lag weight vectors corresponding to each meteorological variable in the lag weight matrix, perform feature reconstruction on the time series data of each meteorological variable in the training sample data, including extracting the eigenvalue of the meteorological variable at different preset lag periods from the training sample data, determining the local lag weight of each preset lag period according to the local lag weight vector, and performing feature fusion on multiple eigenvalues of the meteorological variable through multiple local lag weights to generate the lag impact aggregation feature of each meteorological variable in the training sample data.
[0017] Preferably, for introducing the water level critical constraint into the long short-term memory network model, it further includes:
[0018] Generate the water level critical constraint threshold according to the critical feature sequence, where the critical feature sequence includes the critical feature parameters corresponding to multiple water level critical events in the historical water level record data, and determine the water level critical constraint weight in the target loss function based on the water level critical constraint threshold:
[0019] ;
[0020] In the formula, represents the critical feature parameter corresponding to the input data associated with the predicted value output by the water level prediction model, represents the water level critical constraint threshold.
[0021] Preferably, extracting the critical feature parameter of each water level critical event includes:
[0022] Extract the water level critical feature data and water level stable feature data of each water level critical event, construct the water level critical feature sequence and water level stable feature sequence of each water level critical event, calculate the water level critical fluctuation parameter and state change parameter of the water level critical event according to the water level critical feature sequence, calculate the water level stable fluctuation parameter of the water level critical event according to the water level stable feature sequence, take the mean value of the water level stable fluctuation parameters of multiple water level critical events as the water level stable fluctuation reference value, for any water level critical event, calculate the ratio of the water level critical fluctuation parameter to the water level stable fluctuation reference value, and multiply it by the state change parameter of the water level critical event to obtain the critical feature parameter of the water level critical event. After generating a critical feature sequence containing multiple critical feature parameters, determine the water level critical constraint threshold of the historical water level record data according to the multiple critical feature parameters in the critical feature sequence.
[0023] Preferably, calculate the multiple mutual informations between each meteorological variable and the water level under each preset sliding window, and determine the local lag feature of each meteorological variable within the preset sliding window, including:
[0024] Determine multiple preset lag periods of each meteorological variable. For any preset sliding window, construct the local lag feature sequence of the meteorological variable under each preset lag period according to the historical meteorological discrete feature data within the preset sliding window, extract the corresponding local water level feature sequence of the historical water level discrete feature data within the preset sliding window, and calculate the mutual information between the local lag feature sequence of the meteorological variable under each preset lag period and the local water level feature sequence, so as to obtain the local lag feature of the meteorological variable within the preset sliding window.
[0025] In a second aspect, a water level prediction system is provided for implementing the above water level prediction method, including:
[0026] A historical data acquisition module for collecting the historical meteorological record data and historical water level record data of the target basin;
[0027] A data discretization processing module for discretizing multiple meteorological variables in the historical water level record data and historical meteorological record data to obtain historical water level discrete feature data and historical meteorological discrete feature data;
[0028] A lag feature analysis module for performing sliding window processing on the historical water level discrete feature data and historical meteorological discrete feature data, calculating the multiple mutual informations between each meteorological variable and the water level under each preset sliding window, determining the local lag feature of each meteorological variable within the preset sliding window, including the local lag weights under different preset lag periods, traversing the historical water level discrete feature data and historical meteorological discrete feature data, and extracting the global lag data between each meteorological variable and the water level.
[0029] A critical state analysis module for performing water level critical analysis on historical water level record data, including determining multiple water level critical events in the historical water level record data, extracting critical characteristic parameters of each water level critical event, and constructing a critical characteristic sequence;
[0030] A water level prediction management module for constructing a sample data set for training a water level prediction model based on historical meteorological record data, historical water level record data, and multiple groups of global lag data. The sample data set contains multiple groups of training sample data, and realizes the water level prediction of the target basin through the trained water level prediction model;
[0031] Among them, the water level prediction model is an improved long short-term memory network model, including adding a feature reconstruction unit and a lag perception unit to the long short-term memory network model and introducing a water level critical constraint, which is used to capture the meteorological variable lag characteristics and water level critical state characteristics in the input data.
[0032] The present invention has the following beneficial effects:
[0033] The present invention discretizes the historical meteorological record data and historical water level dynamic change data of the target basin, adopts a strategy based on sliding window mutual information analysis to mine the temporal evolution law of the influence of different meteorological variables on the water level, obtains the global lag data between meteorological variables and the water level, performs water level critical analysis on the historical water level record data, mines the fluctuation characteristics and mutation laws under the water level critical state to extract the critical characteristic sequence, combines the historical data with the global lag data to construct the training sample data, and improves the long short-term memory network model by combining the global lag data and the critical characteristic sequence to obtain the water level prediction model, including introducing a water level critical constraint mechanism, a dynamic feature reconstruction mechanism, and a lag perception mechanism, which can effectively capture the differential lag laws of the influence of different meteorological variables on the water level, improve the attention degree of the model to the water level critical state, and at the same time make the model have a higher adaptability to complex meteorological scenarios, so as to realize high-precision water level prediction. Brief Description of the Drawings
[0034] Figure 1 It is a schematic flow chart of a water level prediction method exemplary of an embodiment of the present invention.
[0035] Figure 2 It is a schematic structural diagram of a water level prediction model exemplary of an embodiment of the present invention.
[0036] Figure 3 It is a schematic structural diagram of a water level prediction system exemplary of an embodiment of the present invention. Detailed Embodiments
[0037] To enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0038] Please refer to Figure 1 and Figure 2 , an exemplary water level prediction method of the present invention includes the following steps:
[0039] Step S01: Collect historical meteorological record data and historical water level record data of the target basin, discretize multiple meteorological variables in the historical water level record data and historical meteorological record data, and obtain historical water level discrete feature data and historical meteorological discrete feature data.
[0040] In this step, for a certain basin that needs to be analyzed for water level prediction, namely the target basin, such as a river channel, a reservoir, etc., the historical meteorological record data of this basin contains record data under multiple meteorological variables such as temperature, precipitation, humidity, wind speed, etc. within a certain period in the past, such as the past six months or one year. The historical water level record data contains water level data at one or more hydrological monitoring points within the basin, such as the water level monitoring data of a certain dam or reservoir. The historical data provides the relationship between hydrology and meteorology within the target basin. First, discretize these data to convert continuous meteorological data and water level data into discrete feature values. For example, the temperature is divided into a discrete category every 5°C. Finally, historical meteorological discrete feature data containing information such as timestamp, rainfall category, temperature category, wind speed category, etc., and historical water level discrete feature data containing information such as timestamp, discrete water level category, original water level value, etc. are obtained.
[0041] Step S02: Perform a sliding window process on the historical water level discrete feature data and historical meteorological discrete feature data, calculate multiple mutual informations between each meteorological variable and the water level under each preset sliding window, determine the local lag features of each meteorological variable within the preset sliding window, and traverse the historical water level discrete feature data and historical meteorological discrete feature data to extract the global lag data between each meteorological variable and the water level.
[0042] In this step, the sliding window technique is adopted to analyze the discretized historical water level characteristic data and meteorological characteristic data. The data is traversed through a window with a preset size, and the size of the sliding window can be reasonably set according to factors such as the basin area. For example, 24 hours is selected in large basins to ensure the analysis accuracy. For the data within each preset sliding window, lag analysis is performed on each meteorological variable respectively. In this process, multiple preset lag periods for each meteorological variable are first determined, such as 1h, 3h, 6h, etc. For any preset sliding window, according to the historical meteorological discrete characteristic data within the preset sliding window, a local lag characteristic sequence of the meteorological variable at each preset lag period is constructed, and the local water level characteristic sequence corresponding to the historical water level discrete characteristic data within the preset sliding window is extracted. Then, the mutual information between the local lag characteristic sequence of the meteorological variable at each preset lag period and the local water level characteristic sequence is calculated respectively to characterize the correlation degree between the meteorological variable and the water level data at different lag periods, so as to obtain the local lag weights at different lag periods. The local lag characteristics of each meteorological variable within the preset sliding window include the local lag weights corresponding to multiple preset lag periods respectively. The greater the conditional mutual information corresponding to the lag period, the greater the local lag weight, which is used to quantitatively represent the lag influence intensity of the meteorological variable on the water level. Through the above method, the local lag characteristics of each meteorological variable within the preset sliding window are obtained, revealing the mutual influence relationship between different meteorological variables and the water level. After traversing the historical water level discrete characteristic data and historical meteorological discrete characteristic data, multiple groups of local lag characteristics are obtained, and finally the global lag data corresponding to each meteorological variable and the water level respectively is generated, which can characterize the change phenomenon of the lag correlation between the meteorological variable and the water level in different periods.
[0043] Step S03: Conduct water level critical analysis on the historical water level record data, including determining multiple water level critical events in the historical water level record data, extracting the critical characteristic parameters of each water level critical event, and constructing a critical characteristic sequence.
[0044] In this step, the purpose of water level critical analysis is to identify key events in the historical water level record data, which can be the situation where the water level reaches a certain critical value such as the flood warning line, so as to conduct a more in-depth analysis on some representative data in the water level change. After determining multiple water level critical events through the preset critical value, the water level change data within a period of time before and after the critical state can be extracted, and feature analysis is performed on these data to extract the critical characteristic parameters representing the water level change law in the water level critical event, and then a critical characteristic sequence is constructed according to multiple critical characteristic parameters.
[0045] In an alternative solution, for the calculation of critical characteristic parameters, first, the water level critical characteristic data and water level stable characteristic data of each water level critical event are extracted, and the water level critical characteristic sequence and water level stable characteristic sequence of each water level critical event are constructed. The water level critical characteristic data can specifically be the specific change data of the water level during the process when the water level starts to rise at a certain growth rate, and the water level stable characteristic data is the state change data during the period when the water level phase fluctuates less smoothly before the water level critical event. The water level critical characteristic data refers to the water level data and its related characteristics when the water level reaches the critical value (such as the flood warning line or the low water line), such as the degree of sudden change and the change rate of the water level. The water level stable characteristic data is the stability index of the water level in the non-critical state, usually indicating that the water level changes little and is in a relatively stable state.
[0046] Based on the water level critical characteristic data, a water level critical characteristic sequence representing the rapid growth and change of the water level is constructed, the water level critical fluctuation parameter characterizing the fluctuation characteristics of the water level before the critical phenomenon appears in the water level critical event, and the state change parameter characterizing the persistence characteristics of the water level change state before the critical phenomenon appears are calculated. In this embodiment, the variance of the water level critical characteristic sequence is calculated as the water level critical fluctuation parameter, and the autocorrelation coefficient of the water level critical characteristic sequence is calculated as the state change parameter. And based on the water level stable characteristic data, a water level stable characteristic sequence representing the slight fluctuation of the water level under normal conditions is constructed, the change of the water level in the stable state is measured by the variance, and the water level stable fluctuation parameter of the water level critical event is calculated according to the water level stable characteristic sequence.
[0047] Then, the mean value of the water level stable fluctuation parameters of multiple water level critical events is taken as the water level stable fluctuation reference value. Taking the calculation of the critical characteristic parameters of any water level critical event as an example, the ratio of the water level critical fluctuation parameter to the water level stable fluctuation reference value is calculated, and the calculated ratio is multiplied by the state change parameter of the water level critical event to obtain the critical characteristic parameters of the water level critical event. In this way, the critical characteristic parameters of each water level critical event are obtained, which characterize the overall change characteristics of the water level during the process of abnormal water level growth and possible reaching of the critical threshold. This parameter combines the severity of water level fluctuations and the suddenness of state changes, and can reflect the severity of the water level critical state.
[0048] Step S04: Based on the historical meteorological record data, historical water level record data, and multiple groups of global lag data, a sample data set for training the water level prediction model is constructed, and the water level of the target basin is predicted through the trained water level prediction model.
[0049] In this step, through the aforementioned critical analysis, the critical change characteristics of water levels in historical data and the lag change characteristics between different meteorological variables and water levels are extracted. Based on this characteristic information, a sample data set for training the water level prediction model is finally constructed based on historical meteorological record data, historical water level record data, and multiple groups of global lag data. Among them, each set of training sample data can be set based on the size of the sliding window in the previous sliding window analysis process. For example, the data within one window constitutes the training sample data, which includes the change sequence of the water level in the target basin and the change sequences of multiple meteorological variables within the window, as well as the local lag characteristics of multiple meteorological variables within the preset sliding window in the historical data corresponding to the change sequences.
[0050] For the water level prediction model, specifically an improved long short-term memory network model, LSTM is an effective neural network structure for processing time series data and can capture long-term and short-term dependencies in sequence data. However, the original LSTM model has certain deficiencies in responding to and processing complex lag characteristics of dynamic changes and critical state characteristics of water level changes. In this embodiment, improvements are made in the LSTM network to add a feature reconstruction unit and a lag perception unit. The feature reconstruction unit can reconstruct the input meteorological and water level data based on lag characteristics, improving the model's ability to identify dynamic lag characteristics in complex data patterns. The lag perception unit further deeply analyzes the lag characteristics related to meteorological variables in the reconstructed input data, identifies the importance of different lag characteristics, and facilitates the conventional LSTM in the process of performing time series modeling on data to pay more attention to some key lag characteristics in the process of analyzing the characteristics of information transmission of different meteorological variables over time, facilitating the model to accurately capture the complex relationship between meteorological factors and water levels. At the same time, a water level critical constraint is introduced into the model training process to help the model identify critical state characteristics of water levels and pay more attention to the impact after the water level approaches the critical state during prediction. After training the water level prediction model through the sample data set, the water level prediction of the target basin is realized based on the water level prediction model, including inputting the real-time meteorological data of the target basin into the model to predict the water level state in the basin at a future time through model training. The water level prediction of the target basin is effectively realized.
[0051] In an alternative solution, for the above water level prediction model, the specific structure includes an input layer, a feature reconstruction layer, a lag perception layer, an LSTM layer, and an output layer.
[0052] The input layer is used to receive multiple sets of training sample data in the sample data set. Each set of training sample data includes the original observation sequences of multiple meteorological variables and the local lag characteristics corresponding to different meteorological variables.
[0053] The feature reconstruction layer is used to perform feature reconstruction on multiple sets of training sample data based on multiple sets of global lag data, including constructing a lag weight matrix according to multiple sets of global lag data, and performing weighted aggregation on multiple sets of training sample data respectively through the lag weight matrix to achieve feature reconstruction, and generating lag impact aggregation features corresponding to each meteorological variable in each set of training sample data.
[0054] Among them, for the process of feature reconstruction, according to the local lag features of each meteorological variable under each preset sliding window, a local lag weight vector of each meteorological variable in each set of training sample data is generated, that is, it is constructed according to the local lag weights of the meteorological variable at different preset lag periods in the historical data corresponding to the training sample data. In this embodiment, it is illustrated by taking the time length of the training sample data to be the same as the preset sliding window as an example. Those skilled in the art can also select data within multiple preset sliding windows to construct a set of training sample data. Then, the local lag weights of each meteorological variable at different preset lag periods can preferably be the means within multiple windows.
[0055] After generating the lag weight matrix of each set of training sample data according to multiple local lag weight vectors, feature reconstruction is performed on the time series data of each meteorological variable in the training sample data through the local lag weight vector corresponding to each meteorological variable in the lag weight matrix. Specifically, it includes extracting the eigenvalue of the meteorological variable at different preset lag periods from the training sample data. For example, the temperature at multiple lag periods such as 1h, 3h, 6h, 12h, etc. before the current time point for the variable of precipitation. Then, the local lag weight of each preset lag period is determined according to the local lag weight vector, and the multiple eigenvalues of the meteorological variable at different preset lag periods are subjected to feature fusion to generate the lag impact aggregation feature of each meteorological variable in the training sample data. It is used to comprehensively represent the aggregation feature of the temperature in the sample data. In this way, the lag impact aggregation feature corresponding to each meteorological variable in the training sample data is generated.
[0056] The lag perception layer is used to adjust the lag impact aggregation features of multiple meteorological variables according to the lag perception unit, and generate lag dynamic adjustment features corresponding to each lag impact aggregation feature. Among them, the lag perception unit is a conventional gating unit in the LSTM model, mainly used to process multiple lag impact aggregation features generated by the feature reconstruction layer, including dynamically adjusting the contribution weights of each lag feature, analyzing which lag factors are more important. During the model training process, the LSTM gating parameters in the lag perception unit are iteratively updated through backpropagation to learn how to select more important lag features according to the context.
[0057] The LSTM layer is used to splice multiple lag dynamic adjustment features of each set of training sample data with the included historical meteorological record data to generate historical meteorological time series features, and perform time series modeling on the historical meteorological time series features through LSTM units. Compared with the above-mentioned lag perception unit, the LSTM layer splices the lag dynamic adjustment features after feature importance analysis with the sequence data of different meteorological variables in the training sample data, and performs time series modeling on the data after splicing the lag features through a gating mechanism to capture the dynamic change features of meteorological variables.
[0058] In this process, taking a certain set of training sample data as an example, which contains the sequence data of multiple meteorological variables before 12:00 noon on a certain day, and using the water level data at 1:00 pm as the prediction label. In the conventional model training process, prediction is carried out by analyzing the multiple sequence data before 12:00. The above scheme is to reconstruct the features of the sequence data of multiple meteorological variables before 12:00 to obtain the aggregated features of each meteorological variable, such as the comprehensive rainfall value (19.5 mm), the comprehensive temperature value (26.2 °C), the real-time rainfall (35 mm), the real-time temperature (29 °C), to form the historical meteorological time series features of the training sample data, and use the water level observation value at 1:00 pm as the label for model training.
[0059] The output layer is used to output the water level prediction result of the water level prediction model. Specifically, the hidden state features output by the LSTM layer are mapped to prediction values through a fully connected layer, and then the prediction result is output through the output layer.
[0060] For the above water level prediction model, by introducing a feature reconstruction layer into the conventional LSTM network, and through a lag weight matrix constructed according to historical data, aggregating meteorological data of multiple time steps to transform high-dimensional redundant features into low-dimensional physical representations, it can well reduce the complexity of model training. The dynamic weight adjustment of the lag perception layer has good scene adaptability. Since the attention to the lag characteristics of different meteorological variables will change under different meteorological scenarios such as heavy rain and snowmelt, for example, in the heavy rain scenario, more attention is paid to the short-term lag rainfall variable, and in the snowmelt scenario, more attention is paid to the long-term lag temperature variable. In the iterative training process of the model, the lag perception unit adapts to the attention degree of the aggregated features of different lag effects based on the dynamic change of the meteorological scene by learning the rules in the sample data, so that the model can flexibly adapt to the lag effect differences under different meteorological scenarios such as heavy rain and snowmelt. In the actual prediction process, it can dynamically adjust the lag features of different meteorological variables according to the real-time meteorological scene as the input of the LSTM, so that the model focuses on the most relevant historical information in the current scene, and solves the scene generalization bottleneck of traditional static models.
[0061] In an alternative solution, for the loss of the water level prediction model during training, the target loss function of the water level prediction model includes two parts: the water level prediction loss based on the water level critical constraint and the lag gradient matching loss. Specifically, the target loss function is:
[0062] ;
[0063] In the formula, represents the total loss of the water level prediction model, represents the predicted value output by the water level prediction model, represents the predicted value corresponding true value in the sample dataset, represents the water level critical constraint weight under the water level critical constraint. In this process, the difference between the predicted value and the true value is constrained by the water level critical constraint weight, making the model pay more attention to the water level critical phenomenon during training. Specifically, when the water level is close to the threshold, the penalty for the prediction error is amplified, and the attention degree of the model to the low water level state is reduced to form the water level prediction loss based on the water level critical constraint. represents the lag-weighted feature of the th meteorological variable, that is, the lag impact aggregation feature after feature fusion of the eigenvalue under different preset lag periods mentioned above, represents the partial derivative of the predicted value of the water level prediction model with respect to the lag-weighted feature of the th meteorological variable, represents the predicted value corresponding true value with respect to the partial derivative of the lag-weighted feature of the th meteorological variable, represents the total time step, represents the total number of meteorological variables, thus forming the lag gradient matching loss, which is used to control the gradient change law of the model learning lag features, so that the response of the model to lag features is as consistent as possible with the true lag characteristics. The gradient can be understood as the amplitude of the current water level change when the lag feature at a certain moment (such as the rainfall amount 3 hours ago) increases by 1 unit. During the training process of the model, it may achieve short-term water level prediction based on the current rainfall in a timely manner, rather than predicting through the rainfall amount with a 3-hour lag. Although the short-term prediction result may be accurate in this case, the long-term prediction is prone to failure. For example, after the rainfall stops, the water level is wrongly predicted to continue to rise. If the rainfall variable with a 3-hour lag has a high gradient in the actual sample data, it can be corrected through the lag gradient matching loss. represents the hyperparameter, which is optimized through the training process and is used to balance the consistency between the prediction accuracy and the gradient change law.
[0064] For the optimized design of the above target loss function, by introducing dynamic weight penalties for the water level critical interval in the loss function, the model can prioritize ensuring the prediction accuracy near the warning water level and reduce the risk of false alarms and missed reports. The gradient matching loss constrains the sensitivity of the model's predictions to meteorological variables to be consistent with the gradient pattern, avoiding counter-intuitive predictions caused by pure data-driven methods. Combining the dual constraints of critical state perception and gradient change patterns can effectively improve the credibility and generalization ability of the model, and show stronger robustness in scenarios with scarce data or extreme events.
[0065] In an alternative solution, for the introduction of water level critical constraints in the long short-term memory network model described above, the setting of the water level critical constraint weight specifically includes:
[0066] Generate the water level critical constraint threshold according to the critical feature sequence. Among them, the critical feature sequence includes the critical feature parameters corresponding to multiple water level critical events in the historical water level record data. After generating the critical feature sequence containing multiple critical feature parameters, determine the water level critical constraint threshold of the historical water level record data according to the multiple critical feature parameters in the critical feature sequence. In this embodiment, the water level critical constraint threshold is set by the preset quantile of multiple critical feature parameters. For example, the 95% quantile of multiple critical feature parameters is used as the water level critical constraint threshold for early warning.
[0067] And determine the water level critical constraint weight in the target loss function based on the water level critical constraint threshold:
[0068] ;
[0069] In the formula, represents the critical feature parameter corresponding to the input data associated with the predicted value output by the water level prediction model, represents the water level critical constraint threshold. Combine the sigmoid function to determine the water level critical constraint weight in the water level prediction loss, thereby realizing the control of the model to focus on the critical state of abnormal water level changes.
[0070] Please refer to Figure 3 , based on the same inventive concept, this embodiment also provides a water level prediction system, including:
[0071] A historical data acquisition module for collecting historical meteorological record data and historical water level record data of the target basin;
[0072] A data discretization processing module for discretizing multiple meteorological variables in the historical water level record data and historical meteorological record data to obtain historical water level discrete feature data and historical meteorological discrete feature data;
[0073] The lag feature analysis module is used to perform a sliding window process on the historical water level discrete feature data and the historical meteorological discrete feature data, calculate multiple mutual informations between each meteorological variable and the water level under each preset sliding window, and determine the local lag features of each meteorological variable within the preset sliding window, including the local lag weights under different preset lag periods. It traverses the historical water level discrete feature data and the historical meteorological discrete feature data to extract the global lag data between each meteorological variable and the water level;
[0074] The critical state analysis module is used to perform water level critical analysis on the historical water level record data, including determining multiple water level critical events in the historical water level record data, extracting the critical feature parameters of each water level critical event, and constructing a critical feature sequence;
[0075] The water level prediction management module is used to construct a sample data set for training the water level prediction model based on the historical meteorological record data, the historical water level record data, and multiple groups of global lag data. The sample data set contains multiple groups of training sample data, and realizes the water level prediction of the target basin through the trained water level prediction model;
[0076] Among them, the water level prediction model is an improved long short-term memory network model, including adding a feature reconstruction unit and a lag perception unit to the long short-term memory network model and introducing a water level critical constraint, which is used to capture the meteorological variable lag features and water level critical state features in the input data.
[0077] The water level prediction model includes an input layer, a feature reconstruction layer, a lag perception layer, an LSTM layer, and an output layer. The input layer is used to receive multiple groups of training sample data. The feature reconstruction layer is used to perform feature reconstruction on multiple groups of training sample data based on multiple groups of global lag data, including constructing a lag weight matrix according to multiple groups of global lag data, and performing feature reconstruction on multiple groups of training sample data respectively through the lag weight matrix to generate the lag impact aggregation features of each meteorological variable in each group of training sample data. The lag perception layer is used to adjust the lag impact aggregation features of multiple meteorological variables according to the lag perception unit to generate the lag dynamic adjustment features corresponding to each lag impact aggregation feature. The LSTM layer is used to splice the multiple lag dynamic adjustment features of each group of training sample data with the included historical meteorological record data to generate historical meteorological time series features, and perform time series modeling on the historical meteorological time series features through LSTM units. The output layer is used to output the water level prediction result of the water level prediction model.
[0078] The above are only the specific implementation manners of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The parts not described in detail in this specification belong to the prior art well-known to those skilled in the art.
Claims
1. A water level prediction method, characterized in that: include: Collect historical meteorological record data and historical water level record data of the target basin, discretize multiple meteorological variables in the historical water level record data and historical meteorological record data, and obtain historical water level discrete feature data and historical meteorological discrete feature data; Perform sliding window processing on the historical water level discrete feature data and the historical meteorological discrete feature data, calculate multiple mutual information between each meteorological variable and the water level under each preset sliding window, determine the local lag characteristics of each meteorological variable within the preset sliding window, including the local lag weight under different preset lag periods, traverse the historical water level discrete feature data and the historical meteorological discrete feature data, and extract the global lag data between each meteorological variable and the water level; Perform water level critical analysis on historical water level record data, including determining multiple water level critical events in the historical water level record data, extracting critical characteristic parameters of each water level critical event and constructing a critical characteristic sequence; A sample data set for training a water level prediction model is constructed based on historical meteorological record data, historical water level record data and multiple sets of global lag data. The sample data set contains multiple sets of training sample data. The water level prediction of the target basin is realized through the trained water level prediction model. Among them, the water level prediction model is an improved long short-term memory network model, which includes adding feature reconstruction units and lag perception units in the long short-term memory network model and introducing water level critical constraints to capture the lag characteristics of meteorological variables and water level critical state characteristics in the input data.
2. A water level prediction method according to claim 1, characterized in that: For the water level prediction model, also include: The water level prediction model includes an input layer, a feature reconstruction layer, a lag perception layer, an LSTM layer and an output layer. The input layer is used to receive multiple groups of training sample data. The feature reconstruction layer is used to perform feature reconstruction on multiple groups of training sample data based on multiple groups of global lag data, including building a lag weight matrix according to multiple groups of global lag data, reconstructing features of multiple groups of training sample data respectively through the lag weight matrix, and generating a lag influence aggregation feature of each meteorological variable in each group of training sample data. The lag perception layer is used to adjust the lag influence aggregation features of multiple meteorological variables according to the lag perception unit, and generate a lag dynamic adjustment feature corresponding to each lag influence aggregation feature. The LSTM layer is used to splice multiple lag dynamic adjustment features of each group of training sample data with the historical meteorological record data contained therein to generate historical meteorological time series features, and perform time series modeling on the historical meteorological time series features through the LSTM unit. The output layer is used to output the water level prediction result of the water level prediction model. Among them, the objective loss function of the water level prediction model includes the water level prediction loss based on the water level critical constraint and the hysteresis gradient matching loss. The objective loss function is: ; In the formula, represents the total loss of the water level prediction model, represents the predicted value output by the water level prediction model, Represents the predicted value The corresponding true value in the sample data set, Indicates The lagged weighted characteristics of meteorological variables, The predicted value of the water level prediction model is The partial derivative of the lagged weighted characteristics of the meteorological variables, Represents the predicted value The corresponding true value About The partial derivative of the lagged weighted characteristics of the meteorological variables, represents the total time step, represents the water level critical constraint weight under the water level critical constraint, represents the hyperparameter, Represents the total number of meteorological variables.
3. A water level prediction method according to claim 2, characterized in that: Feature reconstruction of multiple sets of training sample data is performed based on multiple sets of global lag data, including: According to the local lag characteristics of each meteorological variable under each preset sliding window, a local lag weight vector of each meteorological variable in each group of training sample data is generated. The time length of the training sample data is the same as the preset sliding window. According to multiple local lag weight vectors, a lag weight matrix of each group of training sample data is generated. Through the local lag weight vectors corresponding to each meteorological variable in the lag weight matrix, the time series data of each meteorological variable in the training sample data is reconstructed, including extracting the eigenvalues of the meteorological variables at different preset lag periods from the training sample data, determining the local lag weights of each preset lag period according to the local lag weight vector, and fusing the multiple eigenvalues of the meteorological variables through multiple local lag weights to generate the lag influence aggregation characteristics of each meteorological variable in the training sample data.
4. A water level prediction method according to claim 2, characterized in that: For the introduction of water level critical constraints in the long short-term memory network model, it also includes: The water level critical constraint threshold is generated according to the critical feature sequence, wherein the critical feature sequence includes the critical feature parameters corresponding to multiple water level critical events in the historical water level record data, and the water level critical constraint weight in the objective loss function is determined based on the water level critical constraint threshold: ; In the formula, It represents the critical characteristic parameters corresponding to the input data associated with the predicted value output by the water level prediction model. Indicates the water level critical constraint threshold.
5. A water level prediction method according to claim 1, characterized in that: The critical characteristic parameters of each water level critical event are extracted, including: The water level critical characteristic data and water level stable characteristic data of each water level critical event are extracted, and the water level critical characteristic sequence and water level stable characteristic sequence of each water level critical event are constructed. The water level critical fluctuation parameters and state change parameters of the water level critical event are calculated according to the water level critical characteristic sequence. The water level stable fluctuation parameters of the water level critical event are calculated according to the water level stable characteristic sequence. The average of the water level stable fluctuation parameters of multiple water level critical events is taken as the water level stable fluctuation reference value. For any water level critical event, the ratio of the water level critical fluctuation parameter to the water level stable fluctuation reference value is calculated, and multiplied with the state change parameter of the water level critical event to obtain the critical characteristic parameter of the water level critical event. After generating a critical characteristic sequence containing multiple critical characteristic parameters, the water level critical constraint threshold of the historical water level record data is determined according to the multiple critical characteristic parameters in the critical characteristic sequence.
6. A water level prediction method according to claim 1, characterized in that: Calculate multiple mutual information between each meteorological variable and water level under each preset sliding window, and determine the local hysteresis characteristics of each meteorological variable within the preset sliding window, including: Determine multiple preset lag periods for each meteorological variable. For any preset sliding window, construct a local lag feature sequence of the meteorological variable at each preset lag period based on the historical meteorological discrete feature data in the preset sliding window, extract the local water level feature sequence corresponding to the historical water level discrete feature data in the preset sliding window, calculate the mutual information between the local lag feature sequence of the meteorological variable at each preset lag period and the local water level feature sequence, and obtain the local lag characteristics of the meteorological variable in the preset sliding window.
7. A water level prediction system, characterized in that: The system is used to implement a water level prediction method according to any one of claims 1 to 6, comprising: A historical data acquisition module is used to collect historical meteorological record data and historical water level record data of the target basin; The data discretization processing module is used to discretize multiple meteorological variables in the historical water level record data and the historical meteorological record data to obtain the historical water level discrete feature data and the historical meteorological discrete feature data; The hysteresis feature analysis module is used to perform sliding window processing on the historical water level discrete feature data and the historical meteorological discrete feature data, calculate multiple mutual information between each meteorological variable and the water level under each preset sliding window, determine the local hysteresis feature of each meteorological variable in the preset sliding window, including the local hysteresis weight under different preset hysteresis periods, traverse the historical water level discrete feature data and the historical meteorological discrete feature data, and extract the global hysteresis data between each meteorological variable and the water level; The critical state analysis module is used to perform water level critical analysis on the historical water level record data, including determining multiple water level critical events in the historical water level record data, extracting the critical characteristic parameters of each water level critical event and constructing a critical characteristic sequence; The water level prediction management module is used to construct a sample data set for training the water level prediction model based on historical meteorological record data, historical water level record data and multiple sets of global lag data. The sample data set contains multiple sets of training sample data. The water level prediction of the target basin is realized through the trained water level prediction model. Among them, the water level prediction model is an improved long short-term memory network model, which includes adding feature reconstruction units and lag perception units in the long short-term memory network model and introducing water level critical constraints to capture the lag characteristics of meteorological variables and water level critical state characteristics in the input data.
Citation Information
Patent Citations
Ground subsidence prediction method, training method, device and equipment
CN117648873A
Evaluation and prediction system for water environment bearing capacity of lake basin in arid region
CN119129827A