Medium- and long-term precipitation forecasting method and system based on secondary screening and fusion of multi-head self-attention mechanism

Through the fusion of multi-head self-attention mechanism and convolutional long and short memory neural network based on secondary screening, the difficulty of factor selection and model integration in medium and long-term precipitation forecasting is solved, the forecasting accuracy is improved and the local optimal problem is avoided, achieving a more comprehensive Precipitation forecast analysis.

CN118673336BActive Publication Date: 2024-10-29NANJING HYDRAULIC RES INST
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411163010.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-10-29
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

In the study of medium- and long-term precipitation forecasting, the selection of forecast factors and the integrated construction of diversity models are difficult, which makes it difficult to guarantee the forecast accuracy. It is difficult for a single method to take advantage of machine learning, and it is easy to fall into the local optimal problem.

Method used

A fused multi-head self-attention mechanism based on secondary screening is used to screen predictors through statistical methods and random forest algorithms. The multi-head self-attention mechanism is integrated with the convolutional long and short memory neural network. The Sparrow algorithm is used for parameter optimization. It is under construction. Long-term precipitation forecast model.

Benefits of technology

Through selected forecast factors and multi-level training, the accuracy of medium- and long-term precipitation forecasts is improved, effectively alleviating the problem that the model is prone to local optimality, and achieving more comprehensive analysis and better forecast results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118673336B_ABST
    Figure CN118673336B_ABST
Patent Text Reader

Abstract

The present invention provides a medium- and long-term precipitation forecasting method and system based on secondary screening and fusion multi-head self-attention mechanism, which relates to the field of precipitation forecasting. The method steps are as follows: obtaining historical meteorological factor data and hydrological station precipitation data in the study area, using statistical methods and random forest algorithms to screen forecasting factors, and obtaining the final forecasting factor library; fusing the multi-head self-attention mechanism with the convolutional long-short memory neural network, and using the sparrow algorithm for optimization coupling to construct a medium- and long-term precipitation forecasting model; using the final forecasting factor library to input the constructed optimization model to achieve the estimation of medium- and long-term precipitation in the study area; and comparing statistical parameters with traditional forecasting models to evaluate the model forecasting effect. The present invention selects forecasting factors through secondary screening, and introduces multi-head self-attention mechanism layers to train traditional forecasting models at multiple levels, and estimates that the subsequent medium- and long-term precipitation forecast accuracy is higher than that of traditional methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of precipitation forecasting, and in particular to a medium- and long-term precipitation forecasting method and system based on secondary screening and fusion of a multi-head self-attention mechanism. Background Art

[0002] Reliable medium- and long-term precipitation forecasts can reduce the losses caused by natural risks, provide reliable technical and data references for flood control and scheduling of water conservancy projects, and help optimize the hydrological and meteorological disaster warning system to achieve sustainable use of water resources. However, the forecast period of medium- and long-term precipitation forecast research is long, the influencing factors are complex, the model generalization ability is poor, and the forecast accuracy is difficult to be effectively guaranteed. Using historical meteorological data and meteorological forecast data to conduct process-based medium- and long-term predictions is one of the main research directions at present.

[0003] In the study of medium- and long-term precipitation forecasting, the selection of forecasting factors and the integrated construction of diverse models have always been the difficulties in medium- and long-term forecasting research. In recent years, the academic community has carried out a lot of research on the selection and identification of forecasting factors, the construction and optimization of forecasting models, and other aspects. At present, with the increasing complexity of the actual situation of the research object, it is difficult to reflect the advantages of various model mechanisms in machine learning by using a single method to construct a forecasting model, and it is difficult to avoid its inherent defects. Therefore, the construction coupling of the forecasting model needs to be deepened. By constructing a combined forecasting model, the advantages of each model and mechanism can be effectively exerted to a certain extent, thereby improving the forecast accuracy. Summary of the invention

[0004] Purpose of the invention: To propose a medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism, and further propose a system for implementing the above method to solve the above problems existing in the prior art.

[0005] First, a medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism is proposed. The method includes the following steps:

[0006] Step 1: Obtain historical meteorological factor data of a predetermined study area and construct a basic meteorological factor library; obtain precipitation data of a hydrological station in the study area, and calculate the average precipitation data sequence of the study area under the monthly surface based on the precipitation data of the hydrological station; push the historical meteorological factor data forward to a predetermined month in sequence to match the monthly time scale of the precipitation data of the hydrological station, and construct a monthly meteorological factor forecast library;

[0007] Step 2: Calculate the correlation coefficient between the average precipitation data sequence and the meteorological factor forecast library, and obtain a set of correlation coefficient results between the average precipitation data sequence and the meteorological factor forecast library in different forward months; analyze the set of correlation coefficient results, screen out multiple groups of forecast factor sequences, and obtain the final forecast factor library under the study area;

[0008] Step 3: The multi-head self-attention mechanism is integrated with the convolutional long short-term memory neural network to obtain a medium- and long-term precipitation forecast model and optimize its parameters;

[0009] Step 4: Input the final prediction factor library into the medium- and long-term precipitation forecast model after parameter optimization, output the medium- and long-term precipitation forecast results of the target area, and perform statistical analysis on the forecast results:

[0010] If the forecast result meets expectations, the current forecast result is directly output;

[0011] If the forecast result does not meet expectations, repeat steps 1 to 3 until a medium- and long-term precipitation forecast model that meets expectations is iterated and a forecast result that meets expectations is output.

[0012] In a further embodiment of the first aspect, step 1 specifically comprises:

[0013] Step 1-1, obtaining meteorological factor data of a predetermined research area and a predetermined research period to form a basic meteorological factor library; wherein the meteorological factor data includes atmospheric circulation factors and sea temperature factors;

[0014] Step 1-2: Obtain the point precipitation data of each hydrological station in the study area during the study period, and calculate the surface precipitation of the study area using the Thiessen polygon method;

[0015] Step 1-3, from January to December, the basic meteorological factor library is combined with the time series of surface precipitation in the study area to form meteorological factor-target precipitation combinations of multiple different forward months, which are used as the meteorological factor forecast library.

[0016] In a further embodiment of the first aspect, step 2 specifically comprises:

[0017] Step 2-1: For the meteorological factor forecast database obtained in step 1-3, calculate the rank correlation coefficient of the meteorological factor-target precipitation combination after matching , calculate the rank correlation coefficient of all combinations Then construct a set of serial correlation coefficients. Rank correlation coefficient The calculation is as follows:

[0018]

[0019] In the formula, n represents the length of the sample sequence, It indicates the position difference of two variables after they are sorted. The correlation coefficient value is between -1 and 1. The larger the absolute value, the stronger the correlation. When the absolute value is 0, there is no correlation between the level and the rank.

[0020] Step 2-2, analyze the constructed serial correlation coefficient set, screen out the meteorological factor-target precipitation combinations of the top-ranked forward months, use the random forest method to evaluate the importance of each feature in the meteorological factor-target precipitation combination, and calculate the Gini index of each feature;

[0021] The Gini coefficient is used as the evaluation index to conduct secondary screening of the predictor factors to obtain multiple groups of predictor factor sequences, which constitute the final predictor factor library.

[0022] In a further embodiment of the first aspect, in step 2-1, the importance of each feature in the meteorological factor-target precipitation combination is evaluated using a random forest method, as follows:

[0023] There are J features, I decision trees and C categories in total. Tree Node Gini index The calculation formula is as follows:

[0024]

[0025] In the formula, Indicates Nodes of a tree Medium Category The proportion of

[0026] Calculate the The importance of the feature in the entire random forest system :

[0027]

[0028] In the formula, and are the Gini indexes of the two new nodes after branching; For the The feature in Tree Node The importance of Features In the decision tree The collection of nodes that appear in .

[0029] In a further embodiment of the first aspect, step 3 specifically comprises:

[0030] Step 3-1, using the multiple sets of prediction factor sequences screened in step 2-2 as input, and the surface precipitation of the study area calculated in step 1-2 as output, constructing multiple sets of prediction sequence combinations and inputting them into a convolutional long short-term memory neural network; the convolutional long short-term memory neural network includes a signal input layer, a CNN convolution layer, a pooling layer, an LSTM layer, and a classification output layer; wherein the LSTM layer includes two hidden layers;

[0031] Step 3-2: Optimize the parameters of the LSTM layer using the sparrow algorithm: map the parameters in the LSTM layer to sparrow positions; , , is the optimization objective, where is the number of hidden layer nodes, is the initial learning rate, is the L2 regularization coefficient;

[0032] After multiple rounds of iterations, the optimal number of hidden layer nodes, the optimal initial learning rate, and the optimal L2 regularization coefficient of the convolutional long short-term memory neural network are found;

[0033] Step 3-3: Insert the multi-head self-attention mechanism layer into the LSTM layer whose parameters have been optimized in step 3-2 to obtain a medium- and long-term precipitation forecast model.

[0034] In a further embodiment of the first aspect, step 3-2 specifically includes:

[0035] Determine the number of hidden layer nodes by manually adjusting parameters , initial learning rate , L2 regularization coefficient Several parameter samples in the algorithm are divided into followers and explorers according to a predetermined ratio; the explorer is used to jump out of the local optimum, and the follower is used to search near the explorer;

[0036] The explorer's position update rules are as follows:

[0037]

[0038] In the formula, is the maximum number of iterations; is a random number in [0,1]; and ST are warning value and safety value respectively; Q is a random number that follows normal distribution; L is a dimension , d is the number of columns of the matrix, and any element in the matrix is ​​1; represents the v-th dimension position information of the u-th sparrow in the t-th iteration; represents the v-th dimension position information of the u-th sparrow in the t+1-th iteration after the explorer's position is updated;

[0039] The follower's position update rule is as follows:

[0040]

[0041] In the formula, is the position of the optimal explorer; is the current global worst position; s is the population size; A is a dimension , d is the number of columns in the matrix, and each element in the matrix is ​​randomly assigned a value of ±1; is the transposed matrix of A; is the maximum number of iterations; is a random number in [0,1]; u is the sparrow number.

[0042] In a further embodiment of the first aspect, performing statistical analysis on the forecast results in step 4 specifically includes:

[0043] The final prediction factor library is input into the medium- and long-term precipitation forecast model after parameter optimization, and the medium- and long-term precipitation forecast result sequence of the target area is output;

[0044] Calculate the coefficient of determination, mean absolute error and mean square error of the forecast result series;

[0045] Among them, the coefficient of determination The calculation is as follows:

[0046]

[0047] The mean absolute error MAE is calculated as follows:

[0048]

[0049] The mean square error MSE is calculated as follows:

[0050]

[0051] Where n is the sequence length; is the actual value of the sequence; is the actual average value of the series; is the i-th forecast value in the sequence.

[0052] A second aspect of the present invention provides a medium- and long-term precipitation forecast system, which includes a data acquisition unit, a first database construction unit, a calculation unit, a second database construction unit, a forecast model construction unit, and a forecast result output unit.

[0053] The data acquisition unit is used to acquire historical meteorological factor data of a predetermined study area and construct a basic meteorological factor library; in addition, the data acquisition unit also acquires precipitation data from a hydrological station in the study area and calculates a monthly average precipitation data sequence for the study area based on the precipitation data from the hydrological station.

[0054] The first database construction unit is used to sequentially push the historical meteorological factor data forward to a predetermined month so as to match the monthly time scale of the hydrological station precipitation data and construct a monthly meteorological factor forecast database.

[0055] The calculation unit is used to calculate the correlation coefficient between the average precipitation data sequence and the meteorological factor forecast library, and obtain a set of correlation coefficient results between the average precipitation data sequence and the meteorological factor forecast library in different forward months.

[0056] The second database construction unit is used to analyze the correlation coefficient result set, screen out multiple groups of prediction factor sequences, and obtain a final prediction factor library for the study area.

[0057] The forecast model construction unit is used to fuse the multi-head self-attention mechanism with the convolutional long short-term memory neural network to obtain a medium- and long-term precipitation forecast model and optimize its parameters.

[0058] The forecast result output unit is used to input the final forecast factor library into the medium- and long-term precipitation forecast model after parameter optimization, output the medium- and long-term precipitation forecast results of the target area, and perform statistical analysis on the forecast results:

[0059] If the forecast result meets expectations, the current forecast result is directly output;

[0060] If the forecast result does not meet expectations, it is fed back to the forecast model building unit until a medium- and long-term precipitation forecast model that meets expectations is iterated and a forecast result that meets expectations is output.

[0061] The precipitation forecasting system can automatically execute the medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism as disclosed in the first aspect and its further embodiments.

[0062] In a third aspect of the present invention, an electronic device is proposed, comprising a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism as described in the first aspect is implemented.

[0063] In a fourth aspect of the present invention, a computer-readable storage medium is proposed, which stores at least one executable instruction. When the executable instruction is executed on an electronic device, the electronic device executes the medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism as described in the first aspect.

[0064] Compared with the prior art, the technical solution proposed by the present invention has at least the following beneficial effects:

[0065] (1) Statistical methods and the random forest algorithm were used to screen predictive factors. Through secondary screening, appropriate regional main influencing predictive factors were selected more accurately, and the final predictive factor library of the target study area was obtained.

[0066] (2) By integrating the multi-head self-attention mechanism with the convolutional long short-term memory neural network and using the sparrow algorithm for optimization coupling, a medium- and long-term precipitation forecast model is constructed. The advantages of the multi-model mechanism are effectively combined, and model training and fitting are performed in layers. The problem that the model is prone to local optimality is effectively alleviated, thereby more comprehensively analyzing the implicit rules to obtain better medium- and long-term precipitation forecast results. By combining carefully selected forecast factors, the medium- and long-term precipitation in the study area can be estimated. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 This is a flow chart of Embodiment 1 of the present invention.

[0068] Figure 2 This is a flow chart of Embodiment 2 of the present invention.

[0069] Figure 3 It is a heat map of the Spearman rank correlation coefficient of each region on a monthly basis and the item-by-item monitoring and detection index from January to December.

[0070] Figure 4 This is the effect diagram of the SCLM model regional forecast test set.

[0071] Figure 5 This is the effect diagram of the SCLM model predicting the entire sequence.

[0072] Figure 6 This is the full sequence effect diagram predicted by the CNN-LSTM model. DETAILED DESCRIPTION

[0073] In the following description, a large number of specific details are provided to provide a more thorough understanding of the present invention. However, it is apparent to those skilled in the art that the present invention can be implemented without one or more of these details. In other examples, in order to avoid confusion with the present invention, some technical features known in the art are not described.

[0074] Embodiment 1:

[0075] like Figure 1 As shown, this embodiment discloses a medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism, the steps are as follows:

[0076] The historical meteorological factor data and precipitation data of the hydrological station in the study area were obtained, the monthly average precipitation data series of the study area were calculated, and the historical meteorological factors were pushed forward month by month to match the monthly time scale of the precipitation data to build a monthly meteorological factor forecast library; the statistical methods and random forest algorithm were used to screen the forecast factors to obtain the monthly meteorological factor forecast library for the target research.

[0077] The correlation coefficient between the average precipitation data series and the meteorological factor forecast database was calculated, and the correlation coefficient result set between the average precipitation data series and the meteorological factor forecast database in different forward months was obtained and analyzed. Multiple groups of forecast factor sequences were screened out to obtain the final forecast factor database for the study area.

[0078] The multi-head self-attention mechanism is integrated with the convolutional long short-term memory neural network, and the sparrow algorithm is used for optimized coupling to construct a medium- and long-term precipitation forecast model.

[0079] The optimization model constructed by using the final forecast factor library as input is used to predict the medium- and long-term precipitation in the study area. The statistical parameters are compared with those of the traditional forecast model to evaluate the model's forecasting effect.

[0080] The present invention selects forecast factors through secondary screening and introduces a multi-head self-attention mechanism layer to train the traditional forecast model at multiple levels, and estimates that the accuracy of subsequent medium- and long-term precipitation forecasts is higher than that of traditional methods.

[0081] Embodiment 2:

[0082] See Figure 2 As shown, based on Example 1, this embodiment proposes a detailed step of a medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism, as follows:

[0083] Step 1: Obtain historical meteorological factor data information in the study area to build a forecast factor library, obtain precipitation data from a certain number of hydrological stations in the study area, use the precipitation data from the hydrological stations to calculate the monthly surface average precipitation data sequence in the study area, and push the meteorological factors forward a certain number of months in turn to match the monthly time scale of the precipitation data, and build a monthly meteorological factor forecast library;

[0084] Step 1-1: Obtain meteorological factors including atmospheric circulation factors and sea temperature factors for the corresponding research period through the National Climate Center of China to form a basic meteorological factor library;

[0085] Step 1-2: Obtain the point precipitation data of each hydrological station in the study area during the study period through the hydrological yearbook, and calculate the surface precipitation in the study area through the Thiessen polygon method;

[0086] Step 1-3: According to the principle of forwarding month by month, from January to December, the monthly-scale meteorological factor library in step 1-1 and step 1-2 is combined with the surface precipitation time series of the study area to form multiple combinations of meteorological factors and target precipitation in different forward months, which are used as the meteorological factor forecast library.

[0087] Step 2: Calculate the Spearman rank correlation coefficient between the precipitation data sequence and the meteorological factor library constructed in step 1 using a statistical method to obtain a set of correlation coefficient results for different forward months; Use the random forest algorithm on the set of correlation coefficient results and use the Gini coefficient as an evaluation index to perform secondary screening of the prediction factors to obtain the final prediction factor library for the target study area;

[0088] Step 2-1: For the meteorological factor forecast database obtained in step 1-3, after matching, the Spearman rank correlation coefficient of the forward month factor-target month precipitation combination is calculated to measure the correlation coefficient of the two matching sequences. , after calculating the correlation coefficients of all combinations, a set of serial correlation coefficients is constructed;

[0089]

[0090] In the formula, n represents the length of the sample sequence, It indicates the position difference of two variables after they are sorted. The correlation coefficient value is between -1 and 1. The larger the absolute value, the stronger the correlation. When the absolute value is 0, there is no correlation between the level and the rank.

[0091] Step 2-2: Analyze the correlation coefficient set in step 2-1, select the top-ranked forward-month factor-target-month precipitation combinations, and perform random forest (RF) feature importance evaluation on the selected results. Evaluate each feature by calculating the Gini index (GI). The calculated Gini index results of each parameter are filtered according to the set threshold and the ranking order to obtain the final selected forward-month factor-target-month precipitation combination for the study area.

[0092] There are J features, I decision trees and C categories in total. Tree Node Gini index The calculation formula is as follows:

[0093]

[0094] In the formula, Indicates Nodes of a tree Medium Category The proportion of

[0095] Calculate the The importance of the feature in the entire random forest system :

[0096]

[0097] In the formula, and are the Gini indexes of the two new nodes after branching; For the The feature in Tree Node The importance of Features In the decision tree The collection of nodes that appear in .

[0098] Step 3: The multi-head self-attention mechanism is integrated with the convolutional long short-term memory neural network, and the sparrow algorithm is used for optimization to couple and build a medium- and long-term precipitation forecast model;

[0099] Step 3-1: Based on the available data, the multiple sets of forecast factor sequences finally screened in step 2 are used as the model input, and the surface precipitation in the study area calculated in step 1 is used as the model output to construct a forecast sequence combination of a multi-input-single-output medium- and long-term precipitation forecast model;

[0100] Step 3-2, use the sparrow algorithm to optimize the CNN-LSTM model. The sparrow search algorithm can conduct a lot of exploration during the iteration process and has a strong global search capability. In the algorithm, individuals are usually divided into explorers and followers. By determining the position update rules of the two, better global development capabilities and local exploration capabilities can be effectively obtained. The overall structure of the CNN-LSTM convolutional neural network-long short memory model consists of a signal input layer, a CNN convolution layer, a pooling layer, an LSTM layer, and a classification output layer. The parameters in the LSTM layer are mapped to sparrow positions; the sparrow position , , is the optimization objective, where is the number of hidden layer nodes, is the initial learning rate, is the L2 regularization coefficient; after multiple rounds of iterations, the optimal number of hidden layer nodes, the optimal initial learning rate, and the optimal L2 regularization coefficient of the convolutional long short-term memory neural network are found.

[0101] Determine the number of hidden layer nodes by manually adjusting parameters , initial learning rate , L2 regularization coefficient Several parameter samples in the algorithm are divided into followers and explorers according to a predetermined ratio; the explorer is used to jump out of the local optimum, and the follower is used to search near the explorer;

[0102] The explorer's position update rules are as follows:

[0103]

[0104] In the formula, is the maximum number of iterations; is a random number in [0,1]; and ST are warning value and safety value respectively; Q is a random number that follows normal distribution; L is a dimension , d is the number of columns of the matrix, and any element in the matrix is ​​1; represents the v-th dimension position information of the u-th sparrow in the t-th iteration; represents the v-th dimension position information of the u-th sparrow in the t+1-th iteration after the explorer's position is updated;

[0105] The follower's position update rule is as follows:

[0106]

[0107] In the formula, is the position of the optimal explorer; is the current global worst position; s is the population size; A is a dimension , d is the number of columns in the matrix, and each element in the matrix is ​​randomly assigned a value of ±1; is the transposed matrix of A; is the maximum number of iterations; is a random number in [0,1]; u is the sparrow number.

[0108] Step 3-3, insert the Multi-head Attention (MHA) multi-head self-attention mechanism layer into two LSTM layers, and finally obtain the SSA-CNN-LSTM-MHA (SCLM) forecast model of the fusion mechanism for medium- and long-term precipitation forecast. The main workflow of MHA includes: mechanism layer initialization, linear transformation using weight matrix, multi-head segmentation and projection, scaling and normalization of attention scores, weighted summation of attention weights, multi-output (multi-head) splicing and linear transformation output of the final result. It is achieved by running multiple Self-Attention layers simultaneously so that each layer learns different attention independently, and finally all parallel self-attention mechanism layers are merged and output through a single-layer fully connected neural network linear layer without non-linear activation layer.

[0109] Step 4: input the final prediction factor library into the medium- and long-term precipitation forecast model after parameter optimization, output the medium- and long-term precipitation forecast results of the target area, and perform statistical analysis on the forecast results (calculate the determination coefficient, mean absolute error, and mean square error).

[0110] Among them, the coefficient of determination The calculation is as follows:

[0111]

[0112] The mean absolute error MAE is calculated as follows:

[0113]

[0114] The mean square error MSE is calculated as follows:

[0115]

[0116] Where n is the sequence length; is the actual value of the sequence; is the actual average value of the series; is the i-th forecast value in the sequence.

[0117] If the forecast result meets expectations, the current forecast result is directly output;

[0118] If the forecast result does not meet expectations, repeat steps 1 to 3 until a medium- and long-term precipitation forecast model that meets expectations is iterated and a forecast result that meets expectations is output.

[0119] Embodiment 3:

[0120] On the basis of the above two embodiments, this embodiment takes the middle and upper reaches of the Han River above Danjiangkou as the research object, and proposes a medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism. The middle and upper reaches of the Han River above the Danjiangkou Reservoir (32°36′-33°48′N, 110°59′-111°49′E) are mainly hilly slopes, belonging to the subtropical monsoon climate, with abundant rainfall, but the precipitation is unevenly distributed throughout the year. 70%~80% of the annual rainfall is concentrated in the flood season (May~October), with large interannual variations, and the average rainfall for many years is 800mm~1200mm. The precipitation is unevenly distributed in time and space, and the annual precipitation is generally greater on the south bank than on the north bank, and water and drought disasters occur frequently.

[0121] This example collects precipitation, evaporation, and runoff data of some stations in the upper reaches of the Han River for a total of 65 years from 1956 to 2020, as well as 130 global monitoring and detection index data from the National Climate Center (http: / / ncc-cma.net / cn / ) for a total of 66 years from 1955 to 2020, as a prediction factor library for the mid- and long-term precipitation forecast research of the basin (Shiquan section, Shiquan Ankang section, Ankang Baihe section, Pankou section, Pankou Huanglongtan section, Baihe Danjiangkou section). The mid- and long-term precipitation forecast method based on secondary screening and fusion multi-head self-attention mechanism is applied, and the main steps are as follows:

[0122] S1): Construction of meteorological factor forecast database: 130 monthly global monitoring and detection indexes for a total of 66 years from 1955 to 2020 were obtained from the National Climate Center of China, including monthly atmospheric circulation index, monthly sea temperature index and other items. Precipitation data of some stations in the upper reaches of the Hanjiang River in the study area for a total of 65 years from 1956 to 2020 were obtained from hydrological yearbooks, hydrological stations and meteorological monitoring stations. The study area was divided into six sub-areas (Shiquan section, Shiquan-Ankang section, Ankang-Baihe section, Pankou section, Pankou-Huanglongtan section, Baihe-Danjiangkou section), and the monthly surface rainfall data of each sub-area was calculated using the Thiessen polygon method. The meteorological factor database was matched and combined with the time scale of regional surface precipitation according to the forward January-December months, and multiple combinations of forward monthly factors-target month precipitation were constructed, thereby constructing the forecast factor database of the Danjiangkou Reservoir.

[0123] S2): Secondary screening of prediction factors based on statistics and random forest algorithm: For the constructed prediction factor library, the preliminary screening of prediction factors is carried out by considering the Spearman rank correlation coefficient between the monthly surface precipitation in each sub-region from 1956 to 2020 and the item-by-item monitoring and detection index in different forward months from 1955 to 2020. The absolute value of the calculated correlation coefficient is taken and the top 50 items are sorted and screened. The Gini coefficient is used for importance assessment as a secondary screening of the prediction factors, thereby constructing the final regional prediction factor library.

[0124] S3): Optimization of medium- and long-term precipitation forecast model: The sparrow optimization algorithm (SSA) is used to optimize the convolutional long short-term memory neural network (CNN-LSTM) integrated with the multi-head self-attention mechanism, and the SCLM model used for forecasting is constructed. It can learn independently from multiple levels to effectively alleviate the local optimal problem. At the same time, the secondary factor screening results in S2) are used as the driving factors of the model, and the training set and test set of the model are divided into 8:2. For each region, the regional strong influencing factors and the whole basin strong influencing factors are used for training and test forecasting to obtain the final forecast results.

[0125] S4): To analyze the effectiveness of the method of the present invention, the statistical index determination coefficient (R 2 ), mean absolute error (MAE) and mean square error (MSE) are used to evaluate the prediction results of the optimized model. At the same time, Example 3 compares the prediction results of the improved model with the results of the traditional prediction model (CNN-LSTM). It should be noted that the difference between the traditional method and the method of the present invention is only in the model part, and the prediction factor input and other parts remain the same.

[0126] Table 1 gives the ranking of the importance of factors after secondary screening in each region. The present invention selects the prediction factors through secondary factor screening, and at the same time, by distinguishing and comparing the important influencing factors in each region, it is found that the overall strong influencing factor screening results are basically consistent, with only differences in the degree of importance. The best prediction factor in the overall evaluation is the Asian polar vortex area index I, which is of great importance in the entire basin and each region.

[0127] Table 1 Ranking of factors importance after secondary screening in each region

[0128]

[0129] Table 2 gives a comparison of the forecast result parameters of the distinguishing prediction factor library. From the perspective of the determination coefficient, the prediction effect of the unified prediction factor library in the training set is better than that of the regional unique prediction factor library, but in the test set, the prediction effect of the regional unique prediction factor library is better than that of the unified prediction factor library. In the full sequence prediction results, only the determination coefficient of the unified prediction factor library prediction results in the Shiquan-Ankang interval and the Pankou-Huanglongtan interval is slightly larger than the prediction results of the regional unique prediction factor library. From the perspective of MAE and MSE, the MAE of the unique prediction factor library in the Baihe-Danjiangkou interval of the test set is 0.92, which is only slightly larger than the MAE value of 0.91 of the unified prediction factor library. The results of the other test sets all show that the prediction effect of the unique factor library has a smaller error and better results.

[0130] Table 2 Comparison of prediction result parameters of different prediction factor libraries

[0131]

[0132] Table 3 gives the comparison results of the forecast parameters of the traditional model and the improved model. The determination coefficients of the forecast results of the traditional model CNN-LSTM and the improved model SCLM using the same forecast factor library as the driving factor are shown. It can be seen that the improved model is generally significantly better than the traditional model for the medium- and long-term precipitation forecast in the target area. It can be considered that the improvement of the model effectively improves the accuracy of the medium- and long-term precipitation forecast and can better predict the future precipitation trend.

[0133] Table 3 Comparison of prediction parameters of traditional model and improved model

[0134]

[0135] Figure 3 The Spearman rank correlation coefficient diagram between the monthly surface precipitation in each sub-region from 1956 to 2020 and the item-by-item monitoring and detection index of different forward months from 1955 to 2020 is given. From left to right and from top to bottom are the Spearman rank correlation coefficients of the monthly monitoring and detection index of each region from January to December and the forward January to December. Some factors have good correlation, among which February, April, June, and November show a strong regularity that the correlation becomes stronger as the forward forecast month increases, and the overall factors have the same impact (positive and negative correlation) on different regions.

[0136] Figure 4 The test set prediction results of the improved model are given. From top to bottom, they are the forecast results of the common factors test set of the whole basin (left column) and the regional unique factors test set prediction results (right column) of Shiquan section, Shiquan-Ankang section, Ankang-Baihe section, Pankou section, Pankou-Huanglongtan section, and Baihe-Danjiangkou section.

[0137] Figure 5 The comparison results of the full series forecast results of the model before improvement (SCLM model) are given. Figure 6 The comparison results of the full sequence prediction results of the improved model (CNN-LSTM model) are given.

[0138] By adopting the above technical solution disclosed in the present invention, the following beneficial effects are obtained: by using the Spearman coefficient and RF to perform secondary screening on the prediction factor library, the problem of repeated and redundant factors is effectively solved, and the SAA and MHA optimization are introduced into the traditional CNN-LSTM model to construct a medium- and long-term precipitation forecast model of the sparrow algorithm-optimized convolutional long short-term memory neural network (SCLM) that integrates the multi-head self-attention mechanism. By improving the selection method of prediction factors and introducing a new learning mechanism to enrich the model structure, a new idea is demonstrated in the medium- and long-term precipitation forecast for larger basins, which has produced a relatively positive effect and can effectively promote the development of medium- and long-term precipitation forecast technology.

[0139] In terms of information utilization, the above embodiments mainly involve the 130 climate indices provided by the National Climate Center of China and the precipitation data of the hydrological stations in the study area. In terms of the use of the forecast model, it mainly involves the CNN-LSTM model. It should be noted that the present invention has strong scalability, and other precipitation information, runoff forecast and flood forecast can all adopt the model provided by the method of the present invention to a certain extent.

[0140] As described above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes may be made to it in form and detail without departing from the spirit and scope of the present invention as defined in the appended claims.

Claims

1. A medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism, characterized in that: The steps include: Step 1: Obtain historical meteorological factor data of a predetermined study area and construct a basic meteorological factor library; obtain precipitation data of a hydrological station in the study area, and calculate the average precipitation data sequence of the study area under the monthly surface based on the precipitation data of the hydrological station; push the historical meteorological factor data forward to a predetermined month in sequence to match the monthly time scale of the precipitation data of the hydrological station, and construct a monthly meteorological factor forecast library; Step 1-1, obtaining meteorological factor data of a predetermined research area and a predetermined research period to form a basic meteorological factor library; wherein the meteorological factor data includes atmospheric circulation factors and sea temperature factors; Step 1-2: Obtain the point precipitation data of each hydrological station in the study area during the study period, and calculate the surface precipitation of the study area using the Thiessen polygon method; Step 1-3, from January to December, the basic meteorological factor library is combined with the time series of the surface precipitation in the study area to form a plurality of meteorological factor-target precipitation combinations of different forward months, which are used as the meteorological factor forecast library; Step 2: Calculate the correlation coefficient between the average precipitation data sequence and the meteorological factor forecast library, and obtain a set of correlation coefficient results between the average precipitation data sequence and the meteorological factor forecast library in different forward months; Analyze the correlation coefficient result set, screen out multiple groups of prediction factor sequences, and obtain a final prediction factor library for the study area; Step 2-1: For the meteorological factor forecast database obtained in step 1-3, calculate the rank correlation coefficient of the meteorological factor-target precipitation combination after matching ; ; In the formula, n represents the length of the sample sequence, It represents the difference in the position of the two variables after they are sorted. Calculate the rank correlation coefficient for all combinations Then construct a set of serial correlation coefficients; Step 2-2, analyze the constructed serial correlation coefficient set, screen out the meteorological factor-target precipitation combinations of the top-ranked forward months, use the random forest method to evaluate the importance of each feature in the meteorological factor-target precipitation combination, and calculate the Gini index of each feature; The Gini coefficient is used as an evaluation index to screen the prediction factors twice to obtain multiple sets of prediction factor sequences, which constitute the final prediction factor library. Step 3: The multi-head self-attention mechanism is integrated with the convolutional long short-term memory neural network to obtain a medium- and long-term precipitation forecast model and optimize its parameters; Step 3-1, using the multiple sets of prediction factor sequences screened in step 2-2 as input, and the surface precipitation of the study area calculated in step 1-2 as output, constructing multiple sets of prediction sequence combinations and inputting them into a convolutional long short-term memory neural network; the convolutional long short-term memory neural network includes a signal input layer, a CNN convolution layer, a pooling layer, an LSTM layer, and a classification output layer; wherein the LSTM layer includes two hidden layers; Step 3-2: Optimize the parameters of the LSTM layer using the sparrow algorithm: map the parameters in the LSTM layer to sparrow positions; , , is the optimization objective, where is the number of hidden layer nodes, is the initial learning rate, is the L2 regularization coefficient; After multiple rounds of iterations, the optimal number of hidden layer nodes, the optimal initial learning rate, and the optimal L2 regularization coefficient of the convolutional long short-term memory neural network are found; Step 3-3, insert the multi-head self-attention mechanism layer into the LSTM layer whose parameters have been optimized in step 3-2 to obtain a medium- and long-term precipitation forecast model; Step 4: Input the final prediction factor library into the medium- and long-term precipitation forecast model after parameter optimization, output the medium- and long-term precipitation forecast results of the target area, and perform statistical analysis on the forecast results: If the forecast result meets expectations, the current forecast result is directly output; If the forecast result does not meet expectations, repeat steps 1 to 3 until a medium- and long-term precipitation forecast model that meets expectations is iterated and a forecast result that meets expectations is output.

2. The medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism according to claim 1 is characterized in that: In step 2-2, the random forest method is used to evaluate the importance of each feature in the meteorological factor-target precipitation combination, including: There are J features, I decision trees and C categories in total. Tree Node Gini index The calculation formula is as follows: ; In the formula, Indicates Nodes of a tree Medium Category The proportion of Calculate the The importance of the feature in the entire random forest system : ; In the formula, and are the Gini indexes of the two new nodes after branching; For the The feature in Tree Node The importance of Features In the decision tree The collection of nodes that appear in .

3. The medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism according to claim 1 is characterized in that: Step 3-2 further includes: Determine the number of hidden layer nodes by manually adjusting parameters , initial learning rate , L2 regularization coefficient Several parameter samples in the algorithm are divided into followers and explorers according to a predetermined ratio; the explorer is used to jump out of the local optimum, and the follower is used to search near the explorer; The explorer's position update rules are as follows: ; In the formula, is the maximum number of iterations; is a random number in [0,1]; and ST are warning value and safety value respectively; Q is a random number that follows normal distribution; L is a dimension , d is the number of columns of the matrix, and any element in the matrix is ​​1; represents the v-th dimension position information of the u-th sparrow in the t-th iteration; represents the v-th dimension position information of the u-th sparrow in the t+1-th iteration after the explorer's position is updated; The position update rules of the followers are as follows: ; In the formula, is the position of the optimal explorer; is the current global worst position; s is the population size; A is a dimension , d is the number of columns in the matrix, and each element in the matrix is ​​randomly assigned a value of ±1; is the transposed matrix of A; is the maximum number of iterations; is a random number in [0,1]; u is the sparrow number.

4. The medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism according to claim 1 is characterized in that: In step 4, statistical analysis is performed on the forecast results, including: The final prediction factor library is input into the medium- and long-term precipitation forecast model after parameter optimization, and the medium- and long-term precipitation forecast result sequence of the target area is output; Calculate the coefficient of determination, mean absolute error and mean square error of the forecast result series; Among them, the coefficient of determination The calculation is as follows: ; The mean absolute error MAE is calculated as follows: ; The mean square error MSE is calculated as follows: ; Where n is the sequence length; is the actual value of the sequence; is the actual average value of the series; is the i-th forecast value in the sequence.

5. A medium- and long-term precipitation forecast system, used to implement the medium- and long-term precipitation forecast method based on secondary screening and fusion of multi-head self-attention mechanism as described in any one of claims 1 to 4; characterized in that: The medium- and long-term precipitation forecast system includes: Data acquisition unit; the data acquisition unit is used to acquire historical meteorological factor data of a predetermined study area and construct a basic meteorological factor library; in addition, the data acquisition unit also acquires precipitation data of a hydrological station in the study area, and calculates a monthly average precipitation data sequence of the study area based on the precipitation data of the hydrological station; The first database construction unit is used to sequentially push the historical meteorological factor data forward to a predetermined month so as to match the monthly time scale of the hydrological station precipitation data, and construct a monthly meteorological factor forecast library; A calculation unit; the calculation unit is used to calculate the correlation coefficient between the average precipitation data sequence and the meteorological factor forecast library, and obtain a set of correlation coefficient results between the average precipitation data sequence and the meteorological factor forecast library in different forward months; A second database construction unit; the second database construction unit is used to analyze the correlation coefficient result set, screen out multiple groups of prediction factor sequences, and obtain a final prediction factor library under the study area; A forecast model construction unit; the forecast model construction unit is used to fuse the multi-head self-attention mechanism with the convolutional long short-term memory neural network to obtain a medium- and long-term precipitation forecast model and optimize its parameters; Forecast result output unit: The forecast result output unit is used to input the final forecast factor library into the medium- and long-term precipitation forecast model after parameter optimization, output the medium- and long-term precipitation forecast results of the target area, and perform statistical analysis on the forecast results: If the forecast result meets expectations, the current forecast result is directly output; If the forecast result does not meet expectations, it is fed back to the forecast model building unit until a medium- and long-term precipitation forecast model that meets expectations is iterated and a forecast result that meets expectations is output.

6. An electronic device, characterized in that: The device includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction. When the executable instruction is executed on the electronic device, the electronic device executes the medium- and long-term precipitation forecasting method based on secondary screening and fusion of multi-head self-attention mechanism as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • A method for calibrating satellite AOD product by fusing geographic parameters of multi-source features is disclosed

    CN109213964A

  • Medium and long-term rainfall grading coupling forecasting method and system based on statistical dynamics

    CN111665575A

  • Middle-and-long-term rainfall forecast modeling method for whole-process coupling machine learning

    CN113537600A

  • Underground water level multi-step prediction method based on convolutional attention long-short term neural network

    CN117520784A