Water level prediction method and system
By discretizing and sliding window analysis of historical meteorological and water level data, global lag data and water level critical feature sequences were extracted, and sample data sets were constructed for training improved long and short-term memory network models, which solved the problem that existing water level prediction technology failed to fully consider the lag characteristics and water level critical state of meteorological variables, and achieved high-precision and highly adaptable water level prediction.
Patent Information
- Application Number
- CN202510444418.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-04-10
AI Technical Summary
The existing water level prediction technology fails to fully consider the difference in hysteresis characteristics of the impact of meteorological variables on water level, resulting in insufficient prediction effect, especially lack of attention in the identification of critical water level 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 and the critical feature sequence of water level are extracted, and a sample data set is constructed for training the improved long and short-term memory network model. This model adds feature reconstruction units, hysteresis sensing units and water level critical constraints to the LSTM network to capture the hysteresis and water level critical state characteristics of meteorological variables.
Through the improved water level prediction model, the differentiated lag law of the impact of different meteorological variables on water level can be effectively captured, the model's attention to the critical state of water level, and the accuracy and adaptability of water level prediction can be improved.
Smart Images

Figure CN119962767A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water level prediction, and in particular to a water level prediction method and system. Background Art
[0002] Accurate water level prediction is the core link of the flood prevention and disaster reduction system. In related research, data-driven methods based on time series prediction networks to achieve water level prediction have gradually become a hot topic in water level prediction research. However, some deep learning modeling processes directly use the original time series meteorological data as the input of the model for model training, without fully considering the differences in the hysteresis characteristics of different meteorological variables on water levels. For example, the immediate impact effect of short-term heavy rainfall on water levels and the delayed effect of sustained low temperatures on snow melting have completely different response mechanisms. In addition, although the time series prediction model can capture the hysteresis 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 hysteresis patterns. For example, in heavy rain events, the sensitivity of water levels to short-lag rainfall factors is significantly increased, while long-lag temperature factors in the snowmelt season may become the dominant factor. In the process of water level prediction, the identification of critical water level states needs more attention, while the state in stable periods can be appropriately reduced. 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 solution provided by the present invention is as follows. In a first aspect, the present invention provides a water level prediction method, comprising: 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.
[0005] Preferably, the water level prediction model further includes: 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.
[0006] Preferably, 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.
[0007] Preferably, the method further includes: introducing a water level critical constraint into the long short-term memory network model; 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.
[0008] Preferably, 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.
[0009] Preferably, multiple mutual information between each meteorological variable and the water level under each preset sliding window is calculated to 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.
[0010] A second aspect provides a water level prediction system, which is used to implement the above-mentioned water level prediction method, including: 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.
[0011] The present invention has the following beneficial effects: The present invention discretizes the historical meteorological record data and the historical water level dynamic change data of the target basin, adopts the strategy based on sliding window mutual information analysis to mine the time series evolution law of the influence of different meteorological variables on water level, obtains the global lag data between meteorological variables and water level, performs water level critical analysis on the historical water level record data, mines the fluctuation characteristics and mutation law under the critical state of water level to extract the critical feature sequence, combines the historical data with the global lag data to construct the training sample data, improves the long short-term memory network model with the global lag data and the critical feature sequence to obtain the water level prediction model, including the introduction of water level critical constraint mechanism, dynamic feature reconstruction mechanism and lag perception mechanism, which can effectively capture the differentiated lag law of the influence of different meteorological variables on water level, enhance the model's attention to the critical state of water level, and make the model more adaptable to complex meteorological scenes, thereby realizing high-precision water level prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 The figure is a flow chart of a water level prediction method according to an embodiment of the present invention.
[0013] Figure 2 It is a schematic diagram of the structure of an exemplary water level prediction model according to an embodiment of the present invention.
[0014] Figure 3 The figure is a schematic diagram of the structure of a water level prediction system according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0015] In order to make the technical scheme in the present invention better understood by the persons skilled in the art, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with 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.
[0016] See also Figure 1 and Figure 2 An exemplary water level prediction method of the present invention comprises the following steps: Step S01, collecting historical meteorological record data and historical water level record data of the target basin, discretizing multiple meteorological variables in the historical water level record data and historical meteorological record data, and obtaining historical water level discrete feature data and historical meteorological discrete feature data.
[0017] In this step, for a certain basin that needs to be analyzed for water level forecasting, i.e., the target basin, such as a river channel or a reservoir, the historical meteorological record data of the basin includes the record data of multiple meteorological variables such as temperature, precipitation, humidity, wind speed, etc. in the past six months or a year, and the historical water level record data includes the water level data of one or more hydrological monitoring points in the basin, such as the water level monitoring data of a dam or reservoir. The historical data provides the relationship between hydrology and meteorology in the target basin. First, these data are discretized to convert continuous meteorological data and water level data into discrete feature values, such as the temperature is divided into a discrete category every 5°C, and finally the historical meteorological discrete feature data containing information such as timestamp, rainfall category, temperature category, wind speed category, etc., and the historical water level discrete feature data containing information such as timestamp, discrete water level category, and original water level value are obtained.
[0018] Step S02, 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, 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.
[0019] In this step, the sliding window technology is used to analyze the discretized historical water level characteristic data and meteorological characteristic data, and the data is traversed through a window of preset size. The size of the sliding window can be reasonably set according to factors such as the basin area. For example, in large basins, 24 hours is selected to ensure the analysis accuracy. For the data in each preset sliding window, a lag analysis is performed on each meteorological variable. 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, the local distribution of the meteorological variable at each preset lag period is constructed according to the historical meteorological discrete characteristic data in the preset sliding window. The lag feature sequence extracts the local water level feature sequence corresponding to the historical water level discrete feature data in the preset sliding window, and then calculates the mutual information between the local lag feature sequence and the local water level feature sequence of the meteorological variable at each preset lag period to characterize the degree of association between the meteorological variable and the water level data at different lag periods, thereby obtaining the local lag weights at different lag periods. The local lag feature of each meteorological variable in the preset sliding window includes a plurality of local lag weights corresponding to the preset lag periods. The larger the conditional mutual information corresponding to the lag period, the larger the local lag weight, which is used to quantify the lag effect intensity of the meteorological variable on the water level. The local lag feature of each meteorological variable in the preset sliding window is obtained in the above manner, revealing the mutual influence relationship between different meteorological variables and water levels. After traversing the historical water level discrete feature data and the historical meteorological discrete feature data, multiple groups of local lag features are obtained, and finally the global lag data corresponding to each meteorological variable and the water level are generated, which can characterize the change phenomenon of the lag association between meteorological variables and water levels in different periods.
[0020] Step S03, performing 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 critical characteristic parameters of each water level critical event and constructing a critical characteristic sequence; In this step, water level critical analysis aims to identify key events in historical water level record data, which can be situations where the water level reaches a certain critical value, such as a flood warning line, so as to conduct a more in-depth analysis of some data that are representative of water level changes. After determining multiple water level critical events through preset critical values, the water level change data for a period of time before and after the critical state can be extracted, and feature analysis can be performed on these data to extract the critical feature parameters that characterize the water level change law in the water level critical event, and then a critical feature sequence is constructed based on multiple critical feature parameters.
[0021] In an optional scheme, for the calculation of critical characteristic parameters, the water level critical characteristic data and water level stable characteristic data of each water level critical event are first 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 in the process of the water level starting to rise at a certain growth rate, and the water level stable characteristic data is the state change data in the period of time when the water level phase is stable and has small fluctuations 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 a critical value (such as a flood warning line or a low water line), such as the degree of mutation of the water level, the rate of change, etc. The water level stable characteristic data refers to the stability index of the water level in a non-critical state, which is usually expressed as a relatively stable state with small changes in the water level.
[0022] According to the water level critical characteristic data, a water level critical characteristic sequence representing the rapid growth and change of the water level is constructed, and the water level critical fluctuation parameter representing the fluctuation characteristics of the water level before the critical phenomenon occurs in the water level critical event is calculated, and the state change parameter representing the continuous characteristics of the water level change state before the critical phenomenon occurs is 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. According to 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, and the change of the water level in the stable state is measured by the variance. According to the water level stable characteristic sequence, the water level stable fluctuation parameter of the water level critical event is calculated.
[0023] Then, the average of the water level steady fluctuation parameters of multiple water level critical events is taken as the water level steady 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 steady 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 parameter 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 in 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 critical state of the water level.
[0024] Step S04: construct a sample data set for training a water level prediction model based on historical meteorological record data, historical water level record data and multiple sets of global lag data, and realize water level prediction for the target basin through the trained water level prediction model.
[0025] In this step, through the aforementioned critical analysis, the critical change characteristics of the water level in the historical data and the hysteresis change characteristics between different meteorological variables and the water level are extracted. Through these characteristic information, a sample data set for training the water level prediction model is finally constructed based on the historical meteorological record data, the historical water level record data and multiple sets of global hysteresis 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 a window constitutes the training sample data, which includes the change sequence of the water level in the target basin within the window and the change sequence of multiple meteorological variables, as well as the local hysteresis characteristics of multiple meteorological variables in the preset sliding window in the historical data corresponding to the change sequence.
[0026] For the water level prediction model, specifically the improved long short-term memory network model, LSTM is an effective neural network structure for processing time series data, which can capture the long-term and short-term dependencies in the sequence data. However, the original LSTM model has certain deficiencies in the response processing of the complex hysteresis characteristics of dynamic changes and the critical state characteristics of water level changes. This embodiment is improved in the LSTM network for this situation, and a feature reconstruction unit and a hysteresis perception unit are added. The feature reconstruction unit can reconstruct the input meteorological and water level data based on the hysteresis characteristics, and improve the model's recognition ability of dynamic hysteresis characteristics in complex data patterns. The hysteresis perception unit further analyzes the hysteresis characteristics related to the reconstructed meteorological variables in the input data in depth, identifies the importance of different hysteresis characteristics, and facilitates the conventional LSTM to pay more attention to some key hysteresis characteristics in the process of analyzing the characteristics of different meteorological variables that transmit information over time in the process of time series modeling of data, so as to facilitate the model to accurately capture the complex relationship between meteorological factors and water levels. At the same time, the water level critical constraint is introduced into the training process of the model to help the model identify the critical state characteristics of the water level, and pay more attention to the impact of the water level approaching the critical state when predicting. After the water level prediction model is obtained through training of 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, and training the water level state in the basin at a certain time in the future through the model. The water level prediction of the target basin is effectively realized.
[0027] In an optional solution, for the above-mentioned 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.
[0028] 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 sequence of multiple meteorological variables and the local lag features corresponding to different meteorological variables.
[0029] The feature reconstruction layer is used to reconstruct features of multiple sets of training sample data based on multiple sets of global lagged data, including constructing a lagged weight matrix according to multiple sets of global lagged data, performing weighted aggregation on multiple sets of training sample data through the lagged weight matrix to achieve feature reconstruction, and generating lagged impact aggregation features corresponding to each meteorological variable in each set of training sample data.
[0030] Among them, for the process of feature reconstruction, 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 set of training sample data is generated, that is, according to the historical data corresponding to the training sample data, the local lag weights of the meteorological variables at different preset lag periods are constructed. In this embodiment, the time length of the training sample data is the same as the preset sliding window as an example for explanation. Those skilled in the art can also select data in multiple preset sliding windows to construct a set of training sample data. Then the local lag weight of each meteorological variable at different preset lag periods can be preferably the mean value in multiple windows.
[0031] After generating the lag weight matrix of each group of training sample data according to multiple local lag weight vectors, the time series data of each meteorological variable in the training sample data is reconstructed by using the local lag weight vectors corresponding to each meteorological variable in the lag weight matrix, specifically including extracting the characteristic values of meteorological variables at different preset lag periods from the training sample data, such as the temperature of the variable precipitation at multiple lag periods such as 1h, 3h, 6h, and 12h before the current time point, and then determining the local lag weight of each preset lag period according to the local lag weight vector, and performing feature fusion on multiple characteristic values of the meteorological variables at different preset lag periods to generate the lag influence aggregation features of each meteorological variable in the training sample data. The aggregation features used to comprehensively characterize the temperature in the sample data are used to generate the lag influence aggregation features corresponding to each meteorological variable in the training sample data in this way.
[0032] The lag perception layer is used to adjust the lag effect aggregation features of multiple meteorological variables according to the lag perception unit, and generate the lag dynamic adjustment features corresponding to each lag effect aggregation feature. Among them, the lag perception unit is a conventional gating unit in the LSTM model, which is mainly used to process multiple lag effect aggregation features generated by the feature reconstruction layer, including dynamically adjusting the contribution weights of each lag feature and 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 back propagation to learn how to select more important lag features according to the context.
[0033] The LSTM layer is used to splice multiple lagged dynamic adjustment features of each set 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. Compared with the above-mentioned lagged perception unit, the LSTM layer splices the lagged 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 lagged features through the gating mechanism to capture the dynamic state change characteristics of the meteorological variables.
[0034] In this process, taking a set of training sample data as an example, it contains sequence data of multiple meteorological variables before 12 noon on a certain day, and the water level data at 1 pm is used as the prediction label. In the conventional model training process, prediction is made by analyzing multiple sequence data before 12 o'clock. The above scheme reconstructs the features of the sequence data of multiple meteorological variables before 12 o'clock to obtain the aggregated features of each meteorological variable, such as the comprehensive rainfall value (19.5mm), the comprehensive temperature value (26.2°C), the real-time rainfall (35mm), and the real-time temperature (29°C), to form the historical meteorological time series features of the training sample data, and uses the water level observation value at 1 pm as the label for model training.
[0035] The output layer is used to output the water level prediction results of the water level prediction model. Specifically, the hidden features output by the LSTM layer are mapped to prediction values through the fully connected layer, and then the prediction results are output through the output layer.
[0036] The above-mentioned water level prediction model can reduce the complexity of model training by introducing a feature reconstruction layer in the conventional LSTM network and aggregating meteorological data of multiple time steps to convert high-dimensional redundant features into low-dimensional physical representations through the lag weight matrix constructed according to historical data. The dynamic weight adjustment of the lag perception layer has a good scene adaptation ability. Due to the change in the attention of the lag characteristics of different meteorological variables in different meteorological scenes such as heavy rain and snowmelt, for example, in heavy rain scenes, more attention is paid to short-term lagged rainfall variables, while in snowmelt, more attention is paid to long-term lagged temperature variables. During the iterative training process of the model, the lag perception unit learns the rules in the sample data and realizes the adaptive adjustment of the attention of the aggregation features of different lag effects based on the dynamic change of meteorological scene adjustment, so that the model can flexibly adapt to the differences in lag effects in different meteorological scenes such as heavy rain and snowmelt. In the actual prediction process, the lag characteristics of different meteorological variables can be dynamically adjusted according to the real-time meteorological scene as the input of LSTM, so that the model focuses on the most relevant historical information in the current scene, solving the scene generalization bottleneck of traditional static models.
[0037] In an optional solution, for the loss of the water level prediction model during the training process, 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: ; 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, It 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, so that the model pays more attention to the water level critical phenomenon during the training process. Specifically, when the water level is close to the threshold, the penalty for the prediction error is amplified, and the model's attention to the low water level state is reduced, so as to constitute the water level prediction loss based on the water level critical constraint. Indicates The lagged weighted features of the meteorological variables, that is, the lagged impact aggregation features after the feature fusion of the feature values under different preset lag periods, 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 total number of meteorological variables, thus constituting the lagged gradient matching loss, which is used to control the gradient change law of the model learning lagged features, so that the model's response to the lagged features is as consistent as possible with the true lagged characteristics. The gradient can be understood as the amplitude of the current water level change when the lagged feature at a certain moment (such as the rainfall 3 hours ago) increases by 1 unit. During the training process, the model may timely realize short-term water level prediction based on the current rainfall, rather than predicting by, for example, 3h lagged rainfall. Although the short-term prediction results may be accurate in this case, the long-term prediction is prone to failure. For example, it is wrong to predict that the water level will continue to rise after the rainfall stops. In the actual sample data, if the rainfall variable with a 3h lag has a high gradient, it can be corrected by the lagged gradient matching loss. Represents a hyperparameter, which is optimized during the training process to balance the prediction accuracy and the consistency of the gradient change law.
[0038] For the optimization design of the above-mentioned objective loss function, by introducing a dynamic weight penalty for the critical interval of water level into the loss function, the model can give priority to ensuring the prediction accuracy near the warning water level and reduce the risk of false alarms and omissions. The gradient matching loss constrains the model prediction sensitivity to meteorological variables to be consistent with the gradient law, avoiding counterintuitive predictions caused by pure data drive. The dual constraints of critical state perception and gradient change law can greatly improve the credibility and generalization ability of the model, and show stronger robustness in scenarios with scarce data or extreme events.
[0039] In an optional solution, for the above-mentioned introduction of water level critical constraints in the long short-term memory network model, the setting of water level critical constraint weights specifically includes: A water level critical constraint threshold is generated according to a critical feature sequence, wherein the critical feature sequence includes critical feature parameters corresponding to multiple water level critical events in the historical water level record data. After the critical feature sequence including multiple critical feature parameters is generated, the water level critical constraint threshold of the historical water level record data is determined 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 quantiles 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.
[0040] 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. It represents the critical constraint threshold of the water level, and is combined with the sigmoid function to determine the critical constraint weight of the water level in the water level prediction loss, so as to achieve the critical state of the control model focusing on the abnormal change of the water level.
[0041] See also Figure 3 Based on the same inventive concept, this embodiment also provides a water level prediction system, including: 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;
[0042] 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.
[0043] 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 reconstruct the features of the multiple groups of training sample data based on multiple groups of global lag data, including building a lag weight matrix according to the multiple groups of global lag data, reconstructing the features of the multiple groups of training sample data respectively through the lag weight matrix, and generating the lag influence aggregation features 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 the lag dynamic adjustment features corresponding to each lag influence aggregation feature. The LSTM layer is used to splice the 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.
[0044] The above is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. Parts not described in detail in this specification belong to the prior art 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
Photovoltaic power prediction method and system based on multi-characteristic variable and time sequence correlation
CN118734079A
Evaluation and prediction system for water environment bearing capacity of lake basin in arid region
CN119129827A
Water level sequence data monitoring and early warning method based on big data
CN119785534A
Model training method, power prediction method, and device
WO2024198769A1