Methods, devices, equipment, and storage media for predicting the number of days with heavy rainfall

By generating a model for predicting the number of days with heavy rainfall and training it with historical and factor data, the problem of predicting the number of days with heavy rainfall in the future has been solved, enabling accurate prediction of heavy rainfall and early implementation of preventive measures.

CN119620239BActive Publication Date: 2026-04-03YUNNAN POWER GRID CO LTD ELECTRIC POWER RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Current technology lacks effective methods to predict the number of days with heavy rainfall in the future, making it impossible to take targeted preventive measures to reduce the adverse effects of heavy rainfall.

Method used

By acquiring historical heavy rain days and heavy rain factor datasets for the target region, the initial model is trained to generate a heavy rain days prediction model. The heavy rain factor data for the target prediction time is then input to predict the future number of heavy rain days.

Benefits of technology

It enables accurate prediction of the number of days with heavy rain in the future, allowing for targeted preventative measures to be taken in advance and reduce the harm of continuous heavy rain to production and daily life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119620239B_ABST
    Figure CN119620239B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and storage medium for predicting the number of rainstorm days. The method includes: acquiring a historical rainstorm day dataset and a corresponding rainstorm factor dataset for a target area; training a preset initial model based on the historical rainstorm day dataset and the corresponding rainstorm factor data to generate a rainstorm day prediction model; collecting target rainstorm factor data for a target prediction time; and inputting the target rainstorm factor data into the rainstorm day prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm day prediction model. By acquiring rainstorm influencing factors that affect the number of rainstorm days and training the model based on the historical rainstorm day dataset and the corresponding rainstorm factor dataset, a rainstorm day prediction model is obtained. This allows for the prediction of future rainstorm days based on the rainstorm day prediction model, enabling targeted preventative measures to be taken when there are too many rainstorm days in the future.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of model prediction technology, and in particular to methods, apparatus, equipment and storage media for predicting the number of days with heavy rain. Background Technology

[0002] Continuous torrential rains have a significant impact on both the natural environment and human life. For the natural environment, continuous torrential rains affect water bodies, soil, and ecosystems. For example, heavy rains can cause rivers and lakes to rise rapidly, potentially leading to floods. Prolonged heavy rains can also cause water pollution, as rainwater washes pollutants from the surface into water bodies. For human life, continuous torrential rains have a significant impact on agriculture, transportation, cities, and the economy. For instance, heavy rains can destroy farmland, roads, bridges, and other infrastructure, causing substantial economic losses. Therefore, it is necessary to predict the number of days with heavy rain in the future so that appropriate preventative measures can be taken to mitigate the adverse effects of torrential rains.

[0003] Currently, there is no effective method to predict the number of days with heavy rain in the future, which makes it impossible to obtain information about future heavy rain conditions and thus impossible to take targeted preventive measures. Summary of the Invention

[0004] Therefore, it is necessary to propose methods, devices, equipment, and storage media for predicting the number of rainstorm days to address the above-mentioned problems, so as to accurately obtain the number of rainstorm days in the future.

[0005] To achieve the above objectives, the first aspect of this application provides a method for predicting the number of days with heavy rainfall, the method comprising:

[0006] Obtain the historical heavy rainfall days dataset for the target region and the corresponding heavy rainfall factor dataset;

[0007] The initial model is trained based on the historical heavy rain days dataset and the corresponding heavy rain factor dataset to generate a heavy rain days prediction model.

[0008] Collect target rainfall factor data for the target prediction time;

[0009] The target rainstorm factor data is input into the rainstorm days prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm days prediction model.

[0010] Furthermore, the step of obtaining the historical heavy rainfall days dataset for the target area and the corresponding heavy rainfall factor dataset specifically includes:

[0011] A historical heavy rain days dataset is generated by obtaining the number of heavy rain days within the forecast period of each year in the past N years, wherein the forecast period is any consecutive months in a preset year, and the historical heavy rain days dataset contains the number of heavy rain days within the forecast period of the past N years.

[0012] The monthly values ​​of the rainstorm impact factor for each month within a number of months prior to the reporting month of the historical target year are used as the rainstorm factor data corresponding to the historical target year. All the rainstorm factor data corresponding to the historical target year are used to generate the rainstorm factor dataset corresponding to the historical rainstorm days dataset. The historical target year is any year in the past N years, and the reporting month is any month before the preset forecast time.

[0013] Furthermore, the step of training a preset initial model based on the historical heavy rain days dataset and the corresponding heavy rain factor dataset to generate a heavy rain days prediction model specifically includes:

[0014] Correlation analysis is performed on the number of rainy days within the forecast period of the historical target year and the rainy factor data of the historical target year to determine the target month with the highest correlation to the number of rainy days within the forecast period;

[0015] Delete the rainstorm factor data that is not for the target month from the rainstorm factor dataset to obtain the target rainstorm factor dataset;

[0016] The preset initial model is trained based on the historical heavy rain days dataset and the target heavy rain factor dataset to generate a heavy rain days prediction model.

[0017] Furthermore, the step of training a preset initial model based on the historical heavy rain days dataset and the target heavy rain factor dataset to generate a heavy rain days prediction model specifically includes:

[0018] Using a preset optimization method, the rainstorm factor types in the target rainstorm factor dataset are filtered according to the historical rainstorm days dataset and the target rainstorm factor dataset to obtain the top M target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time;

[0019] Delete the data in the target rainstorm factor dataset that does not correspond to the target rainstorm factor type to obtain the standard rainstorm factor dataset;

[0020] The initial model is trained using the historical heavy rain days dataset and the standard heavy rain factor dataset to generate a heavy rain days prediction model.

[0021] Furthermore, the step of using a preset optimization method to filter the rainstorm factor types in the target rainstorm factor dataset based on the historical rainstorm days dataset and the target rainstorm factor dataset, and obtaining the top M target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time, specifically includes:

[0022] Using a preset linear algorithm, the rainstorm factor types in the target rainstorm factor dataset are filtered according to the historical rainstorm days dataset and the target rainstorm factor dataset to obtain the top M first target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time;

[0023] Using a preset nonlinear algorithm, the rainstorm factor types in the target rainstorm factor dataset are filtered according to the historical rainstorm days dataset and the target rainstorm factor dataset to obtain the top M second target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time;

[0024] The step of deleting data from the target rainstorm factor dataset that does not correspond to the target rainstorm factor type to obtain a standard rainstorm factor dataset specifically includes:

[0025] Delete the data in the target rainstorm factor dataset that does not correspond to the first target rainstorm factor type to obtain the first standard rainstorm factor dataset.

[0026] Delete the data in the target rainstorm factor dataset that does not correspond to the second target rainstorm factor type to obtain the second standard rainstorm factor dataset;

[0027] The step of training the initial model based on the historical heavy rain days dataset and the standard heavy rain factor dataset to generate a heavy rain days prediction model specifically includes:

[0028] The initial model is trained using the historical heavy rain days dataset, the first standard heavy rain factor dataset, and the second standard heavy rain factor dataset to generate a heavy rain days prediction model.

[0029] Furthermore, the step of training the initial model based on the historical heavy rain days dataset, the first standard heavy rain factor dataset, and the second standard heavy rain factor dataset to generate a heavy rain days prediction model specifically includes:

[0030] The initial model is trained based on the historical heavy rain days dataset and the first standard heavy rain factor dataset to generate a first heavy rain days prediction model;

[0031] The initial model is trained based on the historical heavy rain days dataset and the second standard heavy rain factor dataset to generate a second heavy rain days prediction model;

[0032] The step of inputting the target rainstorm factor data into the rainstorm days prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm days prediction model specifically includes:

[0033] The target rainstorm factor data is input into the first rainstorm day prediction model to obtain the first predicted rainstorm day output by the first rainstorm day prediction model;

[0034] The target rainstorm factor data is input into the second rainstorm days prediction model to obtain the second predicted rainstorm days output by the second rainstorm days prediction model;

[0035] The predicted number of rainstorm days for the target prediction time is calculated based on the first predicted number of rainstorm days and the second predicted number of rainstorm days.

[0036] Furthermore, the step of calculating the number of predicted rainy days for the target prediction time based on the first predicted number of rainy days and the second predicted number of rainy days specifically includes:

[0037] Obtain the prediction pass rate of the first heavy rain days prediction model and the second heavy rain days prediction model;

[0038] The first heavy rain day prediction model and the second heavy rain day prediction model are weighted according to their prediction pass rates. The first weight of the first heavy rain day prediction model and the second weight of the second heavy rain day prediction model are assigned.

[0039] The predicted number of rainy days for the target prediction time is obtained by weighting the first predicted number of rainy days, the second predicted number of rainy days, the first weight, and the second weight.

[0040] To achieve the above objectives, a second aspect of this application provides a device for predicting the number of rainstorm days, the device comprising a data acquisition unit, a model training unit, and a rainstorm prediction unit;

[0041] The data acquisition unit is used to acquire the historical heavy rain days dataset of the target area and the heavy rain factor dataset corresponding to the historical heavy rain days dataset;

[0042] The model training unit is used to train a preset initial model based on the historical heavy rain days dataset and the heavy rain factor data corresponding to the historical heavy rain days dataset, and generate a heavy rain days prediction model.

[0043] The rainstorm prediction unit is used to collect target rainstorm factor data for the target prediction time;

[0044] The target rainstorm factor data is input into the rainstorm days prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm days prediction model.

[0045] To achieve the above objectives, a third aspect of this application provides a computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the processor performs the steps of the method described in the first aspect.

[0046] To achieve the above objectives, a fourth aspect of this application provides a computer device including a memory and a processor, characterized in that the memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the method described in the first aspect.

[0047] The embodiments of the present invention have the following beneficial effects:

[0048] This invention proposes a method for predicting the number of rainstorm days. The method includes: acquiring a historical dataset of rainstorm days and a corresponding dataset of rainstorm factors for a target region; training a pre-set initial model based on the historical dataset of rainstorm days and the corresponding rainstorm factor data to generate a rainstorm day prediction model; collecting target rainstorm factor data for a target prediction time; and inputting the target rainstorm factor data into the rainstorm day prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm day prediction model. By acquiring the rainstorm influencing factors that affect the number of rainstorm days and training the model based on the historical dataset of rainstorm days and the corresponding rainstorm factor dataset, a rainstorm day prediction model is obtained. This allows for the prediction of future rainstorm days based on the rainstorm day prediction model, enabling targeted preventative measures to be taken when there are too many rainstorm days in the future. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] in:

[0051] Figure 1 This is a flowchart illustrating the method for predicting the number of rainstorm days according to an embodiment of the present invention;

[0052] Figure 2 This is a comparison chart of the prediction results of the first heavy rain days prediction model constructed using the 5 factors selected by the Lasso regression algorithm in an embodiment of the present invention.

[0053] Figure 3 This is a comparison chart of the prediction results of the second rainstorm day prediction model constructed using the 5 factors selected by the random forest algorithm in an embodiment of the present invention.

[0054] Figure 4 This is a comparison chart of the prediction results obtained by using the Lasso regression algorithm and the random forest algorithm to select 5 factors in an embodiment of the present invention;

[0055] Figure 5 This is a comparison chart of the prediction results of the first heavy rain days prediction model constructed using the 10 factors selected by the Lasso regression algorithm in an embodiment of the present invention.

[0056] Figure 6 This is a comparison chart of the prediction results of the second rainstorm day prediction model constructed using 10 factors selected by the random forest algorithm in an embodiment of the present invention.

[0057] Figure 7 This is a comparison chart of the prediction results obtained by using the Lasso regression algorithm and the random forest algorithm to screen 10 factors in an embodiment of the present invention;

[0058] Figure 8 This is a comparison chart of the prediction results of the first heavy rain days prediction model constructed using the 15 factors selected by the Lasso regression algorithm in an embodiment of the present invention.

[0059] Figure 9 This is a comparison chart of the prediction results of the second rainstorm day prediction model constructed using 15 factors selected by the random forest algorithm in an embodiment of the present invention.

[0060] Figure 10 This is a comparison chart of the prediction results obtained by using the Lasso regression algorithm and the random forest algorithm to screen 15 factors in an embodiment of the present invention;

[0061] Figure 11 This is a structural block diagram of the rainstorm day prediction device according to an embodiment of the present invention;

[0062] Figure 12 This is an internal structural diagram of a computer device in an embodiment of the present invention. Detailed Implementation

[0063] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0064] Existing forecasts of rainfall amounts in a particular region or basin mainly focus on rainfall intensity, with few studies forecasting the number of rainy days or even the number of days with heavy rain.

[0065] Since continuous heavy rainfall in a certain region or river basin can have a significant impact on production and daily life, this invention proposes a method for predicting the number of days with heavy rainfall. This method can be referenced for further information. Figure 1 , Figure 1 This is a flowchart illustrating the method for predicting the number of rainstorm days in an embodiment of the present invention. The method includes:

[0066] Step 120: Obtain the historical heavy rain days dataset and the corresponding heavy rain factor dataset for the target region.

[0067] In this embodiment of the invention, the target area can be a region with high annual rainfall. By predicting the number of rainstorm days in the target area with high rainfall, relevant departments can take targeted preventive measures to avoid major losses and safety problems caused by continuous rainstorms.

[0068] A rainstorm day can be defined as a day when the rainfall exceeds a preset rainfall threshold, such as a day with rainfall exceeding 50 mm / day. The number of rainstorm days is the total number of rainstorm days within a certain period, which can be the number of rainstorm days within a year, a month, or several months; there are no restrictions. For example, in Yunnan, the rainy season is from April to October each year, so the number of rainstorm days from April to October of each past year can be obtained as a historical rainstorm day dataset.

[0069] There are many factors that affect the rainfall intensity in the target area. For example, there are 130 types of rainstorm factors, such as atmospheric circulation, sea surface temperature, and teleconnection index. The relevant data corresponding to the rainstorm factor types are the rainstorm factor data. By obtaining the rainstorm factor data corresponding to the number of rainstorm days, we can obtain the rainstorm factor dataset corresponding to the historical rainstorm day dataset.

[0070] In one embodiment of the present invention, the rainstorm factor data can be the monthly value of each rainstorm factor type in a certain month. For example, the rainstorm factor type can be the Western Pacific subtropical high intensity index, and the rainstorm factor data is the average air pressure value of the Western Pacific subtropical high intensity index in a certain month.

[0071] Step 140: Train the preset initial model based on the historical heavy rain days dataset and the corresponding heavy rain factor dataset to generate a heavy rain days prediction model.

[0072] In this invention, training samples and test samples are generated based on a historical heavy rainfall days dataset and a corresponding heavy rainfall factor dataset. Each sample contains historical heavy rainfall days and corresponding heavy rainfall factor data. A preset initial model is trained using the training samples to generate an initial heavy rainfall days prediction model. The initial heavy rainfall days prediction model is then tested and adjusted using the test samples to obtain the final heavy rainfall days prediction model.

[0073] Step 160: Collect target rainstorm factor data for the target prediction time.

[0074] In this embodiment of the invention, the target prediction time for the number of rainstorm days to be predicted is determined, for example, April 2024 to October 2024, and rainstorm factor data for the target prediction time is obtained, such as relevant data on 130 rainstorm factor types including atmospheric circulation, sea surface temperature, and teleconnection index.

[0075] Step 180: Input the target rainstorm factor data into the rainstorm days prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm days prediction model.

[0076] This invention uses a heavy rain day prediction model to predict the number of heavy rain days in a target area in advance, which is beneficial for making important decision-making references for power dispatching and disaster prevention in the target area, and minimizing the harm caused by continuous heavy rain to production and life.

[0077] In one embodiment of the present invention, step 120, obtaining the historical heavy rain days dataset and the corresponding heavy rain factor dataset for the target area, specifically includes:

[0078] Step 210: Obtain the number of rainy days within the forecast period of each year in the past N years to generate a historical rainy day dataset. The forecast period is any consecutive months in each year. The historical rainy day dataset contains the number of rainy days within the forecast period of the past N years.

[0079] In this embodiment of the invention, the time to be predicted is the number of rainstorm days in a year or one or more months within a year. For example, if the time to be predicted is April to October of each year, then April to October of each year is used as the forecast time, and the number of rainstorm days in April to October of each year over the past N years is obtained as a historical rainstorm day dataset. Therefore, the historical rainstorm day dataset contains the number of rainstorm days within the forecast time of each year over the past N years.

[0080] Step 220: Take the monthly values ​​of the rainstorm impact factor for each month from the starting month of the historical target year to the months preceding the starting month as the rainstorm factor data corresponding to the historical target year. Generate the rainstorm factor dataset corresponding to the historical rainstorm days dataset from all the rainstorm factor data corresponding to the historical target year. The historical target year is any year in the past N years, and the starting month is any month before the preset forecast time.

[0081] In this embodiment of the invention, rainstorm factor data corresponding to the forecast time for each year in the past N years are obtained. Specifically, any year in the past N years is taken as the historical target year. For example, if the current year is 2024, 2020 can be selected as the historical target year, and rainstorm factor data corresponding to the forecast time (e.g., April to October) in 2020 are obtained.

[0082] Since the goal is to predict the number of rainy days in a target region, there will be a time difference between the rainstorm factor data and the forecast time. In other words, to predict the number of rainy days within the forecast period, it's necessary to obtain rainstorm factor data from the time before the forecast time. Therefore, the first step is to determine the reporting start time based on the forecast time. The starting time can be any month before the forecast time, determined by the actual situation. After determining the starting month, the sampling interval is then determined. The sampling interval can be several months, and the rainstorm factor data for each month within the sampling interval, starting from the starting month, is obtained. This rainstorm factor data represents the rainstorm factor data corresponding to the forecast time in the year to be predicted. For example, to predict the number of rainy days from April to October 2024, the starting month can be determined as March 2024 or earlier. Assuming a sampling period of 60 months, the monthly values ​​of the rainstorm factor for each month within the 60 months preceding March 2024 are needed. This rainstorm factor data represents the rainstorm factor data corresponding to April to October 2024. The rainfall factor data for each of the past N years can be obtained through the above method, thereby generating a rainfall factor dataset corresponding to the historical rainfall day dataset.

[0083] In one embodiment of the present invention, step 140, training a preset initial model based on a historical heavy rain days dataset and a corresponding heavy rain factor dataset to generate a heavy rain days prediction model, specifically includes:

[0084] Step 410: Conduct a correlation analysis between the number of rainy days in the forecast period of the historical target year and the rainy factor data of the historical target year to determine the target month with the highest correlation to the number of rainy days in the forecast period.

[0085] In this embodiment of the invention, considering that the rainstorm factor data includes monthly values ​​of rainstorm factors for several months, in order to reduce the computational burden and improve the prediction efficiency, and to avoid the error caused by the monthly values ​​of rainstorm factors in months with less influence on the prediction results, the target month of the rainstorm factor data that has the greatest impact on the number of rainstorm days at the forecast time is determined by analyzing the correlation between the number of rainstorm days at the forecast time and the month in which the rainstorm factor is located.

[0086] Specifically, a correlation analysis is performed between the number of rainstorm days in historical target years and the monthly values ​​of rainstorm factors in the corresponding historical target years' rainstorm factor data to determine the month with the highest correlation. For example, if this year is 2024, the number of rainstorm days from April to October of each year in the past 10 years (i.e., 2014-2023) and the corresponding rainstorm factor data for each year are obtained. This rainstorm factor data includes the monthly values ​​of rainstorm factors for the five months prior to March of each year. The correlation between the monthly value of the rainstorm factor and the number of rainstorm days in each month is analyzed to determine the target month containing the rainstorm factor monthly value with the highest correlation to the number of rainstorm days.

[0087] Step 420: Delete the rainstorm factor data that is not for the target month from the rainstorm factor dataset to obtain the target rainstorm factor dataset.

[0088] In this embodiment of the invention, only the monthly values ​​of the rainstorm factor for the target month in the rainstorm factor dataset corresponding to each year are retained. For example, if Step 410 calculates that the monthly value of the rainstorm factor for February is most correlated with April to October each year, then only the monthly value of the rainstorm factor for February in the rainstorm factor dataset corresponding to the forecast time each year is retained, thereby obtaining the target rainstorm factor dataset corresponding to the historical rainstorm days dataset.

[0089] Step 430: Train the preset initial model based on the historical heavy rain days dataset and the target heavy rain factor dataset to generate a heavy rain days prediction model.

[0090] This invention embodiment performs preliminary screening on the rainstorm factor dataset, removing monthly values ​​of rainstorm factors that have little impact on forecast time, thus avoiding these data from affecting the accuracy of the rainstorm day prediction model. In addition, it can reduce computational pressure and improve the efficiency of model training.

[0091] In one embodiment of the present invention, Step 430, training a preset initial model based on a historical heavy rain days dataset and a target heavy rain factor dataset to generate a heavy rain days prediction model, specifically includes:

[0092] Step 431: Using a preset optimization method, filter the rainstorm factor types in the target rainstorm factor dataset based on the historical rainstorm days dataset and the target rainstorm factor dataset to obtain the top M target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time.

[0093] In this embodiment of the invention, the target rainstorm factor dataset is further filtered to retain more meaningful monthly rainstorm factor values. Since there are many types of rainstorm factors obtained, up to 130, in order to reduce the computational burden and improve prediction efficiency, and to avoid the influence of factors with less impact on the number of rainy days on the prediction results, the rainstorm factor types in the target rainstorm factor dataset can be filtered to determine the target rainstorm factor types that have a greater impact on the number of rainy days at the forecast time.

[0094] Specifically, an appropriate optimization algorithm can be selected to determine the top M target rainstorm factor types that have the highest correlation with the number of rainstorm days at the forecast time. It is understood that M is determined based on the actual situation.

[0095] Step 432: Delete the data corresponding to non-target rainstorm factor types in the target rainstorm factor dataset to obtain the standard rainstorm factor dataset.

[0096] In this embodiment of the invention, only the rainstorm factor data corresponding to the target rainstorm factor type in the target rainstorm factor dataset is retained to generate a standard rainstorm factor dataset.

[0097] Step 433: Train the initial model based on the historical heavy rain days dataset and the standard heavy rain factor dataset to generate a heavy rain days prediction model.

[0098] This invention further filters the target rainstorm factor dataset, removing rainstorm factor types that have a small impact on the number of rainstorm days for forecast time. This avoids the rainstorm factor thresholds corresponding to these rainstorm factor types affecting the accuracy of the rainstorm day prediction model. In addition, it can reduce computational pressure and improve the efficiency of model training.

[0099] In one embodiment of the present invention, Step 431 involves using a preset optimization method to filter the rainstorm factor types in the target rainstorm factor dataset based on the historical rainstorm days dataset and the target rainstorm factor dataset, thereby obtaining the top M target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time. Specifically, this includes:

[0100] Step 431: Using a preset linear algorithm, filter the rainstorm factor types in the target rainstorm factor dataset based on the historical rainstorm days dataset and the target rainstorm factor dataset to obtain the top M first target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time.

[0101] In this embodiment of the invention, screening rainstorm factor types using a linear algorithm can yield a relatively stable regression relationship through a regression model, and can also provide a more intuitive explanation of the role of each rainstorm factor type in the number of rainstorm days in the forecast time at a physical level.

[0102] In one embodiment of the present invention, the linear algorithm can be the Lasso regression algorithm, which is used to filter the types of rainstorm factors. A filtering target can be set, such as 5, 10, or 15 rainstorm factor types. The Lasso regression algorithm reduces the complexity of the model by introducing L1 regularization, thus enabling the selection of rainstorm factor types.

[0103] The correlation coefficient of each rainstorm factor type is calculated using the objective function of Lasso regression. The rainstorm factor types corresponding to the M correlation coefficients with the largest absolute values ​​are taken as the first target rainstorm factor types.

[0104] In this embodiment of the invention, the objective function of Lasso regression is:

[0105]

[0106] In the formula, the mean square error is: L1 regularization term:

[0107] Where w is the coefficient vector, n is the number of samples, and y i The number of days with heavy rain in the sample. To predict the number of days with heavy rainfall, λ is the regularization intensity hyperparameter, and p is the total number of heavy rainfall factor types.

[0108] Step 432: Using a preset nonlinear algorithm, the rainstorm factor types in the target rainstorm factor dataset are filtered based on the historical rainstorm days dataset and the target rainstorm factor dataset to obtain the top M second target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time.

[0109] In this embodiment of the invention, since the number of rainstorm days is affected by the complexity of atmospheric motion, and nonlinear algorithms can capture the exponential, power-law, and other nonlinear relationships between atmospheric circulation and precipitation, nonlinear algorithms can be selected to screen rainstorm factor types to improve the effectiveness of rainstorm factor type selection.

[0110] In one embodiment of the present invention, the nonlinear algorithm can be a random forest algorithm. The random forest algorithm calculates the importance of different rainstorm factor types and selects the top M second-target rainstorm factor types that contribute the most. M can take values ​​such as 5, 10, or 15.

[0111] This invention uses two different methods to screen for rainstorm factors, thereby identifying the main factors that have the greatest impact on the number of rainstorm days in the forecast time of the target area, and thus providing a scientific basis for rainstorm forecasting and disaster prevention and mitigation.

[0112] Based on this, Step 432, delete the data corresponding to non-target rainstorm factor types from the target rainstorm factor dataset to obtain the standard rainstorm factor dataset, which specifically includes:

[0113] Step 4321: Delete the data corresponding to non-first target rainstorm factor types in the target rainstorm factor dataset to obtain the first standard rainstorm factor dataset.

[0114] After obtaining the first target rainstorm factor type based on the linear algorithm, only the monthly values ​​of the rainstorm factors corresponding to the first target rainstorm factor type in the target rainstorm factor dataset are retained to generate the first standard rainstorm factor dataset.

[0115] Step 4322: Delete the data in the target rainstorm factor dataset that are not the second target rainstorm factor type to obtain the second standard rainstorm factor dataset.

[0116] After obtaining the second target rainstorm factor type based on a nonlinear algorithm, only the monthly values ​​of the rainstorm factor corresponding to the second target rainstorm factor type in the target rainstorm factor dataset are retained to generate the second standard rainstorm factor dataset.

[0117] Based on this, Step 433 trains the initial model using the historical heavy rain days dataset and the standard heavy rain factor dataset to generate a heavy rain days prediction model, specifically including:

[0118] Step 4331: Train the initial model based on the historical heavy rain days dataset, the first standard heavy rain factor dataset, and the second standard heavy rain factor dataset to generate a heavy rain days prediction model.

[0119] Specifically, an initial model can be trained using the union or intersection of the first and second standard rainstorm factor datasets and a historical rainstorm day dataset to generate a rainstorm day prediction model. This embodiment of the invention trains the initial model using rainstorm factor types selected through two linear and nonlinear algorithms. This accurately identifies the rainstorm factor types that have the greatest impact on the number of rainstorm days at the forecast time, enabling the model to be trained based on a precise standard rainstorm factor dataset, resulting in a more accurate rainstorm day prediction model.

[0120] In one embodiment of the present invention, Step 4331, training the initial model based on the historical heavy rain days dataset, the first standard heavy rain factor dataset, and the second standard heavy rain factor dataset to generate a heavy rain days prediction model, specifically includes:

[0121] Step 43311: Train the initial model based on the historical heavy rain days dataset and the first standard heavy rain factor dataset to generate the first heavy rain days prediction model.

[0122] Step 43312: Train the initial model based on the historical heavy rain days dataset and the second standard heavy rain factor dataset to generate the second heavy rain days prediction model.

[0123] In this embodiment of the invention, a first heavy rain day prediction model is constructed based on a historical heavy rain day dataset and a first standard heavy rain factor dataset using a preset inverse neural network; a second heavy rain day prediction model is constructed based on the historical heavy rain day dataset and the second standard heavy rain factor dataset using the same preset inverse neural network. Using two heavy rain day prediction models allows for consideration of the differences arising from different methods of factor selection.

[0124] Based on this, step 180 involves inputting the target rainstorm factor data into the rainstorm days prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm days prediction model, specifically including:

[0125] Step 811: Input the target rainstorm factor data into the first rainstorm day prediction model to obtain the first predicted rainstorm day output by the first rainstorm day prediction model.

[0126] Step 812: Input the target rainstorm factor data into the second rainstorm day prediction model to obtain the second predicted rainstorm day output by the second rainstorm day prediction model.

[0127] Step 813: Calculate the number of predicted rainstorm days for the target prediction time based on the first and second predicted rainstorm days.

[0128] In this embodiment of the invention, the target prediction time is first determined, which is the target prediction year. For example, if the target prediction year is 2024, it means that the number of rainstorm days in the forecast period of 2024 (e.g., April to October) needs to be predicted. Secondly, the target rainstorm factor data for the target prediction time is obtained. For example, assuming that the monthly value of the rainstorm factor most correlated with the forecast time is in February, and the target rainstorm factor types most correlated with the forecast time are A, B, C, D, and E, then the monthly values ​​of rainstorm factor types A, B, C, D, and E in February 2024 are obtained as the target rainstorm factor data corresponding to the target prediction time.

[0129] After obtaining the target rainstorm factor data, the target rainstorm factor data is input into the first rainstorm day prediction model and the second rainstorm day prediction model respectively, to obtain the first predicted rainstorm day and the second predicted rainstorm day output by the two rainstorm day prediction models respectively. Then, the predicted rainstorm day for the target prediction time is calculated based on the first predicted rainstorm day and the second predicted rainstorm day. For example, the predicted rainstorm day for the target prediction time can be the mean, maximum, minimum or other characteristic values ​​of the first predicted rainstorm day and the second predicted rainstorm day.

[0130] In one embodiment of the present invention, Step 813, calculating the predicted number of rainstorm days for the target prediction time based on the first predicted number of rainstorm days and the second predicted number of rainstorm days, specifically includes:

[0131] Step 8131: Obtain the prediction pass rate of the first heavy rain day prediction model and the second heavy rain day prediction model.

[0132] In this embodiment of the invention, a pass rate test is performed on the prediction results of the first heavy rain days prediction model and the second heavy rain days prediction model using a set of standard samples.

[0133] Specifically, the relative error between the predicted number of rainstorm days and the actual number of rainstorm days is calculated. The relative error is calculated as (predicted number of rainstorm days - actual number of rainstorm days) ÷ actual number of rainstorm days × 100%. When the relative error is less than the preset error threshold, it is considered qualified. Each rainstorm day prediction model is tested based on a set of standard samples, and the prediction qualification rate of each rainstorm day prediction model is calculated.

[0134] Step 8132: Based on the prediction pass rate of the first heavy rain day prediction model and the second heavy rain day prediction model, assign weights to the first heavy rain day prediction model and the second heavy rain day prediction model.

[0135] Specifically, the weights of each heavy rain day prediction model are calculated using the following formula:

[0136]

[0137] In the formula, γ1 is the target heavy rain day prediction model, which is either the first heavy rain day prediction model or the second heavy rain day prediction model. φ1 is the prediction pass rate of the target heavy rain day prediction model, and φ2 is the prediction pass rate of the other heavy rain day prediction model.

[0138] Step 8133: Calculate the weighted average of the first predicted number of rainstorm days, the second predicted number of rainstorm days, the first weight, and the second weight to obtain the predicted number of rainstorm days for the target prediction time.

[0139] Specifically, the predicted number of rainstorm days for the target prediction time is obtained by weighted averaging of the predicted number of rainstorm days and weights of each rainstorm prediction model.

[0140] In this embodiment of the invention, the number of rainstorm days in the future is predicted by using two rainstorm day prediction models corresponding to two screening factor algorithms, so as to improve the accuracy of rainstorm day prediction.

[0141] To demonstrate the advantages of this invention, the following sets of experiments were conducted:

[0142] (1) For reference Figure 2 , Figure 2 This is a comparison chart of the prediction results of the first heavy rain days prediction model constructed using the 5 factors selected by the Lasso regression algorithm in this embodiment of the invention. It can be seen that the overall trend of the predicted values ​​is relatively consistent with the actual measurements, with a correlation coefficient of 0.66. Figure 3 This is a comparison chart of the prediction results of the second heavy rain day prediction model constructed using the 5 factors selected by the random forest algorithm in this embodiment of the invention. It can be seen that the overall prediction effect is slightly lower than that of the previous model. Figure 1 The correlation coefficient reached 0.58; Figure 4 This is a comparison chart of the prediction results obtained by selecting 5 factors using the Lasso regression algorithm and the random forest algorithm in this embodiment of the invention. The chart combines the prediction results of both methods (Lasso regression and random forest) with the selection of 5 factors, showing that the combined prediction performance is slightly better than the combined prediction. Figure 2 ,and Figure 1 They are similar, with a correlation coefficient of 0.68.

[0143] (2) For reference Figure 5 , Figure 5 The image shows a comparison of the prediction results of the first heavy rain days prediction model constructed using the 10 factors selected by the Lasso regression algorithm in this embodiment of the invention. It can be seen that the overall trend of the predicted values ​​is relatively consistent with the actual measurements, and the 10-factor prediction effect is slightly better than the 5-factor prediction, with a correlation coefficient of 0.68. Figure 6 This is a comparison chart of the prediction results of the second rainstorm day prediction model constructed using 10 factors selected by the random forest algorithm in this embodiment of the invention. The 10-factor prediction effect is slightly better than the 5-factor prediction. It can be seen that the overall prediction effect is slightly lower than the Lasso regression algorithm, with a correlation coefficient of 0.62. Figure 7 This is a comparison chart of the prediction results obtained by using the Lasso regression algorithm and the random forest algorithm to select 10 factors in an embodiment of the present invention. It can be seen that the ensemble prediction effect is better than that of the random forest algorithm. Figure 5 and Figure 6 Furthermore, the 10-factor prediction performance was slightly better than the 5-factor prediction, with a correlation coefficient of 0.77.

[0144] (3) For reference Figure 8 , Figure 8 This is a comparison chart of the prediction results of the first heavy rain days prediction model constructed using 15 factors selected by the Lasso regression algorithm in this embodiment of the invention. It can be seen that the overall trend of the predicted values ​​is relatively consistent with the actual measurements, and the prediction effect of the 15 factors is slightly better than that of the 5-factor and 10-factor predictions, with a correlation coefficient of 0.83. Figure 9 This is a comparison chart of the prediction results of the second rainstorm day prediction model constructed using 15 factors selected by the random forest algorithm in this embodiment of the invention. It can be seen that the overall prediction effect is slightly higher than that of the previous model. Figure 8 Furthermore, the 15-factor prediction performance was slightly better than that of the 5-factor and 10-factor predictions, with a correlation coefficient of 0.87. Figure 10 This is a comparison chart of the prediction results obtained by selecting 15 factors using the Lasso regression algorithm and the random forest algorithm in this embodiment of the invention. The chart combines the prediction results of both methods (Lasso regression and random forest) with the 15-factor selection, showing that the combined prediction performance is slightly better than the combined prediction. Figure 8 and Figure 9 Furthermore, the 15-factor prediction performance was slightly better than that of the 5-factor and 10-factor predictions, with a correlation coefficient of 0.91.

[0145] The two sets of experiments above demonstrate that the advantage of building a model based on linear selection factors lies in its superior predictive performance compared to nonlinear selection factors when the number of retained factors is small. However, when the number of retained factors is large, the advantage of nonlinear selection factors outweighs that of linear selection factors. The prediction method based on weight sets, on the other hand, can balance the influence of both linear and nonlinear factors on the predicted object, resulting in optimal predictive performance.

[0146] The present invention also proposes a device for predicting the number of rainstorm days, which can be referred to. Figure 11 , Figure 11 The diagram shows the structure of the rainstorm day prediction device in this embodiment of the invention. The device includes a data acquisition unit 1101, a model training unit 1102, and a rainstorm prediction unit 1103.

[0147] The data acquisition unit 1101 is used to acquire the historical heavy rain days dataset and the corresponding heavy rain factor dataset for the target area.

[0148] The model training unit 1102 is used to train a preset initial model based on the historical heavy rain days dataset and the corresponding heavy rain factor data to generate a heavy rain days prediction model.

[0149] The rainstorm prediction unit 1103 is used to collect target rainstorm factor data for the target prediction time.

[0150] Input the target rainstorm factor data into the rainstorm days prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm days prediction model.

[0151] This invention obtains a rainstorm influencing factor that affects the number of rainstorm days, and trains a model based on a historical rainstorm day dataset and a corresponding rainstorm factor dataset to obtain a rainstorm day prediction model. This model can be used to predict the number of future rainstorm days, enabling targeted preventative measures to be taken when there are too many rainstorm days in the future.

[0152] Figure 12 An internal structural diagram of a computer device according to one embodiment of the present invention is shown. This computer device can specifically be a terminal or a system. Figure 12 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program causes the processor to perform the steps in the above-described method embodiments. The internal memory may also store a computer program, which, when executed by the processor, causes the processor to perform the steps in the above-described method embodiments. Those skilled in the art will understand that... Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0153] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps in the above method embodiments.

[0154] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the steps in the above method embodiments.

[0155] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0156] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0157] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for predicting the number of days with heavy rainfall, characterized in that, The method includes: Obtain the historical heavy rainfall days dataset for the target region and the corresponding heavy rainfall factor dataset; The initial model is trained based on the historical heavy rain days dataset and the corresponding heavy rain factor dataset to generate a heavy rain days prediction model. Collect target rainfall factor data for the target prediction time; The target rainstorm factor data is input into the rainstorm days prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm days prediction model. Specifically, obtaining the historical heavy rainfall days dataset for the target region and the corresponding heavy rainfall factor dataset includes: A historical heavy rain days dataset is generated by obtaining the number of heavy rain days within the forecast period of each year in the past N years, wherein the forecast period is any consecutive months in a preset year, and the historical heavy rain days dataset contains the number of heavy rain days within the forecast period of the past N years. The monthly values ​​of the rainstorm impact factor for each month from the reporting start month to several months before the reporting start month of the historical target year are used as the rainstorm factor data corresponding to the historical target year. All the rainstorm factor data corresponding to the historical target year are used to generate the rainstorm factor dataset corresponding to the historical rainstorm days dataset. The historical target year is any year in the past N years, and the reporting start month is any month before the preset forecast time. The step of training a preset initial model based on the historical heavy rain days dataset and the corresponding heavy rain factor dataset to generate a heavy rain days prediction model specifically includes: Correlation analysis is performed on the number of rainy days within the forecast period of the historical target year and the rainy factor data of the historical target year to determine the target month with the highest correlation to the number of rainy days within the forecast period; Delete the rainstorm factor data that is not for the target month from the rainstorm factor dataset to obtain the target rainstorm factor dataset; The initial model is trained based on the historical heavy rain days dataset and the target heavy rain factor dataset to generate a heavy rain days prediction model. The step of training a preset initial model based on the historical heavy rain days dataset and the target heavy rain factor dataset to generate a heavy rain days prediction model specifically includes: Using a preset optimization method, the rainstorm factor types in the target rainstorm factor dataset are filtered according to the historical rainstorm days dataset and the target rainstorm factor dataset to obtain the top M target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time; Delete the data in the target rainstorm factor dataset that does not correspond to the target rainstorm factor type to obtain the standard rainstorm factor dataset; The initial model is trained based on the historical heavy rain days dataset and the standard heavy rain factor dataset to generate a heavy rain days prediction model; Specifically, the step of using a preset optimization method to filter the rainstorm factor types in the target rainstorm factor dataset based on the historical rainstorm days dataset and the target rainstorm factor dataset to obtain the top M target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time includes: Using a preset linear algorithm, the rainstorm factor types in the target rainstorm factor dataset are filtered according to the historical rainstorm days dataset and the target rainstorm factor dataset to obtain the top M first target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time; Using a preset nonlinear algorithm, the rainstorm factor types in the target rainstorm factor dataset are filtered according to the historical rainstorm days dataset and the target rainstorm factor dataset to obtain the top M second target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time; The step of deleting data from the target rainstorm factor dataset that does not correspond to the target rainstorm factor type to obtain a standard rainstorm factor dataset specifically includes: Delete the data in the target rainstorm factor dataset that does not correspond to the first target rainstorm factor type to obtain the first standard rainstorm factor dataset. Delete the data in the target rainstorm factor dataset that does not correspond to the second target rainstorm factor type to obtain the second standard rainstorm factor dataset; The step of training the initial model based on the historical heavy rain days dataset and the standard heavy rain factor dataset to generate a heavy rain days prediction model specifically includes: The initial model is trained using the historical heavy rain days dataset, the first standard heavy rain factor dataset, and the second standard heavy rain factor dataset to generate a heavy rain days prediction model.

2. The method as described in claim 1, characterized in that, The step of training the initial model based on the historical heavy rain days dataset, the first standard heavy rain factor dataset, and the second standard heavy rain factor dataset to generate a heavy rain days prediction model specifically includes: The initial model is trained based on the historical heavy rain days dataset and the first standard heavy rain factor dataset to generate a first heavy rain days prediction model; The initial model is trained based on the historical heavy rain days dataset and the second standard heavy rain factor dataset to generate a second heavy rain days prediction model; The step of inputting the target rainstorm factor data into the rainstorm days prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm days prediction model specifically includes: The target rainstorm factor data is input into the first rainstorm day prediction model to obtain the first predicted rainstorm day output by the first rainstorm day prediction model; The target rainstorm factor data is input into the second rainstorm days prediction model to obtain the second predicted rainstorm days output by the second rainstorm days prediction model; The predicted number of rainstorm days for the target prediction time is calculated based on the first predicted number of rainstorm days and the second predicted number of rainstorm days.

3. The method as described in claim 2, characterized in that, The calculation of the predicted number of rainy days for the target prediction time based on the first predicted number of rainy days and the second predicted number of rainy days specifically includes: Obtain the prediction pass rate of the first heavy rain days prediction model and the second heavy rain days prediction model; The first heavy rain day prediction model and the second heavy rain day prediction model are weighted according to their prediction pass rates. The first weight of the first heavy rain day prediction model and the second weight of the second heavy rain day prediction model are assigned. The predicted number of rainy days for the target prediction time is obtained by weighting the first predicted number of rainy days, the second predicted number of rainy days, the first weight, and the second weight.

4. A device for predicting the number of days of heavy rain, characterized in that, The device includes a data acquisition unit, a model training unit, and a rainstorm prediction unit; The data acquisition unit is used to acquire the historical heavy rain days dataset of the target area and the heavy rain factor dataset corresponding to the historical heavy rain days dataset; The model training unit is used to train a preset initial model based on the historical heavy rain days dataset and the heavy rain factor data corresponding to the historical heavy rain days dataset, and generate a heavy rain days prediction model. The rainstorm prediction unit is used to collect target rainstorm factor data for the target prediction time; input the target rainstorm factor data into the rainstorm days prediction model to obtain the predicted number of rainstorm days for the target prediction time output by the rainstorm days prediction model; The data acquisition unit is further configured to acquire the number of rainstorm days within the forecast period of each year in the past N years to generate a historical rainstorm days dataset, wherein the forecast period is any consecutive months in a preset year, and the historical rainstorm days dataset contains the number of rainstorm days within the forecast period of the past N years; the monthly value of the rainstorm impact factor of each month from the start month of the historical target year to the several months before the start month is used as the rainstorm factor data corresponding to the historical target year, and all the rainstorm factor data corresponding to the historical target year are used to generate the rainstorm factor dataset corresponding to the historical rainstorm days dataset, wherein the historical target year is any year in the past N years, and the start month is any month before the preset forecast period; The model training unit is further configured to perform correlation analysis between the number of rainy days during the forecast period of the historical target year and the rainy factor data of the historical target year, and determine the target month with the highest correlation to the number of rainy days during the forecast period; delete the rainy factor data that is not in the target month from the rainy factor dataset to obtain the target rainy factor dataset; and train the preset initial model based on the historical rainy day dataset and the target rainy factor dataset to generate a rainy day prediction model. The model training unit is further configured to use a preset optimization method to filter the rainstorm factor types in the target rainstorm factor dataset based on the historical rainstorm days dataset and the target rainstorm factor dataset, to obtain the top M target rainstorm factor types that have the greatest impact on the number of rainstorm days for the forecast time; delete data in the target rainstorm factor dataset that does not correspond to the target rainstorm factor types to obtain a standard rainstorm factor dataset; and train the initial model based on the historical rainstorm days dataset and the standard rainstorm factor dataset to generate a rainstorm days prediction model. The model training unit is further configured to use a preset linear algorithm to filter the rainstorm factor types in the target rainstorm factor dataset based on the historical rainstorm days dataset and the target rainstorm factor dataset, to obtain the top M first target rainstorm factor types that have the greatest impact on the number of rainstorm days at the forecast time; and to use a preset nonlinear algorithm to filter the rainstorm factor types in the target rainstorm factor dataset based on the historical rainstorm days dataset and the target rainstorm factor dataset, to obtain the top M second target rainstorm factor types that have the greatest impact on the number of rainstorm days at the forecast time. The model training unit is further configured to delete data in the target rainstorm factor dataset that does not correspond to the first target rainstorm factor type to obtain a first standard rainstorm factor dataset; and to delete data in the target rainstorm factor dataset that does not correspond to the second target rainstorm factor type to obtain a second standard rainstorm factor dataset. The model training unit is also used to train the initial model based on the historical rainstorm days dataset, the first standard rainstorm factor dataset, and the second standard rainstorm factor dataset to generate a rainstorm days prediction model.

5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the processor performs the steps of the method as described in any one of claims 1 to 3.

6. A computer device comprising a memory and a processor, characterized in that, The memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 3.