Anti-regulation reservoir upstream and downstream water level prediction method fusing physical mechanism deep learning model
Through a deep learning model that integrates physical mechanisms, combined with data-driven methods and physical constraints, the loss function of the LSTM model is improved, solving the problem of low prediction accuracy of water level upstream and downstream of the reverse regulation reservoir, and achieving higher prediction accuracy and adaptability.
Patent Information
- Application Number
- CN202510036818.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-30
AI Technical Summary
The existing water level prediction methods have low accuracy in the prediction of water level upstream and downstream of the reverse adjustment reservoir, and cannot effectively adapt to complex changing conditions, especially when the hydraulic connection is close and the gate opening and closing changes are large.
A deep learning model with a fusion physics mechanism is adopted, combined with a data-driven method, and an improved LSTM model is built. By introducing physical constraints and prior knowledge, the loss function is improved, and a deep learning water level prediction model with a fusion physics mechanism is built.
It significantly improves the accuracy and adaptability of water level prediction, can better understand the physical process of reservoir scheduling, enhances the stability and reliability of prediction, and avoids unreasonable prediction results in traditional methods.
Smart Images

Figure CN120067970A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of reservoir operation, and particularly to a method for predicting the water levels upstream and downstream of a regulating reservoir by integrating a physical mechanism deep learning model. Background Art
[0002] In the process of reservoir operation and the safe operation and efficiency improvement of hydropower stations, accurate water level prediction plays a crucial role. However, due to the intertwined influence of various complex factors, it is extremely challenging to achieve high-precision water level prediction in reality.
[0003] Traditional water level prediction methods, such as the method of interpolating water level-flow curves and the empirical formula method for unsteady flow, although they can to a certain extent reflect the changing trend of the water levels upstream and downstream of the reservoir, their prediction accuracy is often not satisfactory. Especially in cascade power stations, due to the close hydraulic connection between power stations, the prediction error of the outflow discharge of the upstream power station will be further transmitted to the downstream power station, thus increasing the difficulty of water level prediction for the downstream power station. In addition, complex hydraulic conditions such as the reciprocating flow between two dams and the imbalance between inflow and outflow also make the accurate prediction of the water level of the downstream power station more difficult.
[0004] When the power station undertakes peak shaving and frequency modulation tasks or conducts gate opening and closing operations, the output and outflow discharge of the power station will change significantly, resulting in the formation of unsteady flow with sharp changes in water level and flow velocity in the downstream river channel. This unsteady flow makes the relationship between the tail water level and the outflow discharge extremely complex, further increasing the difficulty of water level prediction. At the same time, different combinations and openings of gates will also cause significant differences in the characteristics of water level changes upstream and downstream, making the water level prediction problem more complex and changeable.
[0005] Facing these complex situations, existing water level prediction methods often have difficulty effectively predicting the water level change process accurately. Especially when the operation boundary is narrow, it is even more difficult to meet the requirements of refined operation.
[0006] For example, CN109447336B discloses a method for optimizing the water level control between an upstream reservoir and its regulating reservoir. Although this method trains a neural network model based on historical operation data and attempts to predict the water level by matching the current working condition with historical working conditions, this method does not consider the important influence of gates on water level changes in the actual reservoir operation process, and this method only relies on data fitting to train the model, highly depending on the integrity and accuracy of the data; if the data is missing or has errors, it will directly affect the prediction effect of the model; in addition, the construction and training process of the neural network model is relatively complex and requires high technical level and computing resource support. When conducting the trial calculation of water level optimization control between cascade reservoirs, it is also necessary to continuously adjust the outflow discharge of the upstream reservoir and conduct neural network prediction until the total output of the cascade reservoir reaches the optimum. This process has a huge amount of calculation and affects the real-time performance.
[0007] For another example, CN112001556B discloses a method for predicting the downstream water level of a reservoir based on a deep learning model. Although the prediction accuracy is improved to a certain extent, there are still problems such as only relying on data fitting to train the model, without considering the physical constraints existing in the actual reservoir operation, and highly depending on the quality and integrity of historical data. If there are missing or error in the historical data, it will directly affect the training effect and prediction accuracy of the deep learning model. In addition, the deep learning model has a complex structure and numerous parameters, requiring high computing resources and professional skills for model training and optimization. At the same time, the interpretability of this method is poor, which limits its application in some fields that require high transparency and interpretability.
[0008] In view of the deficiencies of the existing water level prediction methods, therefore, there is an urgent need for a water level prediction method that can comprehensively consider various influencing factors, has high prediction accuracy and can adapt to complex changing conditions.
[0009] In view of this, the present invention proposes a deep learning water level prediction model integrating physical mechanisms, aiming to combine the prior knowledge in reservoir operation and machine learning through learning, and use a data-driven method to avoid the errors caused by feature curve interpolation and boundary condition accuracy requirements in traditional prediction methods, in order to solve the problem of low prediction accuracy of the upstream and downstream water levels of the reverse regulation reservoir, and provide more reliable data support for the actual reservoir operation and the safe operation of power stations. Summary of the Invention
[0010] The technical problem to be solved by the present invention is to provide a method for predicting the upstream and downstream water levels of a reverse regulation reservoir integrating a deep learning model with physical mechanisms, and solve the technical problem of low prediction accuracy of the upstream and downstream water levels of the reverse regulation reservoir, especially the water level prediction problem affected by complex factors such as close hydraulic connection and large changes in gate opening and closing.
[0011] To solve the above technical problem, the technical solution adopted by the present invention is: a method for predicting the upstream and downstream water levels of a reverse regulation reservoir integrating a deep learning model with physical mechanisms, including the following steps: Step1: Original data processing, collect and organize the historical operation data of the reservoir, and interpolate and correct the missing or abnormal data; Step2: Construct training samples, generate model training and test samples according to the collected and organized reservoir operation data; Step3: Determine physical constraint conditions, analyze the physical constraint conditions, operation prior knowledge and rules in the reservoir operation process, including water level monotonicity constraint and reservoir water level boundary constraint; Step 4: Construct a water level prediction model. Based on the reservoir operation rules and boundary conditions, improve the loss function of the LSTM (Long Short-Term Memory) model, and construct a deep learning water level prediction model that integrates physical mechanisms. Step 5: Model calibration. Train the model through the sample data set, and adjust the hyperparameters of the model until the most suitable model parameters are obtained for water level prediction.
[0012] In the preferred solution, the original data in Step 1 includes the inflow, upstream and downstream water levels, power generation of the power station, and gate opening and closing status data.
[0013] In the preferred solution, the missing data in Step 1 is interpolated using the average value of the previous and subsequent moments or linear fitting, and the outliers are removed by combining box plots with manual experience.
[0014] In the preferred solution, the construction of the training samples in Step 2 is to unify the data of different time scales into the same time scale, and at the same time convert the gate opening and closing status data into the gate opening size data corresponding to the time scale, so as to form data pairs including the inflow, upstream and downstream water levels, power generation of the power station, gate opening at the beginning of the period, and upstream and downstream water levels at the end of the period.
[0015] In the preferred solution, the determination of the physical constraint conditions in Step 3 is crucial for the accuracy of model prediction, mainly including judging the water level monotonicity constraint by giving a small increase in the gate opening under the condition that the time series of other input variables remains unchanged, and setting the boundary constraints of the upstream and downstream water levels according to the actual situation of reservoir operation.
[0016] In the preferred solution, the constraint equations of the water level monotonicity constraint and the boundary constraints of the upstream and downstream water levels are as follows: (1) In the formula, is the mapping relationship of the reservoir water level established by the model based on the input variables, is the calculated upstream water level of the reservoir, is the calculated downstream water level of the reservoir; is the small increase in the reservoir gate opening, is the reservoir operation period gate opening, is the reservoir operation period; (2) In the formula, is the reservoir operation period the upper boundary constraint of the reservoir upstream water level, and the default value is the dam crest elevation; is the reservoir operation period The lower boundary constraint of the water level downstream of the reservoir. The default value is the elevation of the riverbed downstream of the reservoir. is the predicted value of the downstream water level; is the predicted value of the upstream water level.
[0017] In the preferred solution, the construction of the deep learning water level prediction model integrating the physical mechanism in Step 4 is performed by using the improved LSTM model for calculation, and the loss function is improved by physical constraints.
[0018] In the preferred solution, the LSTM model is an advanced deep learning model with information filtering and conversion functions, which can mine time dependencies to achieve sequence prediction. The calculation process is: Step 4.1: First, use the external state of the previous moment and the input of the current moment to calculate three gates and candidate states. The three gates include the forget gate, input gate, and output gate. Their specific calculations are as follows: (3) In the formula, For the Gate of Forgetfulness, yes The combined variables entered before time, is the S-type activation function, Input variable weight matrix to the forget gate, is the hidden state weight matrix of the forget gate, is the forget gate bias vector; (4) In the formula, is the input gate, Input variable weight matrix for the input gate, is the input gate hidden state weight matrix, is the input gate bias vector; (5) In the formula, is the output gate, Input variable weight matrix for output gate, is the output gate hidden state weight matrix, is the output gate bias vector; Step 4.2: Combine the forget gate and the input gate to update the memory unit; Step 4.3: Combined with the output gate, the information of the internal state is passed to the external state: (10) In the formula, for The hidden layer state at time t, is the cell state, is the Hadamard operator, and is the hyperbolic tangent activation function; The final output is: (11) where and are the weight matrix and bias vector identified during model training.
[0019] In a preferred embodiment, the loss function of the improved LSTM model is expressed as: (6) where is the loss function of the deep learning model for reservoir water level prediction constructed by physical mechanism guidance; is the mean square error between the simulated water level and the observed water level of a general deep learning model; is the penalty term for violating the monotonicity constraint of the reservoir water level; is the penalty term for violating the boundary constraint of the reservoir water level; , , respectively represent the weight coefficients of the root mean square error MAE (Mean Absolute Error), the monotonicity constraint penalty term, and the boundary constraint penalty term.
[0020] In a preferred embodiment, the monotonicity constraint penalty term is obtained by calculating the difference between the simulated results of the upstream and downstream water levels of the reservoir after giving a small increase in the gate opening and the simulated results of the original input sequence. The penalty term for violating the monotonicity constraint of the reservoir water level is: (7) where , are respectively the simulated values of the upstream and downstream water levels of the reservoir corresponding to the input sample obtained by giving a small increase in the gate opening while assuming that the time series of other input variables remains unchanged; is the length of the sample time series during the training period; is the simulated value of the downstream water level of the reservoir for the input sample; is the simulated value of the upstream water level of the reservoir for the input sample.
[0021] In a preferred embodiment, the penalty term for the boundary constraint is obtained by judging whether the simulated upstream and downstream water level values satisfy the upstream and downstream boundary conditions and the magnitude relationship between the upstream and downstream water levels, and calculating the difference that does not satisfy the constraint. The penalty term for violating the boundary constraint of the reservoir water level is: (8) In the formula, is the penalty value corresponding to a single input sample that violates the reservoir water level boundary constraint.
[0022] In the preferred solution, the goal of model calibration in Step5 is to obtain an optimal parameter water level prediction model, and historical data and forecast data are used to predict the water levels upstream and downstream of the reservoir.
[0023] In the preferred solution, the model calibration is to use the backpropagation algorithm to iteratively optimize the network parameters of the deep learning model. By updating the network parameters, the loss function is minimized, and then by solving the partial derivative of the loss function with respect to the network parameter set and setting the partial derivative to zero, the optimal network parameter set is solved, specifically as follows: (9) In the formula, and are two different network parameter sets of the deep learning model.
[0024] The method for predicting the water levels upstream and downstream of the regulating reservoir by integrating the physical mechanism deep learning model provided by the present invention has the following beneficial effects: 1. By introducing a deep learning model integrating physical mechanisms and combining data-driven methods, the present invention effectively solves the technical problems faced in predicting the water levels upstream and downstream of the regulating reservoir, such as low accuracy, inability to adapt to complex scheduling scenarios, and unreasonable prediction results, especially the problems affected by complex factors such as close hydraulic connection and large changes in gate opening and closing, improving the accuracy and adaptability of water level prediction; 2. Based on the LSTM model, the present invention integrates physical mechanisms, that is, considers the physical constraint conditions and prior knowledge in the reservoir scheduling process, improves the loss function. By introducing the physical mechanism, the model can better understand the physical process of reservoir scheduling, thereby improving the accuracy and stability of water level prediction; 3. The present invention uses a data-driven method for water level prediction, fully utilizes the measured data information, can flexibly respond to different reservoir scheduling scenarios, and continuously optimizes the prediction effect by learning new reservoir scheduling data; 4. The present invention uses measured data to optimize the prediction. The model can continuously learn new reservoir scheduling data. Through continuous learning, the model can gradually adapt to complex and changeable reservoir scheduling scenarios, improving the prediction accuracy and reliability; 5. When constructing the water level prediction model, the present invention comprehensively considers the water level monotonicity constraint and the reservoir water level boundary constraint. These constraint conditions ensure that the predicted water level is consistent with the actual situation, avoiding unreasonable prediction results in traditional methods; 6. The present invention significantly improves the prediction accuracy of the water levels upstream and downstream of the reservoir by integrating a deep learning model with physical mechanisms, combining data-driven methods and comprehensive constraints. The prediction results are more accurate and reasonable, and can better meet the actual needs of reservoir operation; 7. The present invention can continuously learn new reservoir operation data, optimize the prediction effect, adapt to complex and changeable reservoir operation scenarios, improve the flexibility and accuracy of reservoir operation, and contribute to enhancing the safe, efficient, and stable operation of hydropower stations; 8. The water level prediction results of the present invention are more accurate and reasonable, and can better guide reservoir operation. For cascade power stations with close hydraulic connections, this technical solution can improve the operation efficiency and benefits of the entire cascade power station, and promote the optimal allocation of energy resources; 9. The integrated physical mechanism deep learning model provided by the present invention fully considers the influence of gate opening and closing during the reservoir operation process, improves the accuracy and reliability of the water level prediction upstream and downstream of the reservoir, and helps to formulate a more scientific and reasonable reservoir operation plan; 10. The present invention integrates the water level monotonicity constraint and the reservoir water level boundary constraint, avoids the problem that the predicted water level does not match the actual situation in traditional methods, and the prediction results are closer to the actual situation, and can better guide reservoir operation and energy management decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The present invention will be further described below in conjunction with the drawings and embodiments: Figure 1 It is a schematic flow chart of the prediction method of the present invention; Figure 2 It is a schematic diagram of the principle of the LSTM model of the present invention; Figure 3 It is the predicted result of the water level upstream of the main river of the present invention (MAE = 3.87 cm); Figure 4 It is the predicted result of the water level downstream of the main river of the present invention (MAE = 5.64 cm); Figure 5 It is the predicted result of the water level upstream of the secondary river of the present invention (MAE = 4.44 m); Figure 6 It is the predicted result of the water level downstream of the secondary river of the present invention (MAE = 6.92 cm). DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] The technical solutions in the present invention will be further described below in conjunction with the drawings and embodiments: Embodiment 1 As Figures 1-2 shown, the method for predicting the water levels upstream and downstream of the regulating reservoir by integrating a deep learning model with physical mechanisms includes the following steps: Step1: Process the original data, collect and organize the historical operation data of the reservoir, and interpolate and correct the missing or abnormal data; Step2: Construct the training samples, and generate the model training and test samples according to the collected and organized reservoir operation data; Step3: Determine the physical constraint conditions, analyze the physical constraint conditions, operation prior knowledge and rules in the reservoir operation process, including the water level monotonicity constraint and the reservoir water level boundary constraint; Step4: Construct the water level prediction model, based on the reservoir operation rules and boundary conditions, improve the loss function of the LSTM model, and construct a deep learning water level prediction model integrating physical mechanisms; Step5: Model calibration, train the model through the sample data set, and adjust the hyperparameters of the model until the most suitable model parameters are obtained for water level prediction.
[0027] In this embodiment, the original data in Step1 includes the incoming flow, upstream and downstream water levels, power generation of the power station, and the data of the gate opening and closing status.
[0028] Furthermore, the missing data in Step1 is interpolated by the average value of the previous and subsequent moments or linear fitting, and the outliers are removed by combining the box plot with artificial experience.
[0029] Furthermore, in the process of processing the original data in Step1, the missing or abnormal data is interpolated and corrected. The specific method is as follows: If there is missing data at a certain time point, take the average value of the data at the previous and subsequent moments of this time point for substitution, or use the linear fitting method to generate the linear regression equation of the missing data for interpolation and supplementation; For outliers, by drawing the box plot of the data and making logical judgments, if there are outliers, combine artificial experience to determine whether it is a sample corresponding to extreme hydrological conditions. If so, remove it and use the missing data interpolation rule for data interpolation.
[0030] Furthermore, the training samples in Step2 are to unify the data of different time scales into the same time scale, and process the gate opening and closing status data into the gate opening size data corresponding to the time scale, forming data pairs. Each data pair includes the incoming flow, upstream and downstream water levels, power generation of the power station, and the gate opening size at the beginning of the period, as well as the upstream and downstream water levels at the end of the period.
[0031] Furthermore, the water level monotonicity constraint in Step3 is that when the time series of other input variables remains unchanged, give a small increase in the gate opening, and the simulated result of the downstream water level of the reservoir corresponding to the sample is not less than the simulated result of the original input sequence, and the simulated result of the upstream water level of the reservoir corresponding to the sample is not greater than the simulated result of the original input sequence. Its constraint equation is as follows: (1).
[0032] Furthermore, the reservoir water level boundary constraint in Step 3 is that the predicted value of the upstream and downstream water levels should be within the boundary conditions of the actual reservoir operation, and its constraint equation is as follows: (2).
[0033] Furthermore, the deep learning water level prediction model integrating physical mechanisms is constructed in Step 4, including calculation using the LSTM model, and improving the loss function through water level monotonicity constraints and reservoir water level boundary constraints, wherein the loss function includes the mean square error MAE between the simulated water level and the observed water level of the model, the penalty term of the monotonicity constraint, and the penalty term of the boundary constraint.
[0034] Furthermore, the LSTM model is an advanced deep learning model with information filtering and conversion functions, which can mine time dependencies to achieve sequence prediction. Its calculation process is: Step 4.1: First, use the external state of the previous moment and the input of the current moment to calculate three gates and candidate states. The three gates include the forget gate, input gate, and output gate. Their specific calculations are as follows: For the input variable set , first use the nonlinear activation function of , perform input transformation on it, and get the input vector , calculated as follows: (12); Forget Gate Control the cell state at the previous moment How much information do we need to forget? yes The combined variables input before time, also called hidden layer states, It is a S-type activation function, which is calculated as follows: (3); Input Gate Control the current cell state How much information needs to be saved is calculated as follows: (4); Cell state First, calculate the candidate value of the cell state , as follows: (13) (14); Output Gate Control the cell state at the current moment How much information needs to be output to The hidden layer state at the moment , and the specific calculation is as follows: (5); Step4.2: Combine the forget gate and the input gate to update the memory cell; Step4.3: Combine the output gate to transfer the information of the internal state to the external state. The specific process is as follows: The current The hidden layer state at the moment is calculated as follows: (10); The final output is: (11).
[0035] Furthermore, the loss function of the improved LSTM model in Step5 is expressed as: (6).
[0036] Furthermore, the monotonicity constraint penalty term is obtained by calculating the difference between the simulated upstream and downstream water levels of the reservoir and the simulated results of the original input sequence after giving a small increase to the gate opening. The penalty term for violating the monotonicity constraint of the reservoir water level is expressed as:
[0037] Furthermore, the penalty term for the boundary constraint is obtained by judging whether the simulated upstream and downstream water level values meet the upstream and downstream boundary conditions and the magnitude relationship between the upstream and downstream water levels, and calculating the difference that does not meet the constraint. The penalty term for violating the boundary constraint of the reservoir water level is: The final model input is the initial reservoir inflow, upstream and downstream water levels, power station output, gate opening and closing, and the opening size, and the output is the upstream and downstream water levels at the end of the period.
[0038] Furthermore, the goal of model calibration in Step5 is to obtain an optimal parameter water level prediction model, and historical data and forecast data are used to predict the upstream and downstream water levels of the reservoir.
[0039] Further, the model calibration uses the backpropagation algorithm to iteratively optimize the network parameters of the deep learning model. By updating the network parameters, the loss function is minimized. Then, by solving the partial derivative of the loss function with respect to the network parameter set and setting the partial derivative to zero, the optimal network parameter set is solved, as follows: (9).
[0040] Further, the prediction method further includes using the water level prediction model with the optimal parameters after iterative optimization to predict the upstream and downstream water levels of the reservoir through historical data and forecast data.
[0041] Embodiment 2 In another preferred embodiment, on the basis of Embodiment 1, the present invention takes a certain hydropower station as an example. The station is affected by a combination of factors such as water level backwater, unsteady flow downstream of the station, and complex time delays in flow propagation between cascade power stations. Existing traditional methods such as the water level - discharge curve interpolation method and the unsteady flow empirical formula method have low calculation accuracy, cannot effectively predict the water level change process, and are difficult to meet the refined scheduling requirements when the scheduling boundary is narrow. The following uses the upstream and downstream water level prediction method for the regulating reservoir integrating the physical - mechanism deep learning model provided by the present invention to predict the water level.
[0042] In step 1, according to the research needs, the incoming flow, upstream and downstream water levels, power generation of the power station, and gate opening and closing status data are collected and sorted. Considering the error in the calculation of the incoming flow of this hydropower station, the outgoing flow of its upstream dam is used in this example. The upstream and downstream water level data includes the piezoresistive water level of Station 6# Stand 1, the downstream water level of Unit 8#, the water level of Station 5, and the piezoresistive water level of Station 7# Stand 1. The power generation data is the total power generation of the Dajiang and Erjiang power stations, and the gate opening and closing status data is the opening size of the Dajiang sediment - flushing gate and the Erjiang water - discharging gate. The 2 - hour outgoing flow data, 1 - hour upstream and downstream water level and power generation data, and gate opening and closing status data in August 2020 are collected.
[0043] If there are individual missing data or incomplete information, interpolation of missing data and correction of outliers are performed. The rules for interpolation and correction of missing data are as follows: if there is missing data at a certain time point, the average value of the data before and after the time point is taken as a substitute; if the time points before and after are also missing, the two nearest non-missing data points before and after the missing data are found, and the linear regression equation of these two data points is generated by linear fitting, and the missing data of the corresponding time point is supplemented by the linear interpolation method of the regression equation. The rules for correction of outliers are as follows: by drawing a box plot of the data, calculating the upper and lower quartiles of the data, and calculating the interquartile range based on the upper and lower quartiles, the upper and lower edges of the data are obtained, and finally, by logically judging whether there are data points less than the lower edge or greater than the upper edge, it is determined whether there are outliers in the data. If there are outliers, the number and specific values of the outliers are output; otherwise, "there are no outliers in the data" is output. If the data is abnormal, it is further judged by manual experience whether it is a sample corresponding to extreme hydrological conditions. If it is indeed an outlier, it will be eliminated, and the aforementioned missing correction rules will be used for data interpolation.
[0044] In step 2 of the present invention, the outflow data of the upstream dam of 2 hours is linearly interpolated into 1 hour, and the gate opening and closing states of the Dajiang sand flushing gate and the Erjiang sluice gate are processed into the gate opening size data of 1 hour. Finally, the collected and processed data are formed into data pairs according to the time one by one correspondence, wherein each data pair includes the outflow of the upstream dam at the beginning of the time period, the 6# station #1 piezoresistive water level, the 8# machine downstream water level, the 5th water level station, the 7# station #1 piezoresistive water level, the total output of the Dajiang and Erjiang power stations, the opening size of the Dajiang sand flushing gate and the Erjiang sluice gate, and the upstream and downstream water levels at the end of the time period. Finally, a sample data set is sorted out, and the time scale of the data is 1 hour.
[0045] In step 3, two physical constraints, water level monotonicity constraint and reservoir water level boundary constraint, are established.
[0046] The water level monotonicity constraint is to give the gate opening a small increase while the time series of other input variables remain unchanged. , the simulated result of the downstream water level of the reservoir corresponding to the corresponding sample is not less than the simulated result of the original input sequence, and the simulated result of the upstream water level of the reservoir corresponding to the corresponding sample is not greater than the simulated result of the original input sequence. Therefore, the following equation can be obtained: (1).
[0047] The reservoir water level boundary constraint is that the predicted value of the upstream and downstream water levels should be within the boundary conditions of the actual reservoir operation. The specific equation is as follows: (2).
[0048] In step 3, a deep learning water level prediction model integrating physical mechanisms is constructed. The specific steps include the LSTM model, as Figure 2 shown, calculating and improving the loss function: The model calculation process is as follows: (1) First, use the combined variables input before and the input at the current time to calculate three gates and the candidate cell state ; (2) Combine the forget gate and the input gate to update the memory unit cell state ; (3) Combine the output gate to transfer the information of the internal state to the hidden layer state at .
[0049] The specific calculation process is as follows; For the input variable set , first use the non-linear activation function of to perform input transformation , obtaining the input vector , and the calculation is as shown in the following formula: (12); The forget gate controls how much information of the internal state at the previous time needs to be forgotten. is the combined variables input before , also known as the hidden layer state. (3); The input gate controls how much information of the cell state at the current time needs to be saved, and the specific calculation is as follows: (4); For the calculation of the cell state , first calculate the candidate value of the cell state , as follows: (13) (14); The output gate controls how much information of the cell state at the current time needs to be output to the hidden layer state at , and the specific calculation is as follows: (5); Current Hidden layer state at the moment is calculated as follows: (10); The final output is: (11).
[0050] The specific calculation parameters are shown in Table 1:
[0051] The loss function improved by the water level monotonicity constraint and reservoir water level boundary constraint established in step 3 is as follows: (6) In the formula, is the loss function of the deep learning model for reservoir water level prediction constructed by physical mechanism guidance, , and are two different network parameters of the deep learning model, which are the weight matrix and bias vector in the LSTM model; is the mean square error between the simulated water level and the observed water level of the general deep learning model; is the penalty term for violating the reservoir water level monotonicity constraint; is the penalty term for violating the reservoir water level boundary constraint, including the upper boundary constraint and the lower boundary constraint; , , respectively represent the weight coefficients of the root mean square error, monotonicity constraint penalty term, and boundary constraint penalty term, which are 0.8, 0.1, and 0.1 respectively.
[0052] Among them, the construction of and is defined as follows. is the penalty term for violating the reservoir water level monotonicity constraint. The monotonicity constraint is that when the time series of other input variables remains unchanged, a small increase in the gate opening is given, and the simulated result of the downstream water level of the reservoir corresponding to the input sample is not less than the simulated result of the original input sequence, and the simulated result of the upstream water level of the reservoir is not greater than the simulated result of the original input sequence; "small increase" is to randomly increase the value of the original gate opening at each time period on the basis of the original time series, so as to construct a new time series; the small increase is specifically implemented by the function in Python. The expression of (7) In the formula, , For the constructed hypothesis that other input variable time series remain unchanged, a small increase in the gate opening is given corresponding to the simulated values of the upstream and downstream reservoir water levels of the input samples, unit: m; in this example, a small increase is randomly given to the gate openings in each partition of the main river and the second river. Since there are 2 water level data for both upstream and downstream, the sum of the 4 water level simulation results and the simulation results of the original input sequence is used as the penalty term for violating the monotonicity constraint of the reservoir water level.
[0053] The penalty term for violating the reservoir water level boundary constraint; the flow boundary constraint includes the upper and lower boundaries of the reservoir water level, including the upper boundary of the upstream reservoir water level, the lower boundary of the downstream reservoir water level, and the magnitude relationship between the upstream and downstream reservoir water levels. The expression is: (8); The final model input is the initial period inflow, upstream and downstream water levels, power station output, gate opening and closing, and the magnitude of the gate opening, and the output is the upstream and downstream water levels at the end of the period.
[0054] In this example, for the 4 simulated water level values, the upstream and downstream boundaries are judged simultaneously, as well as the comparison of the upstream and downstream water levels. If any constraint is not satisfied, the difference is calculated. Finally, the average value of the four water level judgment results is used as the penalty term and added to the loss function.
[0055] The final model input is the upstream dam outflow at the beginning of the period, the piezoresistive water level of Station 6#1, the downstream water level of Unit 8#, the 5th water level station, the piezoresistive water level of Station 7#1, the total output of the main river and second river power stations, and the magnitudes of the gate openings of the main river sediment flushing gate and the second river water discharge gate, and the output is the piezoresistive water level of Station 6#1, the downstream water level of Unit 8#, the 5th water level station, and the piezoresistive water level of Station 7#1 at the end of the period.
[0056] Furthermore, based on the model training samples constructed in Step 2 and the water level prediction model integrating physical mechanisms constructed in Step 4, by using the backpropagation algorithm, the network parameters of the deep learning model are iteratively optimized according to formula (9); the purpose of backpropagation is to minimize the loss function by updating the network parameters (i.e., the network parameter set of the deep learning model, the deep learning model parameter set and ); then, by solving the partial derivatives of the loss function with respect to the network parameter set and and setting the partial derivatives to zero, the optimal network parameter set is solved, which is: (9).
[0057] Finally, through the iterative optimal parameter water level prediction model, the water levels upstream and downstream of the reservoir can be predicted based on historical data and forecast data. The prediction results of the water levels upstream and downstream in this example are shown in the appendix Figures 3-6 as follows.
[0058] The method for predicting the water levels upstream and downstream of the regulating reservoir by integrating the physical mechanism deep learning model provided by the present invention fully considers the influence of the opening and closing of the gates during the reservoir operation process, improves the prediction accuracy of the water levels upstream and downstream of the reservoir; uses a data-driven method for water level prediction, makes full use of the measured data information, can continuously learn new reservoir operation data to optimize the prediction effect, and at the same time combines the water level monotonicity constraint and the reservoir water level boundary constraint. The predicted water level avoids the problem of inconsistency with the actual situation existing in the traditional method, and can better guide the reservoir operation.
[0059] In a preferred solution, the original data in Step 1 includes the inflow, water levels upstream and downstream, power generation of the power station, and gate opening and closing status data; the above settings can accurately capture the key information in the reservoir operation process, effectively support the training and optimization of the deep learning model, and thus improve the accuracy and stability of water level prediction.
[0060] In a preferred solution, the missing data in Step 1 is interpolated using the average value of the previous and next moments or linear fitting, and the outliers are removed by combining the box plot with manual experience; the above settings ensure the data integrity, improve the data quality, provide a reliable data basis for subsequent model training and prediction, reduce the error sources, and improve the accuracy and credibility of the prediction results.
[0061] In a preferred solution, for the construction of the training samples in Step 2, the data of different time scales are unified into the same time scale, and at the same time, the gate opening and closing status data is converted into the gate opening size data corresponding to the time scale, so as to form a data pair including the inflow, water levels upstream and downstream, power generation of the power station, gate opening at the beginning of the period, and water levels upstream and downstream at the end of the period; the above settings realize the standardized processing of the data, enhance the comparability and consistency of the data, enable the deep learning model to more effectively capture the correlation and time series characteristics between variables, and improve the model's simulation ability of the reservoir operation process and the accuracy of water level prediction.
[0062] In the preferred solution, the determination of the physical constraint conditions in Step 3 is crucial for the accuracy of model prediction. It mainly includes judging the water level monotonicity constraint by giving a small increase in the gate opening while keeping the time series of other input variables unchanged, and setting the boundary constraints of the upstream and downstream water levels according to the actual situation of reservoir operation; the above settings ensure that the model prediction results conform to the physical laws of reservoir operation, enhancing the rationality and credibility of the prediction. The water level monotonicity constraint avoids unreasonable fluctuations in the water level during prediction, while the boundary constraints of the upstream and downstream water levels limit the change of the predicted water level within a reasonable range, jointly improving the prediction accuracy and practicality of the model.
[0063] In the preferred solution, the construction of the deep learning water level prediction model integrating physical mechanisms in Step 4 is calculated using the improved LSTM model, and the loss function is improved through physical constraint conditions; the above settings, by integrating physical mechanisms and deep learning technologies, strengthen the model's ability to understand the complex physical processes of reservoir operation. The improved loss function further guides the model to output prediction results that conform to physical constraint conditions, significantly improving the accuracy and stability of water level prediction.
[0064] In the preferred solution, the goal of model calibration in Step 5 is to obtain a water level prediction model with optimal parameters, and historical data and forecast data are used to predict the upstream and downstream water levels of the reservoir; the above settings aim to optimize the model parameters through model calibration, improve the model's adaptability to historical data and forecast data, and ensure that the water level prediction model can provide high-precision and high-stability prediction results in practical applications, providing a scientific basis for reservoir operation decision-making.
[0065] In summary, the present invention proposes an innovative deep learning model integrating physical mechanisms for calculating the upstream and downstream water levels of a regulating reservoir, effectively overcoming the technical bottleneck of insufficient prediction accuracy of the upstream and downstream water levels of a regulating reservoir; the core of this method lies in the organic integration of physical mechanisms and deep learning technologies, that is, fully considering the physical constraint conditions and prior knowledge in the reservoir operation process, and specifically improving the loss function of the deep learning model, thereby realizing the accurate simulation and prediction of the physical process of reservoir operation; this method integrating physical mechanisms and deep learning shows significant novelty in the field of water level prediction. It not only utilizes the advantages of data-driven, fully excavates the information of measured data, but also combines physical mechanisms, significantly improving the accuracy and stability of prediction.
[0066] Another major highlight of the present invention lies in the deep integration of data-driven and physical mechanisms. Through this innovative method, the model can flexibly handle various complex reservoir operation scenarios while ensuring that the prediction results strictly follow physical laws. During the model construction process, the present invention creatively integrates the water level monotonicity constraint and the reservoir water level boundary constraint. The introduction of these constraint conditions not only ensures a high degree of coincidence between the predicted water level and the actual situation but also effectively avoids unreasonable prediction results that may occur in traditional methods, further improving the prediction accuracy and significantly enhancing the robustness and reliability of the model.
[0067] By continuously improving the loss function of the deep learning model, the present invention enables the model to more deeply understand the physical process of reservoir operation, thus achieving a significant improvement in prediction performance. At the same time, the present invention tightly combines the data-driven method with the physical mechanism to achieve their deep integration. With the continuous learning and optimization of new reservoir operation data, the model can continuously improve the prediction effect while ensuring the physical rationality of the prediction results. This method of deep integration not only reflects the creativity of the present invention at the methodological level but also brings a new perspective and method to the fields of reservoir operation and water level prediction.
[0068] Generally speaking, the proposed method for predicting the water levels upstream and downstream of the regulating reservoir by integrating the physical mechanism deep learning model provides solid data support and technical guarantee for reservoir operation and the safe operation of power stations, opens up a new path for research and application in related fields, and has important practical value and theoretical significance.
Claims
1. A method for predicting upstream and downstream water levels of a counter-regulating reservoir integrating a physical mechanism deep learning model, characterized in that: The following steps are involved: Step 1: Raw data processing: collect and organize historical reservoir dispatching data, and interpolate and correct missing or abnormal data; Step 2: Construct training samples and generate model training and testing samples based on the collected reservoir operation data; Step 3: Determine the physical constraints, analyze the physical constraints, prior knowledge and rules of the reservoir operation process, including water level monotonicity constraints and reservoir water level boundary constraints; Step 4: Build a water level prediction model. Based on reservoir operation rules and boundary conditions, improve the loss function of the LSTM model and build a deep learning water level prediction model integrating physical mechanisms. Step 5: Model calibration: train the model through a sample data set and adjust the model's hyperparameters until the most appropriate model parameters are obtained for water level prediction.
2. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 1 is characterized in that: The original data in Step 1 include inflow, upstream and downstream water levels, power station output, and gate opening and closing status data.
3. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 1 is characterized in that: The missing data in Step 1 are interpolated by using the average values of the previous and next moments or linear fitting, and outliers are eliminated by box plots combined with manual experience.
4. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 1 is characterized in that: The construction of training samples in Step 2 is to unify data of different time scales into the same time scale, and at the same time convert the gate opening and closing status data into gate opening size data of the corresponding time scale, thereby forming a data pair including the inflow at the beginning of the time period, the upstream and downstream water levels, the power station output, the gate opening, and the upstream and downstream water levels at the end of the time period.
5. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 1 is characterized in that: The determination of the physical constraints in Step 3 is crucial to the accuracy of the model prediction, which mainly includes judging the water level monotonicity constraint by giving a small increase in the gate opening when the time series of other input variables remain unchanged, and setting the boundary constraints of the upstream and downstream water levels according to the actual situation of reservoir operation.
6. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 5 is characterized in that: The constraint equations of the water level monotonicity constraint and the boundary constraint of the upstream and downstream water levels are as follows: (1); In the formula, It is the reservoir water level mapping relationship established by the model based on the input variables. The calculated value is the water level upstream of the reservoir. The calculated value is the water level downstream of the reservoir; is a small increase in the reservoir gate opening. Reservoir operation period Gate opening, It is the reservoir operation period; (2); In the formula, Reservoir operation period The upper boundary constraint of the upstream water level of the reservoir, the default value is the dam crest elevation; Reservoir operation period The lower boundary constraint of the water level downstream of the reservoir. The default value is the elevation of the riverbed downstream of the reservoir. is the predicted value of the downstream water level; is the predicted value of the upstream water level.
7. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 1 is characterized in that: The construction of the deep learning water level prediction model integrating physical mechanisms in Step 4 is performed by using the improved LSTM model for calculation, and improving the loss function through physical constraints.
8. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 7 is characterized in that: The LSTM model is an advanced deep learning model with information filtering and conversion functions. It can mine time dependencies to achieve sequence prediction. Its calculation process is: Step 4.1: First, use the external state of the previous moment and the input of the current moment to calculate three gates and candidate states. The three gates include the forget gate, input gate, and output gate. Their specific calculations are as follows: (3); In the formula, For the Gate of Forgetfulness, yes The combined variables entered before time, is the S-type activation function, Input variable weight matrix to the forget gate, is the hidden state weight matrix of the forget gate, is the forget gate bias vector; (4); In the formula, is the input gate, Input variable weight matrix for the input gate, is the input gate hidden state weight matrix, is the input gate bias vector; (5); In the formula, is the output gate, Input variable weight matrix for output gate, is the output gate hidden state weight matrix, is the output gate bias vector; Step 4.2: Combine the forget gate and the input gate to update the memory unit; Step 4.3: Combine with the output gate to pass the information of the internal state to the external state.
9. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 7 is characterized in that: The loss function of the improved LSTM model is expressed as: (6); In the formula, The loss function of the deep learning model for reservoir water level prediction guided by physical mechanisms; is the mean square error between the simulated water level and the observed water level of the general deep learning model; is the penalty term for violating the monotonicity constraint of reservoir water level; is the penalty term for violating the reservoir water level boundary constraint; , , They represent the weight coefficients of the root mean square error, monotonicity constraint penalty term, and boundary constraint penalty term respectively.
10. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 9 is characterized in that: The monotonicity constraint penalty term is obtained by giving a small increase to the gate opening, and then calculating the difference between the simulated results of the upstream and downstream water levels of the reservoir and the simulated results of the original input sequence. The penalty term for violating the monotonicity constraint of the reservoir water level is The expression is: (7); In the formula, , They are respectively constructed assuming that the other input variables time series remain unchanged, giving the gate opening a small increase corresponding to the simulated values of the upstream and downstream water levels of the reservoir of the input sample; is the length of the sample time series during the training period; is the simulated value of the reservoir downstream water level of the input sample; is the simulated value of the reservoir upstream water level of the input sample.
11. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 9 is characterized in that: The penalty term of the boundary constraint is obtained by judging whether the simulated upstream and downstream water level values meet the upstream and downstream boundary conditions and the size relationship of the upstream and downstream water levels, and calculating the difference that does not meet the constraints. The penalty term for violating the reservoir water level boundary constraint is The expression is: (8); In the formula, is the penalty value for violating the reservoir water level boundary constraint for a single input sample.
12. The method for predicting upstream and downstream water levels of a counter-regulation reservoir by integrating a physical mechanism deep learning model according to claim 1, characterized in that: The model calibration in Step 5 uses the back propagation algorithm to iteratively optimize the network parameters of the deep learning model, minimize the loss function by updating the network parameters, and then solve the partial derivative of the loss function with respect to the network parameter set and set the partial derivative to zero to solve the optimal network parameter set, as follows: (9); In the formula, and are two different network parameter sets for the deep learning model.
Citation Information
Patent Citations
A method for optimizing water level control between an upstream reservoir and its counter-regulating reservoir dam.
CN109447336B
A method for predicting downstream water levels in a reservoir based on a deep learning model
CN112001556B
Cited By
Cascade reservoir optimization regulation and control method based on nitrogen and phosphorus circulation of water body
CN120509682A
Machine learning-based method for calculating hydraulic performance of nodes of channel and pipe combined water delivery system
CN121503232A
Water level data anomaly detection method based on rule and neural network fusion
CN121706023A