Runoff forecasting method and device based on data statistical analysis
Through the runoff forecasting method based on data statistical analysis, the runoff forecasting process is simplified by using historical runoff data and runoff event cycles, solving the problem of dependence on short-term rainfall or runoff data in the prior art, and improving forecast efficiency and accuracy.
Patent Information
- Application Number
- CN202411523880.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-29
AI Technical Summary
Existing runoff prediction methods rely on rainfall or runoff data in a short period of time, resulting in redundant prediction processes and low efficiency.
By obtaining the historical runoff data and runoff event periods of the hydrological station to be predicted, the periodic time variables at the time of the runoff event are determined based on the runoff event period and the preset reference time, regression training is performed to obtain the probability distribution of the relative deviation, and randomly select the to be predicted. The relative deviation of the time is determined based on the runoff average trend data and the relative deviation.
Reliance on short-term rainfall data in the basin or short-term runoff data at upstream sites has been reduced, runoff forecasting process has been simplified, runoff forecasting efficiency has been improved, and the difficulty of obtaining and transmitting forecast data has been reduced.
Smart Images

Figure CN119396939A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of water conservancy engineering, and in particular to a runoff forecasting method and device based on data statistical analysis. Background Art
[0002] Runoff refers to the flow of water along the surface or underground under the action of gravity, such as rainfall, meltwater from ice and snow, or irrigation water. Runoff prediction plays an important role in the planning, design, construction and operation management of water conservancy projects. It is also of great significance for flood prevention and disaster reduction, rational allocation of water resources, and ecological environmental protection.
[0003] Related runoff prediction methods rely on rainfall or runoff data in a short period of time for prediction. However, since rainfall or runoff data in a short period of time is difficult to obtain, the runoff prediction process is redundant and the prediction efficiency is low. Summary of the invention
[0004] In view of this, the present invention provides a runoff forecasting method based on data statistical analysis to solve the problem that rainfall or runoff data is difficult to obtain in existing forecasting methods, resulting in redundant runoff forecasting processes and low prediction efficiency.
[0005] In a first aspect, the present invention provides a runoff forecasting method based on data statistical analysis, the method comprising:
[0006] Obtain historical runoff data and runoff event cycle of the hydrological site to be forecasted, and determine the periodic time variable of the runoff event occurrence time based on the runoff event cycle and the preset reference time;
[0007] Regression training is performed on the periodic time variables corresponding to the historical runoff data and the time when the runoff event occurs to obtain the probability distribution of relative deviations;
[0008] The relative deviation of the time to be predicted is randomly selected based on the probability distribution of relative deviation;
[0009] Determine the average runoff trend data at the time to be predicted based on the reference time and the runoff event period;
[0010] The runoff data at the time to be predicted is determined based on the average runoff trend data at the time to be predicted and the relative deviation at the time to be predicted.
[0011] The runoff forecasting method based on data statistical analysis provided in the present embodiment obtains historical runoff data and runoff event cycles of the hydrological station to be forecasted, determines the periodic time variable of the runoff event occurrence time based on the runoff event cycle and a preset reference time, and then determines the relative deviation of the time to be forecasted according to the periodic time variable corresponding to the historical runoff data and the runoff event occurrence time, determines the average runoff trend data of the time to be forecasted based on the reference time and the runoff event cycle, and finally determines the runoff data of the time to be forecasted based on the average runoff trend data of the time to be forecasted and the relative deviation of the time to be forecasted; in the process of forecasting the runoff of the hydrological station to be forecasted at a future time, the dependence on the short-term rainfall data of the basin or the short-term runoff data of the upstream station is reduced, and the acquisition of the runoff forecast of the hydrological station with a long series of historical runoff data is realized, which effectively reduces the difficulty of acquiring and transmitting the runoff forecast data, and at the same time reduces the dependence on the real-time runoff data, simplifies the runoff forecasting process, and improves the runoff forecasting efficiency.
[0012] In an optional implementation, regression training is performed on the historical runoff data and the periodic time variables corresponding to the time when the runoff event occurs to obtain the probability distribution of the relative deviation, including:
[0013] Obtaining the functional relationship between the average runoff trend and the periodic time variable, based on the periodic time variable corresponding to the time when the runoff event occurs, using the functional relationship between the average runoff trend and the periodic time variable to determine the average runoff trend prediction data;
[0014] Determine relative deviations based on average runoff trend forecast data and historical runoff data;
[0015] The standard deviation of the relative deviation is calculated based on the relative deviation, and the probability distribution of the relative deviation is obtained based on the standard deviation of the relative deviation.
[0016] The runoff forecasting method based on data statistical analysis provided in this embodiment uses the functional relationship between the runoff average trend and the periodic time variable to determine the runoff average trend forecast data, and determines the relative deviation based on the runoff average trend forecast data and the historical runoff data, thereby achieving accurate calculation of the relative deviation between the runoff average trend forecast data and the historical runoff data, and obtaining the probability distribution of the relative deviation through the standard deviation of the relative deviation. In the runoff forecasting process, the influence of random errors on the forecast results is taken into account, so that the runoff forecast results are more accurate.
[0017] In an optional implementation, before obtaining the functional relationship between the average runoff trend and the periodic time variable, and determining the average runoff trend prediction data based on the periodic time variable corresponding to the time when the runoff event occurs and using the functional relationship between the average runoff trend and the periodic time variable, the method further includes:
[0018] Obtain the data volume of historical runoff data, determine the number of decision trees and the search range of pre-pruning parameters based on the data volume of historical runoff data, and establish a parameter grid;
[0019] Set cross-validation parameters and evaluation indicators, and determine the optimal number of decision trees and pre-pruning parameters based on the parameter grid, cross-validation folds, and evaluation indicators;
[0020] Based on the optimal number of decision trees and pre-pruning parameters, the random forest algorithm was used to obtain the functional relationship between the average trend of runoff and the periodic time variable.
[0021] The runoff forecasting method based on data statistical analysis provided in this embodiment determines the optimal number of decision trees and pre-pruning parameters through parameter grids, cross-validation folds and evaluation indicators, effectively avoiding the contradiction between the requirements of runoff forecast accuracy, computational cost, etc. when the amount of historical runoff data is large, and realizes the selection of random forest algorithm parameters. Then, based on the optimal number of decision trees and pre-pruning parameters, the random forest algorithm is used to obtain the functional relationship between the average trend of runoff and the periodic time variable, thereby realizing an accurate description of the functional relationship between the average trend of runoff and the periodic time variable and simplifying the runoff forecasting process.
[0022] In an optional implementation, determining the average runoff trend data at the time to be predicted based on the reference time and the runoff event period includes:
[0023] Calculate the periodic time variable at the forecast time based on the reference time and the runoff event period;
[0024] The average trend data of runoff at the time to be predicted is determined based on the periodic time variables at the time to be predicted.
[0025] The runoff forecasting method based on data statistical analysis provided in this embodiment realizes accurate calculation of the average trend of runoff changes by calculating the periodic time variables at the time to be forecasted and the average runoff trend data at the time to be forecasted, thus laying a foundation for subsequent runoff forecasting.
[0026] In an optional implementation, the periodic time variable of the moment when the runoff event occurs is determined based on the runoff event cycle and the preset reference time. The calculation formula of the periodic time variable of the moment when the runoff event occurs is as follows:
[0027]
[0028] Among them, τ i represents the periodic time variable of the time when the runoff event occurs, frac represents the decimal part, T represents the runoff event period, t0 represents the reference time, t i Indicates the time when the runoff event occurs.
[0029] In an optional implementation, the runoff data at the time to be predicted is determined based on the average runoff trend data at the time to be predicted and the relative deviation at the time to be predicted. The calculation formula for the runoff data at the time to be predicted is as follows:
[0030]
[0031] Among them, Q j represents the runoff data at the time to be predicted, represents the average trend data of runoff at the time to be predicted, r j Indicates the relative deviation of the time to be predicted.
[0032] In a second aspect, the present invention provides a runoff forecasting device based on data statistical analysis, the device comprising:
[0033] The first determination module is used to obtain the historical runoff data and runoff event cycle of the hydrological site to be predicted, and determine the periodic time variable of the runoff event occurrence time based on the runoff event cycle and the preset reference time;
[0034] The regression training module is used to perform regression training on the periodic time variables corresponding to the historical runoff data and the time when the runoff event occurred, and obtain the probability distribution of the relative deviation;
[0035] An extraction module, used for randomly extracting the relative deviation of the time to be predicted based on the probability distribution of the relative deviation;
[0036] The second determination module is used to determine the average runoff trend data at the time to be predicted based on the reference time and the runoff event cycle;
[0037] The third determination module is used to determine the runoff data at the time to be predicted based on the average runoff trend data at the time to be predicted and the relative deviation at the time to be predicted.
[0038] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to execute the runoff forecasting method based on data statistical analysis of the above-mentioned first aspect or any corresponding embodiment thereof.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the runoff forecasting method based on data statistical analysis of the above-mentioned first aspect or any corresponding embodiment thereof.
[0040] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the runoff forecasting method based on data statistical analysis of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 is a flow chart of a runoff forecasting method based on data statistical analysis according to an embodiment of the present invention;
[0043] Figure 2 is a flow chart of another runoff forecasting method based on data statistical analysis according to an embodiment of the present invention;
[0044] Figure 3 is a flow chart of another runoff forecasting method based on data statistical analysis according to an embodiment of the present invention;
[0045] Figure 4 is a flow chart of another runoff forecasting method based on data statistical analysis according to an embodiment of the present invention;
[0046] Figure 5 is a schematic diagram of machine learning results of daily measured runoff at hydrological station A from 2003 to 2020 according to an embodiment of the present invention;
[0047] Figure 6 is a probability (frequency) distribution diagram of the deviation of the measured runoff at hydrological station A relative to its average trend according to an embodiment of the present invention;
[0048] Figure 7 is the daily runoff forecast result of hydrological station A in 2021 according to an embodiment of the present invention;
[0049] Figure 8 is a structural block diagram of a runoff forecasting device based on data statistical analysis according to an embodiment of the present invention;
[0050] Fig. 9 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0052] Related runoff prediction methods include:
[0053] The first method is based on the rainfall-runoff hydrological model. It uses the rainfall, evaporation and infiltration data of the basin during the forecast period to calculate the runoff through the hydrological model, thereby realizing the runoff forecast of the site. This method has a clear concept, but the forecast period is short, and it cannot obtain and transmit relevant data with a long forecast period and high accuracy in time, making it difficult to improve the runoff forecast accuracy for more than 3 days in the future.
[0054] The second method is the rainfall-runoff regression relationship method, which makes forecasts by establishing a regression relationship between rainfall and runoff. It omits the process of runoff calculation in the first method and only relies on rainfall data within the forecast period. However, it is difficult to obtain and transmit relevant data with a long forecast period and high accuracy in a timely manner.
[0055] The third method is the corresponding flow method, which is based on the real-time runoff measurement of the upstream station and combines the water surface wave transmission to calculate the runoff of the downstream station to be predicted. It requires that the distance between the upstream and downstream stations is short and the water flow between the upstream and downstream intervals can be ignored. Although it does not rely on rainfall data, it is difficult to obtain runoff data of the upstream station in a short time, resulting in low runoff forecast accuracy.
[0056] In the long-term water conservancy practice, hydrological stations in various places have accumulated a considerable amount of historical runoff data; however, the historical runoff data collected by hydrological stations in various places have not been fully utilized in runoff forecasting methods. If we can conduct in-depth analysis based on the historical runoff data of hydrological stations in various places and propose new forecasting methods based on this, it will be expected to solve the difficulties faced by current runoff forecasting methods in obtaining and transmitting basic data, reduce dependence on real-time data, simplify the forecasting process and improve the efficiency of runoff forecasting.
[0057] To solve the above technical problems, an embodiment of the present invention provides a runoff forecasting method based on data statistical analysis, which overcomes the deficiency of related runoff forecasting methods that rely on short-term rainfall or runoff data. On the premise of knowing the long series of historical runoff data of the hydrological station to be forecasted and the time when the runoff event occurs, the runoff of the hydrological station to be forecasted at future times can be effectively forecasted. The runoff forecasting process can not only take into account the average trend of runoff changes, but also random errors.
[0058] The embodiment of the present invention provides a method for runoff forecasting based on statistical analysis of data. It should be noted that the method for runoff forecasting based on statistical analysis of data provided by the embodiment of the present invention may be executed by a device for runoff forecasting based on statistical analysis of data. The runoff forecasting based on statistical analysis of data may be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware. The electronic device may be a server or a terminal. The server in the embodiment of the present application may be a single server or a server cluster composed of multiple servers. The terminal in the embodiment of the present application may be a smart phone, a personal computer, a tablet computer, an intelligent robot, or other intelligent hardware devices. In the following method embodiments, the execution subject is an electronic device as an example for explanation.
[0059] According to an embodiment of the present invention, a runoff forecasting method embodiment based on statistical analysis of data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0060] In this embodiment, a runoff forecasting method based on data statistical analysis is provided, which can be used in the above-mentioned electronic device. Figure 1 is a flow chart of a runoff forecasting method based on data statistical analysis according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0061] Step S101, obtaining historical runoff data and runoff event cycle of the hydrological site to be forecasted, and determining the periodic time variable of the runoff event occurrence time based on the runoff event cycle and a preset reference time.
[0062] Specifically, most of the hydrological stations have the characteristic of annual cycle changes. For these hydrological stations, the runoff event cycle is "year". When the hydrological data are counted according to the natural year, since the number of days in the normal year and leap year in the natural year are 365 days and 366 days respectively, if the runoff event cycle is "year", it is necessary to deal with the inconsistency of the number of days in the normal year and leap year; further considering that the long series of runoff data (i.e. the historical runoff data of the hydrological station to be predicted) is used as the basic data, the data usually periodically contains several normal year and leap year data, so the unified processing of the normal year and leap year data can not only simplify the data processing work, but also help to bridge the errors.
[0063] Furthermore, since leap years occur every four years, the calculation formula for the runoff event period T (unit: day) is as follows:
[0064] T = (365*3+366) / 4 = 365.25 (1)
[0065] Therefore, the period T of the runoff event was determined to be 365.25 days.
[0066] Furthermore, the reference time t0 is selected as the quantitative reference. For each data in the historical runoff data of the hydrological station to be predicted, the calculation formula of the periodic time variable at the time when the runoff event occurs is as follows:
[0067]
[0068] Among them, τ i represents the time t when the runoff event occurs i frac is the periodic time variable, T is the runoff event period, t0 is the reference time, and t i Indicates the time when the runoff event occurs.
[0069] Furthermore, the above formula (1) quantifies the historical runoff data Q i (i=1,2,…,m) and the occurrence time t i The relative relationship between the periodicity and the benchmark time t0 only provides a quantitative benchmark for the historical runoff data Q i and the occurrence time t i The relative relationship of the periodicity between them has no effect, therefore, the reference time t0 can be selected arbitrarily.
[0070] Step S102, performing regression training on the historical runoff data and the periodic time variables corresponding to the time when the runoff event occurred, to obtain the probability distribution of the relative deviation.
[0071] Step S103: randomly extracting the relative deviation of the time to be predicted based on the probability distribution of the relative deviation.
[0072] Specifically, on the basis of pseudo-random number generation, the Ziggurat algorithm based on acceptance-rejection strategy (a method for generating random numbers), or the Box-Muller algorithm based on inverse transformation (a method for generating standard normal distribution random numbers), or the Marsaglia polar coordinate algorithm based on inverse transformation and acceptance-rejection strategy (a method for generating random numbers with specific probability distribution) and the modified Box-Muller algorithm can be used for random sampling to obtain the relative deviation of the time to be predicted.
[0073] Furthermore, since the Permuted Congruential Generator (PCG) series of algorithms have advantages over other algorithms in terms of simplicity, speed, storage saving, good statistical effect and unpredictability, the Permuted Congruential Generator series of algorithms are used to generate pseudo-random numbers.
[0074] Step S104, determining the average runoff trend data at the time to be predicted based on the reference time and the runoff event period.
[0075] Step S105, determining the runoff data at the time to be predicted based on the average runoff trend data at the time to be predicted and the relative deviation at the time to be predicted.
[0076] Specifically, the calculation formula for runoff data at the time to be predicted is as follows:
[0077]
[0078] Among them, Q j represents the runoff data at the time to be predicted, represents the average trend data of runoff at the time to be predicted, r j Indicates the relative deviation of the time to be predicted.
[0079] The runoff forecasting method based on data statistical analysis provided in the present embodiment obtains historical runoff data and runoff event cycles of the hydrological station to be forecasted, determines the periodic time variable of the runoff event occurrence time based on the runoff event cycle and a preset reference time, and then determines the relative deviation of the time to be forecasted according to the periodic time variable corresponding to the historical runoff data and the runoff event occurrence time, determines the average runoff trend data of the time to be forecasted based on the reference time and the runoff event cycle, and finally determines the runoff data of the time to be forecasted based on the average runoff trend data of the time to be forecasted and the relative deviation of the time to be forecasted; in the process of forecasting the runoff of the hydrological station to be forecasted at a future time, the dependence on the short-term rainfall data of the basin or the short-term runoff data of the upstream station is reduced, and the acquisition of the runoff forecast of the hydrological station with a long series of historical runoff data is realized, which effectively reduces the difficulty of acquiring and transmitting the runoff forecast data, and at the same time reduces the dependence on the real-time runoff data, simplifies the runoff forecasting process, and improves the runoff forecasting efficiency.
[0080] In this embodiment, a runoff forecasting method based on data statistical analysis is provided, which can be used in the above-mentioned electronic device. Figure 2 is a flow chart of a runoff forecasting method based on data statistical analysis according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0081] Step S201, obtain the historical runoff data and runoff event cycle of the hydrological station to be forecasted, and determine the periodic time variable of the runoff event occurrence time based on the runoff event cycle and the preset reference time. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0082] Step S202, performing regression training on the historical runoff data and the periodic time variables corresponding to the time when the runoff event occurred, to obtain the probability distribution of the relative deviation.
[0083] Specifically, the above step S202 includes:
[0084] Step S2021, obtaining the functional relationship between the average runoff trend and the periodic time variable, based on the periodic time variable corresponding to the time when the runoff event occurs, and using the functional relationship between the average runoff trend and the periodic time variable to determine the average runoff trend prediction data.
[0085] Specifically, due to the complexity of runoff events, the average trend change of runoff is not a simple periodic function relationship, so it is impossible to use known functions or their combinations for regression representation; with the continuous development and wide application of machine learning technology, new means are provided to solve this problem, and machine learning is used to obtain the functional relationship between the average trend of runoff and periodic time variables; because in machine learning methods, the random forest algorithm has the advantages of not being affected by the actual function that the data should satisfy, strong generalization ability, and low difficulty in parameter tuning, it is suitable for application under various hydrological conditions. Therefore, the random forest algorithm is used to obtain the functional relationship between the average trend of runoff and periodic time variables.
[0086] Furthermore, the random forest algorithm contains parameters such as the number of decision trees and the maximum tree depth, the minimum tree sample split value, and the minimum number of leaf node samples (the latter three are pre-pruning parameters, and usually only one of them is controlled). The above parameters are generally selected based on the balance between forecast accuracy, computing cost and other requirements. However, for historical runoff data with a large data volume, the contradiction between forecast accuracy, computing cost and other requirements may be more prominent, and it is necessary to select the best parameters within the allowable range; therefore, forecast accuracy, computing cost and other requirements can be used as evaluation factors, and the grid search method combined with cross validation can be used to optimize the relevant parameters of the random forest algorithm.
[0087] Furthermore, the process of determining the functional relationship between the average trend of runoff and the periodic time variables is as follows: obtaining the data volume of historical runoff data, determining the number of decision trees and the search range of pre-pruning parameters based on the data volume of historical runoff data, and establishing a parameter grid; setting cross-validation parameters and evaluation indicators, and determining the optimal number of decision trees and pre-pruning parameters based on the parameter grid, cross-validation folds and evaluation indicators; based on the optimal number of decision trees and pre-pruning parameters, using the random forest algorithm to obtain the functional relationship between the average trend of runoff and the periodic time variables.
[0088] Furthermore, the specific steps for determining the optimal number of decision trees and pre-pruning parameters are as follows: define the search range of parameters and establish a parameter grid; set the fold number K of cross-validation (5 folds or 10 folds); select evaluation indicators (such as prediction accuracy, computational cost, or a combination of the two); perform grid search; sort the grid search results to find the parameter combination with the best average evaluation indicator; select the parameter combination with the best evaluation indicator from the sorted results as the optimal parameters, and the optimal parameters include the optimal number of decision trees and pre-pruning parameters; the specific steps of grid search are as follows:
[0089] a) For each parameter combination in the parameter grid: for each of the K folds, use the K-1 fold data to train the random forest model, and validate the model on the remaining 1 fold and calculate the evaluation index; calculate the average of the K evaluation indicators.
[0090] b) Record each parameter combination and its corresponding average evaluation index.
[0091] Furthermore, machine learning was used to conduct regression training on the periodic time variable series and historical runoff data series at the time of runoff events, and the functional relationship between the average runoff trend and the periodic time variable was obtained. The function between it and the periodic time variable τ is as follows:
[0092]
[0093] Step S2022, determining the relative deviation based on the runoff average trend prediction data and the historical runoff data.
[0094] Specifically, each periodic time variable τ i Substituting into the above formula (4), we can get the average runoff trend prediction data: Furthermore, each historical runoff data Q i and the corresponding average runoff trend forecast data The relative deviation between i , the specific formula is as follows;
[0095]
[0096] Step S2023, calculating the standard deviation of the relative deviation based on the relative deviation, and obtaining the probability distribution of the relative deviation based on the standard deviation of the relative deviation.
[0097] Specifically, the relative deviation r i Assume that the relative deviation r of the population follows a normal distribution with a mean of zero. i Estimate the standard deviation σ of the r variable population. The calculation formula for the standard deviation σ is as follows:
[0098]
[0099] Where m is the number of runoff data.
[0100] Furthermore, the probability distribution of the relative deviation is determined by the standard deviation of the relative deviation. The calculation formula of the probability distribution of the relative deviation is as follows:
[0101]
[0102] Among them, ξ represents the threshold of relative deviation, P r It represents the probability when the relative deviation is less than the threshold ξ, and x is the integral variable.
[0103] Step S203, randomly extract the relative deviation of the time to be predicted based on the probability distribution of the relative deviation. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0104] Step S204: Determine the average runoff trend data at the time to be predicted based on the reference time and the runoff event cycle. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0105] Step S205: Determine the runoff data at the time to be predicted based on the average runoff trend data at the time to be predicted and the relative deviation at the time to be predicted. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0106] The runoff forecasting method based on data statistical analysis provided in this embodiment uses the functional relationship between the runoff average trend and the periodic time variable to determine the runoff average trend forecast data, and determines the relative deviation based on the runoff average trend forecast data and the historical runoff data, thereby achieving accurate calculation of the relative deviation between the runoff average trend forecast data and the historical runoff data, and obtaining the probability distribution of the relative deviation through the standard deviation of the relative deviation. In the runoff forecasting process, the influence of random errors on the forecast results is taken into account, so that the runoff forecast results are more accurate.
[0107] In this embodiment, a runoff forecasting method based on data statistical analysis is provided, which can be used in the above-mentioned electronic device. Figure 3 is a flow chart of a runoff forecasting method based on data statistical analysis according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0108] Step S301, obtain the historical runoff data and runoff event cycle of the hydrological station to be forecasted, and determine the periodic time variable of the runoff event occurrence time based on the runoff event cycle and the preset reference time. Figure 2 Step S201 of the illustrated embodiment will not be described in detail here.
[0109] Step S302: Perform regression training on the historical runoff data and the periodic time variables corresponding to the time when the runoff event occurred to obtain the probability distribution of the relative deviation. Figure 2 Step S202 of the illustrated embodiment will not be described in detail here.
[0110] Step S303: randomly extract the relative deviation of the time to be predicted based on the probability distribution of the relative deviation. Figure 2 Step S203 of the illustrated embodiment will not be described in detail here.
[0111] Step S304, determining the average runoff trend data at the time to be predicted based on the reference time and the runoff event period.
[0112] Specifically, the above step S304 includes:
[0113] Step S3041, calculating the periodic time variable of the time to be predicted based on the reference time and the runoff event period.
[0114] Specifically, the forecast time t j (j = 1, 2, ..., n; n is the number of the time to be predicted) into the above formula (2), and the time to be predicted t j The corresponding periodic time variable τ j .
[0115] Step S3042, determining the average trend data of runoff at the time to be predicted based on the periodic time variable at the time to be predicted.
[0116] Specifically, the forecast time t j The corresponding periodic time variable τ j Substituting into the above formula (4), we get the forecast time τ j Average runoff trend data
[0117] Step S305, determining the runoff data at the time to be predicted based on the average runoff trend data at the time to be predicted and the relative deviation at the time to be predicted; for details, see Figure 2 Step S205 of the illustrated embodiment will not be described in detail here.
[0118] The runoff forecasting method based on data statistical analysis provided in this embodiment realizes accurate calculation of the average trend of runoff changes by calculating the periodic time variables at the time to be forecasted and the average runoff trend data at the time to be forecasted, thus laying a foundation for subsequent runoff forecasting.
[0119] The following is a specific example to illustrate the specific steps of a runoff forecasting method based on data statistical analysis.
[0120] Embodiment 1:
[0121] The daily runoff forecast for 2021 of hydrological station A in a certain place is selected. The historical runoff data used for the forecast are the daily runoff measured data of the station from 2003 to 2020. Figure 4 As shown in Figure 2, the specific steps of the runoff forecasting method based on data statistical analysis are as follows:
[0122] Step 1: Determine the runoff event cycle of hydrological station A as "year". Since 2003 to 2020 includes ordinary years and leap years, the two are treated uniformly and "year" is calculated as 365.25 days.
[0123] Step 2: Select 0:00:00:00 on January 1, 2001 as the reference time t0, and for each historical runoff data Q of the daily runoff measurement data of hydrological station A from 2003 to 2020 i To simplify the calculation, it is assumed that the time of occurrence of historical runoff data is t i All are at 12:00:00:00 noon on the same day, and then calculate t i The corresponding periodic time variable τ i , as shown in Table 1 below:
[0124] Table 1:
[0125] i <![CDATA[Q i ]]> <![CDATA[t i ]]> <![CDATA[τ i ]]> 1 3050 2003-01-01 12:00:00 0.000000000 2 3040 2003-01-02 12:00:00 0.002737851 3 2810 2003-01-03 12:00:00 0.005475702 … … … … 6575 4980 2020-12-31 12:00:00 0.998631075
[0126] Step 3: Take the periodic time variable τ in Table 1 above i Sequence as training feature, historical runoff data Q i The sequence is used as the training target, and the random forest algorithm is used to train τ i Sequence and Q i Sequential machine learning regression training was carried out, where the number of decision trees was taken as 100, the maximum tree depth was calculated based on full expansion, the minimum tree sample split value was 2, and the minimum number of leaf node samples was 1, to obtain the average trend of runoff The functional relationship between and the periodic time variable τ. For ease of presentation and comparison, the relationship is transformed into The functional relationship between and the actual time t is as follows: Figure 5 As shown by the solid line, Figure 5 The hollow dots in the figure represent the measured runoff data Q i situation.
[0127] Step 4: Based on each τ in Table 1 above i get Series, daily runoff relative deviation from 2003 to 2020 i The calculation results are shown in Table 2 below:
[0128] Table 2:
[0129]
[0130] Step 5: Calculate each Q i With the corresponding The relative deviation between i , we get r i Series, daily runoff relative deviation from 2003 to 2020 i The calculation results are shown in Table 3 below:
[0131] Table 3:
[0132] i <![CDATA[r i ]]> 1 -0.1874 2 -0.1614 3 -0.2221 … … 6575 0.2272
[0133] Step 6: i The sequence is regarded as a random sample of the r variable population, and the r variable population is considered to obey a normal distribution with a mean of zero. i The sequence estimates the standard deviation σ of the r variable population according to formula (4) as 0.225, thereby determining the probability (frequency) distribution of the r variable population, as follows: Figure 6 Shown by the middle curve. Figure 6 It also shows r i The probability (frequency) histogram of the sequence as a random sample of the r variable population basically conforms to the normal distribution with a mean of zero.
[0134] Step 7: Forecast the daily runoff of hydrological station A in 2021. For simplicity, the forecast time is still set at 12:00:00:00 noon on the same day according to historical data, and calculate the forecast time t j The corresponding periodic time variable τ j , the daily runoff periodic time variable τ in 2021 j The calculation results are shown in Table 4 below:
[0135] Table 4:
[0136] j <![CDATA[t j ]]> <![CDATA[τ j ]]> 1 2021-01-01 12:00:00 0.001368925 2 2021-01-02 12:00:00 0.004106776 3 2021-01-03 12:00:00 0.006844627 … … … 365 2021-12-31 12:00:00 0.997946612
[0137] Step 8: Calculate τ j The corresponding Average daily runoff trend in 2021 The forecast results are shown in Table 5 below:
[0138] Table 5:
[0139]
[0140] Step 9: Based on the probability (frequency) distribution, the Ziggurat algorithm is used to carry out n (= 365) random samplings, wherein the pseudo-random number generation adopts the PCG-64 algorithm in the PCG series algorithm to obtain r j , the relative deviation of daily runoff in 2021 j The forecast results are shown in Table 6 below:
[0141] Table 6:
[0142] j <![CDATA[r j ]]> 1 0.0548 2 0.2552 3 -0.2101 … … 365 0.1412
[0143] Step 10: Forecast time t j The runoff Q j , 2021 daily runoff Q j The forecast results are shown in Table 7 below:
[0144] Table 7:
[0145] j <![CDATA[Q j ]]> 1 3892.5 2 4615.9 3 2825.4 … … 365 4437.1
[0146] Figure 7 This is the comparison between the daily runoff of hydrological station A in 2021 predicted according to the above steps and the measured daily runoff.
[0147] In this embodiment, a runoff forecasting method device based on data statistical analysis is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0148] This embodiment provides a runoff forecasting method and device based on data statistical analysis, such as Figure 8 As shown, including:
[0149] The first determination module 801 is used to obtain historical runoff data and runoff event cycle of the hydrological site to be predicted, and determine the periodic time variable of the runoff event occurrence time based on the runoff event cycle and a preset reference time.
[0150] The regression training module 802 is used to perform regression training on the periodic time variables corresponding to the historical runoff data and the time when the runoff event occurred, so as to obtain the probability distribution of the relative deviation.
[0151] The extraction module 803 is used to randomly extract the relative deviation of the time to be predicted based on the probability distribution of the relative deviation.
[0152] The second determination module 804 is used to determine the average runoff trend data at the time to be predicted based on the reference time and the runoff event period.
[0153] The third determination module 805 is used to determine the runoff data at the time to be predicted based on the average runoff trend data at the time to be predicted and the relative deviation at the time to be predicted.
[0154] In some optional implementations, the regression training module 802 includes:
[0155] The acquisition unit is used to obtain the functional relationship between historical runoff data and periodic time variables, and determine the runoff average trend prediction data based on the periodic time variables corresponding to the time when the runoff event occurs and using the functional relationship between the historical runoff data and the periodic time variables.
[0156] The first determining unit is used to determine the relative deviation based on the runoff average trend prediction data and the historical runoff data.
[0157] The first calculation unit is used to calculate the standard deviation of the relative deviation based on the relative deviation, and obtain the probability distribution of the relative deviation based on the standard deviation of the relative deviation.
[0158] In some optional implementations, the regression training module 802 further includes:
[0159] A subunit is established to obtain the data volume of historical runoff data, the number of decision trees and the search range of pre-pruning parameters are determined based on the data volume of historical runoff data, and a parameter grid is established.
[0160] Determine the subunits used to set cross-validation parameters and evaluation indicators, and determine the optimal number of decision trees and pre-pruning parameters based on the parameter grid, cross-validation folds, and evaluation indicators.
[0161] The computing subunit is used to obtain the functional relationship between the average trend of runoff and the periodic time variable by using the random forest algorithm based on the optimal number of decision trees and pre-pruning parameters.
[0162] In some optional implementations, the second determining module 804 includes:
[0163] The second calculation unit is used to calculate the periodic time variable of the time to be predicted based on the reference time and the runoff event period.
[0164] The second determination unit is used to determine the average trend data of runoff at the time to be predicted based on the periodic time variable at the time to be predicted.
[0165] In some optional implementations, the calculation formula of the periodic time variable at the time when the runoff event occurs in the first determination module 801 is as follows:
[0166]
[0167] Among them, τ i represents the periodic time variable of the time when the runoff event occurs, frac represents the decimal part, T represents the runoff event period, t0 represents the reference time, t i Indicates the time when the runoff event occurs.
[0168] In some optional implementations, the calculation formula for the runoff data at the time to be predicted in the third determination module 805 is as follows:
[0169]
[0170] Among them, Q j represents the runoff data at the time to be predicted, represents the average trend data of runoff at the time to be predicted, r j Indicates the relative deviation of the time to be predicted.
[0171] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0172] In this embodiment, a runoff forecasting method device based on data statistical analysis is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0173] An embodiment of the present invention further provides a computer device having the above-mentioned runoff forecasting device based on data statistical analysis.
[0174] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 9As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.
[0175] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0176] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0177] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0178] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0179] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.
[0180] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0181] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0182] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0183] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A runoff forecasting method based on statistical analysis of data, characterized in that: The method comprises: Acquire historical runoff data and runoff event cycle of the hydrological site to be forecasted, and determine the periodic time variable of the runoff event occurrence time based on the runoff event cycle and a preset reference time; Performing regression training on the historical runoff data and the periodic time variables corresponding to the time when the runoff event occurred to obtain a probability distribution of relative deviations; Randomly extracting the relative deviation of the time to be predicted based on the probability distribution of the relative deviation; Determine the average runoff trend data at the time to be predicted based on the reference time and the runoff event period; The runoff data at the time to be predicted is determined based on the average runoff trend data at the time to be predicted and the relative deviation at the time to be predicted.
2. The method according to claim 1, characterized in that The step of performing regression training on the historical runoff data and the periodic time variables corresponding to the time when the runoff event occurred to obtain the probability distribution of the relative deviation includes: Obtaining a functional relationship between an average runoff trend and a periodic time variable, and determining average runoff trend prediction data based on the periodic time variable corresponding to the time when the runoff event occurs by using the functional relationship between the average runoff trend and the periodic time variable; Determining a relative deviation based on the runoff average trend prediction data and the historical runoff data; A standard deviation of the relative deviation is calculated based on the relative deviation, and a probability distribution of the relative deviation is obtained based on the standard deviation of the relative deviation.
3. The method according to claim 2, characterized in that Before obtaining the functional relationship between the average runoff trend and the periodic time variable, and determining the average runoff trend prediction data based on the periodic time variable corresponding to the time when the runoff event occurs by using the functional relationship between the average runoff trend and the periodic time variable, the method further includes: Acquiring the data volume of historical runoff data, determining the number of decision trees and the search range of pre-pruning parameters based on the data volume of the historical runoff data, and establishing a parameter grid; Setting cross-validation parameters and evaluation indicators, and determining the optimal number of decision trees and pre-pruning parameters based on the parameter grid, the cross-validation folds and the evaluation indicators; Based on the optimal number of decision trees and the pre-pruning parameters, a random forest algorithm is used to obtain the functional relationship between the average runoff trend and the periodic time variable.
4. The method according to claim 1, characterized in that: The method of determining the average runoff trend data at the time to be predicted based on the reference time and the runoff event period includes: Calculating a periodic time variable of a time to be predicted based on the reference time and the runoff event period; The average trend data of runoff at the time to be predicted is determined based on the periodic time variable at the time to be predicted.
5. The method according to claim 1, characterized in that The periodic time variable of the moment when the runoff event occurs is determined based on the runoff event cycle and the preset reference time. The calculation formula of the periodic time variable of the moment when the runoff event occurs is as follows: Among them, τ i represents the periodic time variable of the time when the runoff event occurs, frac represents the decimal part, T represents the runoff event period, t0 represents the reference time, t i Indicates the time when the runoff event occurs.
6. The method according to claim 1, characterized in that The runoff data at the time to be predicted is determined based on the average runoff trend data at the time to be predicted and the relative deviation at the time to be predicted. The calculation formula of the runoff data at the time to be predicted is as follows: Among them, Q j represents the runoff data at the time to be predicted, represents the average trend data of runoff at the time to be predicted, r j Indicates the relative deviation of the time to be predicted.
7. A runoff forecasting device based on statistical analysis of data, characterized in that: The device comprises: The first determination module is used to obtain the historical runoff data and the runoff event cycle of the hydrological site to be predicted, and determine the periodic time variable of the runoff event occurrence time based on the runoff event cycle and the preset reference time; A regression training module, used for performing regression training on the historical runoff data and the periodic time variables corresponding to the time when the runoff event occurred, to obtain a probability distribution of relative deviations; An extraction module, used for randomly extracting the relative deviation of the time to be predicted based on the probability distribution of the relative deviation; A second determination module is used to determine the average runoff trend data at the time to be predicted based on the reference time and the runoff event period; The third determination module is used to determine the runoff data at the time to be predicted based on the average runoff trend data at the time to be predicted and the relative deviation at the time to be predicted.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the runoff forecasting method based on data statistical analysis as described in any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the runoff forecasting method based on data statistical analysis according to any one of claims 1 to 6.
10. A computer program product, characterized in that It comprises computer instructions, and the computer instructions are used to make a computer execute the runoff forecasting method based on data statistical analysis as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for predicting runoff in area lacking data
CN117057174A
Method for forecasting runoff under influence of upstream reservoir group by utilizing forecasting errors
US20230071484A1