Model training method, rainfall runoff prediction method, device, equipment and medium
By calculating the spatial and temporal variation index of geographical factor factors and optimizing the value of geographical factor factors, the data redundancy problem in the rainfall runoff prediction model is solved, and the generalization ability and prediction accuracy of the model are improved.
Patent Information
- Application Number
- CN202411252146.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-09-09
AI Technical Summary
The existing rainfall runoff prediction method based on deep learning has high requirements for the input geographical feature data set. Data redundancy will lead to overfitting of the model, reducing generalization ability, and thus increasing prediction error.
By obtaining multiple sets of rainfall runoff related data, the spatial variation index and temporal variation index of each geographical factor factor are calculated, the values of geographical factor factors are marked and updated, data redundancy is reduced, and the model training process is optimized.
The generalization ability of the rainfall runoff prediction model is improved, the prediction error is reduced, and the practical application reliability of the model is enhanced.
Smart Images

Figure CN118761336B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of geographic hydrological information, and in particular to a model training method, a rainfall runoff prediction method, a device, equipment and a medium. Background Art
[0002] In the field of hydrology and water resources management, rainfall runoff refers to the runoff formed by rainfall. It is the general term for the flow of water that flows into rivers, lakes or oceans along the surface or underground after deducting the water volume of evaporation, soil infiltration, plant interception and depression storage. Accurately predicting rainfall runoff can effectively reduce flood disasters, optimize water resources allocation, and support ecological and environmental protection.
[0003] Existing deep learning-based rainfall runoff prediction methods usually first use geographic feature data sets to train the model, and then input the geographic feature data to be predicted into the trained model to output the predicted rainfall runoff.
[0004] However, the existing deep learning-based rainfall runoff prediction methods have high requirements for the geographic feature data set of the input model. If there is data redundancy in the data in the input geographic feature data set during training, the model may overfit, which will reduce its generalization ability and lead to large errors in the model's prediction results. Summary of the invention
[0005] The present application provides a model training method, a rainfall runoff prediction method, a device, equipment and a medium to improve the generalization ability of the rainfall runoff prediction model.
[0006] In a first aspect, the present application provides a model training method, the model training method comprising:
[0007] Acquire multiple sets of data related to rainfall runoff, each set of data includes: geographical location, time period, values of multiple geographical elements corresponding to the geographical location and time period, and actual rainfall runoff of the geographical location in the time period, and different data correspond to different geographical locations and / or time periods;
[0008] Determine the spatial variation index and temporal variation index of each geographic element factor. The spatial variation index refers to the rate at which the geographic element factor changes with the geographical location; the temporal variation index refers to the rate at which the geographic element factor changes with time.
[0009] If the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is within a first preset range, and the temporal variation index indicates that the rate at which the geographical element factor changes with time is within a second preset range, the geographical element factor is marked as a first-category geographical element factor, and the values of the first-category geographical element factor in different geographical locations and different time periods are updated to first fixed values;
[0010] If the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is within a first preset range, and the temporal variation index indicates that the rate at which the geographical element factor changes with time is outside a second preset range, the geographical element factor is marked as a second type of geographical element factor, and the values of the second type of geographical element factor in different geographical locations are updated to second fixed values;
[0011] If the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is outside the first preset range, and the temporal variation index indicates that the rate at which the geographical element factor changes with time is within the second preset range, the geographical element factor is marked as a third type of geographical element factor, and the values of the third type of geographical element factor in different time periods are updated to third fixed values;
[0012] The rainfall-runoff prediction model is trained using multiple sets of updated data.
[0013] In one possible design, the spatial and temporal variation indices of each geographic factor are determined, including:
[0014] For each geographic factor, calculate the gradient of the geographic factor at each location, and take the sum of the gradients at each location as the spatial variation index of the geographic factor;
[0015] The standard deviation of the change of each geographic factor within the preset time is calculated as the time variation index of each geographic factor.
[0016] In a possible design, the model training method further includes:
[0017] For each geographic element factor, determine the number of first remaining geographic element factors whose spatial variation index is less than or equal to the spatial variation index of the geographic element factor to determine a first ratio of the number of the first remaining geographic element factors to the number of all geographic element factors, and determine the number of second remaining geographic element factors whose temporal variation index is less than or equal to the temporal variation index of the geographic element factor to determine a second ratio of the number of the second remaining geographic element factors to the number of all geographic element factors;
[0018] If the first ratio is less than or equal to the first threshold, determining that the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is within a first preset range;
[0019] If the second ratio is less than or equal to the second threshold, it is determined that the time variation index indicates that the rate at which the geographic element factor changes over time is within a second preset range.
[0020] In a possible design, before determining the spatial variation index and the temporal variation index of each geographic element factor, the model training method further includes:
[0021] Determine a first average value of each geographic element factor according to the corresponding values of each geographic element factor in the multiple groups of data;
[0022] Input the corresponding values of any two geographic element factors in multiple groups of data, and the first average values of the two geographic element factors respectively, into the correlation coefficient function to calculate the first correlation of the two geographic element factors;
[0023] From the multiple groups of data, the value of one of the two geographic element factors whose first correlation is greater than or equal to the first correlation threshold is deleted.
[0024] In a possible design, before determining the spatial variation index and the temporal variation index of each geographic element factor, the model training method further includes:
[0025] Determine a second average value of the geographic element factor according to the corresponding values of any geographic element factor in the multiple sets of data;
[0026] Determine the average rainfall runoff based on the actual rainfall runoff in multiple sets of data;
[0027] Inputting the corresponding values of any geographic element factor in multiple sets of data, the actual rainfall runoff in the multiple sets of data, the second average value, and the average rainfall runoff into the correlation coefficient function, and calculating the second correlation between any geographic element factor and rainfall runoff;
[0028] From the multiple sets of data, the values of the geographic element factors whose second correlation is less than the second correlation threshold are deleted.
[0029] In a possible design, the rainfall-runoff prediction model is trained with multiple sets of updated data, including:
[0030] dividing the updated multiple sets of data into a first data set and a second data set;
[0031] Divide the first data set into K subsets, where K is an integer greater than or equal to 2;
[0032] In each round of training iteration, any subset of the K subsets is selected as a validation set, and K-1 subsets of the K subsets other than the validation set are selected as training sets, so as to train the rainfall-runoff prediction model through the training set, and verify the rainfall-runoff prediction model trained in this round of iteration through the validation set;
[0033] After the training is completed, the rainfall-runoff prediction model is analyzed using the second data set.
[0034] In a possible design, after the training is completed, the rainfall-runoff prediction model is analyzed by a second data set, including:
[0035] Inputting the values of the geographic element factors in the second data set into the trained rainfall-runoff prediction model to obtain rainfall-runoff prediction data;
[0036] According to the rainfall runoff prediction data and the actual rainfall runoff, the Nash coefficient, runoff relative error and flood peak relative error of the rainfall runoff prediction model are calculated to analyze the prediction accuracy of the rainfall runoff prediction model.
[0037] In a second aspect, the present application provides a rainfall runoff prediction method, comprising:
[0038] Obtaining multiple geographic element factors related to rainfall runoff and the values of the geographic element factors in a target area and / or a target time period, wherein the multiple geographic element factors include marked first-category geographic element factors, second-category geographic element factors, and third-category geographic element factors;
[0039] Updating the value of the first type of geographic element factor in the target area and / or target time period to a first fixed value;
[0040] Update the value of the second type of geographic element factor in the target area to a second fixed value;
[0041] Update the value of the third type of geographic element factor in the target time period to the third fixed value;
[0042] The values of the geographical element factors in the target area and / or target time period are input into the pre-trained rainfall runoff prediction model for prediction, so as to obtain the rainfall runoff in the target area in the target time period.
[0043] In a third aspect, the present application provides a model training device, comprising:
[0044] An acquisition module is used to acquire multiple sets of data related to rainfall runoff, each set of data includes: geographical location, time period, values of multiple geographical elements corresponding to the geographical location and time period, and actual rainfall runoff of the geographical location in the time period, and different data correspond to different geographical locations and / or time periods;
[0045] A determination module is used to determine the spatial variation index and temporal variation index of each geographic element factor. The spatial variation index refers to the rate at which the geographic element factor changes with the geographic location; the temporal variation index refers to the rate at which the geographic element factor changes with time;
[0046] A first value-taking module, for marking a geographic element factor as a first-category geographic element factor, and updating the values of the first-category geographic element factor in different geographic locations and different time periods to a first fixed value, if the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is within a first preset range, and the time variation index indicates that the rate at which the geographic element factor changes with time is within a second preset range;
[0047] A second value-taking module, for marking the geographic element factor as a second-category geographic element factor, and updating the value of the second-category geographic element factor at different geographic locations to a second fixed value, if the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is within a first preset range, and the time variation index indicates that the rate at which the geographic element factor changes with time is outside a second preset range;
[0048] A third value-taking module, for marking the geographic element factor as a third type of geographic element factor, and updating the values of the third type of geographic element factor in different time periods to third fixed values, if the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is outside a first preset range, and the time variation index indicates that the rate at which the geographic element factor changes with time is within a second preset range;
[0049] The training module is used to train the rainfall-runoff prediction model using multiple sets of updated data.
[0050] In a fourth aspect, the present application provides a rainfall runoff prediction device, comprising:
[0051] A target data acquisition module is used to obtain multiple geographical element factors related to rainfall runoff and the values of the geographical element factors in the target area and / or the target time period, wherein the multiple geographical element factors include the marked first-category geographical element factors, the second-category geographical element factors and the third-category geographical element factors;
[0052] A first fixed value module, used to update the value of the first type of geographic element factor in the target area and / or target time period to a first fixed value;
[0053] A second fixed value module, used for updating the value of the second type of geographic element factor in the target area to a second fixed value;
[0054] A third fixed value module, used to update the value of the third type of geographic element factor in the target time period to a third fixed value;
[0055] The prediction module is used to input the values of geographical element factors in the target area and / or target time period into the pre-trained rainfall runoff prediction model for prediction, so as to obtain the rainfall runoff in the target area in the target time period.
[0056] In a fifth aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0057] Memory stores computer-executable instructions;
[0058] The processor executes computer-executable instructions stored in the memory to implement a model training method of the first invention or a rainfall runoff prediction method of the second invention.
[0059] In a sixth aspect, the present application provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement a model training method of the first aspect of the invention or a rainfall runoff prediction method of the second aspect of the invention.
[0060] In a seventh aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement a model training method of the first aspect of the invention or a rainfall runoff prediction method of the second aspect of the invention.
[0061] The present application provides a model training method, rainfall runoff prediction method, device, equipment and medium, which obtains multiple groups of data related to rainfall runoff, each group of data includes: geographical location, time period, values of multiple geographical element factors corresponding to the geographical location and time period, and actual rainfall runoff of the geographical location in the time period, and different data correspond to different geographical locations and / or time periods; determines the spatial variation index and temporal variation index of each geographical element factor, the spatial variation index refers to the rate at which the geographical element factor changes with the geographical location; the temporal variation index refers to the rate at which the geographical element factor changes with time; if the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is within a first preset range, and the temporal variation index indicates that the rate at which the geographical element factor changes with time is within a second preset range, then the geographical element factor is marked as a first-category geographical element factor, and the first-category geographical element factor is marked as a first-category geographical element factor. The values of the geographical element factors in different geographical locations and different time periods are updated to the first fixed values; if the spatial variation index indicates that the rate of change of the geographical element factors with the geographical location is within the first preset range, and the time variation index indicates that the rate of change of the geographical element factors with time is outside the second preset range, the geographical element factors are marked as the second type of geographical element factors, and the values of the second type of geographical element factors in different geographical locations are updated to the second fixed values; if the spatial variation index indicates that the rate of change of the geographical element factors with the geographical location is outside the first preset range, and the time variation index indicates that the rate of change of the geographical element factors with time is within the second preset range, the geographical element factors are marked as the third type of geographical element factors, and the values of the third type of geographical element factors in different time periods are updated to the third fixed values; the rainfall runoff prediction model is trained by using the updated multiple sets of data. The following technical effects are achieved: by training the rainfall runoff prediction model with multiple sets of updated data, the data redundancy of the input rainfall runoff prediction model is reduced, thereby reducing the overfitting phenomenon of the rainfall runoff prediction model, thereby improving the generalization ability of the rainfall runoff prediction model and reducing the prediction error of the rainfall runoff prediction model; by determining the spatial variation index and the temporal variation index of each geographical element factor, and optimizing and updating the values of multiple geographical element factors according to the spatial variation index and the temporal variation index, the data redundancy problem existing in the data input to the rainfall runoff prediction model is solved; by updating the values of the geographical element factors with smaller spatial variation index and / or temporal variation index to the first fixed value, the second fixed value or the third fixed value, the problem of how to optimize the values of the geographical element factors is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0063] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0064] Figure 1 A schematic diagram of an application scenario of the model training method provided in an embodiment of the present application;
[0065] Figure 2 Schematic diagram of the model training method provided in the embodiment of the present application Figure 1 ;
[0066] Figure 3 Schematic diagram of the model training method provided in the embodiment of the present application Figure 2 ;
[0067] Figure 4 Schematic diagram of the model training method provided in the embodiment of the present application Figure 3 ;
[0068] Figure 5 Schematic diagram of the model training method provided in the embodiment of the present application Figure 4 ;
[0069] Figure 6 A schematic diagram of a flow chart of a rainfall runoff prediction method provided in an embodiment of the present application;
[0070] Figure 7 A schematic diagram of the structure of a model training device provided in an embodiment of the present application;
[0071] Figure 8 A schematic diagram of the structure of a rainfall runoff prediction device provided in an embodiment of the present application;
[0072] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0073] Reference numerals:
[0074] 110-data processing server; 120-terminal;
[0075] 610-acquisition module; 620-determination module; 630-first value-taking module; 640-second value-taking module; 650-third value-taking module; 660-training module;
[0076] 710 - target data acquisition module; 720 - first fixed value module; 730 - second fixed value module; 740 - third fixed value module; 750 - prediction module;
[0077] 810 - processor; 820 - memory; 830 - communication component; 840 - bus. DETAILED DESCRIPTION
[0078] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0079] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will appreciate that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.
[0080] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or it can be a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, a model training method provided in the embodiment of the present application is only used as an example, and a model training method can also include more or less content.
[0081] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0082] Geographical factors: refers to those factors related to topography and land features that have a significant impact on rainfall runoff. These factors include slope and aspect (topographic features), land use type (such as agricultural land, urban land, forest, etc.), vegetation coverage (such as forest coverage, grassland coverage), and soil moisture. In addition, other factors such as soil type, surface roughness and hydrogeological characteristics may also be included.
[0083] In the field of hydrology and water resources management, rainfall runoff refers to the total amount of water that flows through the surface and infiltrates underground, minus evaporation loss, soil absorption, vegetation interception, surface water storage, etc., and finally flows into water bodies (such as rivers, lakes, and oceans). Accurately predicting this process is crucial for flood prevention and disaster reduction, rational allocation of water resources, and ecological protection.
[0084] At present, deep learning-based rainfall runoff prediction methods usually use data sets containing multiple geographic feature features such as soil type, topography, vegetation cover, historical rainfall data, etc. to train the model. However, if there is data redundancy in these geographic feature data sets, the model may overfit. Overfitting will cause the model to perform well on the training data, but perform poorly on new data, thereby reducing the generalization ability of the model, increasing the prediction error, and limiting the reliability and effectiveness of the model in actual situations. Therefore, optimizing data preprocessing and reducing unnecessary data redundancy are the key to improving the prediction accuracy of rainfall runoff prediction models.
[0085] Based on this, the embodiments of the present application provide a model training method, rainfall runoff prediction method, device, equipment and medium, which can be used in the field of geographic hydrological information, aiming to solve the above technical problems of the prior art.
[0086] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0087] In order to facilitate understanding of the technical solution of the present application, the application scenario of the model training method provided in the embodiment of the present application is first introduced. Figure 1 Schematic diagram of application scenarios of the model training method provided in the embodiment of the present application. It should be noted that: Figure 1 What is shown are merely examples of application scenarios to which the embodiments of the present application can be applied, in order to help those skilled in the art understand the technical content of the present application, but it does not mean that the embodiments of the present application cannot be used in other devices, systems, environments or scenarios.
[0088] like Figure 1As shown, the application scenario includes: a terminal 120 and a data processing server 110. Among them, the terminal 120 is connected to the data processing server 110 for communication. It should be noted that Figure 1 The number of terminals 120 and data processing servers 110 shown in the figure is for illustration only. In other embodiments, the application scenario may also include other numbers of terminals 120 and data processing servers 110, which are not specifically limited here.
[0089] The terminal 120 in this embodiment can be understood as various electronic devices, such as wired terminals or wireless terminals, including devices such as smart phones, computers, and computers storing databases, etc., and no specific restrictions are made here. The data processing server 110 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server, etc., and no specific restrictions are made here.
[0090] The terminal 120 can obtain multiple sets of data related to rainfall runoff, and send the multiple sets of data related to rainfall runoff to the data processing server 110, so that the data processing server 110 processes the multiple sets of data after obtaining the multiple sets of data related to rainfall runoff, thereby determining multiple geographic element factors, and different values of multiple geographic element factors in multiple geographical locations and multiple time periods. Then determine the spatial variation index (Geographical Element Spatial Variability Index, GESVI) and temporal variation index (Geographical Element Temporal Variability Index, GETVI) of each geographic element factor, and optimize the value of each geographic element factor according to the spatial variation index of the rate of change of each geographic element factor with the geographical location, and the temporal variation index of the rate of change of each geographic element factor with time. And train the rainfall runoff prediction model according to the optimized geographic element factors. Accordingly, the rainfall runoff prediction model is set in the data processing server 110 for predicting rainfall runoff.
[0091] The data processing server 110 may be a server that provides rainfall runoff prediction services. The data processing server 110 is the execution subject of the model training and rainfall runoff prediction method, which is deployed locally or in the cloud. The data processing server 110 is used to train the rainfall runoff prediction model according to the optimized geographical element factors and perform rainfall runoff prediction.
[0092] Figure 2 Schematic diagram of the model training method provided in the embodiment of the present application Figure 1 .like Figure 2 As shown, the method includes:
[0093] S101, obtaining multiple sets of data related to rainfall runoff, each set of data including: a geographical location, a time period, values of multiple geographical elements corresponding to the geographical location and the time period, and actual rainfall runoff of the geographical location in the time period, and different data correspond to different geographical locations and / or time periods;
[0094] Specifically, the model training method provided in the embodiment of the present application can be applied to a data processing server, and the data processing server can obtain multiple sets of data related to rainfall runoff through various methods such as literature research or database query. Each set of data includes: multiple geographical locations, multiple time periods, values corresponding to multiple geographical elements in multiple geographical locations and multiple time periods, and actual rainfall runoff in multiple geographical locations in multiple time periods. The values corresponding to different geographical elements in different geographical locations and different time periods may be different, and the actual rainfall runoff may also be different in different geographical locations and different time periods.
[0095] In this embodiment, the geographic element factor may refer to the slope and aspect related to the terrain, as well as the land use type, vegetation coverage, soil moisture and other factors closely related to rainfall runoff. In other words, the geographic element factor covers the characteristics related to the terrain, such as slope and aspect, which directly affect the direction and speed of surface water flow and have an important impact on the formation and distribution of rainfall runoff; it also includes land use type (such as urbanized areas, forests, cultivated land, etc.), vegetation coverage (affecting the infiltration and evaporation of precipitation) and soil moisture (determining the water absorption capacity and saturation of the soil), which are all key factors affecting the formation, convergence and flow of rainfall runoff. Therefore, these geographic element factors are extremely important input variables when establishing a rainfall runoff prediction model, which can help the rainfall runoff prediction model better learn and simulate rainfall runoff.
[0096] At the same time, the data processing server can also pre-process the multiple sets of data related to rainfall runoff, including but not limited to data cleaning, eliminating outliers or filling missing values. Among them, the missing values can be filled by the inverse distance weighting method. In addition, in order to avoid the differences caused by the different dimensions of different geographical elements, the values of each element can be standardized, and the initial geographical element factor library can be further constructed.
[0097] S102. Determine the spatial variation index and temporal variation index of each geographic element factor, wherein the spatial variation index refers to the rate at which the geographic element factor changes with the geographic location; and the temporal variation index refers to the rate at which the geographic element factor changes with time;
[0098] Specifically, in order to optimize the geographic element factors, the data processing server first determines the spatial variation index and temporal variation index of each geographic element factor, where the spatial variation index refers to the rate at which the geographic element factor changes with the geographical location. If the spatial variation index of the geographic element factor is large, it indicates that the geographic element factor is an important geographic element factor and its value does not need to be optimized; the temporal variation index refers to the rate at which the geographic element factor changes with time. If the temporal variation index of the geographic element factor is large, it also indicates that the geographic element factor is an important geographic element factor and its value does not need to be optimized.
[0099] S103, if the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is within a first preset range, and the temporal variation index indicates that the rate at which the geographical element factor changes with time is within a second preset range, then the geographical element factor is marked as a first type of geographical element factor, and the values of the first type of geographical element factor in different geographical locations and different time periods are updated to first fixed values;
[0100] Specifically, if the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is within the first preset range, then it means that the rate at which the geographical element factor changes with the geographical location is small, that is, the spatial variation index is small, and the value of the geographical element factor can be optimized; similarly, if the temporal variation index indicates that the rate at which the geographical element factor changes with time is within the second preset range, then it means that the rate at which the geographical element factor changes with time is small, that is, the temporal variation index is small, and the value of the geographical element factor can also be optimized.
[0101] In this embodiment, if the spatial variation index of the geographic element factor indicates that the rate at which the geographic element factor changes with the geographic location is within a first preset range, and the temporal variation index of the geographic element factor indicates that the rate at which the geographic element factor changes with time is within a second preset range, it indicates that both the spatial variation index and the temporal variation index of the geographic element factor are small, and it has temporal stability and spatial stationarity. Then, the geographic element factor can be marked as a first-class geographic element factor, and the values of the first-class geographic element factor in different geographic locations and different time periods can be updated to a first fixed value. The first fixed value can be obtained by calculating the average value of multiple values of the geographic element factor, that is, calculating the average of multiple values corresponding to the geographic element factor in multiple different geographic locations and multiple different time periods, and taking the average as the first fixed value, or the median of multiple values corresponding to the geographic element factor can be taken as the first fixed value, or the first fixed value can be determined by other methods, and no specific restrictions are made here.
[0102] S104. If the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is within a first preset range, and the temporal variation index indicates that the rate at which the geographical element factor changes with time is outside a second preset range, the geographical element factor is marked as a second type of geographical element factor, and the value of the second type of geographical element factor in different geographical locations is updated to a second fixed value;
[0103] Specifically, if the spatial variation index of the geographic element factor indicates that the rate at which the geographic element factor changes with the geographical location is within the first preset range, and the temporal variation index of the geographic element factor indicates that the rate at which the geographic element factor changes with time is outside the second preset range, then it means that the spatial variation index of the geographic element factor is small, but the temporal variation index is large, indicating that the geographic element factor changes greatly in time, but changes less in space, that is, the spatial characteristics are relatively stable. Therefore, the geographic element factor can be considered in each time period, but the value at different geographical locations can be replaced by a constant. In other words, the geographic element factor can be marked as a second-type geographic element factor, and the value of the second-type geographic element factor at different geographical locations corresponding to each time period can be updated to a second fixed value. The second fixed value of the geographic element factor corresponding to each time period can be obtained by calculating the average of multiple values of the geographic element factor in multiple geographical locations, that is, in each time period, the average of multiple values of the geographic element factor corresponding to multiple different geographical locations is calculated, and the average is used as the second fixed value. In addition, in each time period, the median of the multiple values corresponding to the geographic element factor can be used as the second fixed value. Alternatively, the second fixed value can be determined by other methods, and no specific restrictions are made here.
[0104] S105. If the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is outside the first preset range, and the temporal variation index indicates that the rate at which the geographical element factor changes with time is within the second preset range, the geographical element factor is marked as a third type of geographical element factor, and the values of the third type of geographical element factor in different time periods are updated to third fixed values;
[0105] Specifically, if the spatial variation index of the geographic element factor indicates that the rate at which the geographic element factor changes with the geographic location is outside the first preset range, and the temporal variation index of the geographic element factor indicates that the rate at which the geographic element factor changes with time is within the second preset range, then it means that the temporal variation index of the geographic element factor is small, but the spatial variation index is large, indicating that the geographic element factor changes greatly in space, but changes less in time, that is, the temporal characteristics are relatively stable. Therefore, the geographic element factor can be considered in each geographic location, but the values in different time periods can be replaced by constants. In other words, the geographic element factor can be marked as a third-category geographic element factor, and the values of the third-category geographic element factor corresponding to each geographic location in different time periods can be updated to the third fixed value. The third fixed value of the geographic element factor corresponding to each geographic location can be obtained by averaging multiple values of the geographic element factor in multiple time periods, that is, at each geographic location, the average of multiple values of the geographic element factor corresponding to multiple different time periods is calculated, and the average is used as the third fixed value. Alternatively, at each geographic location, the median of the multiple values corresponding to the geographic element factor can be used as the third fixed value. Alternatively, the third fixed value can be determined by other methods, which are not specifically limited here.
[0106] In addition, if the spatial variation index of the geographic element factor indicates that the rate of change of the geographic element factor with the geographical location is outside the first preset range, and the temporal variation index of the geographic element factor indicates that the rate of change of the geographic element factor with time is outside the second preset range, then it means that the temporal variation index and spatial variation index of the geographic element factor are both large, indicating that the spatial and temporal changes of the geographic element factor are large, and its value does not need to be optimized.
[0107] S106, training the rainfall runoff prediction model using the updated multiple sets of data;
[0108] Specifically, the data processing server can train the rainfall runoff prediction model through multiple sets of updated data. By using the updated multiple sets of data, the data redundancy of the input rainfall runoff prediction model can be reduced, thereby reducing the overfitting phenomenon of the rainfall runoff prediction model, thereby improving the generalization ability of the rainfall runoff prediction model and reducing the prediction error of the rainfall runoff prediction model.
[0109] A model training method provided in the present embodiment obtains multiple groups of data related to rainfall runoff, each group of data includes: geographical location, time period, values corresponding to multiple geographical elements in the geographical location and time period, and actual rainfall runoff in the geographical location in the time period, and different data correspond to different geographical locations and / or time periods; determines the spatial variation index and temporal variation index of each geographical element factor, the spatial variation index refers to the rate at which the geographical element factor changes with the geographical location; the temporal variation index refers to the rate at which the geographical element factor changes with time; if the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is within a first preset range, and the temporal variation index indicates that the rate at which the geographical element factor changes with time is within a second preset range, then the geographical element factor is marked as a first-category geographical element factor, and the first-category geographical element factor is not For the same geographical location, the values in different time periods are updated to the first fixed values; if the spatial variation index indicates that the rate of change of the geographical element factor with the geographical location is within the first preset range, and the time variation index indicates that the rate of change of the geographical element factor with time is outside the second preset range, the geographical element factor is marked as the second type of geographical element factor, and the values of the second type of geographical element factor in different geographical locations are updated to the second fixed values; if the spatial variation index indicates that the rate of change of the geographical element factor with the geographical location is outside the first preset range, and the time variation index indicates that the rate of change of the geographical element factor with time is within the second preset range, the geographical element factor is marked as the third type of geographical element factor, and the values of the third type of geographical element factor in different time periods are updated to the third fixed values; the rainfall runoff prediction model is trained by using the updated multiple sets of data. The following technical effects are achieved: by training the rainfall runoff prediction model with multiple sets of updated data, the data redundancy of the input rainfall runoff prediction model is reduced, thereby reducing the overfitting phenomenon of the rainfall runoff prediction model, thereby improving the generalization ability of the rainfall runoff prediction model and reducing the prediction error of the rainfall runoff prediction model; by determining the spatial variation index and the temporal variation index of each geographical element factor, and optimizing and updating the values of multiple geographical element factors according to the spatial variation index and the temporal variation index, the data redundancy problem existing in the data input to the rainfall runoff prediction model is solved; by updating the values of the geographical element factors with smaller spatial variation index and / or temporal variation index to the first fixed value, the second fixed value or the third fixed value, the problem of how to optimize the values of the geographical element factors is solved.
[0110] Figure 3 Schematic diagram of the model training method provided in the embodiment of the present application Figure 2 In one possible example, Figure 3 As shown, in this embodiment Figure 2Based on the embodiment, how to determine the spatial variation index and temporal variation index of each geographic element factor is described in detail. S102, determining the spatial variation index and temporal variation index of each geographic element factor, the spatial variation index refers to the rate at which the geographic element factor changes with the geographical location; the temporal variation index refers to the rate at which the geographic element factor changes with time, including:
[0111] S201, for each geographic element factor, calculating the gradient of the geographic element factor at each location, and taking the sum of the gradients at each location as the spatial variation index of the geographic element factor;
[0112] Specifically, the data processing server determines the spatial variation index of each geographic factor by calculating the gradient of each position of the geographic factor in two-dimensional space and taking the sum of the gradients of each position as the spatial variation index of the geographic factor. The specific calculation method of the spatial variation index is as follows:
[0113]
[0114] in, Indicates the geographic element factor in the coordinate The value at Indicates the geographic element factor in the coordinate The size (modulus) of the gradient at can be used to represent the influence of geographic elements on the coordinates The rate of change at the point. Regardless of the direction, the calculation formula for the gradient size is as follows:
[0115]
[0116] in, and They are The partial reciprocals in the x and y directions can be discretely solved using the bidirectional difference method for geographic element factors. and The value of can be solved by the following formula:
[0117]
[0118] in, Indicates the geographic element factor in the coordinate The value at Indicates the geographic element factor in the coordinate The value at Indicates the geographic element factor in the coordinate The value at Indicates the geographic element factor in the coordinate The value at .
[0119] S202, calculating the standard deviation of the variation of each geographical element factor within a preset time as the time variation index of each geographical element factor;
[0120] Specifically, the data processing server can obtain the time variation index of each geographic factor by calculating the standard deviation of the change of each geographic factor within a preset time. The specific calculation method is as follows:
[0121]
[0122] Where n is the length of time, the unit can be years, quarters or other time units. When the unit of n is years, Indicates that in the t+1th year, the geographic element factor is in the coordinate The value at Indicates that in year t, the geographic element factor is in the coordinate The value at It represents the average change in the value of the geographical element factor from the first year to the nth year. The specific calculation method is as follows:
[0123]
[0124] Among them, n-1 means from the 1st year to the nth year, including n-1 time periods in total, and the length of each time period is 1 year.
[0125] S203. For each geographic element factor, determine the number of the first remaining geographic element factors whose spatial variation index is less than or equal to the spatial variation index of the geographic element factor, so as to determine a first ratio of the number of the first remaining geographic element factors to the number of all geographic element factors, and determine the number of the second remaining geographic element factors whose temporal variation index is less than or equal to the temporal variation index of the geographic element factor, so as to determine a second ratio of the number of the second remaining geographic element factors to the number of all geographic element factors;
[0126] Specifically, after determining the spatial variation index and the temporal variation index of each geographic element factor, the data processing server can further determine the number of remaining geographic element factors whose spatial variation index is less than or equal to the spatial variation index of the geographic element factor for each geographic element factor, and mark the remaining geographic element factors as first remaining geographic element factors. To determine a first ratio of the number of first remaining geographic element factors to the number of all geographic element factors. And, the data processing server can further determine the number of remaining geographic element factors whose temporal variation index is less than or equal to the temporal variation index of the geographic element factor, and mark the remaining geographic element factors as second remaining geographic element factors. To determine a second ratio of the number of second remaining geographic element factors to the number of all geographic element factors.
[0127] S204: If the first ratio is less than or equal to the first threshold, determine that the rate at which the spatial variation index indicates that the geographic element factor changes with the geographic location is within a first preset range;
[0128] Specifically, if the first ratio is less than or equal to the preset first threshold, the data processing server can determine that the spatial variation index indicates that the rate at which the geographic element factor changes with the geographical location is within a first preset range, indicating that the rate at which the geographic element factor changes with the geographical location is small, that is, the spatial variation index is small, and the value of the geographic element factor can be optimized.
[0129] S205, if the second ratio is less than or equal to the second threshold, determining that the rate at which the time variation index indicates that the geographic element factor changes over time is within a second preset range;
[0130] Specifically, if the second ratio is less than or equal to the preset second threshold, the data processing server can determine that the time variation index indicates that the rate at which the geographic element factor changes over time is within a second preset range, indicating that the rate at which the geographic element factor changes over time is small, that is, the time variation index is small, and the value of the geographic element factor can also be optimized.
[0131] In other embodiments, the geographical element factors may be sorted according to the spatial variation index to obtain a first sequence, and the geographical element factors may be sorted according to the temporal variation index to obtain a second sequence.
[0132] For each geographical element factor, determine the first ratio between the first position number of the geographical element factor in the first sequence and the number of types of all geographical element factors, as well as the second ratio between the second position number of the geographical element factor in the second sequence and the number of types of all geographical element factors; here, if the sorting is in ascending order from small to large according to the numerical value, the first position number and the second position number are the sequential numbers from the front to the back in the first sequence and the second sequence, respectively; if the sorting is in descending order from large to small according to the numerical value, the first position number and the second position number are the reverse numbers from the back to the front in the first sequence and the second sequence, respectively.
[0133] If the first ratio is less than or equal to the preset first threshold, it is determined that the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is within the first preset range, indicating that the rate at which the geographical element factor changes with the geographical location is small, that is, the spatial variation index is small, and the value of the geographical element factor can be optimized.
[0134] If the second ratio is less than or equal to the preset second threshold, it is determined that the time variation index indicates that the rate at which the geographical element factor changes over time is within a second preset range, indicating that the rate at which the geographical element factor changes over time is small, that is, the time variation index is small, and the value of the geographical element factor can also be optimized.
[0135] Furthermore, in other embodiments, the first percentile of the spatial variation index of each geographic element factor among all geographic element factors and the second percentile of the temporal variation index of each geographic element factor among all geographic element factors may be calculated respectively.
[0136] When the first percentile of the geographic element factor is less than the first preset percentile, the spatial variation index is determined to indicate that the rate at which the geographic element factor changes with the geographical location is within the first preset range, indicating that the rate at which the geographic element factor changes with the geographical location is small, that is, the spatial variation index is small, and the value of the geographic element factor can be optimized.
[0137] When the second percentile of the geographic element factor is less than the second preset percentile, it is determined that the time variation index indicates that the rate at which the geographic element factor changes over time is within the second preset range, indicating that the rate at which the geographic element factor changes over time is small, that is, the time variation index is small, and the value of the geographic element factor can also be optimized.
[0138] Figure 4 Schematic diagram of the model training method provided in the embodiment of the present application Figure 3 In one possible example, Figure 4 As shown, in this embodiment Figure 3 Based on the embodiment, how to optimize the value of the geographical element factor according to the correlation coefficient function before determining the spatial variation index and the temporal variation index of each geographical element factor is described in detail. Figure 4 As shown, the method includes:
[0139] S301, determining a first average value of each geographic factor according to the corresponding values of each geographic factor in multiple groups of data;
[0140] Specifically, before optimizing the value of each geographic factor according to the spatial variation index and the temporal variation index of each geographic factor, the data processing server can also optimize the geographic factor according to the correlation coefficient function. First, it is introduced how to optimize any two geographic factors with high autocorrelation in multiple groups of data according to the Pearson Correlation Coefficient.
[0141] The data processing server can calculate the average value of each geographic element factor according to the corresponding values of each geographic element factor in multiple groups of data, and mark it as the first average value.
[0142] S302, inputting the corresponding values of any two geographic element factors in the multiple data sets and the first average values respectively corresponding to the two geographic element factors into the correlation coefficient function, and calculating the first correlation between the two geographic element factors;
[0143] Specifically, the data processing server can input the corresponding values of any two geographic element factors in multiple groups of data, and the first average values corresponding to the any two geographic element factors, into the correlation coefficient function to calculate the first correlation of the any two geographic element factors. The specific calculation method is as follows:
[0144]
[0145] Where n is the length of time. When the unit of n is year, It refers to the value of the i-th geographical element factor in the t-th year. It refers to the value of the jth geographical factor in year t. It refers to the first average value of the i-th geographical element factor in n years. It refers to the first average value of the jth geographical element factor in n years. It refers to the first correlation between the i-th geographical element factor and the j-th geographical element factor.
[0146] S303, deleting, from the multiple groups of data, a value of one of the two geographic element factors whose first correlation is greater than or equal to a first correlation threshold;
[0147] Specifically, the data processing server may delete, from the plurality of data sets, the value of one of the two geographic element factors whose first correlation is greater than or equal to a preset first correlation threshold. , and the first correlation threshold is 0.9, then the value of the i-th geographical element factor can be deleted from the multiple sets of data, or the value of the j-th geographical element factor can be deleted. It should be noted that the first correlation threshold is 0.9 here, which is only an example. It can also be set to other specific values, such as 0.8, 0.85, 0.7 or 0.6, etc. according to the actual situation of model training. There is no specific restriction here.
[0148] S304, determining a second average value of the geographic factor according to the corresponding values of any geographic factor in the multiple sets of data;
[0149] Specifically, the data processing server can also optimize the geographical element factors with low runoff correlation in multiple sets of data according to the Pearson correlation coefficient. First, the data processing server can determine the average value of each geographical element factor according to the corresponding value of any geographical element factor in multiple sets of data, which can be marked as the second average value here. It should be noted that the second average value is consistent with the first average value. The description method of the first average value and the second average value is used here only to distinguish different application scenarios.
[0150] S305, determining average rainfall runoff according to actual rainfall runoff in multiple sets of data;
[0151] Specifically, the data processing server can determine the average rainfall runoff based on the actual rainfall runoff in multiple sets of data.
[0152] S306, inputting the corresponding values of any geographic element factor in the multiple sets of data, the actual rainfall runoff in the multiple sets of data, the second average value, and the average rainfall runoff into the correlation coefficient function, and calculating the second correlation between any geographic element factor and rainfall runoff;
[0153] Specifically, the data processing server can input the corresponding values of any geographic element factor in multiple sets of data, the actual rainfall runoff in multiple sets of data, the second average value, and the average rainfall runoff into the correlation coefficient function, so as to calculate the second correlation between any geographic element factor and the actual rainfall runoff. The specific calculation method is as follows:
[0154]
[0155] Where n is the length of time. When the unit of n is year, It refers to the value of actual rainfall runoff corresponding to the tth year. is the average rainfall runoff over n years, It refers to the second correlation between the i-th geographical element factor and the actual rainfall runoff.
[0156] S307, deleting the values of the geographical element factors whose second correlation is less than the second correlation threshold from the multiple groups of data;
[0157] Specifically, the data processing server may delete, from the plurality of data sets, the values of the geographic element factors whose second correlation is less than a preset second correlation threshold. , and the second correlation threshold is 0.6, then the value of the i-th geographic element factor can be deleted from the multiple sets of data. It should be noted that the second correlation threshold is 0.6 here, which is only an example. It can also be set to other specific values according to the actual situation of model training, such as 0.65, 0.55 or 0.5, etc., and no specific restrictions are made here.
[0158] A model training method provided in an embodiment of the present application optimizes any two geographic element factors with high autocorrelation in multiple groups of data through the Pearson correlation coefficient, and deletes the value of one of the two geographic element factors whose first correlation is greater than or equal to a first correlation threshold from the multiple groups of data, thereby reducing data redundancy input to the rainfall runoff prediction model and reducing noise interference input to the model, thereby improving the generalization ability of the rainfall runoff prediction model; optimizes geographic element factors with low runoff correlation in multiple groups of data through the Pearson correlation coefficient, and deletes the value of the geographic element factor whose second correlation is less than a second correlation threshold from the multiple groups of data, thereby also reducing data redundancy input to the rainfall runoff prediction model, making the model more focused on data with high runoff correlation, thereby further improving the generalization ability of the rainfall runoff prediction model.
[0159] Figure 5 Schematic diagram of the model training method provided in the embodiment of the present application Figure 4 In one possible example, Figure 5 As shown, in this embodiment Figure 2 Based on the embodiment, how to train the rainfall runoff prediction model using the updated multiple sets of data is described in detail. S106, training the rainfall runoff prediction model using the updated multiple sets of data, including:
[0160] S401, dividing the updated multiple sets of data into a first data set and a second data set;
[0161] Specifically, the data processing server may first divide the updated multiple sets of data into a first data set and a second data set. The first data set may be used to train the rainfall runoff prediction model, and the first data set may include 80% to 90% of the data in the multiple sets of data; the second data set is used to analyze the trained rainfall runoff prediction model, and the second data set may include 10% to 20% of the data in the multiple sets of data.
[0162] S402, dividing the first data set into K subsets, where K is an integer greater than or equal to 2;
[0163] Specifically, the data processing server may further divide the first data set into K subsets, where K is an integer greater than or equal to 2.
[0164] S403, in each round of training iteration, any one of the K subsets is selected as a validation set, and K-1 subsets of the K subsets other than the validation set are selected as training sets, so as to train the rainfall-runoff prediction model through the training set, and verify the rainfall-runoff prediction model trained in this round of iteration through the validation set;
[0165] Specifically, in each round of iteration of training the rainfall runoff prediction model, the data processing server can select any one of the K subsets as a validation set, and use K-1 subsets of the K subsets other than the validation set as training sets, so as to train the rainfall runoff prediction model through the training set, and verify the rainfall runoff prediction model trained in this round of iteration through the validation set. By dividing the first data set into K subsets, the rainfall runoff prediction model can be trained for K rounds of iterations. The data processing server can also take the average of K verification results to analyze the performance of the rainfall runoff prediction model.
[0166] The rainfall runoff prediction model in this embodiment can be a deep learning neural network model in the prior art, including but not limited to models such as long short-term memory network (Long Short-Term Memory, LSTM) and convolutional neural network (Convolutional Neural Networks, CNN). The process of model training may include steps such as data preparation, forward propagation, loss calculation, back propagation and parameter update. In addition, during the training process, the number of layers of the model, the number of neurons in each layer, the activation function and other layer configurations, such as pooling layer, batch normalization layer (BatchNormalization, BN), etc. can be determined first. The data processing server can minimize the loss function by continuously adjusting the model parameters. During training, the data processing server can input the data of the training set into the model, calculate the output rainfall runoff prediction data through forward propagation, and then calculate the loss function based on the output rainfall runoff prediction data; then, the gradient of the loss function relative to the model parameters is calculated by the back propagation algorithm, and the optimization algorithm, such as the Adaptive Moment Estimation (Adam) algorithm, is used to adjust the model parameters according to the gradient to minimize the loss. After each round of iterative training, the validation set is used to analyze the model performance, monitor overfitting and underfitting during model training, and adjust hyperparameters such as learning rate and regularization parameters based on the validation set feedback.
[0167] S404, inputting the values of the geographic element factors in the second data set into the trained rainfall runoff prediction model to obtain rainfall runoff prediction data;
[0168] Specifically, after the training is completed, the data processing server can analyze the rainfall runoff prediction model through the second data set, that is, the values of the geographical element factors in the second data set are input into the trained rainfall runoff prediction model, and the model processes the input data through forward propagation to generate rainfall runoff prediction data.
[0169] S405, calculating the Nash coefficient, runoff relative error and flood peak relative error of the rainfall runoff prediction model according to the rainfall runoff prediction data and the actual rainfall runoff, so as to analyze the prediction accuracy of the rainfall runoff prediction model;
[0170] Specifically, the data processing server can calculate the Nash coefficient (Nash-Sutcliffe Efficiency, NSE), runoff relative error (RelativeError, RE) and peak flow relative error (Peak Flow RelativeError, PE) of the rainfall runoff prediction model based on the rainfall runoff prediction data and the actual rainfall runoff, so as to analyze the prediction accuracy of the rainfall runoff prediction model. Specifically, the calculation formula of the Nash coefficient is:
[0171]
[0172] in, Refers to the actual rainfall runoff, Refers to rainfall runoff prediction data, It refers to the average rainfall runoff determined based on actual rainfall runoff.
[0173] The calculation formula of runoff relative error is:
[0174]
[0175] The calculation formula of the relative error of the flood peak is:
[0176]
[0177] in, It refers to the peak flow output by the rainfall runoff prediction model. It refers to the peak flow in actual rainfall runoff.
[0178] Next, a detailed description is given of how to use the rainfall runoff prediction model pre-trained in the embodiments of the present application to predict the rainfall runoff in the target area or target time period.
[0179] Figure 6 The following is a flow chart of the rainfall runoff prediction method provided in the embodiment of the present application. Figure 6 As shown, the method includes:
[0180] S501, obtaining multiple geographical element factors related to rainfall runoff and values of the geographical element factors in a target area and / or a target time period, wherein the multiple geographical element factors include marked first-category geographical element factors, second-category geographical element factors, and third-category geographical element factors;
[0181] Specifically, the data processing server can first determine the target area and / or target time period for rainfall runoff prediction, and obtain multiple geographic element factors related to rainfall runoff and the values of the geographic element factors in the target area and / or the target time period, and then classify the multiple geographic element factors according to the spatial variation index and temporal variation index of each geographic element factor. The classified multiple geographic element factors may include the marked first-category geographic element factors, second-category geographic element factors, and third-category geographic element factors.
[0182] S502: updating the value of the first type of geographic element factor in the target area and / or target time period to a first fixed value;
[0183] Specifically, the data processing server may optimize the value of the first type of geographic element factor according to different classification results, that is, update the value of the first type of geographic element factor in the target area and / or the target time period to a first fixed value.
[0184] S503, updating the value of the second type of geographic element factor in the target area to a second fixed value;
[0185] Specifically, the data processing server may also optimize the value of the second type of geographic element factor according to different classification results, that is, update the value of the second type of geographic element factor in the target area to a second fixed value.
[0186] S504, updating the value of the third type of geographic element factor in the target time period to a third fixed value;
[0187] Specifically, the data processing server may also optimize the value of the third category geographic element factor according to different classification results, that is, update the value of the third category geographic element factor in the target time period to a third fixed value.
[0188] S505, inputting the values of the geographical element factors in the target area and / or the target time period into the pre-trained rainfall runoff prediction model for prediction, and obtaining the rainfall runoff of the target area in the target time period;
[0189] Specifically, the data processing server can input the values of the geographical element factors in the target area and / or the target time period into a pre-trained rainfall runoff prediction model for prediction, thereby obtaining the rainfall runoff of the target area in the target time period.
[0190] A rainfall runoff prediction method provided in an embodiment of the present application classifies a plurality of geographical element factors according to the spatial variation index and the temporal variation index of each geographical element factor, and optimizes the values of the geographical element factors according to different classification results, updates the values of the first type of geographical element factors in the target area and / or the target time period to the first fixed value, updates the values of the second type of geographical element factors in the target area to the second fixed value, and updates the values of the third type of geographical element factors in the target time period to the third fixed value, and then inputs the values of the geographical element factors in the target area and / or the target time period into a pre-trained rainfall runoff prediction model for prediction, and obtains the rainfall runoff of the target area in the target time period, thereby reducing redundant data and noise interference of the input model and improving the accuracy of rainfall runoff prediction.
[0191] In some embodiments, the data processing server may also directly input the obtained multiple geographic element factors related to rainfall runoff and the values of the geographic element factors in the target area and / or target time period into the pre-trained rainfall runoff prediction model for prediction, so as to obtain the rainfall runoff in the target area in the target time period. That is, in the prediction stage, the multiple geographic element factors are not classified according to the spatial variation index and temporal variation index of each geographic element factor, and the values of the geographic element factors are optimized according to different classification results.
[0192] The embodiment of the present invention can divide the electronic device or the main control device into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0193] Figure 7 This is a schematic diagram of the structure of the model training device provided in the embodiment of the present application. Figure 7 As shown, the model training device includes: an acquisition module 610, a determination module 620, a first value module 630, a second value module 640, a third value module 650, and a training module 660.
[0194] The acquisition module 610 is used to acquire multiple sets of data related to rainfall runoff, each set of data includes: a geographical location, a time period, values of multiple geographical elements corresponding to the geographical location and the time period, and actual rainfall runoff at the geographical location in the time period, and different data correspond to different geographical locations and / or time periods;
[0195] The determination module 620 is used to determine the spatial variation index and the temporal variation index of each geographic element factor, wherein the spatial variation index refers to the rate at which the geographic element factor changes with the geographic location; and the temporal variation index refers to the rate at which the geographic element factor changes with time;
[0196] A first value taking module 630 is configured to mark the geographic element factor as a first type of geographic element factor, and update the values of the first type of geographic element factor in different geographic locations and different time periods to a first fixed value if the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is within a first preset range, and the time variation index indicates that the rate at which the geographic element factor changes with time is within a second preset range;
[0197] A second value taking module 640 is configured to mark the geographic element factor as a second type of geographic element factor, and update the value of the second type of geographic element factor at different geographic locations to a second fixed value if the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is within a first preset range, and the temporal variation index indicates that the rate at which the geographic element factor changes with time is outside a second preset range;
[0198] A third value taking module 650 is used to mark the geographic element factor as a third type of geographic element factor, and update the values of the third type of geographic element factor in different time periods to third fixed values if the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is outside the first preset range, and the time variation index indicates that the rate at which the geographic element factor changes with time is within the second preset range;
[0199] The training module 660 is used to train the rainfall runoff prediction model using multiple sets of updated data.
[0200] In one possible design, the determination module 620 includes: a spatial variation index determination module and a temporal variation index determination module;
[0201] A spatial variation index determination module is used to calculate the gradient of the geographical element factor at each location for each geographical element factor, and take the sum of the gradients at each location as the spatial variation index of the geographical element factor;
[0202] The time variation index determination module is used to calculate the standard deviation of the change of each geographical element factor within a preset time as the time variation index of each geographical element factor.
[0203] In one possible design, the determination module 620 further includes: a ratio determination module, a first preset range determination module, and a second preset range determination module;
[0204] a ratio determination module, for determining, for each geographic element factor, a first number of remaining geographic element factors whose spatial variation index is less than or equal to the spatial variation index of the geographic element factor, so as to determine a first ratio of the first number of remaining geographic element factors to the number of all geographic element factors, and a second number of remaining geographic element factors whose temporal variation index is less than or equal to the temporal variation index of the geographic element factor, so as to determine a second ratio of the second number of remaining geographic element factors to the number of all geographic element factors;
[0205] A first preset range determination module, for determining that the rate at which the spatial variation index indicates that the geographic element factor changes with the geographic location is within a first preset range if the first ratio is less than or equal to a first threshold;
[0206] The second preset range determination module is used to determine that the rate at which the time variation index indicates that the geographic element factor changes over time is within a second preset range if the second ratio is less than or equal to a second threshold.
[0207] In a possible design, the model training device further includes: a first average value determination module, a first correlation calculation module, and a first deletion module;
[0208] A first average value determination module, used to determine a first average value of each geographic element factor according to the corresponding value of each geographic element factor in multiple groups of data;
[0209] A first correlation calculation module is used to input the corresponding values of any two geographic element factors in multiple groups of data and the first average values corresponding to the two geographic element factors into the correlation coefficient function to calculate the first correlation of the two geographic element factors;
[0210] The first deletion module is used to delete, from multiple groups of data, the value of one of the two geographic element factors whose first correlation is greater than or equal to a first correlation threshold.
[0211] In a possible design, the model training device further includes: a second average value determination module, an average rainfall runoff determination module, a second correlation correlation calculation module, and a second deletion module;
[0212] A second average value determination module, used to determine a second average value of the geographic element factor according to the corresponding value of any geographic element factor in multiple groups of data;
[0213] An average rainfall runoff determination module is used to determine the average rainfall runoff according to the actual rainfall runoff in multiple sets of data;
[0214] A second correlation calculation module is used to input the corresponding values of any geographical element factor in the multiple sets of data, the actual rainfall runoff in the multiple sets of data, the second average value, and the average rainfall runoff into the correlation coefficient function to calculate the second correlation between any geographical element factor and the rainfall runoff;
[0215] The second deletion module is used to delete the values of the geographical element factors whose second correlation is less than the second correlation threshold from the multiple groups of data.
[0216] In one possible design, the training module 660 includes: a data partitioning module, a first data set partitioning module, an iteration module, and an analysis module;
[0217] A data division module, used for dividing the updated multiple sets of data into a first data set and a second data set;
[0218] A first data set partitioning module, used to divide the first data set into K subsets, where K is an integer greater than or equal to 2;
[0219] An iteration module is used to select any one of the K subsets as a validation set in each round of training, and to select K-1 subsets of the K subsets other than the validation set as training sets, so as to train the rainfall-runoff prediction model through the training set, and to verify the rainfall-runoff prediction model trained in this round of iteration through the validation set;
[0220] The analysis module is used to analyze the rainfall runoff prediction model through the second data set after the training is completed.
[0221] In one possible design, the analysis module includes: a second data set input module and an analysis module;
[0222] A second data set input module, used for inputting the values of the geographical element factors in the second data set into the trained rainfall runoff prediction model to obtain rainfall runoff prediction data;
[0223] The analysis module is used to calculate the Nash coefficient, runoff relative error and flood peak relative error of the rainfall runoff prediction model based on the rainfall runoff prediction data and the actual rainfall runoff, so as to analyze the prediction accuracy of the rainfall runoff prediction model.
[0224] A model training device provided in this embodiment can execute a model training method of the above embodiment. Its implementation principle and technical effects are similar, and this embodiment will not be repeated here.
[0225] In a specific implementation of the aforementioned model training device, each module can be implemented as a processor, and the processor can execute computer execution instructions stored in the memory, so that the processor executes the aforementioned model training method.
[0226] Figure 8 This is a schematic diagram of the structure of the rainfall runoff prediction device provided in the embodiment of the present application. Figure 8 As shown, the rainfall runoff prediction device includes: a target data acquisition module 710, a first fixed value module 720, a second fixed value module 730, a third fixed value module 740, and a prediction module 750;
[0227] The target data acquisition module 710 is used to obtain multiple geographical element factors related to rainfall runoff and the values of the geographical element factors in the target area and / or the target time period, wherein the multiple geographical element factors include the marked first-category geographical element factors, the second-category geographical element factors and the third-category geographical element factors;
[0228] A first fixed value module 720, used to update the value of the second type of geographic element factor in the target area to a second fixed value;
[0229] The second fixed value module 730 is used to update the value of the third type of geographic element factor in the target time period to a third fixed value;
[0230] A third fixed value module 740, used to update the value of the third type of geographic element factor in the target time period to a third fixed value;
[0231] The prediction module 750 is used to input the values of the geographical element factors in the target area and / or target time period into the pre-trained rainfall runoff prediction model for prediction, so as to obtain the rainfall runoff in the target area in the target time period.
[0232] A rainfall runoff prediction device provided in this embodiment can execute a rainfall runoff prediction method of the above embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.
[0233] In the specific implementation of the aforementioned rainfall runoff prediction device, each module can be implemented as a processor, and the processor can execute computer-executable instructions stored in the memory, so that the processor executes the aforementioned rainfall runoff prediction method.
[0234] Fig. 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig. 9 As shown, the electronic device includes: at least one processor 810 and a memory 820. The electronic device also includes a communication component 830. The processor 810, the memory 820 and the communication component 830 are connected via a bus 840.
[0235] In the specific implementation process, at least one processor 810 executes the computer execution instructions stored in the memory 820, so that at least one processor 810 executes the model training method or rainfall runoff prediction method executed by the electronic device side as above.
[0236] The specific implementation process of the processor 810 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0237] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0238] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage.
[0239] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0240] The above-mentioned functions implemented by the electronic device and the main control device introduce the scheme provided by the embodiment of the present invention. It can be understood that in order to implement the above-mentioned functions, the electronic device or the main control device includes a hardware structure and / or software module corresponding to the execution of each function. In combination with the units and algorithm steps of each example described in the embodiment disclosed in the embodiment of the present invention, the embodiment of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present invention.
[0241] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, it is used to implement the above model training method or rainfall runoff prediction method.
[0242] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0243] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in an electronic device or a main control device.
[0244] The present application also provides a computer program product, which includes a computer program. The computer program is stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium. At least one processor executes the computer program so that the electronic device executes the solution provided in any of the above embodiments.
[0245] Those skilled in the art can understand that all or part of the steps of the above method embodiments can be completed by hardware related to program instructions. The above program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiments are executed; and the above storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0246] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit.
[0247] So far, the technical solution of the present application has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments, and the above embodiments are only used to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A model training method, It is characterized in that The model training method comprises: Acquire multiple groups of data related to rainfall runoff, each group of data including: a geographical location, a time period, values of multiple geographical elements corresponding to the geographical location and the time period, and actual rainfall runoff of the geographical location in the time period, wherein different data correspond to different geographical locations and / or time periods; Determine the spatial variation index and temporal variation index of each of the geographic element factors, wherein the spatial variation index refers to the rate at which the geographic element factor changes with the geographic location; and the temporal variation index refers to the rate at which the geographic element factor changes with time; If the spatial variation index indicates that the rate at which the geographical element factor changes with the geographical location is within a first preset range, and the temporal variation index indicates that the rate at which the geographical element factor changes with time is within a second preset range, the geographical element factor is marked as a first-category geographical element factor, and the values of the first-category geographical element factor in different geographical locations and different time periods are updated to first fixed values; If the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is within a first preset range, and the temporal variation index indicates that the rate at which the geographic element factor changes with time is outside a second preset range, the geographic element factor is marked as a second type of geographic element factor, and the values of the second type of geographic element factor in different geographic locations are updated to second fixed values; If the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is outside the first preset range, and the temporal variation index indicates that the rate at which the geographic element factor changes with time is within the second preset range, the geographic element factor is marked as a third type of geographic element factor, and the values of the third type of geographic element factor in different time periods are updated to third fixed values; The rainfall runoff prediction model is trained using the updated multiple sets of data.
2. The model training method according to claim 1, It is characterized in that Determining the spatial variation index and temporal variation index of each of the geographic element factors includes: For each of the geographic element factors, calculate the gradient of the geographic element factor at each of the locations, and take the sum of the gradients at each of the locations as the spatial variation index of the geographic element factor; The standard deviation of the change of each of the geographic element factors within a preset time is calculated as the time variation index of each of the geographic element factors.
3. The model training method according to claim 2, It is characterized in that The model training method also includes: For each geographic element factor, determine the number of first remaining geographic element factors whose spatial variation index is less than or equal to the spatial variation index of the geographic element factor, so as to determine a first ratio of the number of the first remaining geographic element factors to the number of all geographic element factors, and determine the number of second remaining geographic element factors whose temporal variation index is less than or equal to the temporal variation index of the geographic element factor, so as to determine a second ratio of the number of the second remaining geographic element factors to the number of all geographic element factors; If the first ratio is less than or equal to a first threshold, it is determined that the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is within the first preset range; If the second ratio is less than or equal to a second threshold, it is determined that the time variation index indicates that the rate at which the geographic element factor changes over time is within the second preset range.
4. The model training method according to claim 3, It is characterized in that Before determining the spatial variation index and the temporal variation index of each of the geographic element factors, the model training method further includes: Determine a first average value of each of the geographic element factors according to the corresponding values of each of the geographic element factors in the multiple sets of data; Inputting the values corresponding to any two of the geographic element factors in the multiple sets of data and the first average values respectively corresponding to the two geographic element factors into the correlation coefficient function to calculate the first correlation between the two geographic element factors; From the multiple groups of data, the value of one of the two geographic element factors whose first correlation is greater than or equal to a first correlation threshold is deleted.
5. The model training method according to claim 3, It is characterized in that Before determining the spatial variation index and the temporal variation index of each of the geographic element factors, the model training method further includes: Determine a second average value of the geographic element factor according to the corresponding value of any one of the geographic element factors in the multiple groups of data; Determine average rainfall runoff according to the actual rainfall runoff in the multiple sets of data; Inputting the corresponding value of any one of the geographic element factors in the multiple sets of data, the actual rainfall runoff in the multiple sets of data, the second average value, and the average rainfall runoff into a correlation coefficient function, and calculating a second correlation between any one of the geographic element factors and the rainfall runoff; From the multiple groups of data, the values of the geographic element factors whose second correlation is less than a second correlation threshold are deleted.
6. The model training method according to any one of claims 1 to 5, It is characterized in that The step of training the rainfall runoff prediction model by using the updated multiple sets of data includes: dividing the updated plurality of sets of data into a first data set and a second data set; Dividing the first data set into K subsets, where K is an integer greater than or equal to 2; In each round of iteration of the training, any one of the K subsets is selected as a validation set, and K-1 subsets of the K subsets other than the validation set are selected as training sets, so as to train the rainfall-runoff prediction model through the training set, and verify the rainfall-runoff prediction model trained in this round of iteration through the validation set; After the training is completed, the rainfall runoff prediction model is analyzed using the second data set.
7. The model training method according to claim 6, It is characterized in that After the training is completed, analyzing the rainfall runoff prediction model through the second data set includes: Inputting the values of the geographic element factors in the second data set into the trained rainfall runoff prediction model to obtain rainfall runoff prediction data; According to the rainfall runoff prediction data and the actual rainfall runoff, the Nash coefficient, runoff relative error and flood peak relative error of the rainfall runoff prediction model are calculated to analyze the prediction accuracy of the rainfall runoff prediction model.
8. A rainfall runoff prediction method, It is characterized in that include: Acquire multiple geographical element factors related to rainfall runoff and the values of the geographical element factors in a target area and / or a target time period, wherein the multiple geographical element factors include marked first-category geographical element factors, second-category geographical element factors, and third-category geographical element factors; Updating the value of the first type of geographical element factor in the target area and / or the target time period to a first fixed value; Updating the value of the second type of geographic element factor in the target area to a second fixed value; Updating the value of the third type of geographic element factor in the target time period to a third fixed value; The values of the geographical element factors in the target area and / or target time period are input into a pre-trained rainfall runoff prediction model for prediction, so as to obtain the rainfall runoff of the target area in the target time period.
9. A model training device, It is characterized in that include: An acquisition module is used to acquire multiple groups of data related to rainfall runoff, each group of data includes: a geographical location, a time period, values of multiple geographical elements corresponding to the geographical location and the time period, and actual rainfall runoff of the geographical location in the time period, and different data correspond to different geographical locations and / or time periods; A determination module, used to determine the spatial variation index and the temporal variation index of each of the geographic element factors, wherein the spatial variation index refers to the rate at which the geographic element factor changes with the geographic location; and the temporal variation index refers to the rate at which the geographic element factor changes with time; A first value-taking module, for marking the geographic element factor as a first-category geographic element factor, and updating the values of the first-category geographic element factor in different geographic locations and different time periods to first fixed values, if the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is within a first preset range, and the time variation index indicates that the rate at which the geographic element factor changes with time is within a second preset range; A second value-taking module, for marking the geographic element factor as a second-category geographic element factor, and updating the value of the second-category geographic element factor in different geographic locations to a second fixed value, if the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is within a first preset range, and the time variation index indicates that the rate at which the geographic element factor changes with time is outside a second preset range; A third value-taking module, for marking the geographic element factor as a third type of geographic element factor, and updating the values of the third type of geographic element factor in different time periods to third fixed values, if the spatial variation index indicates that the rate at which the geographic element factor changes with the geographic location is outside a first preset range, and the time variation index indicates that the rate at which the geographic element factor changes with time is within a second preset range; A training module is used to train the rainfall runoff prediction model using the updated multiple sets of data.
10. A rainfall runoff prediction device, It is characterized in that include: A target data acquisition module, used to acquire multiple geographical element factors related to rainfall runoff and the values of the geographical element factors in a target area and / or a target time period, wherein the multiple geographical element factors include marked first-category geographical element factors, second-category geographical element factors, and third-category geographical element factors; A first fixed value module, used for updating the value of the first type of geographic element factor in the target area and / or the target time period to a first fixed value; A second fixed value module, used for updating the value of the second type of geographical element factor in the target area to a second fixed value; A third fixed value module, used for updating the value of the third type of geographic element factor in the target time period to a third fixed value; The prediction module is used to input the values of the geographical element factors in the target area and / or target time period into the pre-trained rainfall runoff prediction model for prediction, so as to obtain the rainfall runoff of the target area in the target time period.
11. An electronic device, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the model training method according to any one of claims 1 to 7 or the rainfall runoff prediction method according to claim 8.
12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the model training method according to any one of claims 1 to 7 or the rainfall runoff prediction method according to claim 8.
13. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, it implements the model training method according to any one of claims 1 to 7 or the rainfall runoff prediction method according to claim 8.
