Rainfall prediction method based on deep learning

By combining the LSTM layer and humidity threshold-guided Attention mechanism, a deep learning-based rainfall prediction model is built, which solves the limitations of traditional numerical weather forecasting models in rainfall prediction and improves the accuracy and application range of prediction.

CN119557574APending Publication Date: 2025-03-04HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411602046.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

Traditional numerical weather forecasting models have problems such as complex calculations, sensitive to initial conditions, and difficulty in providing high spatial and temporal resolution in rainfall prediction. In addition, deep learning methods based on radar and infrared remote sensing rely on high hardware and cannot be applied nationwide, and have limited predictive capabilities for future rainfall.

Method used

Using a deep learning-based rainfall prediction method, combined with the LSTM layer and the Attention mechanism guided by the humidity threshold, a rainfall prediction model is constructed through VMF wet delay data and weather station data, and the attention weight of the model is optimized to pay attention to key time steps.

Benefits of technology

Improves the accuracy of rainfall forecasts, especially in the prediction of extreme weather, and reduces hardware costs and can be used nationwide.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557574A_ABST
    Figure CN119557574A_ABST
Patent Text Reader

Abstract

The invention discloses a rainfall prediction method based on deep learning, and relates to the technical field of deep learning and meteorological monitoring, and the method comprises the steps: obtaining the meteorological data and actual rainfall of each meteorological station, and forming a data set; preprocessing data in the data set, and taking the preprocessed data set as a sample set; constructing a rainfall prediction model, wherein the model comprises an LSTM layer, an Attention mechanism guided by a humidity threshold and a full connection layer; the sample set is used for training a rainfall prediction model, the input of the rainfall prediction model is meteorological data, and the output of the rainfall prediction model is predicted rainfall; meteorological data in a recent period of time are collected and preprocessed, the preprocessed meteorological data are input into the trained rainfall prediction model, and future predicted rainfall is obtained. The prediction precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of deep learning and meteorological monitoring, and in particular to a rainfall prediction method based on deep learning. Background Art

[0002] Precipitation forecasting plays an important role in meteorological research and practice, especially in disaster prevention and mitigation, agricultural management, water resources planning and other fields. Traditional precipitation forecasting mainly relies on numerical weather prediction (NWP) models, which simulate future weather changes by solving the physical equations of atmospheric motion. However, NWP models have certain limitations: first, the numerical models are computationally complex, take a long time to calculate, and rely heavily on high-performance computing resources. Second, due to the sensitivity of numerical models to initial conditions, the prediction accuracy is easily affected by initial observation errors. In addition, in local weather forecasting, especially the prediction of small-scale heavy rainfall events, numerical models often find it difficult to provide results with high spatial and temporal resolution.

[0003] With the development of artificial intelligence technology, deep learning has been widely used in time series data processing, especially the long short-term memory network (LSTM), which performs well in capturing the time dependency in meteorological data. Compared with traditional physical models, deep learning can automatically learn complex spatiotemporal patterns from historical meteorological data and provide efficient rainfall forecasts. However, the current deep learning methods based on radar, infrared remote sensing and other data, although they have good performance in short-term rainfall monitoring, rely on expensive hardware equipment and cannot be applied in various locations across the country. In addition, the ability to predict future rainfall is limited, especially for small-scale extreme weather phenomena. The effect of such methods is not ideal. Summary of the invention

[0004] In order to overcome the defects in the above-mentioned prior art, the present invention provides a rainfall prediction method based on deep learning. The rainfall prediction model can give priority to the time steps that have an important impact on rainfall in the time series through the guidance of the humidity threshold, thereby improving the accuracy of rainfall prediction.

[0005] To achieve the above object, the present invention adopts the following technical solutions, including:

[0006] A rainfall prediction method based on deep learning, comprising the following steps:

[0007] S1, obtain meteorological data and actual rainfall of each weather station to form a data set;

[0008] S2, preprocessing the data in the data set, and using the preprocessed data set as a sample set;

[0009] S3, build a rainfall prediction model, which includes an LSTM layer, an Attention mechanism guided by humidity thresholds, and a fully connected layer;

[0010] S4, using the sample set to train a rainfall prediction model, the input of the rainfall prediction model is meteorological data, and the output is predicted rainfall;

[0011] S5, collecting meteorological data in a recent period of time and preprocessing it, inputting the preprocessed meteorological data into the trained rainfall prediction model to obtain the future predicted rainfall.

[0012] Preferably, in step S1, the meteorological data includes: wet delay data obtained from the VMF model and total zenith delay, air pressure, temperature, and humidity data obtained from a meteorological station;

[0013] The wet delay data in the GRID format in the VMF model is interpolated in the spatial dimension, i.e., longitude and latitude, and in the temporal dimension, so that the acquired wet delay data is consistent with the spatial and temporal dimensions of the total zenith delay, air pressure, temperature, and humidity data.

[0014] Preferably, in step S2, the preprocessing includes feature extraction processing and normalization processing, and the specific method is as follows:

[0015] S21, for each data item in the data set, i.e., the original value, the moving average and the lag value are calculated respectively as the two eigenvalues ​​extracted from the data item:

[0016] The moving average is calculated as:

[0017]

[0018] Among them, MA t represents the moving average of a certain data at time point t, X t-i Represents the original value of the data at time point ti, and n is the size of the sliding window;

[0019] The moving average is calculated as:

[0020] Lag t =X t-k

[0021] Among them, Lag k represents the lag value of a certain data at time point t, X t-k Represents the original value of the data at time point tk, i.e., lagged by k time steps;

[0022] S22, performing Min-Max normalization processing on the characteristic values ​​and original values ​​of each data, and normalizing the data to the range of [0,1];

[0023] S23, after preprocessing, obtain the moving average value, lag value and original value of each data at each time point.

[0024] Preferably, in step S3, the rainfall prediction model includes an LSTM layer, an Attention mechanism guided by a humidity threshold, and a fully connected layer. The specific processing method is as follows:

[0025] S31, LSTM layer for input data x t Calculate and get the input data x t The hidden state h t , calculated as:

[0026] h t ,c t =LSTM(x t ,h t-1 ,c t-1 )

[0027] Among them, x t represents the meteorological data at the current time, i.e., time point t; h t Indicates the hidden state at the current moment; c t Indicates the memory status at the current moment; h t-1 Indicates the hidden state of the previous moment; c t-1 Indicates the memory state of the previous moment; t=1,2,...,T;

[0028] S32, Attention mechanism is the attention mechanism based on the hidden state h t Calculate the weight α t , calculated as:

[0029] e t =f attention (h t )

[0030]

[0031] Among them, e t is the score of the attention mechanism, f attention (·) represents the attention function, exp(·) represents the exponential function, t'=1,2,...,T,e t′ is the score of the attention mechanism at time point t′;

[0032] The attention mechanism sets a temperature threshold th, which is calculated based on the x value in the input data. t The humidity value is humidity t , and the temperature threshold th, calculate the mask mask at the current time point t t

[0033]

[0034] Among them, λ is the adjustment factor;

[0035] Mask t Applied to attention weights:

[0036] α′ t =α t ·Mask t

[0037]

[0038] Among them, α′ t Is to apply mask t The attention weight α t , α” t is the final attention weight after normalization;

[0039]

[0040] The hidden state h of the LSTM output is adjusted by the attention weight t Perform weighted summation to obtain the weighted hidden state h weighted :

[0041] S33, weighted hidden state h weighted Input to the fully connected layer and mapped to the model output, i.e. the predicted rainfall

[0042]

[0043] Among them, W is the weight matrix and b is the bias term;

[0044] That is, the expression of the rainfall prediction model is as follows:

[0045]

[0046] Preferably, in step S4, during the rainfall prediction model training process, the loss function is:

[0047]

[0048] Among them, y n is the actual rainfall of the nth sample, is the predicted rainfall of the nth sample, N is the number of samples;

[0049] A readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the above-mentioned rainfall prediction method based on deep learning.

[0050] An electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned rainfall prediction method based on deep learning when executing the computer program.

[0051] A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the above-mentioned rainfall prediction method based on deep learning.

[0052] The advantages of the present invention are:

[0053] (1) Based on VMF wet delay data and conventional meteorological data from weather stations, this paper proposes a deep learning rainfall prediction method combining LSTM and Attention mechanism, in which the specially modified Attention layer guides the Attention layer through a threshold, so that it increases the attention weight when the humidity or other features exceed a certain threshold, ensuring that the model pays more attention to the key time step. There are two main reasons: Because rainfall may be strongly affected by a recent time step or a specific weather event, the Attention mechanism enables the model to weight the data of different time steps according to importance. This combination of physical rules can ensure that the prediction results of the model are more in line with reality. VMF wet delay data can directly reflect the water vapor content in the atmosphere, and water vapor is one of the important factors that determine the occurrence of rainfall. By combining VMF wet delay data and ground meteorological data provided by weather stations, such as air pressure, humidity and rainfall, the model can obtain multi-source meteorological information and improve the prediction accuracy. In addition, the introduced humidity threshold mechanism enables the model to identify the potential possibility of rainfall in advance when it captures the atmospheric humidity reaching specific conditions, especially showing higher sensitivity in the prediction of extreme weather.

[0054] (2) The present invention utilizes the wet delay data calculated by the VMF model and the basic meteorological data of the national meteorological station to form a rainfall-specific data set. The acquisition cost of this data is lower than that of radar data and can be widely used in various regions. Then, the processed data set is obtained through normalization and feature generation. The wet delay data and the basic meteorological data are used as the input of a pre-built humidity threshold attention LSTM rainfall prediction neural network model, and the output of the neural network is used as the rainfall prediction value at that moment, so as to calculate the loss function and continuously iterate and train the humidity threshold attention LSTM rainfall prediction neural network model, and obtain the trained humidity threshold attention LSTM rainfall prediction neural network model. Then, the wet delay data and the basic meteorological data at the current moment are normalized and feature generated as the input of the trained model, and the output of the humidity threshold attention LSTM rainfall prediction neural network model is obtained as the rainfall prediction value in the future time step, thereby realizing the rainfall prediction function, which has important practical application value for meteorological forecasting work.

[0055] (3) The present invention innovates the LSTM model based on the characteristics of rainfall. According to the physical laws of rainfall events, a threshold-guided Attention mechanism is introduced into the neural network model for rainfall prediction: the Attention layer is guided by the threshold so that the attention weight is increased when the humidity or other features exceed a certain threshold, ensuring that the model pays more attention to the key time steps. There are mainly two reasons: Because rainfall may be strongly affected by a recent time step or a specific weather event, the Attention mechanism enables the model to weight data at different time steps according to importance. The physical laws of weather are introduced into the Attention layer of the model. When the humidity value exceeds the set threshold, the attention weight of the time step is increased. This combination of physical rules can ensure that the prediction results of the model are more in line with reality.

[0056] (4) The rainfall prediction model can be guided by the humidity threshold and give priority to the time steps that have an important impact on rainfall in the time series, thereby improving the accuracy of rainfall prediction.

[0057] (5) After normalization, the generation of moving averages and lag values, a sample set suitable for rainfall prediction is formed, and the sample set is denoised to ensure its quality and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 This is a flow chart of a rainfall prediction method based on deep learning of the present invention.

[0059] Figure 2 It is a structural diagram of the rainfall prediction model of the present invention. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] Example 1

[0062] Depend on Figure 1 As shown, a rainfall prediction method based on deep learning includes the following steps:

[0063] S1, obtain the meteorological data and actual rainfall of each weather station to form a data set.

[0064] Meteorological data include: wet delay data obtained from the VMF model and total zenith delay, air pressure, temperature, and humidity data obtained from the weather station.

[0065] The wet delay data in the GRID format in the VMF model is interpolated in the spatial dimension, i.e., longitude and latitude, and in the temporal dimension, so that the acquired wet delay data is consistent with the spatial and temporal dimensions of the total zenith delay, air pressure, temperature, and humidity data.

[0066] Among them, VMF model / VMF1 model (Vienna Mapping Function) is the most accurate model for simulating tropospheric conditions at present. It is a mapping function used to convert the zenith delay of satellite signals passing through the atmosphere to any elevation angle. GRID data refers to geographic information data represented in the form of a grid. The grid data of VMF1 and VMF models may include parameters such as air pressure, temperature, humidity, etc. at different locations and altitudes.

[0067] Since the location of the weather station is fixed, the grid data of the VMF model needs to be converted using the bilinear interpolation method to obtain the data of the weather station site location. The grid data of the VMF model divides the world into several blocks with the same area. The Tb grid has a resolution of about 110 kilometers, so the distance between two grid points can be considered as a straight line; in other words, the area surrounded by four grid points can be considered as a plane. Therefore, bilinear interpolation is the most suitable method for VMF grid data interpolation. The data obtained by bilinear interpolation is combined with the national weather station data to generate a data set.

[0068] At the same time, the data from the weather station is measured every 30 minutes, while the data from the VMF model is measured every 6 hours. In order to make the most of the existing data, the data from the VMF model is interpolated in the time dimension so that the two types of data are unified in both time and space.

[0069] Actual rainfall includes actual precipitation in the past hour.

[0070] S2, preprocess the data in the data set and use the preprocessed data set as the sample set.

[0071] Preprocessing includes feature extraction and normalization, and the specific methods are as follows:

[0072] S21, for each data item in the data set, i.e., the original value, a moving average value and a lag value are calculated respectively as two characteristic values ​​extracted from the data item.

[0073] The moving average is used to smooth time series data and reduce fluctuations. Given a time window n, the moving average calculation formula is:

[0074]

[0075] Among them, MA t represents the moving average of a certain data at time point t, X t-i Represents the original value of the data at time point ti, and n is the size of the sliding window;

[0076] The lag value is the data before a specific moment in the time series, which is used to capture the impact of the past on the future. The calculation formula for the lag value is:

[0077] Lag t =X t-k

[0078] Among them, Lag k represents the lag value of a certain data at time point t, X t-k Represents the original value of the data at time point tk, which is lagged by k time steps.

[0079] S22, in order to make the deep learning model converge faster and avoid the impact of differences in numerical ranges, it is necessary to normalize the eigenvalues ​​and original values ​​of each data, specifically Min-Max normalization, to scale the data to [0,1]. The formula is:

[0080]

[0081] Among them, X is the original data (eigenvalue or original value), X norm is the normalized data, X min and Xmax are the minimum and maximum values ​​of the original data respectively.

[0082] S23, after preprocessing, the moving average, lag value and original value of each data at each time point are obtained. The humidity threshold attention LSTM model is gradually trained through the preprocessed meteorological data sequence to obtain an optimized rainfall prediction model.

[0083] S3, constructs a rainfall prediction model, Figure 2 As shown in the figure, the rainfall prediction model includes an LSTM layer, an Attention mechanism guided by the humidity threshold introduced according to the physical laws of rainfall events, and a fully connected layer.

[0084] In the present invention, the LSTM model is innovated according to the characteristics of rainfall. According to the physical laws of rainfall events, a threshold-guided Attention mechanism is introduced into the network model for rainfall: the Attention layer is guided by the threshold so that the attention weight is increased when the humidity or other features exceed a certain threshold, ensuring that the model pays more attention to the key time steps. There are mainly two reasons: Because rainfall may be strongly affected by a recent time step or a specific weather event, the Attention mechanism enables the model to weight data at different time steps according to importance. The physical laws of weather are introduced into the Attention layer of the model. When the humidity value exceeds the set threshold, the attention weight of the time step is increased. This combination of physical rules can ensure that the prediction results of the model are more in line with reality.

[0085] Specifically, the rainfall prediction model can give priority to the time steps that have an important impact on rainfall in the time series through the guidance of the humidity threshold, thereby improving the accuracy of rainfall prediction.

[0086] The specific processing method of the rainfall prediction model is as follows:

[0087] S31, LSTM layer for input data x t Calculate and get the input data x t The hidden state h t , calculated as:

[0088] h t ,c t =LSTM(x t ,h t-1 ,c t-1 )

[0089] Among them, x t represents the meteorological data at the current time, i.e., time point t; h t Indicates the hidden state at the current moment; c tIndicates the memory status at the current moment; h t-1 Indicates the hidden state of the previous moment; c t-1 Indicates the memory state at the previous moment; t=1,2,...,T.

[0090] Among them, the input data X∈R bthsz×tm_ses×nmfaue , the data x at each time step t Contains meteorological characteristics such as humidity, temperature, etc.

[0091] S32, Attention mechanism is the attention mechanism based on the hidden state h t Calculate the attention weight α t , calculated using the softmax function, the calculation method is:

[0092] e t =f attention (h t )

[0093]

[0094] Among them, e t is the score of the attention mechanism, which can be calculated by a small fully connected layer; f attention (·) represents the attention function; exp(·) represents the exponential function; t'=1,2,...,T,e t′ is the score of the attention mechanism at time point t′;

[0095] The attention mechanism sets a temperature threshold th, which is calculated based on the x value in the input data. t The humidity value is humidity t , and the temperature threshold th, calculate the mask mask at the current time point t t

[0096]

[0097] Among them, λ is an adjustment factor, which is used to affect the value of the attention weight according to whether the humidity value exceeds the threshold;

[0098] Mask t Applied to attention weights:

[0099] α′ t =α t ·Mask t

[0100]

[0101] Among them, α′ t Is to apply mask t The attention weight αt , α” t is the final attention weight after normalization;

[0102] The hidden state h of the LSTM output is adjusted by the attention weight t Perform weighted summation to obtain the weighted hidden state h weighted :

[0103]

[0104] Among them, h weighted ∈R batch_size×hidden_size

[0105] S33, weighted hidden state h weighted Input to the fully connected layer and mapped to the model output, i.e. the predicted rainfall

[0106]

[0107] Where W is the weight matrix, which is used to transform the weighted hidden state h weighted Mapped to the predicted output space, in the deep learning model, the weight matrix W is one of the parameters of the model, which is optimized through training so that the output of the model fits the target (predicted rainfall) more accurately; b is the bias term, which is a parameter optimized together with the weight matrix W and is used to adjust the mapping result. The bias term b can help the model fit the data more flexibly, especially when the input data distribution is not strictly concentrated on zero; W∈R 1×hidden_size , b∈R.

[0108] That is, the expression of the rainfall prediction model is as follows:

[0109]

[0110] S4, using the sample set to train the rainfall prediction model, performing multiple rounds of training and parameter adjustment to obtain an optimized rainfall prediction model, the input of the rainfall prediction model is meteorological data, and the output is predicted rainfall.

[0111] During the training of the rainfall prediction model, the loss function is:

[0112]

[0113] Among them, y n is the actual rainfall of the nth sample, is the predicted rainfall of the nth sample, and N is the number of samples.

[0114] When the change of the loss function value tends to be stable, that is, its change range is within the preset small range, the current rainfall prediction model is regarded as an optimized model; otherwise, continue to perform multiple rounds of training and adjustment.

[0115] S5, collecting meteorological data in a recent period of time and preprocessing it, inputting the preprocessed meteorological data into the trained rainfall prediction model to obtain the future predicted rainfall.

[0116] Example 2

[0117] An electronic device comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a rainfall prediction method based on deep learning of the above-mentioned embodiment 1 is implemented.

[0118] The electronic device of the embodiment of the present application can be the mobile device itself, or a stand-alone device independent of the mobile device, which can communicate with the mobile device to receive the collected input signals from them and send the selected target decision behavior to them.

[0119] The electronic device includes one or more processors and memory. The processor may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may run the program instructions to implement the decision behavior decision method and / or other desired functions of the various embodiments of the present application described above.

[0120] Electronic devices may also include input devices and output devices.

[0121] Example 3

[0122] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the decision-making behavior decision method according to various embodiments of the present application described in the above-mentioned embodiment 1 of this specification.

[0123] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0124] Example 4

[0125] An embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the decision-making behavior decision method according to various embodiments of the present application described in the above-mentioned embodiment 1.

[0126] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0127] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A rainfall prediction method based on deep learning, characterized in that: The following steps are involved: S1, obtain meteorological data and actual rainfall of each weather station to form a data set; S2, preprocessing the data in the data set, and using the preprocessed data set as a sample set; S3, build a rainfall prediction model, which includes an LSTM layer, an Attention mechanism guided by humidity thresholds, and a fully connected layer; S4, using the sample set to train a rainfall prediction model, the input of the rainfall prediction model is meteorological data, and the output is predicted rainfall; S5, collecting meteorological data in a recent period of time and preprocessing it, inputting the preprocessed meteorological data into the trained rainfall prediction model to obtain the future predicted rainfall.

2. The rainfall prediction method based on deep learning according to claim 1, characterized in that: In step S1, the meteorological data includes: wet delay data obtained from the VMF model and total zenith delay, air pressure, temperature, and humidity data obtained from the meteorological station; The wet delay data in the GRID format in the VMF model is interpolated in the spatial dimension, i.e., longitude and latitude, and in the temporal dimension, so that the acquired wet delay data is consistent with the spatial and temporal dimensions of the total zenith delay, air pressure, temperature, and humidity data.

3. The rainfall prediction method based on deep learning according to claim 1, characterized in that: In step S2, the preprocessing includes feature extraction processing and normalization processing, and the specific method is as follows: S21, for each data item in the data set, i.e., the original value, the moving average and the lag value are calculated respectively as the two eigenvalues ​​extracted from the data item: The moving average is calculated as: Among them, MA t represents the moving average of a certain data at time point t, X t-i Represents the original value of the data at time point ti, and n is the size of the sliding window; The moving average is calculated as: Lag t =X t-k Among them, Lag k represents the lag value of a certain data at time point t, X t-k Represents the original value of the data at time point tk, i.e., lagged by k time steps; S22, performing Min-Max normalization processing on the characteristic values ​​and original values ​​of each data, and normalizing the data to the range of [0,1]; S23, after preprocessing, obtain the moving average value, lag value and original value of each data at each time point.

4. The rainfall prediction method based on deep learning according to claim 1, characterized in that: In step S3, the rainfall prediction model includes an LSTM layer, an Attention mechanism guided by humidity thresholds, and a fully connected layer. The specific processing method is as follows: S31, LSTM layer for input data x t Calculate and get the input data x t The hidden state h t , calculated as: h t ,c t =LSTM(x t ,h t-1 ,c t-1 ) Among them, x t represents the meteorological data at the current time, i.e., time point t; h t Indicates the hidden state at the current moment; c t Indicates the memory status at the current moment; h t-1 Indicates the hidden state of the previous moment; c t-1 Indicates the memory state of the previous moment; t=1,2,...,T; S32, Attention mechanism is the attention mechanism based on the hidden state h t Calculate the weight α t , calculated as: e t =f attention (h t ) Among them, e t is the score of the attention mechanism, f attention (·) represents the attention function, exp(·) represents the exponential function, t'=1,2,...,T,e t′ is the score of the attention mechanism at time point t'; The attention mechanism sets a temperature threshold th, which is calculated based on the x value in the input data. t The humidity value is humidity t , and the temperature threshold th, calculate the mask mask at the current time point t t Among them, λ is the adjustment factor; Mask t Applied to attention weights: a' t =a t ·mask t Among them, α' t Is to apply mask t The attention weight α t , α” t is the final attention weight after normalization; The hidden state h of the LSTM output is adjusted by the attention weight t Perform weighted summation to obtain the weighted hidden state h weighted : S33, weighted hidden state h weighted Input to the fully connected layer and mapped to the model output, i.e. the predicted rainfall Among them, W is the weight matrix and b is the bias term; That is, the expression of the rainfall prediction model is as follows:

5. The rainfall prediction method based on deep learning according to claim 1, characterized in that: In step S4, during the training of the rainfall prediction model, the loss function is: Among them, y n is the actual rainfall of the nth sample, is the predicted rainfall of the nth sample, and N is the number of samples.

6. A readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the rainfall prediction method based on deep learning as described in any one of claims 1 to 5 is implemented.

7. An electronic device, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a rainfall prediction method based on deep learning as described in any one of claims 1 to 5 is implemented.

8. A computer program product, characterized in that It includes a computer program / instruction, which, when executed by a processor, implements a rainfall prediction method based on deep learning as described in any one of claims 1 to 5.