Cascade reservoir optimization regulation and control method based on nitrogen and phosphorus circulation of water body
By constructing a physical constraint neural network model and a multi-objective reinforcement learning model, the problem of low prediction accuracy of nitrogen and phosphorus cycle in cascade reservoirs is solved, effective control of nitrogen and phosphorus input and rational utilization of water resources are achieved, and the risk of eutrophication is reduced.
Patent Information
- Application Number
- CN202510979018.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-16
- Publication Date
- 2025-08-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The intensive development of cascade reservoirs has led to a decrease in water fluidity and accumulation of nutrients such as nitrogen and phosphorus. In the existing technology, the prediction accuracy of nitrogen and phosphorus cycles is low, and eutrophication cannot be effectively controlled.
Build a physical constraint neural network model, embed physical equations of nitrogen and phosphorus cycles, combine data-driven losses and physical constraint losses, determine key parameters through Bayesian optimization algorithm rate, build a multi-objective reinforcement learning model, and formulate optimization and regulation strategies.
It improves the prediction accuracy of the nitrogen and phosphorus migration and transformation process, effectively controls nitrogen and phosphorus input, reduces the risk of eutrophication, and achieves a balance between water supply guarantee, power generation efficiency and ecological protection.
Smart Images

Figure CN120509682A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water resource management optimization, and in particular to a method for optimizing and regulating cascade reservoirs based on nitrogen and phosphorus cycles in water bodies. Background Art
[0002] With population growth and economic development, the global demand for water resources continues to rise. In order to meet the comprehensive needs of water supply, power generation, flood control, shipping, etc., the construction of cascade reservoirs has become the mainstream model. However, the intensive development of cascade reservoirs has led to reduced water mobility and prolonged hydraulic retention time, providing physical conditions for the accumulation of nutrients such as nitrogen and phosphorus and eutrophication.
[0003] In the existing technology, the nitrogen and phosphorus cycle is affected by the coupling of multiple factors such as hydrology, meteorology, and biogeochemistry, which will lead to the problem of low spatiotemporal resolution of nitrogen and phosphorus input data of cascade reservoirs, affecting the prediction accuracy. Therefore, how to construct a deep learning model based on physical constraints, embed the physical equations of the nitrogen and phosphorus cycle into the neural network loss function, constrain the model learning direction, use physical laws to reduce dependence on big data, and improve prediction reliability is the problem to be solved by the present invention. To this end, a cascade reservoir optimization and control method based on the nitrogen and phosphorus cycle in water bodies is proposed. Summary of the Invention
[0004] The purpose of the present invention is to provide a cascade reservoir optimization and control method based on the nitrogen and phosphorus cycle of water bodies to solve the problems raised in the above background technology.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: The optimization and regulation method of cascade reservoirs based on the nitrogen and phosphorus cycle in water bodies includes the following steps: S1. Collect multi-dimensional data on gradient reservoirs, including remote sensing images, ground water quality monitoring data, meteorological reanalysis data, and hydrological parameters of cascade reservoirs, to construct a spatiotemporally aligned multimodal dataset; S2. Based on the biogeochemical processes of the nitrogen and phosphorus cycle, derive the physical equations of the nitrogen and phosphorus cycle, and design a physical constraint loss term, which is weightedly combined with the data-driven loss to form a hybrid loss function; S3. Build a physical constraint neural network model consisting of a data-driven branch and a physical constraint branch. The two branches are jointly trained using a weighted loss function to achieve a balance between physical consistency and data adaptability. S4. Simulate the nitrogen and phosphorus migration and transformation process between cascade reservoirs based on a physical constraint neural network model, and use a Bayesian optimization algorithm to calibrate the key parameters of the physical equations to minimize the physical constraint loss terms; S5. Using the prediction results of the physical constraint neural network model as the environmental state input, a multi-objective reinforcement learning model is constructed, including the action space, reward function, and training strategy. S6. Build a digital twin platform for cascade reservoirs, integrate the physical constraint neural network model with the multi-objective reinforcement learning model, and formulate an optimized regulation strategy for cascade reservoirs based on the model prediction results to achieve effective control of nitrogen and phosphorus inputs and rational use of water resources.
[0006] A further improvement of the technical solution of the present invention is that: said S1 comprises the following steps: Satellite remote sensing is used to obtain the reservoir's water area and chlorophyll concentration. Ground monitoring stations collect nitrogen and phosphorus concentrations, and meteorological stations collect precipitation and temperature data. Hydrological parameters such as reservoir inflow and outflow, and water levels are also collected simultaneously. Data formats are standardized and outliers are removed to obtain comprehensive, multi-dimensional data. Clean, format, and align the collected multi-dimensional data in time and space to ensure data integrity and consistency; Integrate the multi-dimensional data after time and space alignment to construct a multimodal dataset that covers time and space continuity and has consistent physical meaning.
[0007] A further improvement of the technical solution of the present invention is that: said S2 comprises the following steps: Based on the biogeochemical processes of the nitrogen and phosphorus cycle, reactions such as nitrification, denitrification, mineralization, and adsorption-desorption are analyzed to establish mass balance equations for nitrogen (nitrification / denitrification, ammonia volatilization) and phosphorus (adsorption / desorption, mineralization). Reaction rate constants and meteorological driving terms are introduced to clarify the coupling relationship between the mass balance equations and hydrology and meteorology, forming a system of partial differential physical equations. The derived physical equations are discretized into residual form, and the physical inconsistencies are quantified by the mean square error (MSE). A physical constraint loss term is constructed to constrain the model output to make it conform to biogeochemical laws. The physical constraint loss term and the data-driven loss based on mean square error are weightedly combined to form a hybrid loss function that balances data adaptability and physical consistency.
[0008] A further improvement of the technical solution of the present invention is that the combination process of the hybrid loss function is: Given the observed data and the model prediction value, the mean square error is used as the data-driven loss function, which measures the difference between the model output and the actual observed data by defining the mean square error; Based on the biogeochemical processes of the nitrogen and phosphorus cycles, the physical equations related to the nitrogen and phosphorus cycles are derived by combining the velocity field, diffusion coefficient, and biogeochemical reaction terms. The residuals of the physical equations are then used as physical constraint losses to minimize the physical constraint losses and improve the physical consistency of the model. The weight coefficients of data-driven loss and physical constraint loss are preset, and the data-driven loss and physical constraint loss are weightedly combined to form a hybrid loss function, which finds the best balance between data adaptability and physical consistency, so that the model can meet the physical constraints while fitting the data.
[0009] A further improvement of the technical solution of the present invention is that: said S3 comprises the following steps: Design the infrastructure of a physical constraint neural network model, consisting of a data-driven branch and a physical constraint branch. Use an LSTM-Transformer hybrid model as the data-driven branch. The LSTM layer captures the long-term dependencies between nitrogen and phosphorus concentrations in time series data. A gating mechanism filters key historical information. A Transformer encoder is introduced to extract spatial correlations. A self-attention mechanism dynamically weights data at different locations. The input is a normalized multivariate time series, and the output is the predicted nitrogen and phosphorus concentrations. A physical constraint branch is designed to encode the physical equations of the nitrogen and phosphorus cycles into a differentiable computational graph. The inputs are the model's predicted nitrogen and phosphorus concentrations and meteorological and hydrological driving variables. The physical residuals are calculated through automatic differentiation, a physical constraint loss term is constructed, and a dynamic weight adjustment mechanism is introduced. The data-driven branch and the physical constraint branch are combined to form a total loss function through the weighted summation of the combined hybrid loss function. The Adam optimizer is used to train the physical constraint neural network model in stages, and the early stopping mechanism is used to prevent overfitting. This allows the model to satisfy physical laws while fitting the data, thereby improving the reliability and generalization ability of the prediction.
[0010] A further improvement of the technical solution of the present invention is that the process of training the physical constraint neural network model in stages is: The input data for both the data-driven branch and the physical constraint branch were determined. The input data was preprocessed to unify the spatiotemporal resolution and divided into a training set (60%), a validation set (20%), and a test set (20%). In the dual-branch structure of the physical constraint neural network model, the data-driven branch used an LSTM network, which input time series data and output a concentration forecast for the next day. The physical constraint branch used a partial differential equation (PDE) solver, which input physical parameters and output nitrification / denitrification rates and phosphorus adsorption-desorption amounts. The outputs of the two branches were weighted and summed (initial weight 7:3) at the fusion layer to generate the final prediction value. Based on the determined data-driven branch and physical constraint branch, combined with the combined hybrid loss function, the data-driven loss and the physical constraint loss are weighted and summed to form the total loss function; The Adam optimizer is used to train the physical constraint neural network model in stages. The first 50 rounds focus on data fitting to quickly improve the model's ability to fit the observed data. The parameters of the physical constraint branch are frozen, and only the parameters of the data-driven branch are updated. The Adam optimizer is used to optimize the total loss function. The validation set data-driven loss is checked every 10 rounds. If it does not decrease for three consecutive times, it is terminated early. Training mainly relies on data-driven loss. The next 50 rounds jointly optimize data fitting and physical consistency to improve the physical rationality of the model. The parameters of the physical constraint branch are unfrozen, and the parameters of the data-driven branch and the physical constraint branch are updated at the same time. The Adam optimizer is continued to optimize the total loss function. The validation set physical constraint loss is checked every 5 rounds. If the physical constraint loss decreases for two consecutive rounds, the weight of the physical constraint loss is increased. If the physical constraint loss increases for five consecutive rounds, the physical branch is frozen and the weight is rolled back. The weight ratio is dynamically adjusted, and the weight of the physical constraint loss is gradually increased according to the performance during training. During the training process, an early stopping mechanism is set. If the total loss of the validation set does not decrease for 10 consecutive rounds, or the physical constraint loss increases for 5 consecutive rounds, it indicates that the physical laws are violated. The training is terminated and the model parameters with the smallest validation set loss are saved to prevent overfitting.
[0011] A further improvement of the technical solution of the present invention is that: said S4 comprises the following steps: Using a physical constraint neural network model, the migration and transformation of nitrogen and phosphorus in cascade reservoirs is simulated, and the predicted nitrogen and phosphorus concentrations of each reservoir are output; Using the Bayesian optimization algorithm, the key parameters in the physical equations are calibrated and the physical constraint loss terms are minimized; The calibrated key parameters are substituted into the physical constraint neural network model to verify its performance on measured data, and the physical constraint neural network model is further optimized to ensure its accuracy and reliability in simulating nitrogen and phosphorus cycles in cascade reservoirs.
[0012] A further improvement of the technical solution of the present invention is that the process of minimizing the physical constraint loss term is: The key parameters to be calibrated are identified from the physical equations, and the boundaries of each key parameter are defined to form a multidimensional search space. At the same time, the Bayesian optimizer is initialized, where Latin hypercube sampling (LHS) is used to generate the initial parameter combination, and the Gaussian process (GP) is selected as the proxy model of the parameter-loss function, and the kernel function is set to (moderate smoothness), and simultaneously adopt the expected improvement (EI) criterion to balance exploration and exploitation, and then select a set of randomly sampled initial parameter values to substitute into the physical constraint neural network model, run the model using the training data, calculate the physical constraint loss term and the hybrid loss function, and record the physical constraint loss and hybrid loss function values under the initial parameters as the optimization benchmark; Sample the next set of key parameters determined according to the expected improvement criterion from the surrogate model, and substitute the key parameters into the physical branch of the physical constraint neural network, fix the data-driven branch, calculate the physical constraint loss function, and record the data fitting index based on RMSE as the constraint condition; A constraint processing mechanism is set, which is divided into two conditions. Condition 1 is: if a key parameter combination causes the data fitting loss to be greater than 1.5×initial RMSE, its expected improvement value is penalized to prevent physical optimization from destroying data consistency. Condition 2 is: if the physical constraint loss function of the physical loss is lower than the current optimal value, the combination is retained first, and then the newly evaluated key parameters and the physical constraint loss function are added to the training set, the Gaussian process is refitted, and the proxy model is updated. The termination condition is set to the maximum number of iterations or the expected improvement value is lower than the threshold (1e-3) for 5 consecutive times, indicating convergence, terminating the optimization, and outputting the optimal parameter combination that minimizes the physical constraint loss term.
[0013] A further improvement of the technical solution of the present invention is that: said S5 comprises the following steps: The prediction results of the physical constraint neural network model are used as the environmental state input, and the action space is defined as the continuous control variables of the reservoir discharge rate and water level regulation amplitude to ensure physical feasibility; A multi-objective reward function is constructed that integrates water supply security, power generation efficiency, and ecological protection. The weights of each objective are dynamically adjusted based on real-time water quality through a priority network. The reward function is a weighted sum to balance the relationships between different objectives. A soft actor-critic algorithm is adopted, which uses entropy regularization to balance exploration and exploitation. The environmental state is updated from the physical constraint neural network model in each round. Key decisions are strengthened through priority experience replay to generate a reservoir operation strategy that adapts to the dynamic environment, ensuring the robustness and effectiveness of the strategy.
[0014] A further improvement of the technical solution of the present invention is that: S6 includes the following steps: Build a digital twin platform for cascade reservoirs, integrate a physical constraint neural network model to simulate the migration and transformation of nitrogen and phosphorus, and embed a multi-objective reinforcement learning model to conduct physical and data dual-driven modeling, achieve data interaction and collaborative operation, and provide technical support for optimized regulation; Based on the physical constraint neural network model, the water quality and hydrological process of the reservoir are predicted. In combination with meteorological forecasts and reservoir operation data, a multi-source heterogeneous state space is constructed to update the environmental parameters of the digital twin platform in real time. With the multi-objective reinforcement learning model as the decision-making core, an optimization and control strategy for cascade reservoirs is formulated, and the discharge and water level adjustment actions of the cascade reservoirs are output according to the real-time status. Through priority experience replay, multiple objectives are balanced to achieve nitrogen and phosphorus input control and efficient use of water resources.
[0015] Due to the adoption of the above technical solution, the present invention has the following technical advancements compared to the prior art: The present invention provides a method for optimizing and controlling cascade reservoirs based on the nitrogen and phosphorus cycle in water bodies. By constructing a physical constraint neural network model, the physical equations of the nitrogen and phosphorus cycle are embedded in the neural network loss function. This not only utilizes the powerful fitting ability of the data-driven model, but also ensures that the model output conforms to biogeochemical laws through physical constraints. The key parameters of the physical equation are calibrated through the Bayesian optimization algorithm, further improving the model's prediction accuracy for the nitrogen and phosphorus migration and transformation process, effectively reducing dependence on big data, and still being able to provide reliable prediction results, especially when the data has low spatiotemporal resolution.
[0016] The present invention provides an optimization and control method for cascade reservoirs based on the nitrogen and phosphorus cycle in water bodies. Through a multi-objective reinforcement learning model, multiple objectives such as water supply security, power generation efficiency and ecological protection are integrated into the reward function, and the weight of each objective is dynamically adjusted through a priority network. In this way, in a complex cascade reservoir system, it is possible to meet water supply needs and improve power generation efficiency while taking into account ecological environmental protection, effectively control nitrogen and phosphorus inputs, reduce eutrophication risks, and dynamically adjust the scheduling strategy according to real-time status to ensure the optimal balance between various objectives in a dynamically changing environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments described in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0018] Figure 1 It is a schematic diagram of the workflow of the present invention; Figure 2 Schematic diagram of the method of the present invention. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0020] Example 1, as Figure 1 、 Figure 2 As shown, the present invention provides a method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water bodies, comprising the following steps: S1. Collect multi-dimensional data on gradient reservoirs, including remote sensing images, ground-based water quality monitoring data, meteorological reanalysis data, and hydrological parameters of cascade reservoirs, to construct a spatiotemporally aligned multimodal dataset. Use satellite remote sensing to obtain the reservoir water area and chlorophyll concentration. Combined with nitrogen and phosphorus concentrations collected by ground monitoring stations and precipitation / temperature data obtained by meteorological stations, simultaneously collect hydrological parameters such as reservoir inflow and outflow, water level, etc., unify the data format and remove outliers to obtain comprehensive multi-dimensional data. Clean the collected multi-dimensional data, unify the format, and align them in time and space to ensure data integrity and consistency. Integrate the spatiotemporally aligned multi-dimensional data to construct a multimodal dataset that covers spatiotemporal continuity and has consistent physical meaning. The specific construction process of the multimodal dataset is as follows: The water area of the reservoir is obtained through satellite remote sensing images, the water body index (normalized difference water index NDWI) of remote sensing images is used to identify and extract the water body boundary, the chlorophyll concentration in the reservoir water body is inverted using the spectral data of satellite remote sensing, water samples are collected regularly through ground water quality monitoring stations, the nitrogen and phosphorus concentrations in the water body are measured, the precipitation and temperature data of the reservoir area are obtained from the meteorological station, and the inflow, outflow and water level data of the reservoir are obtained through the hydrological monitoring station; the quality of the collected multi-dimensional data is checked, and obviously abnormal values are eliminated. For missing data, the interpolation method is used to fill in the missing data, and the timestamps of all data are unified into a standard format to ensure the consistency of time information. The data from different sources are converted into a unified unit, and the data with different time resolutions are aligned to a unified time step through time interpolation. For spatial data, the remote sensing images are spatially aligned through geographic information system (GIS) technology. The data are then aligned and cropped to ensure that their spatial resolution and coordinate system are consistent with the location of the ground monitoring station; the multi-dimensional data that have been cleaned, formatted, and aligned in time and space are integrated to construct a multimodal dataset that covers continuous time and space and has consistent physical meaning. The multimodal dataset contains the following: time series data, spatial data, and attribute data. Time series data include daily or hourly chlorophyll concentration, nitrogen and phosphorus concentration, precipitation, temperature, inflow, outflow, and water level, etc. Spatial data include spatial distribution information of the reservoir water area, and attribute data include basic information of the reservoir, such as storage capacity and area. At the same time, the physical meaning and source of each variable in the multimodal dataset are clearly marked to ensure that each data point has a clear timestamp and spatial location information. The multimodal dataset is then stored in a relational database, and a time index is created for the time series data and a spatial index is created for the spatial data to improve data query efficiency. S2. Based on the biogeochemical processes of the nitrogen and phosphorus cycles, the physical equations of the nitrogen and phosphorus cycles are derived, and physical constraint loss terms are designed. These are weightedly combined with data-driven losses to form a mixed loss function. Based on the biogeochemical processes of the nitrogen and phosphorus cycles, reactions such as nitrification, denitrification, mineralization, and adsorption-desorption are analyzed. Mass balance equations for nitrogen (nitrification / denitrification, ammonia volatilization) and phosphorus (adsorption / desorption, mineralization) are established. Reaction rate constants and meteorological driving terms are introduced to clarify the coupling relationship between the mass balance equations and hydrology and meteorology, forming a set of partial differential physical equations. The derived physical equations are discretized into residual form, and physical inconsistencies are quantified using mean square error (MSE). Physical constraint loss terms are constructed to constrain the model output to conform to biogeochemical laws. Physical constraint loss terms are weightedly combined with data-driven losses based on mean square error to form a mixed loss function that balances data adaptability and physical consistency. In addition, the combination process of the hybrid loss function is: Given observed data and model predictions, the mean square error is used as the data-driven loss function. By defining the mean square error to measure the difference between the model output and the actual observed data, the physical equations related to the nitrogen and phosphorus cycle are derived based on the biogeochemical process of the nitrogen and phosphorus cycle, combined with the velocity field, diffusion coefficient, and biogeochemical reaction terms. The residual of the physical equation is then used as the physical constraint loss to minimize the physical constraint loss and improve the physical consistency of the model. The weight coefficients of the data-driven loss and the physical constraint loss are preset, and the data-driven loss and the physical constraint loss are weighted and combined to form a hybrid loss function. The optimal balance between data adaptability and physical consistency is found, so that the model can meet the physical constraints while fitting the data, thereby improving the prediction reliability and generalization ability of the model. The formula for mean square error is as follows: ; Where, is the mean square error, For the The actual observed value of the sample, For the The model prediction value of samples, is the sample size; The formula of the partial differential physical equation related to the nitrogen and phosphorus cycle is as follows: ; Where, is the nitrogen or phosphorus concentration, For time, is the velocity field, is the diffusion coefficient, is the biogeochemical reaction term, is the gradient operator, is the Laplace operator; The formula for physical constraint loss is as follows: ; Where, is the physical constraint loss, which is used to measure the difference between the model prediction value and the physical equation. Represents the index of the sample, used to iterate over each sample when calculating the physical constraint loss. The physical equation The model-predicted nitrogen or phosphorus concentration for each sample, is the number of samples of the physical equation; The physical equation The partial derivative of the nitrogen or phosphorus concentration of a sample with respect to time represents the rate of change of the concentration with time; The physical equation The convection term for each sample represents the change in nitrogen or phosphorus concentration with fluid motion; The physical equation The diffusion term of each sample represents the spatial diffusion of nitrogen or phosphorus concentration; The physical equation The reaction term of each sample represents the change in nitrogen or phosphorus concentration during the chemical reaction; The formula of the mixed loss function is as follows: ; Where, is the mixed loss function, is the weight coefficient of data-driven loss, is the weight coefficient of physical constraint loss; The specific work content of S2 is: Establish mass balance equations for nitrogen and phosphorus. The mass balance equation for nitrogen includes nitrification, denitrification, ammonia volatilization, the introduction of reaction rate constants, and meteorological driving terms (such as temperature and pH value). Nitrification converts ammonia nitrogen into nitrate, denitrification converts nitrate into nitrogen gas, and ammonia volatilization converts ammonia nitrogen into gaseous ammonia. The mass balance equation for phosphorus includes adsorption-desorption, mineralization, the introduction of reaction rate constants, and hydrological driving terms (such as flow rate and water level). Adsorption-desorption is the exchange of phosphorus between water and sediment, and mineralization converts organic phosphorus into inorganic phosphorus. Clarify the coupling between the mass balance equation and hydrology and meteorology. The combined relationship is established, and hydrological and meteorological factors are used as input variables of the mass balance equation to form a group of partial differential physical equations. Among them, hydrological factors include flow rate, water level, water mixing, etc. that affect the transport and distribution of nitrogen and phosphorus, and meteorological factors include temperature, precipitation, wind speed, etc. that affect the biogeochemical reaction rate of nitrogen and phosphorus; further analysis of the construction logic of the mass balance equation, the input items of the nitrogen cycle mass balance include: ammonia nitrogen and nitrate nitrogen carried by the inflowing rivers, nitrogen deposited by the atmosphere (such as nitrogen oxides), and nitrogen released from the bottom sediment (through denitrification or ammonia volatilization and resuspension); output items: mainly nitrogen discharged from the outlet and nitrogen lost by denitrification (converted into N2), and the nitrogen lost by ammonia volatilization are internally converted into nitrification to convert ammonia nitrogen into nitrate nitrogen, denitrification to convert nitrate nitrogen into N2, and mineralization to convert organic nitrogen into ammonia nitrogen. The hydrological driving coupling relationship is: the change of reservoir water level affects the contact area between sediment and water body, thereby changing the sediment release rate, and the water flow velocity affects the mixing efficiency of nitrification / denitrification reactants. The meteorological driving coupling relationship is: the temperature regulates the nitrification / denitrification rate by affecting microbial activity, and the wind speed promotes ammonia volatilization by enhancing water disturbance; the input items of phosphorus cycle mass balance are: particulate phosphorus and dissolved phosphorus carried by the inflowing river, Phosphorus is deposited from the atmosphere (such as dust) and absorbed by sediments (entering the water body through resuspension). Output items include phosphorus discharged from the outlet and phosphorus adsorbed and fixed by sediments (long-term burial). Internal conversion involves adsorption, converting dissolved phosphorus to particulate phosphorus, desorption, and reverse phosphorus release. Mineralization converts organic phosphorus to inorganic phosphorus. The coupled relationship driven by hydrology is as follows: reservoir stratification leads to hypoxia in the bottom layer, promoting phosphorus desorption; discharge operations change water retention time, affecting phosphorus deposition and output. The coupled relationship driven by meteorology is as follows: precipitation increases phosphorus input by increasing inflow runoff; and light indirectly regulates phosphorus bioabsorption by affecting algal growth.The reservoir is divided into multiple grid cells. The reaction rate is assumed to be uniform in each cell. The finite difference method is used to divide the continuous time into discrete steps. The changes in nitrogen and phosphorus concentrations at each time step are calculated. For each grid cell and time step, the deviation between the nitrogen and phosphorus concentration changes predicted by the model and the theoretical changes derived from the physical equations is calculated, that is, the residual. The mean square error (MSE) of the residuals for all grid cells and time steps is taken as the physical constraint loss term. The smaller the MSE, the more consistent the model output is with the biogeochemical laws. The physical constraint loss term is defined by the mean square error (MSE) to quantify physical inconsistency. The mean square error (MSE) is used to measure the difference between the model output and the actual observation data. The physical constraint loss term and the data-driven loss are weighted and combined to form a hybrid loss function. S3. Build a physical constraint neural network model that includes a data-driven branch and a physical constraint branch. The data-driven branch uses an LSTM-Transformer hybrid model to capture the spatiotemporal nonlinear changes in nitrogen and phosphorus concentrations. The physical constraint branch uses a differentiable physical equation layer to force the output to conform to biogeochemical laws. The two branches are jointly trained through a weighted loss function to achieve a balance between physical consistency and data adaptability. Design the basic architecture of the physical constraint neural network model, which includes a data-driven branch and a physical constraint branch. Use an LSTM-Transformer hybrid model as the data-driven branch, use the LSTM layer to capture the long-term dependence of nitrogen and phosphorus concentrations in time series data, filter key historical information through a gating mechanism, introduce a Transformer encoder to extract spatial correlation, and use self-injection to extract spatial correlation. The intention mechanism dynamically weights data at different locations. The input is a normalized multivariate time series, and the output is the predicted nitrogen and phosphorus concentration. A physical constraint branch is designed, and the physical equations of the nitrogen and phosphorus cycle are encoded into a differentiable computational graph. The input is the nitrogen and phosphorus concentrations predicted by the model and meteorological and hydrological driving variables. The physical residual is calculated through automatic differentiation, and a physical constraint loss term is constructed. A dynamic weight adjustment mechanism is introduced. Initially, weak constraints (weight = 0.2) are applied to avoid interfering with data learning, and later, they are gradually strengthened (weight = 0.8) to ensure physical consistency. The data-driven branch and the physical constraint branch are combined, and the total loss function is formed by weighted summation of the combined hybrid loss function. The Adam optimizer is used to train the physical constraint neural network model in stages, and the early stopping mechanism is used to prevent overfitting. This ensures that the model meets physical laws while fitting the data, improving the reliability and generalization ability of the prediction. In addition, the process of training the physical constraint neural network model in stages is: The input data including data-driven branch and physical constraint branch were determined. The data-driven branch included nitrogen and phosphorus concentration, chlorophyll concentration, meteorological data (precipitation, temperature), and hydrological data (flow, water level) monitored on the ground. The physical constraint branch included the water area, temperature / dissolved oxygen profile (used to drive nitrification / denitrification rate), and sediment iron and aluminum content (used for phosphorus adsorption-desorption modeling) retrieved from remote sensing. The input data were preprocessed to unify the spatiotemporal resolution and divided into training set (60%), validation set (20%), and test set (20%). The dual partitioning of the physical constraint neural network model was carried out. In the branch structure, the data-driven branch uses an LSTM network to input time series data and output the concentration forecast for the next day. The physical constraint branch uses a partial differential equation (PDE) solver to input physical parameters and output nitrification / denitrification rate and phosphorus adsorption-desorption amount. The outputs of the two branches are weighted summed in the fusion layer (initial weight 7:3) to generate the final prediction value. Based on the determined data-driven branch and physical constraint branch, combined with the combined hybrid loss function, the data-driven loss and the physical constraint loss are weighted summed to form the total loss function, and the Adam optimizer is used for staged training. For the physical constraint neural network model, the first 50 rounds focus on data fitting to quickly improve the model's ability to fit the observed data. The parameters of the physical constraint branch are frozen, and only the parameters of the data-driven branch are updated. The Adam optimizer is used to optimize the total loss function. The data-driven loss of the validation set is checked every 10 rounds. If it does not decrease for three consecutive rounds, the training is terminated early. Training mainly relies on the data-driven loss. The next 50 rounds jointly optimize data fitting and physical consistency to improve the physical rationality of the model. The parameters of the physical constraint branch are unfrozen, and the parameters of the data-driven branch and the physical constraint branch are updated simultaneously. The Adam optimizer is continued to optimize the total loss function. The physical constraint loss of the validation set is checked every 5 rounds. If the physical constraint loss decreases for two consecutive rounds, the weight of the physical constraint loss is increased. If the physical constraint loss increases for five consecutive rounds, the physical branch is frozen and the weight is rolled back. The weight ratio is dynamically adjusted, and the weight of the physical constraint loss is gradually increased based on the performance during training. During training, an early stopping mechanism is set. If the total loss of the validation set does not decrease for 10 consecutive rounds, or the physical constraint loss increases for five consecutive rounds, it indicates that the physical laws are violated. Training is terminated and the model parameters with the lowest validation set loss are saved to prevent overfitting. The specific work content of S3 is: The data-driven branch uses an LSTM-Transformer hybrid model. Normalized multivariate time series data, including nitrogen and phosphorus concentrations, chlorophyll concentrations, meteorological data, and hydrological data, are input into the LSTM layer to capture the long-term dependency of nitrogen and phosphorus concentrations in the time series data. Key historical information is filtered through a gating mechanism, and time series features processed by LSTM are output. The output features of the LSTM layer are input into the Transformer encoder to extract spatial correlation. The self-attention mechanism is used to dynamically weight data at different locations to enhance the model's perception of spatial information. The representation of the fusion of time and space features is output and the Transformer encoder is input into the output layer. The output of the nsformer encoder is used to predict the nitrogen and phosphorus concentrations for the next day and output the predicted nitrogen and phosphorus concentrations; the physical constraint branch encodes the physical equations of the nitrogen and phosphorus cycle into a differentiable computational graph, inputs the nitrogen and phosphorus concentrations predicted by the model, meteorological driving variables, and hydrological driving variables, calculates the residuals of the physical equations through automatic differentiation, constructs the physical constraint loss term, ensures that the model output conforms to the physical laws, and sets a dynamic weight adjustment mechanism. As the training progresses, the weights are gradually increased to ensure physical consistency in the later stage; the data-driven loss uses the mean square error (MSE) to measure the difference between the model output and the actual observation data, and the physical constraint loss measures the difference between the model output and the physical by quantifying the residuals of the physical equations. The consistency of physical laws is achieved by forming a total loss function through weighted summation with an initial weight ratio of 7:3 (data-driven loss: physical constraint loss). The weight ratio is adjusted dynamically, and the weight of the physical constraint loss is gradually increased according to the performance during training. The physical constraint neural network model is trained in stages. The first 50 rounds focus on data fitting to quickly improve the model's ability to fit the observed data. The parameters of the physical constraint branch are frozen, and only the parameters of the data-driven branch are updated. The Adam optimizer is used to optimize the total loss function. The validation set loss is checked every 10 rounds. Training mainly relies on data-driven loss. The last 50 rounds jointly optimize data fitting and physical consistency to improve the physical rationality of the model and unfreeze the physical constraint. The parameters of the constraint branch are updated simultaneously, and the parameters of the data-driven branch and the physical constraint branch are updated. The Adam optimizer is continued to optimize the total loss function. The validation set loss is checked every 5 rounds, and the weight ratio is dynamically adjusted, gradually increasing the weight of the physical constraint loss. If the total validation set loss does not decrease for 10 consecutive rounds, or the physical constraint loss increases for 5 consecutive rounds, it indicates that the physical laws are violated. Terminate training and save the model parameters with the lowest validation set loss to prevent overfitting. Use an independent test dataset to evaluate the predictive reliability of the model. The evaluation metrics include the mean squared error (MSE), the physical constraint loss, and the hybrid loss function. Check the generalization ability of the model to ensure that it performs well on unseen data. S4. Simulate the nitrogen and phosphorus migration and transformation process between cascade reservoirs based on a physical constraint neural network model, and use a Bayesian optimization algorithm to calibrate the key parameters of the physical equations to minimize the physical constraint loss terms; S5. Using the predictions of the physical constraint neural network model as environmental state input, a multi-objective reinforcement learning model is constructed, consisting of an action space, a reward function, and a training strategy. The action space defines continuous control variables such as reservoir discharge and water level scheduling. The reward function integrates multiple objectives such as water supply security, power generation efficiency, and ecological protection. The weights are dynamically adjusted through a priority network. The training strategy uses a soft actor-critic (SAC) algorithm to achieve a stable exploration-exploitation balance and generate a scheduling strategy that adapts to the dynamic environment. S6. Build a digital twin platform for cascade reservoirs, integrate the physical constraint neural network model with the multi-objective reinforcement learning model, and formulate an optimized regulation strategy for cascade reservoirs based on the model prediction results to achieve effective control of nitrogen and phosphorus inputs and rational use of water resources.
[0021] Example 2, as Figure 1 、 Figure 2 As shown, based on Example 1, the present invention provides a technical solution: preferably, S4 includes the following steps: A physical constraint neural network model was used to simulate the migration and transformation of nitrogen and phosphorus in cascade reservoirs, outputting predicted nitrogen and phosphorus concentrations for each reservoir. A Bayesian optimization algorithm was used to calibrate key parameters in the physical equations. By minimizing the physical constraint loss term, the calibrated key parameters were substituted into the physical constraint neural network model to verify its performance on measured data. This model was then further optimized to ensure its accuracy and reliability in simulating nitrogen and phosphorus cycles in cascade reservoirs. In addition, the process of minimizing the physical constraint loss term is: The key parameters to be calibrated are identified from the physical equations, including the nitrification rate constant, the maximum capacity of phosphorus adsorption, the ammonia volatilization rate coefficient, and the iron and aluminum content of the sediment. The boundaries of each key parameter are defined to form a multidimensional search space. At the same time, the Bayesian optimizer is initialized, in which Latin hypercube sampling (LHS) is used to generate the initial parameter combination, and the Gaussian process (GP) is selected as the proxy model of the parameter-loss function, and the kernel function is set to (moderate smoothness), simultaneously adopt the expected improvement (EI) criterion, balance exploration and utilization, and then select a set of randomly sampled initial parameter values to substitute into the physical constraint neural network model, run the model using training data, calculate the physical constraint loss term (i.e., the residual of the physical equation) and the hybrid loss function, record the physical constraint loss and hybrid loss function values under the initial parameters as the optimization benchmark, sample the next set of key parameters determined according to the expected improvement criterion from the proxy model, and substitute the key parameters into the physical branch of the physical constraint neural network, fix the data-driven branch, that is, the LSTM-Transformer weight remains unchanged, only optimize the physical branch parameters, calculate the physical constraint loss function, and record the value of the physical constraint loss function based on R The MSE data fitting index is used as a constraint condition, and a constraint processing mechanism is set, which is divided into two conditions. Among them, condition 1 is: if a key parameter combination causes the data fitting loss to be greater than 1.5×initial RMSE, its expected improvement value is penalized to prevent physical optimization from destroying data consistency. Condition 2 is: if the physical constraint loss function of the physical loss is lower than the current optimal value, then the combination is retained first, and then the newly evaluated key parameters and the physical constraint loss function are added to the training set, the Gaussian process is refitted, and the surrogate model is updated. The termination condition is set to the maximum number of iterations or the expected improvement value is lower than the threshold (1e-3) for 5 consecutive times, indicating convergence, and the optimization is terminated, and the optimal parameter combination that minimizes the physical constraint loss term is output; The specific work content of S4 is: The preprocessed multi-dimensional data is input into the physical constraint neural network model, and the data-driven branch and the physical constraint branch receive the corresponding input data respectively. Among them, the data-driven branch processes time series data to capture the spatiotemporal characteristics of nitrogen and phosphorus concentrations. The physical constraint branch calculates the residual of the physical equation through the differentiable computation graph to ensure that the model output conforms to the physical laws. The outputs of the two branches are weighted and summed in the fusion layer to generate the final nitrogen and phosphorus concentration prediction value, and then the nitrogen and phosphorus concentration prediction value of each reservoir is output to simulate the migration and transformation process of nitrogen and phosphorus in the cascade reservoir; the key parameters that need to be calibrated are determined based on the physical equation, and the Bayesian optimization algorithm is used to calibrate the key parameters in the physical equation, and the physical constraint loss term is minimized in combination with the set constraint processing mechanism; the key parameters calibrated by the Bayesian optimization algorithm are substituted into the physical constraint neural network model, and independent verification data are used. Run the model on a data set (data not involved in training), evaluate the model's performance on measured data, compare the differences between the model's predicted values and the measured values, check the model's accuracy and reliability, use the mean square error (MSE), physical constraint loss, and hybrid loss function values as evaluation indicators, check the model's performance in different reservoirs and different time periods, and ensure its accuracy and reliability in simulating the nitrogen and phosphorus cycle in cascade reservoirs; based on the verification results, adjust the structure of the data-driven branch and the physical constraint branch, optimize the model's hyperparameters including learning rate and weight ratio, and then use the adjusted model structure and hyperparameters to retrain the physical constraint neural network model. Combined with the calibrated key parameters, further optimize the model's performance, and use an independent test data set to re-verify the model's performance to ensure its accuracy and reliability in simulating the nitrogen and phosphorus cycle in cascade reservoirs; S5 includes the following steps: The prediction results of the physical constraint neural network model are used as environmental state input. The action space is defined as continuous control variables for the reservoir discharge rate and water level adjustment amplitude to ensure physical feasibility. A multi-objective reward function is constructed that integrates water supply security, power generation efficiency, and ecological protection. The priority network dynamically adjusts the weights of each objective based on real-time water quality. The reward function is a weighted sum to balance the relationships between different objectives. A soft actor-critic algorithm is used, and entropy regularization is used to balance exploration and exploitation. The environmental state is updated from the physical constraint neural network model in each round. Key decisions are reinforced through priority experience replay to generate a reservoir scheduling strategy that adapts to the dynamic environment and ensures the robustness and effectiveness of the strategy. The specific work content of S5 is: The prediction results of the physical constraint neural network model are obtained, including the nitrogen and phosphorus concentrations, chlorophyll concentrations, water levels, and flow rates of each reservoir, which are used as environmental state inputs to guide the reservoir scheduling decisions. The action space is then defined as continuous control variables for the reservoir discharge rate and water level regulation amplitude to ensure the physical feasibility of the action. The objectives of the multi-objective reward function are defined as water supply security, power generation efficiency, and ecological protection. Water supply security ensures that the water supply of the reservoir meets downstream demand. Power generation efficiency optimizes the power generation efficiency of the reservoir and improves power generation revenue. Ecological protection controls nitrogen and phosphorus concentrations, reduces eutrophication risks, and protects the water ecological environment. The multi-objective reward function of water supply security, power generation efficiency, and ecological protection is integrated. The weights of each objective are dynamically adjusted based on real-time water quality through the priority network. The reward function is a weighted sum to balance the relationship between different objectives. The priority network dynamically adjusts the weight coefficient according to real-time water quality data. For example, when the nitrogen and phosphorus concentrations are high, the weight of ecological protection is increased. When the water supply demand is tight, the weight of water supply security is increased. A soft actor-critic is used. The algorithm's policy network (actor) and value network (critic) optimize the continuous action space. The input of the policy network is the current environmental state, namely the nitrogen and phosphorus concentrations, water level, flow rate, etc. of the reservoir, and the output is the probability distribution of the action. Entropy regularization is used to ensure the diversity of the strategy and avoid premature convergence to the local optimal solution. The input of the value network is the current environmental state and action, and the output is the value of the action, namely the expected return, to evaluate the quality of the action output by the policy network. The environmental state is updated from the physical constraint neural network model in each round, and key decisions are reinforced through priority experience replay. Experience with a greater impact on the reward function is preferentially sampled, and the gradient update of the policy network and value network is used to optimize the strategy and value functions. Entropy regularization is used to balance exploration and utilization, ensuring that the strategy utilizes known high-return actions while exploring new actions. Then, based on the output of the policy network, a reservoir scheduling strategy is generated, including the discharge rate and water level adjustment amplitude, to ensure the robustness and effectiveness of the strategy and adapt to dynamically changing environmental conditions. S6 includes the following steps: Build a digital twin platform for cascade reservoirs, integrate a physical constraint neural network model to simulate the migration and transformation process of nitrogen and phosphorus, and embed a multi-objective reinforcement learning model to conduct physical-data dual-driven modeling, realize data interaction and collaborative operation, and provide technical support for optimized regulation. Based on the physical constraint neural network model, predict the water quality and hydrological process of the reservoir inflow. Combined with meteorological forecasts and reservoir operation data, build a multi-source heterogeneous state space, and update the environmental parameters of the digital twin platform in real time. With the multi-objective reinforcement learning model as the decision-making core, formulate an optimized regulation strategy for cascade reservoirs, and output the discharge and water level adjustment actions of the cascade reservoirs based on the real-time status. Balance multiple objectives through priority experience replay to achieve nitrogen and phosphorus input control and efficient use of water resources; The specific work content of S6 is: Integrate multi-source heterogeneous data, including: prediction results of physical constraint neural network models (nitrogen and phosphorus concentrations, water levels, flow, etc.), meteorological forecast data (precipitation, temperature, etc.) and reservoir operation data (real-time monitoring of nitrogen and phosphorus concentrations, water levels, flow, etc.), build a multi-source heterogeneous state space, update the environmental parameters of the digital twin platform in real time, and integrate physical constraint neural network models to simulate the migration and transformation process of nitrogen and phosphorus. Embed a multi-objective reinforcement learning model to generate reservoir scheduling strategies, and then use the multi-objective reinforcement learning model as the decision-making core to output the discharge and water level regulation actions of cascade reservoirs according to the real-time status. , balance multiple objectives through priority experience replay, realize nitrogen and phosphorus input control and efficient use of water resources, ensure data flow and information sharing between the physical constraint neural network model and the multi-objective reinforcement learning model, provide a user interface, display real-time status and scheduling strategy; determine the input data of the physical constraint neural network model, including meteorological forecast data (precipitation, temperature, etc.), reservoir operation data (real-time monitoring of nitrogen and phosphorus concentration, water level, flow, etc.) and historical data, the physical constraint neural network model combines the input data to predict the water quality (nitrogen and phosphorus concentration) and hydrological process (flow, water level changes) entering the reservoir, and output the package The system includes the predicted values of nitrogen and phosphorus concentration, flow and water level in the future, and updates the predicted results to the state space of the digital twin platform in real time to provide environmental parameters for the multi-objective reinforcement learning model; integrates the prediction results of the physical constraint neural network model, meteorological forecast data and reservoir operation data to construct a multi-source heterogeneous state space, including the predicted values of nitrogen and phosphorus concentration, flow, water level, meteorological forecast data (precipitation, temperature, etc.) and real-time monitoring data (nitrogen and phosphorus concentration, water level, flow, etc.), and dynamically updates the state space based on the real-time monitoring data and meteorological forecast data. environmental parameters to ensure that the data in the state space is highly timely and accurate; generate a scheduling strategy based on the multi-objective reinforcement learning model, output the discharge and water level adjustment actions of the cascade reservoirs in real time, balance multiple objectives through priority experience replay, ensure the adaptability of the strategy in a dynamic environment, and then evaluate the execution effect of the strategy, including the nitrogen and phosphorus input control effect and the efficient use of water resources. The nitrogen and phosphorus input control effect is used to monitor the changes in nitrogen and phosphorus concentrations to ensure that they meet ecological requirements, and the efficient use of water resources is used to evaluate indicators such as water supply security rate and power generation efficiency. Based on the evaluation results, the model and strategy are further optimized.
[0022] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water bodies, characterized in that: The following steps are involved: S1. Collect multi-dimensional data of gradient reservoirs and construct a spatiotemporally aligned multimodal dataset; S2. Based on the biogeochemical processes of the nitrogen and phosphorus cycle, derive the physical equations of the nitrogen and phosphorus cycle, and design a physical constraint loss term, which is weightedly combined with the data-driven loss to form a hybrid loss function; S3. Build a physical constraint neural network model that includes a data-driven branch and a physical constraint branch. The two branches are jointly trained using a weighted loss function. S4. Simulate the nitrogen and phosphorus migration and transformation process between cascade reservoirs based on a physical constraint neural network model, and use a Bayesian optimization algorithm to calibrate the key parameters of the physical equations to minimize the physical constraint loss terms; S5. Using the prediction results of the physical constraint neural network model as the environmental state input, a multi-objective reinforcement learning model is constructed, including the action space, reward function, and training strategy. S6. Build a digital twin platform for cascade reservoirs, integrate the physical constraint neural network model and the multi-objective reinforcement learning model, and formulate an optimized control strategy for cascade reservoirs based on the model prediction results.
2. The method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water according to claim 1, characterized in that: Said S1 comprises the following steps: Satellite remote sensing is used to obtain the reservoir's water area and chlorophyll concentration. Ground monitoring stations collect nitrogen and phosphorus concentrations, and meteorological stations collect precipitation and temperature data. Hydrological parameters such as reservoir inflow and outflow, and water level are also collected simultaneously. The data format is standardized and outliers are removed to obtain comprehensive, multi-dimensional data. Clean, format, and align the collected multi-dimensional data in time and space; Integrate the multi-dimensional data after time and space alignment to construct a multimodal dataset that covers time and space continuity and has consistent physical meaning.
3. The method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water according to claim 1, characterized in that: The S2 comprises the following steps: Based on the biogeochemical processes of the nitrogen and phosphorus cycles, the mass balance equations for nitrogen and phosphorus are established, and reaction rate constants and meteorological driving terms are introduced to clarify the coupling relationship between the mass balance equations and hydrology and meteorology, forming a set of partial differential physical equations; The derived physical equations are discretized into residual form, and the physical inconsistency is quantified by the mean square error to construct the physical constraint loss term; The physical constraint loss term and the data-driven loss based on mean square error are weightedly combined to form a hybrid loss function that balances data adaptability and physical consistency.
4. The method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water according to claim 3, characterized in that: The combination process of the hybrid loss function is: Given the observed data and the model prediction value, the mean square error is used as the data-driven loss function, which measures the difference between the model output and the actual observed data by defining the mean square error; According to the biogeochemical process of nitrogen and phosphorus cycle, the physical equations related to nitrogen and phosphorus cycle are derived by combining the velocity field, diffusion coefficient and biogeochemical reaction terms. Then, the residual of the physical equation is used as the physical constraint loss to minimize the physical constraint loss. The weight coefficients of data-driven loss and physical constraint loss are preset, and the data-driven loss and physical constraint loss are weightedly combined to form a hybrid loss function.
5. The method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water according to claim 1, characterized in that: The S3 includes the following steps: Design the infrastructure of a physical constraint neural network model, consisting of a data-driven branch and a physical constraint branch. Use an LSTM-Transformer hybrid model as the data-driven branch. The LSTM layer captures the long-term dependencies between nitrogen and phosphorus concentrations in time series data. A gating mechanism filters key historical information. A Transformer encoder is introduced to extract spatial correlations. A self-attention mechanism dynamically weights data at different locations. The input is a normalized multivariate time series, and the output is the predicted nitrogen and phosphorus concentrations. A physical constraint branch is designed to encode the physical equations of the nitrogen and phosphorus cycles into a differentiable computational graph. The inputs are the model's predicted nitrogen and phosphorus concentrations and meteorological and hydrological driving variables. The physical residuals are calculated through automatic differentiation, a physical constraint loss term is constructed, and a dynamic weight adjustment mechanism is introduced. The data-driven branch and the physical constraint branch are combined, and the total loss function is formed by weighted summation of the combined hybrid loss function. The Adam optimizer is used to train the physical constraint neural network model in stages, and the early stopping mechanism is used to prevent overfitting.
6. The method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water according to claim 5, characterized in that: The process of training the physical constraint neural network model in stages is as follows: Determine the input data for both the data-driven branch and the physical constraint branch, preprocess the input data, unify the spatiotemporal resolution, and divide it into training, validation, and test sets. In the dual-branch structure of the physical constraint neural network model, the data-driven branch uses an LSTM network to input time series data and output a concentration forecast for the next day. The physical constraint branch uses a partial differential equation solver to input physical parameters and output nitrification / denitrification rates and phosphorus adsorption-desorption amounts. The outputs of the two branches are weighted and summed in the fusion layer to generate the final prediction value. Based on the determined data-driven branch and physical constraint branch, combined with the combined hybrid loss function, the data-driven loss and the physical constraint loss are weighted and summed to form the total loss function; The Adam optimizer is used to train the physical constraint neural network model in stages. The first 50 rounds focus on data fitting, freeze the parameters of the physical constraint branch, and only update the parameters of the data-driven branch. The Adam optimizer is used to optimize the total loss function. The validation set data-driven loss is checked every 10 rounds. If it does not decrease for three consecutive rounds, the training is terminated early. The next 50 rounds jointly optimize data fitting and physical consistency, unfreeze the parameters of the physical constraint branch, and update the parameters of the data-driven branch and the physical constraint branch at the same time. The Adam optimizer is continued to optimize the total loss function. The validation set physical constraint loss is checked every 5 rounds. If the physical constraint loss decreases for two consecutive rounds, the weight of the physical constraint loss is increased. If the physical constraint loss increases for five consecutive rounds, the physical branch is frozen and the weight is rolled back, and the weight ratio is dynamically adjusted. During the training process, an early stopping mechanism is set. If the total loss of the validation set does not decrease for 10 consecutive rounds, or the physical constraint loss increases for 5 consecutive rounds, it indicates that the physical law is violated. The training is terminated and the model parameters with the smallest validation set loss are saved.
7. The method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water according to claim 1, characterized in that: The S4 comprises the following steps: Using a physical constraint neural network model, the migration and transformation of nitrogen and phosphorus in cascade reservoirs is simulated, and the predicted nitrogen and phosphorus concentrations of each reservoir are output; Using the Bayesian optimization algorithm, the key parameters in the physical equations are calibrated and the physical constraint loss terms are minimized; The calibrated key parameters are substituted into the physical constraint neural network model to verify its performance on the measured data and further optimize the physical constraint neural network model.
8. The method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water according to claim 7, characterized in that: The process of minimizing the physical constraint loss term is: The key parameters to be calibrated are identified from the physical equations, and the boundaries of each key parameter are defined to form a multidimensional search space. At the same time, the Bayesian optimizer is initialized, where Latin hypercube sampling is used to generate the initial parameter combination, and the Gaussian process is selected as the proxy model of the parameter-loss function. The kernel function is set to , simultaneously adopt the expected improvement criterion, balance exploration and utilization, and then select a set of randomly sampled initial parameter values to substitute into the physical constraint neural network model, run the model using the training data, calculate the physical constraint loss term and the hybrid loss function, and record the physical constraint loss and hybrid loss function values under the initial parameters as the optimization benchmark; Sample the next set of key parameters determined according to the expected improvement criterion from the surrogate model, and substitute the key parameters into the physical branch of the physical constraint neural network, fix the data-driven branch, calculate the physical constraint loss function, and record the data fitting index based on RMSE as the constraint condition; A constraint processing mechanism is set, which is divided into two conditions. Condition 1 is: if a key parameter combination causes the data fitting loss to be greater than 1.5×initial RMSE, its expected improvement value is penalized. Condition 2 is: if the physical constraint loss function of the physical loss is lower than the current optimal value, the combination is retained first, and then the newly evaluated key parameters and the physical constraint loss function are added to the training set, the Gaussian process is refitted, and the proxy model is updated. The termination condition is set to the maximum number of iterations or the expected improvement value is lower than the threshold for 5 consecutive times, the optimization is terminated, and the optimal parameter combination that minimizes the physical constraint loss term is output.
9. The method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water according to claim 8, characterized in that: The S5 comprises the following steps: The prediction results of the physical constraint neural network model are used as the environmental state input, and the action space is defined as the continuous control variables of the reservoir discharge rate and water level regulation amplitude. A multi-objective reward function is constructed that integrates water supply security, power generation efficiency, and ecological protection. The weights of each objective are dynamically adjusted based on real-time water quality through a priority network. The reward function is a weighted sum to balance the relationships between different objectives. A soft actor-critic algorithm is adopted, which uses entropy regularization to balance exploration and exploitation. The environmental state is updated from the physical constraint neural network model in each round. Key decisions are strengthened through priority experience replay to generate a reservoir operation strategy that adapts to the dynamic environment.
10. The method for optimizing and controlling cascade reservoirs based on nitrogen and phosphorus cycles in water according to claim 9, characterized in that: The S6 comprises the following steps: Build a digital twin platform for cascade reservoirs, integrate a physical constraint neural network model to simulate the migration and transformation of nitrogen and phosphorus, and embed a multi-objective reinforcement learning model for physical-data dual-driven modeling; Based on the physical constraint neural network model, the water quality and hydrological process of the reservoir are predicted. In combination with meteorological forecasts and reservoir operation data, a multi-source heterogeneous state space is constructed to update the environmental parameters of the digital twin platform in real time. With the multi-objective reinforcement learning model as the decision-making core, an optimization control strategy for cascade reservoirs is formulated, and the discharge and water level adjustment actions of cascade reservoirs are output according to the real-time status.
Citation Information
Patent Citations
Logging reservoir evaluation method and device jointly driven by data and physical model
CN115267935A
Reservoir greenhouse effect evaluation method and device based on physical driving neural network
CN119203721A
Method and model for inverting key parameters in underground water pollutant biodegradation numerical model based on neural network algorithm
CN119558171A
Lake and reservoir nutritive salt concentration simulation method based on coupling mechanism model and deep learning
CN119962408A
Anti-regulation reservoir upstream and downstream water level prediction method fusing physical mechanism deep learning model
CN120067970A
Cited By
Freezing circle drainage basin total phosphorus concentration simulation method and system
CN120724872A
Photovoltaic power generation prediction method and device based on physical constraint and LSTM network
CN120822705A
Cascade channel water level prediction method
CN121052174A
System and method for checking and optimizing port yard design scheme questions and answers
CN121052241A
Multi-level parallel world simulation model dynamic loading method and system
CN121190627A