Rainfall rolling prediction method and device, electronic equipment and storage medium
By combining ConvLSTM and traceless Kalman filtering methods, the model parameters and prediction error thresholds are dynamically adjusted, and the traditional rainfall prediction is achieved, which is suitable for agricultural production and disaster prevention and mitigation and other applications.
Patent Information
- Application Number
- CN202510478228.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-08-19
AI Technical Summary
Traditional rainfall prediction methods lack accuracy under complex nonlinear and non-stationary climate conditions, and deep learning model parameters cannot be updated online, resulting in a decrease in prediction accuracy over time.
Combining the ConvLSTM model and untraceable Kalman filtering, the ConvLSTM model is preprocessed by obtaining historical meteorological data, and pre-training is constructed. The prediction state is corrected using untraceable Kalman filtering, the model parameters are dynamically adjusted, and the prediction-correction-update cycle is repeatedly performed during the rolling prediction process, and the threshold is dynamically adjusted according to the prediction error triggers the model to retrain.
High accuracy and timeliness prediction of rainfall in non-stationary climatic conditions are achieved, the stability and adaptability of the model are maintained, and it is suitable for agricultural production, flood control and disaster reduction and urban stormwater management.
Smart Images

Figure CN120509515A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural disaster early warning technology, and in particular to a rainfall rolling prediction method, device, electronic equipment and storage medium. Background Art
[0002] Rainfall forecasting is an extremely important part of weather forecasting, and has a significant impact on agricultural production, flood prevention and disaster reduction, urban rainwater management, and water resources scheduling.
[0003] Traditional rainfall forecasting mostly relies on numerical weather prediction (NWP) models or empirical models based on statistics. These methods are prone to inaccuracy under complex, nonlinear, and non-stationary climate conditions. Deep learning methods (such as ConvLSTM, a time series prediction model that combines convolutional neural networks and long short-term memory networks) have advantages in spatiotemporal series forecasting. However, when faced with constantly updated measured data, parameters cannot be automatically updated and optimized online, resulting in a potential decline in model prediction accuracy over time. Summary of the Invention
[0004] The main purpose of the present invention is to provide a rainfall rolling forecast method, device, electronic device and storage medium, which can greatly improve the accuracy and timeliness of rainfall forecasts.
[0005] To achieve the above objectives, the present application provides a first aspect of a rainfall rolling forecasting method, the method comprising:
[0006] Obtain historical meteorological data and preprocess it to obtain sample data;
[0007] Constructing a ConvLSTM model, and pre-training the ConvLSTM model using the sample data to obtain a trained prediction model;
[0008] Correcting the prediction state of the trained prediction model through unscented Kalman filtering, and dynamically adjusting the model parameters using the correction result;
[0009] During the rolling forecast process, the time series window is dynamically adjusted and the forecast-correction-update cycle is repeatedly executed to achieve online optimization of the model parameters;
[0010] The threshold is dynamically adjusted according to the prediction error, and model retraining is triggered when the error exceeds the set threshold.
[0011] Optionally, the historical meteorological data includes but is not limited to temperature, air pressure, humidity, wind direction, wind speed, precipitation, tropopause height delay, and wet delay element;
[0012] The acquisition of historical meteorological data and preprocessing to obtain sample data includes:
[0013] The historical meteorological data are quality controlled to remove physically unreasonable values and extreme outliers, and the missing data are processed by interpolation. Then, the minimum-maximum normalization is used to map each meteorological element to the interval [0,1].
[0014] The historical meteorological data are divided into a training set, a validation set and a test set in chronological order to obtain the sample data.
[0015] Optionally, the ConvLSTM model includes:
[0016] 3 convolutional layers with a kernel size of 3×3, using ReLU activation function and maximum pooling downsampling;
[0017] A three-layer LSTM structure is connected after the convolution layer, and a Dropout layer is set between the LSTM layers and after the convolution layer.
[0018] Optionally, correcting the prediction state of the trained prediction model by using an unscented Kalman filter, and dynamically adjusting the model parameters using the correction result, includes:
[0019] Define the state vector as the precipitation distribution predicted by the trained prediction model, and the observation vector as the measured precipitation data;
[0020] Generate prior state estimation and covariance through Sigma point sampling, and map them to the observation space in combination with the observation function;
[0021] Calculate the Kalman gain and update the state and covariance matrix, extract the covariance matrix trace as a quantification indicator of prediction uncertainty;
[0022] The prediction uncertainty quantification indicator is used as part of the loss function to optimize the model parameters.
[0023] Optionally, during the rolling forecast process, dynamically adjusting the time series window and repeatedly executing the forecast-correction-update cycle to achieve online optimization of the model parameters includes:
[0024] Initially, the trained prediction model predicts precipitation at the next moment; based on the predicted data and the measured data, the prediction is updated using the unscented Kalman filter and the posterior covariance is obtained, and then the comprehensive loss is calculated and backpropagation is used to update the network parameters.
[0025] Optionally, during the rolling forecast process, at each forecast, the trained forecast model uses the meteorological data of the past t time steps as input, and the label is the actual precipitation distribution of this time step.
[0026] Optionally, dynamically adjusting the threshold according to the prediction error and triggering model retraining when the error exceeds the set threshold includes:
[0027] Calculate the sliding average error; if the sliding average error exceeds a threshold or the error exceeds the threshold for a predetermined number of times, trigger the following actions: retrain the model using the latest historical meteorological data and update it to the main prediction model;
[0028] The threshold is adjusted dynamically using the following formula:
[0029] θ=θ init ·(1+α·Δt)
[0030] Among them, α is the adjustment coefficient, Δt is the time length of the error, θ init is the initial threshold.
[0031] A second aspect of the present application provides a rainfall rolling prediction device, comprising:
[0032] The acquisition module is used to obtain historical meteorological data and perform preprocessing to obtain sample data;
[0033] A model training module is used to construct a ConvLSTM model and pre-train the ConvLSTM model using the sample data to obtain a trained prediction model;
[0034] A UKF module is used to correct the prediction state of the trained prediction model through unscented Kalman filtering, and dynamically adjust the model parameters using the correction results;
[0035] A dynamic optimization module is used to dynamically adjust the time series window and repeatedly execute the prediction-correction-update cycle during the rolling forecast process to achieve online optimization of the model parameters;
[0036] The dynamic optimization module is also used to dynamically adjust the threshold according to the prediction error, and trigger model retraining when the error exceeds the set threshold.
[0037] Optionally, the historical meteorological data includes but is not limited to temperature, air pressure, humidity, wind direction, wind speed, precipitation, tropopause height delay, and wet delay element;
[0038] The acquisition module is specifically used to:
[0039] The historical meteorological data are quality controlled to remove physically unreasonable values and extreme outliers, and the missing data are processed by interpolation. Then, the minimum-maximum normalization is used to map each meteorological element to the interval [0,1].
[0040] The historical meteorological data are divided into a training set, a validation set and a test set in chronological order to obtain the sample data.
[0041] Optionally, the ConvLSTM model includes:
[0042] 3 convolutional layers with a kernel size of 3×3, using ReLU activation function and maximum pooling downsampling;
[0043] A three-layer LSTM structure is connected after the convolution layer, and a Dropout layer is set between the LSTM layers and after the convolution layer.
[0044] Optionally, the UKF module is specifically used to:
[0045] Define the state vector as the precipitation distribution predicted by the trained prediction model, and the observation vector as the measured precipitation data;
[0046] Generate prior state estimation and covariance through Sigma point sampling, and map them to the observation space in combination with the observation function;
[0047] Calculate the Kalman gain and update the state and covariance matrix, extract the covariance matrix trace as a quantification indicator of prediction uncertainty;
[0048] The prediction uncertainty quantification indicator is used as part of the loss function to optimize the model parameters.
[0049] Optionally, the dynamic optimization module is specifically used to:
[0050] Initially, the trained prediction model predicts precipitation at the next moment; based on the predicted data and the measured data, the prediction is updated using the unscented Kalman filter and the posterior covariance is obtained, and then the comprehensive loss is calculated and backpropagation is used to update the network parameters.
[0051] Optionally, during the rolling forecast process, at each forecast, the trained forecast model uses the meteorological data of the past t time steps as input, and the label is the actual precipitation distribution of this time step.
[0052] Optionally, the dynamic optimization module is further specifically configured to:
[0053] Calculate the sliding average error; if the sliding average error exceeds a threshold or the error exceeds the threshold for a predetermined number of times, trigger the following actions: retrain the model using the latest historical meteorological data and update it to the main prediction model;
[0054] The threshold is adjusted dynamically using the following formula:
[0055] θ=θ init ·(1+α·Δt)
[0056] Among them, α is the adjustment coefficient, Δt is the time length of the error, θ init is the initial threshold.
[0057] A third aspect of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the first aspect and any possible implementation thereof.
[0058] A fourth aspect of the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the method described in the first aspect.
[0059] The present application provides a method for rolling rainfall prediction, which obtains sample data by acquiring historical meteorological data and performing preprocessing; constructs a ConvLSTM model, and pre-trains the ConvLSTM model using the sample data to obtain a trained prediction model; corrects the prediction state of the trained prediction model through unscented Kalman filtering, and dynamically adjusts the model parameters using the correction result; in the rolling prediction process, dynamically adjusts the time series window and repeatedly executes the prediction-correction-update cycle to achieve online optimization of the model parameters; dynamically adjusts the threshold according to the prediction error, and triggers model retraining when the error exceeds the set threshold; this method organically combines the ConvLSTM deep prediction model with the UKF method, and on the basis of using ConvLSTM to perform time series prediction of rainfall, introduces UKF to optimize the model prediction results, and re-passes the optimization feedback results to the ConvLSTM model for adjustment at the parameter and feature input level, which can achieve synchronous prediction and model training and rolling update, greatly improving the accuracy and timeliness of rainfall prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0061] in:
[0062] Figure 1A schematic diagram of a flow chart of a method for rolling rainfall prediction provided in an embodiment of the present application;
[0063] Figure 2 A flowchart of another method for rolling rainfall prediction provided by an embodiment of the present application;
[0064] Figure 3 A schematic diagram of the structure of a rainfall rolling prediction device provided in an embodiment of the present application;
[0065] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0067] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0068] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0069] The unscented Kalman filter (UKF) involved in the embodiments of the present application is a nonlinear data assimilation and state estimation method, which can be used to correct the predicted state in the presence of measured data.
[0070] The main purpose of the method in the embodiment of the present application is to achieve online optimization and dynamic adjustment of rainfall forecast results by combining a deep learning prediction model (ConvLSTM) with an unscented Kalman filter (UKF). When continuously acquiring new measured meteorological data (including precipitation data), the preliminary forecast results are corrected in real time by UKF, and the correction information is fed back to the ConvLSTM model, so that the model parameters and input features can be continuously improved. This method can maintain high prediction accuracy and stability under non-stationary, complex and changeable meteorological conditions, thereby better meeting the precise and efficient requirements for rainfall forecasting in practical applications such as agricultural production, disaster prevention and mitigation, and urban water resources management.
[0071] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0072] See also Figure 1 , is a flow chart of a method for rolling rainfall prediction provided by an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0073] 101. Obtain historical meteorological data and preprocess it to obtain sample data.
[0074] The execution subject of the method in the embodiment of the present application may be a rainfall rolling prediction device. In practical applications, it may be implemented on an electronic device, which may be a terminal device such as a computer.
[0075] The historical meteorological data may include but are not limited to data on meteorological elements such as temperature, air pressure, humidity, wind direction, wind speed, precipitation, tropopause height delay, and wet delay.
[0076] In an optional implementation, the above step 101 includes:
[0077] The above historical meteorological data were quality controlled, physically unreasonable values and extreme outliers were eliminated, missing data were processed by interpolation, and then the minimum-maximum normalization was used to map each meteorological element to the interval [0,1].
[0078] The above historical meteorological data are divided into a training set, a validation set and a test set in chronological order to obtain the above sample data.
[0079] Specifically, historical meteorological data is first acquired, including temperature, pressure, humidity, wind direction, wind speed, precipitation, ZHD (tropopause height delay), and ZWD (wet delay). This data is then quality-controlled to remove physically unreasonable values and extreme outliers (perhaps based on the 3-sigma principle). Missing data is interpolated. The data is then normalized using min-max normalization to map each meteorological element to the [0, 1] range.
[0080] Finally, the data set is divided: the data can be divided into training set, validation set, and test set in chronological order (70%:15%:15%).
[0081] The embodiments of this application involve time series settings and rolling prediction windows:
[0082] The time step can be set to t, that is, each prediction uses the multi-factor meteorological data (including the spatial distribution of precipitation and other factors) of the past t time steps to predict the precipitation distribution at the next moment.
[0083] During the rolling forecast process, when entering the next round of forecasting, the time series window is moved forward one grid: the earliest time step data is removed and the latest observation data is added.
[0084] 102. Construct a ConvLSTM model and pre-train the ConvLSTM model using the sample data to obtain a trained prediction model.
[0085] The ConvLSTM (Convolutional Long Short-Term Memory) model mentioned in the examples of this application is a deep learning model that combines a convolutional neural network (CNN) and a long short-term memory network (LSTM). It is particularly suitable for processing data with spatiotemporal characteristics, such as video, meteorological data, and time series analysis. The ConvLSTM model can capture local spatial features and long-term temporal dependencies in data.
[0086] In an optional embodiment, the ConvLSTM model includes:
[0087] 3 convolutional layers with a kernel size of 3×3, using ReLU activation function and maximum pooling downsampling;
[0088] The above convolutional layer is connected to a three-layer LSTM structure, and a Dropout layer is set between the LSTM layers and after the convolutional layer.
[0089] Specifically, the ConvLSTM model structure in the embodiment of the present application can be:
[0090] Use three convolutional layers with a kernel size of 3×3 and employ max pooling for spatial downsampling. Use the ReLU function as the activation function. Follow the convolutional feature extraction with a three-layer LSTM structure.
[0091] Add Dropout to reduce overfitting. Specifically, in the above model, Dropout can be introduced in the following locations:
[0092] Between LSTM layers: Dropout (p=0.2) is applied to the input and hidden state propagation of the LSTM layers;
[0093] After the convolutional layer: Before the convolutional layer outputs the feature map and inputs it into the LSTM layer, Dropout (p=0.2) can be added to randomly mask some features.
[0094] The training label is the actual observed precipitation distribution at the next moment (normalized). That is, given the meteorological data sequence of the past t time steps as input, the ConvLSTM model outputs the next moment precipitation prediction y pre , the label is the actual precipitation y at the corresponding moment obs .
[0095] The following is a detailed introduction to the pre-training loss function and optimizer:
[0096] Initial training can use Mean Squared Error (MSE) as the loss function:
[0097]
[0098] Backpropagation is performed using the Adam optimizer to update parameters, with an initial learning rate of 0.001. Xavier initialization can be used for parameter initialization to ensure stable initial convergence.
[0099] The pre-training process may include:
[0100] The ConvLSTM model is iteratively trained on the training set, and the error is checked in real time on the validation set. When the validation error no longer decreases significantly, early stopping is used. After pre-training, the ConvLSTM model can initially predict the next moment's precipitation, resulting in a trained prediction model.
[0101] 103. Correct the prediction state of the trained prediction model through unscented Kalman filtering, and dynamically adjust the model parameters using the correction results.
[0102] The Unscented Kalman Filter (UKF) mentioned in the embodiments of the present application is an algorithm for state estimation of nonlinear systems, and is particularly suitable for nonlinear systems that cannot be well approximated by linear models.
[0103] The basic process of UKF consists of two stages: prediction (prior) and update (posterior).
[0104] UKF state vector x and observation z: In the application scenario of the embodiment of this application, the state vector x is represented by the predicted precipitation distribution of ConvLSTM. The actual precipitation observation data is input as the observation z into the update process of UKF to correct the predicted state.
[0105] In an optional implementation, the above step 103 includes:
[0106] Define the state vector as the precipitation distribution predicted by the above-trained prediction model, and the observation vector as the measured precipitation data;
[0107] Generate prior state estimation and covariance through Sigma point sampling, and map them to the observation space in combination with the observation function;
[0108] Calculate the Kalman gain and update the state and covariance matrix, extract the covariance matrix trace as a quantification indicator of prediction uncertainty;
[0109] The above prediction uncertainty quantification indicators are used as part of the loss function to optimize the model parameters.
[0110] Specifically, the UKF prediction steps may include:
[0111] Using ConvLSTM model to give prior and the prior covariance P - In the offline pre-training phase, the mean square error of ConvLSTM on the validation set is calculated as a reference for uncertainty, and then the value is filled in P - The diagonal of The measurement update step uses the measured precipitation y obs to update the state and covariance.
[0112] Specifically, the UKF update steps may include:
[0113] State prediction (prior): given the posterior of the previous moment and its covariance UKF extracts 2L+1 sigma points from the posterior distribution (L is the state dimension, that is, the number of spatial grid points for precipitation prediction). These sigma points are obtained by considering and To select:
[0114]
[0115] Where λ is the adjustment parameter, represents the square root of the i-th column of the covariance matrix. This results in a set of sigma points distributed around the posterior mean.
[0116] The posterior sigma point χ at the previous momentt-1 Mapped to the next moment through the system state transfer function f (the role of f here is approximately given by the prediction of ConvLSTM, which is equivalent to the state equation). For each sigma point:
[0117]
[0118] In this application, the f function can be understood as: given the state at the previous moment, that is, the predicted precipitation distribution, ConvLSTM gives the predicted precipitation distribution for the next moment.
[0119] The prior state estimate and prior covariance are then calculated based on these mapped sigma points:
[0120]
[0121] Where W i m and W i c is the weight, Q is the process noise covariance matrix, and the weight uses the default setting commonly used in UKF. and It is a priori estimate.
[0122] When the new measured precipitation data obs When it arrives, the prior sigma point is mapped to the observation space through the observation function h (in this scenario, h can be: the precipitation in the state directly corresponds to the actual precipitation):
[0123]
[0124] Take the weighted average of these observation sigma points to get the predicted observation
[0125]
[0126] Then calculate the observation-residual covariance and the state-observation covariance:
[0127]
[0128] Where R is the observation noise covariance matrix, which is obtained from actual observed precipitation.
[0129] When the measured precipitation (z t , that is, y obs ) arrives, calculate the Kalman gain:
[0130]
[0131] Update state and covariance:
[0132]
[0133] The posterior covariance matrix is obtained after UKF update The uncertainty scalar is extracted from it, that is, the trace of the matrix represents the sum of the variances of all state variables:
[0134] L uncert =trace(P + )
[0135] The larger the value, the higher the uncertainty of the model prediction.
[0136] In the subsequent parameter optimization of the ConvLSTM model, the loss function is set to comprehensive loss, in which λ is introduced as the weight of the uncertainty loss term:
[0137] L total =L MSE +λ·trace(P + )
[0138] The setting of λ can be adjusted according to the validation set, and multiple levels such as 0.001, 0.01, and 0.1 can be tried. This embodiment of the present application does not limit this.
[0139] 104. During the rolling forecast process, the time series window is dynamically adjusted and the forecast-correction-update cycle is repeatedly executed to achieve online optimization of the above model parameters.
[0140] In an optional embodiment, during the rolling forecast process, the time series window is dynamically adjusted and the forecast-correction-update cycle is repeatedly executed to achieve online optimization of the model parameters, including:
[0141] Initially, the trained prediction model is used to predict precipitation at the next moment. Based on the predicted data and measured data, the unscented Kalman filter is used to update the prediction and obtain the posterior covariance. Then, the comprehensive loss is calculated and backpropagation is used to update the network parameters.
[0142] Specifically, the rolling prediction process in the embodiment of the present application can be described as follows: Initially, the pre-trained ConvLSTM model performs precipitation prediction for the next moment. pre After that, the measured precipitation y ons Coming, use UKF to update the prediction and obtain the posterior covariance P + Then calculate the comprehensive loss L total And back propagate to update the network parameters.
[0143] The dynamic nature of training labels is explained as follows:
[0144] Each time time steps forward, a label is obtained from the newly added measured precipitation data. In other words, in a rolling forecast, the new forecast input sample is a series of historical meteorological data that has been rolled forward by t steps (the oldest step is discarded and the newest step is added), and the label is the actual precipitation distribution at that new time step. This way, the model always makes predictions based on the latest information, and measured data is continuously added, allowing the model to evolve synchronously with the environment.
[0145] Backpropagation update cycle: After receiving a new batch of measured data and completing the UKF update, the new loss is calculated and the ConvLSTM parameters are updated using Adam. This is a complete online optimization iteration.
[0146] In this application, the ConvLSTM model is used for rainfall prediction. The prediction results are then input into the UKF for correction to obtain the corrected prediction state and covariance. The uncertainty scalar in the correction result is extracted and used as part of the loss function to optimize the model parameters, thereby achieving dynamic adjustment of the model and improving the prediction accuracy.
[0147] 105. Dynamically adjust the threshold according to the prediction error, and trigger model retraining when the error exceeds the set threshold.
[0148] Dynamically adjusting the threshold based on the prediction error is an adaptive mechanism used to improve the robustness and accuracy of the prediction model under changing environments. The threshold can be adjusted based on the update formula set as needed.
[0149] In an optional implementation, the above step 105 includes:
[0150] Calculate the sliding average error; if the sliding average error exceeds the threshold or the error exceeds the threshold for a preset number of times, trigger the following actions: retrain the model using the latest historical meteorological data and update it to the main prediction model;
[0151] The above threshold is adjusted dynamically using the following formula:
[0152] θ=θ init ·(1+α·Δt)
[0153] Among them, α is the adjustment coefficient, Δt is the time length of the above error, θ init is the initial threshold.
[0154] Specifically, during the rolling prediction process, the prediction error can be continuously monitored and the moving average error (MAE) can be calculated. Set the initial threshold θ init , dynamically adjusted according to environmental conditions. When the sliding error continues to increase and exceeds the threshold, the model adaptability is determined to be reduced. The dynamic update threshold formula can be as follows:
[0155] θ=θ init ·(1+α·Δt)
[0156] Where α is the adjustment coefficient and Δt is the length of time the error exceeds the limit.
[0157] If the initial error exceeds a threshold or the error exceeds a threshold for more than a preset number of times (e.g., five or more times), the following actions are triggered: the model is retrained using the latest historical weather data and updated to the main forecast model. After the new model replaces the old one, the rolling forecast process resumes.
[0158] Figure 2 The flowchart of another method for rolling rainfall prediction provided in this application embodiment illustrates the entire process described above in more detail, and will not be repeated here. The modules involved in the entire process include a data preprocessing module, a ConvLSTM prediction model, an unscented Kalman filter module, an uncertainty integration training and rolling prediction module, and a dynamic threshold adjustment module, which perform corresponding functions to implement the method of this application.
[0159] In this application, by integrating the nonlinear spatiotemporal sequence prediction capabilities of ConvLSTM with the data assimilation and correction capabilities of UKF, we achieve the strong predictive performance of a deep learning model while also enabling online correction and parameter tuning of prediction results using real-time observation data, thereby maintaining high-precision rainfall forecasting performance in a dynamically changing climate. This method is suitable for a variety of application scenarios, including agricultural irrigation planning, flood control command, and urban rainstorm response.
[0160] Based on the description of the aforementioned method embodiment, an embodiment of the present application also provides a rainfall rolling prediction device.
[0161] Figure 3 This is a schematic diagram of the structure of a rainfall rolling prediction device provided in an embodiment of the present application. Figure 3 As shown, the rainfall rolling prediction device 300 includes:
[0162] An acquisition module 310 is used to acquire historical meteorological data and perform preprocessing to obtain sample data;
[0163] A model training module 320 is used to construct a ConvLSTM model and pre-train the ConvLSTM model using the sample data to obtain a trained prediction model;
[0164] UKF module 330, used to correct the prediction state of the trained prediction model through unscented Kalman filtering, and dynamically adjust the model parameters using the correction results;
[0165] Dynamic optimization module 340 is used to dynamically adjust the time series window and repeatedly execute the prediction-correction-update cycle during the rolling prediction process to achieve online optimization of the above model parameters;
[0166] The above-mentioned dynamic optimization module 340 is also used to dynamically adjust the threshold according to the prediction error, and trigger model retraining when the error exceeds the set threshold.
[0167] Optionally, the above-mentioned historical meteorological data includes but is not limited to temperature, air pressure, humidity, wind direction, wind speed, precipitation, tropopause height delay, and wet delay element;
[0168] The acquisition module 310 is specifically configured to:
[0169] The above historical meteorological data were quality controlled, physically unreasonable values and extreme outliers were eliminated, missing data were processed by interpolation, and then the minimum-maximum normalization was used to map each meteorological element to the interval [0,1].
[0170] The above historical meteorological data are divided into a training set, a validation set and a test set in chronological order to obtain the above sample data.
[0171] Optionally, the above ConvLSTM model includes:
[0172] 3 convolutional layers with a kernel size of 3×3, using ReLU activation function and maximum pooling downsampling;
[0173] The above convolutional layer is connected to a three-layer LSTM structure, and a Dropout layer is set between the LSTM layers and after the convolutional layer.
[0174] Optionally, the UKF module 330 is specifically configured to:
[0175] Define the state vector as the precipitation distribution predicted by the above-trained prediction model, and the observation vector as the measured precipitation data;
[0176] Generate prior state estimation and covariance through Sigma point sampling, and map them to the observation space in combination with the observation function;
[0177] Calculate the Kalman gain and update the state and covariance matrix, extract the covariance matrix trace as a quantification indicator of prediction uncertainty;
[0178] The above prediction uncertainty quantification indicators are used as part of the loss function to optimize the model parameters.
[0179] Optionally, the dynamic optimization module 340 is specifically configured to:
[0180] Initially, the trained prediction model is used to predict precipitation at the next moment. Based on the predicted data and measured data, the unscented Kalman filter is used to update the prediction and obtain the posterior covariance. Then, the comprehensive loss is calculated and backpropagation is used to update the network parameters.
[0181] Optionally, in the above rolling forecast process, at each forecast, the above trained forecast model uses the meteorological data of the past t time steps as input, and the label is the actual precipitation distribution of this time step.
[0182] Optionally, the dynamic optimization module 340 is further configured to:
[0183] Calculate the sliding average error; if the sliding average error exceeds the threshold or the error exceeds the threshold for a preset number of times, trigger the following actions: retrain the model using the latest historical meteorological data and update it to the main prediction model;
[0184] The above threshold is adjusted dynamically using the following formula:
[0185] θ=θ init ·(1+α·Δt)
[0186] Among them, α is the adjustment coefficient, Δt is the time length of the above error, θ init is the initial threshold.
[0187] Understandably, Figure 3 The relevant contents of each module in the above method embodiment have been described in detail, and the details can be referred to the contents of the method embodiment; Figure 3 The provided rainfall rolling prediction device 300 can perform the following operations: Figure 1 or Figure 2 Any steps in the illustrated embodiment will not be described in detail here. Figure 3 The modules in Figure 2 The module divisions involved may be different, but the methods are consistent.
[0188] In one embodiment of the present application, an electronic device is also provided. Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 400 includes a processor 401 and a memory 402. The memory 402 stores a computer program. When the computer program is executed by the processor 401, the following operations are performed: Figure 1 or Figure 2 The electronic device 400 may further include an input / output device, etc. In a specific embodiment, the electronic device may be a terminal device, etc.
[0189] In one embodiment, a computer-readable storage medium is further provided. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor is caused to perform any step in the above method embodiment.
[0190] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0191] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0192] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A method for rolling rainfall prediction, characterized in that: The method comprises: Obtain historical meteorological data and preprocess it to obtain sample data; Constructing a ConvLSTM model, and pre-training the ConvLSTM model using the sample data to obtain a trained prediction model; Correcting the prediction state of the trained prediction model through unscented Kalman filtering, and dynamically adjusting the model parameters using the correction result; During the rolling forecast process, the time series window is dynamically adjusted and the forecast-correction-update cycle is repeatedly executed to achieve online optimization of the model parameters; The threshold is dynamically adjusted according to the prediction error, and model retraining is triggered when the error exceeds the set threshold.
2. The method for rolling rainfall prediction according to claim 1, characterized in that: The historical meteorological data include but are not limited to temperature, air pressure, humidity, wind direction, wind speed, precipitation, tropopause height delay, and wet delay element; The acquisition of historical meteorological data and preprocessing to obtain sample data includes: The historical meteorological data are quality controlled to remove physically unreasonable values and extreme outliers, and the missing data are processed by interpolation. Then, the minimum-maximum normalization is used to map each meteorological element to the interval [0,1]. The historical meteorological data are divided into a training set, a validation set and a test set in chronological order to obtain the sample data.
3. The method for rolling rainfall prediction according to claim 2, characterized in that: The ConvLSTM model includes: 3 convolutional layers with a kernel size of 3×3, using ReLU activation function and maximum pooling downsampling; A three-layer LSTM structure is connected after the convolution layer, and a Dropout layer is set between the LSTM layers and after the convolution layer.
4. The method for rolling rainfall prediction according to claim 3, characterized in that: Correcting the prediction state of the trained prediction model by using an unscented Kalman filter, and dynamically adjusting the model parameters using the correction result, includes: Define the state vector as the precipitation distribution predicted by the trained prediction model, and the observation vector as the measured precipitation data; Generate prior state estimation and covariance through Sigma point sampling, and map them to the observation space in combination with the observation function; Calculate the Kalman gain and update the state and covariance matrix, extract the covariance matrix trace as a quantification indicator of prediction uncertainty; The prediction uncertainty quantification indicator is used as part of the loss function to optimize the model parameters.
5. The method for rolling rainfall prediction according to claim 4, characterized in that: In the rolling forecast process, the time series window is dynamically adjusted and the forecast-correction-update cycle is repeatedly executed to achieve online optimization of the model parameters, including: Initially, the trained prediction model predicts precipitation at the next moment; based on the predicted data and the measured data, the prediction is updated using the unscented Kalman filter and the posterior covariance is obtained, and then the comprehensive loss is calculated and backpropagation is used to update the network parameters.
6. The method for rolling rainfall prediction according to claim 4, characterized in that: During the rolling forecast process, at each forecast, the trained forecast model uses the meteorological data of the past t time steps as input, and the label is the actual precipitation distribution of this time step.
7. The method for rolling rainfall prediction according to claim 1, characterized in that: The method of dynamically adjusting the threshold according to the prediction error and triggering model retraining when the error exceeds the set threshold includes: Calculate the sliding average error; if the sliding average error exceeds a threshold or the error exceeds the threshold for a predetermined number of times, trigger the following actions: retrain the model using the latest historical meteorological data and update it to the main prediction model; The threshold is adjusted dynamically using the following formula: θ=θ init ·(1+α·Δt) Among them, α is the adjustment coefficient, Δt is the time length of the error, θ imit is the initial threshold.
8. A rainfall rolling prediction device, characterized in that: include: The acquisition module is used to obtain historical meteorological data and perform preprocessing to obtain sample data; A model training module is used to construct a ConvLSTM model and pre-train the ConvLSTM model using the sample data to obtain a trained prediction model; A UKF module is used to correct the prediction state of the trained prediction model through unscented Kalman filtering, and dynamically adjust the model parameters using the correction results; A dynamic optimization module is used to dynamically adjust the time series window and repeatedly execute the prediction-correction-update cycle during the rolling forecast process to achieve online optimization of the model parameters; The dynamic optimization module is also used to dynamically adjust the threshold according to the prediction error, and trigger model retraining when the error exceeds the set threshold.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.