A GRU-based reservoir scheduling method
By using a GRU-based reservoir scheduling method, combined with equal-time interval interpolation and support vector regression models, the problem of inaccurate outflow simulation in reservoir scheduling was solved, enabling real-time prediction and automatic control of reservoir outflow, and improving scheduling accuracy and response speed.
Patent Information
- Application Number
- CN202411471688.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-10-22
AI Technical Summary
Existing technologies for reservoir scheduling have low accuracy, poor real-time performance, and high scheduling risks, mainly due to the uncertainty and nonlinear characteristics of reservoir inflow, which make it difficult to accurately simulate outflow.
A reservoir scheduling method based on GRU is adopted. By acquiring historical reservoir data and performing time-period interpolation, a GRU model is constructed and combined with a support vector regression model for error training. The GRU parameters are adjusted using the Nash efficiency coefficient and generalization coefficient to achieve real-time outflow prediction and automatic control.
It enables real-time prediction of reservoir outflow and real-time automatic control of spillway gates, improving the accuracy and response speed of scheduling and reducing scheduling risks.
Smart Images

Figure CN119398420B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water resource scheduling technology, and in particular to a reservoir scheduling method based on GRU. Background Technology
[0002] Reservoir scheduling plays a crucial role in water resource management by adjusting gate openings based on data such as inflow and water level to determine outflow. Current technologies largely employ the water balance principle to estimate outflow, using water balance equations to calculate outflow based on inflow and water level data. However, due to natural and human factors, inflow to reservoirs exhibits significant uncertainty and nonlinearity, making it difficult to simulate outflow. Consequently, existing reservoir scheduling technologies suffer from low accuracy, poor real-time performance, and high scheduling risks. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a reservoir scheduling method based on GRU. This method can perform real-time scheduling of reservoirs with good scheduling accuracy, which helps to reduce reservoir scheduling risks.
[0004] The technical solution adopted by this invention to solve the above-mentioned technical problems is: a reservoir scheduling method based on GRU, comprising,
[0005] S1. Obtain historical data of the reservoir, including historical data of reservoir inflow, historical data of reservoir outflow and historical data of reservoir water level. Process the historical data of the reservoir using the equal time period integration interpolation method to obtain equal time period reservoir historical data, and divide the equal time period reservoir historical data into training set and test set.
[0006] S2, set the initial parameters of the reservoir scheduling GRU model, where the number of neurons in the GRU unit is n, the number of iterations for solving the GRU hyperparameters is i, the length of the input sequence of the GRU unit is f, and the number of neural network layers in the GRU unit is q. Input the historical inflow data and outflow data of the reservoir for the previous f equal periods in the training set into the GRU to obtain the preliminary predicted value of reservoir outflow for the historical forecast period, Osim-a, where the value of n is 2. k k is a natural number greater than or equal to 1, f and q are both natural numbers greater than or equal to 1, i is a natural number greater than 1, and i is an integer multiple of 10;
[0007] S3. Input the historical outflow data of the reservoir for the previous f equal periods in the training set into the support vector regression model to obtain the historical outflow regression value Omea. Subtract Osim-a from Omea to obtain the difference Ov. Then, input the reservoir water level and the difference Ov of the previous f equal periods in the training set into the GRU unit for error training to obtain the error training correction value Osim-v. Add the preliminary prediction value Osim-a of the historical outflow to the error training correction value Osim-v to obtain the predicted value O of the historical outflow.
[0008] S4: Construct GRU model evaluation indicators, including Nash efficiency coefficient NSE and generalization coefficient GA. Determine whether NSE satisfies c≤NSE≤d. If yes, it means that the constructed reservoir scheduling GRU model parameters meet the requirements, and execute S5. If not, continue to determine whether NSE>d and GA<b. If yes, it means that the constructed reservoir scheduling GRU model parameters meet the requirements, and execute S5. If not, adjust the GRU unit parameters according to the set adjustment rules, and return to execute S2, where b, c, and d are positive numbers.
[0009] S5, obtain the number of neurons in the current reservoir scheduling GRU model as n1, the number of neural network layers as q1, the length of the input sequence as f1, and the number of iterations as i1 as the parameters of the constructed reservoir scheduling GRU model;
[0010] S6: Obtain the historical inflow data, outflow data, and water level data of the reservoir for the first f1 days of the real-time forecast period and input them into the constructed reservoir scheduling GRU model to obtain the predicted value of reservoir outflow for the real-time forecast period.
[0011] Furthermore, in step S4, the GRU unit parameters are adjusted according to the set adjustment rules, specifically including:
[0012] When NSE > d and GA ≥ b, check if the value of i is less than 200. If so, execute... That is, the value of i is reduced by 20% and then rounded down; otherwise, i = i - 100 is executed.
[0013] When NSE < c and GA ≤ a, check if the value of i is less than 200. If so, execute the following steps. That is, the value of i is increased by 10% and then rounded up; otherwise, i = i + 100 is executed.
[0014] When NSE < c and a < GA < b, then execute n = 2. k+1 , q = q + 1;
[0015] When NSE < c and GA ≥ b, if k > 1 and q > 1, then execute n = n / 2 = 2.k-1 If q = q - 1, and k > 1 and q = 1, then execute n = n / 2 = 2. k-1 If q = q, and k = 1 and q > 1, then execute n = n; if q = q - 1, and k = 1 and q = 1, then execute n = n. 6 , q = q + 1;
[0016] Where a is a positive number and a is less than b.
[0017] Furthermore, the setting of initial parameters for the reservoir scheduling GRU model specifically includes,
[0018] A GRU model parameter history database is constructed based on the training set data. Each set of parameters in the parameter history database includes the number of neurons n2 of the GRU unit, the number of neural network layers q2 of the GRU unit, the length of the input sequence f2 of the GRU unit, and the number of input data features x2. The initial value of the input sequence length f and the actual number of input data features x of the GRU unit are compared with all sets of parameters in the parameter history database. The n2 and q2 of the corresponding set of parameters with the smallest value of |f-f2|+|x-x2| are selected as the initial value of the number of neurons n and the number of neural network layers q of the GRU unit, respectively.
[0019] Furthermore, the step of constructing a historical database of GRU model parameters based on the training set data specifically includes:
[0020] S21, define the total length of the historical data sequences in the training set as F, and f' as the length of the data selection window in the training set, i.e., the length of the selected data sequence. f' is a natural number greater than or equal to 1, and the initial value of f' is 1. The preset upper limit of the number of neurons in the GRU unit is 2. K The upper limit of the number of neural network layers in a GRU unit is Q;
[0021] S22, Select a data sequence of length f' from the training set;
[0022] S23, the preset number of neurons in the GRU unit is 2. k’ The initial value of k' is 1;
[0023] S24, The number of neural network layers of the GRU unit is preset to q', and the initial value of q' is 1;
[0024] S25, input the selected historical data sequence of length f' into GRU, and execute steps S2 and S3 to obtain the predicted value of the outflow from the first reservoir;
[0025] S26, determine if the value of q' is less than Q. If yes, execute q' = q' + 1 and return to execute S24. If no, execute S27.
[0026] S27, determine if the value of k' is less than K. If so, execute k' = k' + 1 and return to execute S23. Otherwise, execute S28.
[0027] S28, determine whether all data in the historical data sequence of the training set has been selected at least once. If yes, execute S29. If no, slide the data selection window by one data length and return to execute S22.
[0028] S29. Calculate the Nash efficiency coefficient (NSE) of all predicted outflow from the first reservoir under the currently selected data sequence length f'. Find the corresponding number of neurons and the number of neural network layers of the GRU unit whose Nash efficiency coefficient (NSE) value is closest to (c+d) / 2. If there are two or more cases where the NSE of the predicted outflow from the first reservoir is equal, find the corresponding number of neurons and the number of neural network layers of the GRU unit whose generalization coefficient (GA) value is closest to (a+b) / 2. If there are two or more cases where the GA values are equal, arbitrarily select a set of corresponding number of neurons and the number of neural network layers of the GRU unit. Combine the obtained number of neurons and the number of neural network layers of the GRU unit with the current number of input data features and the current data sequence length to form a set of parameters in the parameter history database.
[0029] S30: Determine if the value of f' is less than F. If yes, execute f' = f' + 1 and return to execute S22. If no, end.
[0030] Furthermore, the GRU hyperparameters are solved as follows:
[0031] θ i =θ i-1 -η i (sign(c i )+λθ i-1 )
[0032] c i =β1m i-1 +(1-β1)g i
[0033]
[0034] In the formula, θ i η represents the hyperparameters of the GRU at step size i, including weights and biases. i λ is the learning rate, λ is the model update parameter, sign is the mathematical sign function (sign(x) = 1 when x > 0, sign(x) = 0 when x = 0, sign(x) = -1 when x < 0), β1 is the first-order moment decay coefficient, and J(θ) is the loss function, i.e., the objective function. N is a natural number greater than or equal to 1, where y t Forecast the outbound flow rate at time t, y′ t Let be the measured outflow at time t, i represent the number of optimization update steps, i.e., the number of iterations, and g be the actual outflow. i Let J(θ) be the gradient of the objective function J(θ) at the i-th step, obtained by taking the derivative with respect to θ. m is the mathematical symbol for gradient. i The downgradient g at the i-th step i The first moment, where when i=1, the initial weights are the standard deviations. The Gaussian distributed random numbers are used, with an initial deviation of 0.1.
[0035] Furthermore, the equal-time-period interpolation processing method specifically includes,
[0036] Let x be the data points between two adjacent integer time points in the historical data sequence of the reservoir. m x m+1 The time interval between intervals defaults to r whole time intervals, where r is a natural number greater than 1, and the duration of each whole time interval is set empirically; x is selected. m The first M integer time points, where M is a natural number greater than or equal to 1, are input into the support vector regression model to obtain x. m x m+1 The default predicted data sequence V1 = {v} corresponds to r integer time intervals. 1~1 v 1~2 , ..., v 1~r-1 v 1~r};Select x m+1 The data from the last M integer time points are input into the support vector regression model to obtain x. m x m+1 The default predicted data sequence V2 = {v} corresponds to r integer time intervals. 2~1 v 2~2 , ..., v 2~r-1 v 2~r};
[0037] Remove the marginal effects of V1 and V2, i.e., assign weights w1 and w2 to V1 and V2 respectively, to obtain x. m x m+1 The default sequence V = V1*w1 + V2*w2 is inserted into x. m x m+1 The processed historical data of the reservoir over the same time period.
[0038] Compared with the prior art, the advantages of the present invention are as follows: The method of the present invention is based on GRU to construct a reservoir scheduling model, which can predict the reservoir outflow in real time, thereby enabling real-time automatic control of the reservoir's spillway gates. Furthermore, when constructing the reservoir scheduling model, the GRU parameters can be automatically adjusted by setting evaluation indicators, so that the scheduling method of the present invention has a faster response speed and scheduling accuracy, thereby reducing scheduling risks. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the GRU unit neural network cell structure.
[0040] Figure 2 This is a schematic diagram showing the daily forecast results of the outflow from a reservoir for testing purposes. Detailed Implementation
[0041] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments, examples of which are shown in the drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0042] In the description of this application, it should be noted that directional terms such as "center," "lateral," "longitudinal," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicate the orientation and positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. They should not be construed as limiting the specific scope of protection of this application. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined with "first" and "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0043] This invention relates to a reservoir scheduling method based on GRU, which includes the following steps:
[0044] S1. Obtain historical data of the reservoir, including historical data of reservoir inflow, historical data of reservoir outflow and historical data of reservoir water level. Process the historical data of the reservoir using the equal time period integration interpolation method to obtain equal time period reservoir historical data, and divide the equal time period reservoir historical data into training set and test set.
[0045] S2, set the initial parameters of the reservoir scheduling GRU model, where the number of neurons in the GRU unit is n, the number of iterations for solving the GRU hyperparameters is i, the length of the input sequence of the GRU unit is f, and the number of neural network layers in the GRU unit is q. Input the historical inflow data and outflow data of the reservoir for the previous f equal periods in the training set into the GRU to obtain the preliminary predicted value of reservoir outflow for the historical forecast period, Osim-a, where the value of n is 2. k k is a natural number greater than or equal to 1, f and q are both natural numbers greater than or equal to 1, i is a natural number greater than 1, and i is an integer multiple of 10;
[0046] S3. Input the historical outflow data of the reservoir for the previous f equal periods in the training set into the support vector regression model to obtain the historical outflow regression value Omea. Subtract Osim-a from Omea to obtain the difference Ov. Then, input the reservoir water level and the difference Ov of the previous f equal periods in the training set into the GRU unit for error training to obtain the error training correction value Osim-v. Add the preliminary prediction value Osim-a of the historical outflow to the error training correction value Osim-v to obtain the predicted value O of the historical outflow.
[0047] S4: Construct GRU model evaluation indicators, including Nash efficiency coefficient NSE and generalization coefficient GA. Determine whether NSE satisfies c≤NSE≤d. If yes, it means that the constructed reservoir scheduling GRU model parameters meet the requirements, and execute S5. If not, continue to determine whether NSE>d and GA<b. If yes, it means that the constructed reservoir scheduling GRU model parameters meet the requirements, and execute S5. If not, adjust the GRU unit parameters according to the set adjustment rules, and return to execute S2, where b, c, and d are positive numbers.
[0048] S5, obtain the number of neurons in the current reservoir scheduling GRU model as n1, the number of neural network layers as q1, the length of the input sequence as f1, and the number of iterations as i1 as the parameters of the constructed reservoir scheduling GRU model;
[0049] S6: Obtain the historical inflow data, outflow data, and water level data of the reservoir for the first f1 days of the real-time forecast period and input them into the constructed reservoir scheduling GRU model to obtain the predicted value of reservoir outflow for the real-time forecast period.
[0050] In this embodiment, the above-mentioned equal-time-period interpolation processing method specifically includes,
[0051] Let x be the data points between two adjacent integer time points in the historical data sequence of the reservoir. m x m+1The time interval between intervals defaults to r whole time intervals, where r is a natural number greater than 1, and the duration of each whole time interval is set empirically; x is selected. m The first M integer time points, where M is a natural number greater than or equal to 1, are input into the support vector regression model to obtain x. m x m+1 The default predicted data sequence V1 = {v} corresponds to r integer time intervals. 1~1 v 1~2 , ..., v 1~r-1 v 1~r};Select x m+1 The data from the last M integer time points are input into the support vector regression model to obtain x. m x m+1 The default predicted data sequence V2 = {v} corresponds to r integer time intervals. 2~1 v 2~2 , ..., v 2~r-1 v 2~r};
[0052] To remove the marginal effects of V1 and V2, we assign weights w1 and w2 to V1 and V2 respectively. These weights can be set empirically, thus yielding x. m x m+1 The default sequence V = V1*w1 + V2*w2 is inserted into x. m x m+1 The processed historical data of the reservoir over the same time period.
[0053] In this embodiment, the GRU unit parameters are adjusted according to the set adjustment rules in S4 above, specifically including:
[0054] When NSE > d and GA ≥ b, check if the value of i is less than 200. If so, execute... That is, the value of i is reduced by 20% and then rounded down; otherwise, i = i - 100 is executed.
[0055] When NSE < c and GA ≤ a, check if the value of i is less than 200. If so, execute the following steps. That is, the value of i is increased by 10% and then rounded up; otherwise, i = i + 100 is executed.
[0056] When NSE < c and a < GA < b, then execute n = 2. k+1 , q = q + 1;
[0057] When NSE < c and GA ≥ b, if k > 1 and q > 1, then execute n = n / 2 = 2. k-1 If q = q - 1, and k > 1 and q = 1, then execute n = n / 2 = 2.k-1 If q = q, and k = 1 and q > 1, then execute n = n; if q = q - 1, and k = 1 and q = 1, then execute n = n. 6 , q = q + 1.
[0058] Where a is a positive number and a is less than b. In this embodiment, the values of a, b, c, and d can be set according to requirements such as scheduling accuracy and scheduling response speed, for example, set to 0.5, 1.5, 0.8, and 0.9 respectively.
[0059] In this embodiment, when setting the initial parameters of the reservoir scheduling GRU model, they can be set manually based on experience, or a parameter history database can be constructed. The parameters can be compared with historical parameters in the database before selection to improve the model's response speed. Specifically, a GRU model parameter history database is first constructed based on the training set data. Each set of parameters in the database includes the number of neurons n2 of the GRU unit, the number of neural network layers q2 of the GRU unit, the length of the input sequence f2 of the GRU unit, and the number of input data features x2. The initial value of the input sequence length f and the actual number of input data features x of the GRU unit are compared with all sets of parameters in the parameter history database. The set n2 and q2 of the corresponding set of parameters with the smallest value of |f-f2|+|x-x2| are selected as the initial value of the number of neurons n and the number of neural network layers q of the GRU unit, respectively.
[0060] In this embodiment, a historical database of GRU model parameters is constructed based on the training set data, specifically including:
[0061] S21, define the total length of the historical data sequences in the training set as F, and f' as the length of the data selection window in the training set, i.e., the length of the selected data sequence. f' is a natural number greater than or equal to 1, and the initial value of f' is 1. The preset upper limit of the number of neurons in the GRU unit is 2. K The upper limit of the number of neural network layers in a GRU unit is Q;
[0062] S22, Select a data sequence of length f' from the training set;
[0063] S23, the preset number of neurons in the GRU unit is 2. k’ The initial value of k' is 1;
[0064] S24, The number of neural network layers of the GRU unit is preset to q', and the initial value of q' is 1;
[0065] S25, input the selected historical data sequence of length f' into GRU, and execute steps S2 and S3 to obtain the predicted value of the outflow from the first reservoir;
[0066] S26, determine if the value of q' is less than Q. If yes, execute q' = q' + 1 and return to execute S24. If no, execute S27.
[0067] S27, determine if the value of k' is less than K. If so, execute k' = k' + 1 and return to execute S23. Otherwise, execute S28.
[0068] S28, determine whether all data in the historical data sequence of the training set has been selected at least once. If yes, execute S29. If no, slide the data selection window by one data length and return to execute S22.
[0069] S29. Calculate the Nash efficiency coefficient (NSE) of all predicted outflow from the first reservoir under the currently selected data sequence length f'. Find the corresponding number of neurons and the number of neural network layers of the GRU unit whose Nash efficiency coefficient (NSE) value is closest to (c+d) / 2. If there are two or more cases where the NSE of the predicted outflow from the first reservoir is equal, find the corresponding number of neurons and the number of neural network layers of the GRU unit whose generalization coefficient (GA) value is closest to (a+b) / 2. If there are two or more cases where the GA values are equal, arbitrarily select a set of corresponding number of neurons and the number of neural network layers of the GRU unit. Combine the obtained number of neurons and the number of neural network layers of the GRU unit with the current number of input data features and the current data sequence length to form a set of parameters in the parameter history database.
[0070] S30: Determine if the value of f' is less than F. If yes, execute f' = f' + 1 and return to execute S22. If no, end.
[0071] It should be noted that the parameter history database is constructed based on historical data. When setting the initial parameters of the GRU, comparing the data in the parameter history database reduces the computation time for GRU parameter optimization and improves the scheduling response speed compared to setting parameters solely based on experience. In this embodiment, the input data feature number includes historical data of reservoir inflow, historical data of reservoir outflow, and historical data of reservoir water level; therefore, the value of the input data feature number x is 3.
[0072] In this embodiment, the GRU hyperparameters are solved as follows:
[0073] θ i =θ i-1 -θ i (sign(c i )+λθ i-1 )
[0074] c i =β1m i-1 +(1-β1)gi
[0075]
[0076] In the formula, θ i η represents the hyperparameters of the GRU at step size i, including weights and biases. i λ is the learning rate, λ is the model update parameter, sign is the mathematical sign function (sign(x) = 1 when x > 0, sign(x) = 0 when x = 0, sign(x) = -1 when x < 0), β1 is the first-order moment decay coefficient, and J(θ) is the loss function, i.e., the objective function. N is a natural number greater than or equal to 1, where y t Forecast the outbound flow rate at time t, y′ t Let be the measured outflow at time t, i represent the number of optimization update steps, i.e., the number of iterations, and g be the actual outflow. i Let J(θ) be the gradient of the objective function J(θ) at the i-th step, obtained by taking the derivative with respect to θ. m is the mathematical symbol for gradient. i The downgradient g at the i-th step i The first moment, where when i=1, the initial weights are the standard deviations. The Gaussian distributed random numbers are used, with an initial deviation of 0.1.
[0077] It should be further explained that, as shown in the attached document... Figure 1 As shown, GRU has two gates, namely the update gate z. t and reset door r t The update gate is used to control the current state h. t We need to start from the previous state h t-1 How much information should be retained, and what information needs to be extracted from the candidate states? The amount of information received is used to control the candidate state via a reset gate. Does the calculation depend on the state h from the previous time step? t-1 For each neuron in the GRU,
[0078] z t =σ(W z x t +U z h t-1 +b z )
[0079] r t =σ(W r x t +U r h t-1 +b r )
[0080]
[0081] In the above formula, σ and tanh represent the Sigmoid activation function, respectively. and Tanh activation function W and b represent the weights and error, respectively, which are the hyperparameters of the GRU. The current state ht is the output of the neuron.
[0082] It should be further explained that the support vector regression model is also known as SVR. SVR aims to obtain a regression model f(x) = ω. T x+b′, making the predicted value f(x) as close as possible to the measured value, where ω and b' are parameters to be determined. The principle of using historical data for SVR prediction is existing technology, and this embodiment will not describe SVR for reservoir outflow prediction in detail. After using GRU for preliminary reservoir outflow prediction, using SVR to correct the prediction error can improve the accuracy of reservoir outflow prediction and thus improve the precision of reservoir scheduling.
[0083] It should also be noted that NSE and GA are both calculated from the predicted and measured values of reservoir outflow, which is existing technology. Specifically, they can be calculated using the following formula:
[0084]
[0085]
[0086] In the formula, This represents the observed outflow from the reservoir at time t. This represents the simulated outflow value from the reservoir at time t. Let represent the average value of the reservoir outflow observations within time period T, where T represents the sequence length. Substituting the training and test set data into the RMSE formula yields the RMSE. pred RMSE train Divide the two to get GA.
[0087] To verify the effectiveness of the reservoir outflow prediction method of this invention, this embodiment uses historical reservoir data from 00:00 on November 1, 2006 to 00:00 on November 1, 2018 for modeling. The historical reservoir data is daily data, and some historical data of the reservoir are shown in Table 1. The characteristic parameters of the reservoir are shown in Table 2. It should be noted that the average inflow, average outflow, and average reservoir water level of the reservoir in the table are the average values from 00:00 on November 1, 2006 to 00:00 on November 1, 2018.
[0088] Table 1. Statistical Table of Historical Data for Some Reservoirs in a Certain Reservoir Area
[0089]
[0090]
[0091] Table 2 Basic Characteristic Parameters of a Reservoir
[0092] <![CDATA[Controlled drainage area (km 2 )]]> 1001700 Normal water level (m)* 175 <![CDATA[Total storage capacity (billion m 3 )]]> 39.3 Installed capacity (MW) 22400 <![CDATA[Average annual inflow (m 3 / s)]]> 12832.76 <![CDATA[Average annual outflow (m 3 / s)]]> 12789.02 Multi-year average reservoir water level (m) 160.12
[0093] After obtaining the historical data of the reservoir, since all data are automatically reported, the time intervals are not uniform. It is necessary to use the equal time interval compilation interpolation processing method to process the original historical data of the reservoir into a data sequence with equal time intervals, and then divide it into training set and test set, as shown in Table 3.
[0094] Table 3. Training and Test Set Data
[0095]
[0096]
[0097] After processing the historical reservoir data, the data from the training set is input into the constructed reservoir scheduling model using the method described above to train the model. This yields the optimal number of GRU neurons, the number of GRU neural network layers, and the number of iterations for hyperparameter solving. These optimal parameters are then used as the parameters for the constructed reservoir scheduling model. Specifically, in this project, the optimal number of neurons is 64, the optimal number of GRU neural network layers is 5, and the optimal number of iterations is 180. The input data sequence length is 6. After obtaining the reservoir scheduling model parameters, the outflow from the reservoir is predicted using test set data. The prediction results are attached. Figure 2 As shown, from the appendix Figure 2 It can be seen that the predicted and observed values of reservoir outflow are basically consistent, indicating that the method of the present invention has good accuracy.
[0098] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A reservoir scheduling method based on GRU, characterized in that: include, S1. Obtain historical data of the reservoir, including historical data of reservoir inflow, historical data of reservoir outflow and historical data of reservoir water level. Process the historical data of the reservoir using the equal time period integration interpolation method to obtain equal time period reservoir historical data, and divide the equal time period reservoir historical data into training set and test set. S2, set the initial parameters of the reservoir scheduling GRU model, where the number of neurons in the GRU unit is n, the number of iterations for solving the GRU hyperparameters is i, the length of the input sequence of the GRU unit is f, and the number of neural network layers in the GRU unit is q. Input the historical inflow data and outflow data of the reservoir for the previous f equal periods in the training set into the GRU to obtain the preliminary predicted value of reservoir outflow for the historical forecast period, Osim-a, where the value of n is 2. k k is a natural number greater than or equal to 1, f and q are both natural numbers greater than or equal to 1, i is a natural number greater than 1, and i is an integer multiple of 10; S3. Input the historical outflow data of the reservoir for the previous f equal periods in the training set into the support vector regression model to obtain the historical outflow regression value Omea. Subtract Osim-a from Omea to obtain the difference Ov. Then, input the reservoir water level and the difference Ov of the previous f equal periods in the training set into the GRU unit for error training to obtain the error training correction value Osim-v. Add the preliminary prediction value Osim-a of the historical outflow to the error training correction value Osim-v to obtain the predicted value O of the historical outflow. S4: Construct GRU model evaluation indicators, including Nash efficiency coefficient NSE and generalization coefficient GA. Determine whether NSE satisfies c≤NSE≤d. If yes, it means that the constructed reservoir scheduling GRU model parameters meet the requirements, and execute S5. If not, continue to determine whether NSE>d and GA<b. If yes, it means that the constructed reservoir scheduling GRU model parameters meet the requirements, and execute S5. If not, adjust the GRU unit parameters according to the set adjustment rules, and return to execute S2, where b, c, and d are positive numbers. S5, obtain the number of neurons in the current reservoir scheduling GRU model as n1, the number of neural network layers as q1, the length of the input sequence as f1, and the number of iterations as i1 as the parameters of the constructed reservoir scheduling GRU model; S6: Obtain the historical inflow data, outflow data, and water level data of the reservoir for the first f1 days of the real-time forecast period and input them into the reservoir scheduling GRU model to obtain the predicted outflow value of the reservoir for the real-time forecast period.
2. The reservoir scheduling method based on GRU according to claim 1, characterized in that: In step S4, the GRU unit parameters are adjusted according to the set adjustment rules, specifically including: When NSE > d and GA ≥ b, check if the value of i is less than 200. If so, execute... That is, the value of i is reduced by 20% and then rounded down; otherwise, i = i - 100 is executed. When NSE < c and GA ≤ a, check if the value of i is less than 200. If so, execute the following steps. That is, the value of i is increased by 10% and then rounded up; otherwise, i = i + 100 is executed. When NSE < c and a < GA < b, then execute n = 2. k+1 , q = q + 1; When NSE < c and GA ≥ b, if k > 1 and q > 1, then execute n = n / 2 = 2. k-1 If q = q - 1, and k > 1 and q = 1, then execute n = n / 2 = 2. k-1 If q = q, and k = 1 and q > 1, then execute n = n; if q = q - 1, and k = 1 and q = 1, then execute n = n. 6 , q = q + 1; Where a is a positive number and a is less than b.
3. The reservoir scheduling method based on GRU according to claim 2, characterized in that: The initial parameters for setting the reservoir scheduling GRU model specifically include: A GRU model parameter history database is constructed based on the training set data. Each set of parameters in the parameter history database includes the number of neurons n2 of the GRU unit, the number of neural network layers q2 of the GRU unit, the length of the input sequence f2 of the GRU unit, and the number of input data features x2. The initial value of the input sequence length f and the actual number of input data features x of the GRU unit are compared with all sets of parameters in the parameter history database. The n2 and q2 of the corresponding set of parameters with the smallest value of |f-f2|+|x-x2| are selected as the initial value of the number of neurons n and the number of neural network layers q of the GRU unit, respectively.
4. The reservoir scheduling method based on GRU according to claim 3, characterized in that: The construction of the GRU model parameter history database based on the training set data specifically includes, S21, define the total length of the historical data sequences in the training set as F, and f' as the length of the data selection window in the training set, i.e., the length of the selected data sequence. f' is a natural number greater than or equal to 1, and the initial value of f' is 1. The preset upper limit of the number of neurons in the GRU unit is 2. K The upper limit of the number of neural network layers in a GRU unit is Q; S22, Select a data sequence of length f' from the training set; S23, the preset number of neurons in the GRU unit is 2. k’ The initial value of k' is 1; S24, The number of neural network layers of the GRU unit is preset to q', and the initial value of q' is 1; S25, input the selected historical data sequence of length f' into GRU, and execute steps S2 and S3 to obtain the predicted value of the outflow from the first reservoir; S26, determine if the value of q' is less than Q. If yes, execute q' = q' + 1 and return to execute S24. If no, execute S27. S27, determine if the value of k' is less than K. If so, execute k' = k' + 1 and return to execute S23. Otherwise, execute S28. S28, determine whether all data in the historical data sequence of the training set has been selected at least once. If yes, execute S29. If no, slide the data selection window by one data length and return to execute S22. S29. Calculate the Nash efficiency coefficient (NSE) of all predicted outflow values of the first reservoir under the currently selected data sequence length f'. Find the number of neurons and the number of neural network layers of the corresponding GRU unit whose Nash efficiency coefficient (NSE) value is closest to (c+d) / 2. If there are more than two cases where the NSE values are equal, find the number of neurons and the number of neural network layers of the corresponding GRU unit whose generalization coefficient (GA) value is closest to (a+b) / 2. If there are more than two cases where the GA values are equal, arbitrarily select a set of corresponding GRU unit neurons and GRU unit neural network layers. Combine the obtained number of neurons and GRU unit neural network layers with the current number of input data features and the current data sequence length to form a set of parameters in the parameter history database. S30: Determine if the value of f' is less than F. If yes, execute f' = f' + 1 and return to execute S22. If no, end.
5. A reservoir scheduling method based on GRU according to claim 1, characterized in that: The method for solving the GRU hyperparameters is as follows: i i =θ i-1 -or i (sign(c i )+λθ i-1 ) c i =β1m i-1 +(1-β1)g i In the formula, θ i η represents the hyperparameters of the GRU at the i-th step, including weights and biases. i λ is the learning rate, λ is the model update parameter, sign is the mathematical sign function (sign(x) = 1 when x > 0, sign(x) = 0 when x = 0, sign(x) = -1 when x < 0), β1 is the first-order moment decay coefficient, and J(θ) is the loss function, i.e., the objective function. N is a natural number greater than or equal to 1, where y t Forecast the outbound flow rate at time t, y′ t Let be the measured outflow at time t, i represent the number of optimization update steps, i.e., the number of iterations, and g be the actual outflow. i Let J(θ) be the gradient of the objective function J(θ) at the i-th step, obtained by taking the derivative with respect to θ. m is the mathematical symbol for gradient. i The downgradient g at the i-th step i The first moment, where when i=1, the initial weights are the standard deviations. The Gaussian distributed random numbers are used, with an initial deviation of 0.
1.
6. The reservoir scheduling method based on GRU according to claim 1, characterized in that: The method for interpolating data across equal time periods specifically includes: Let x be the data points between two adjacent integer time points in the historical data sequence of the reservoir. m x m+1 The time interval between them defaults to r whole time intervals, where r is a natural number greater than 1; select x m The first M integer time points, where M is a natural number greater than or equal to 1, are input into the support vector regression model to obtain x. m x m+1 The default predicted data sequence V1 = {v} corresponds to r integer time intervals. 1~1 v 1~2 , ..., v 1~r-1 v 1~r };Select x m+1 The data from the last M integer time points are input into the support vector regression model to obtain x. m x m+1 The default predicted data sequence V2 = {v} corresponds to r integer time intervals. 2~1 v 2~2 , ..., v 2~r-1 v 2~r }; Remove the marginal effects of V1 and V2, i.e., assign weights w1 and w2 to V1 and V2 respectively, to obtain x. m x m+1 The default sequence V = V1*w1 + V2*w2 is inserted into x. m x m+1 The processed historical data of the reservoir over the same time period.
Citation Information
Patent Citations
Method and system for realizing water level early warning based on clustering and GRU
CN112561203A
Drainage pipe network sewage flow prediction method based on space-time diagram convolutional network
CN115526428A