Water conservancy project flow regulation and control method based on machine learning model

By using a flow regulation method based on machine learning models, and leveraging feature vector extraction and multi-model collaborative optimization, the problems of insufficient regulation accuracy and adaptability in traditional methods are solved, thus achieving efficient and precise regulation of water conservancy project flow.

CN121119366APending Publication Date: 2025-12-12WATER RESOURCES RES INST OF SHANDONG PROVINCE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511115937.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2025-08-06
Filing Date
2025-08-11
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Traditional water conservancy engineering flow regulation methods lack in-depth understanding of complex hydrological conditions, are difficult to adapt to dynamic changes, have low response speed and regulation accuracy, and are difficult to balance multiple needs.

Method used

A flow control method based on machine learning models is adopted. By extracting and clustering feature vectors from historical hydrological data, a first machine learning model (such as linear regression) and a second machine learning model (such as convolutional neural network) are trained. Combined with gradient learning and Adam optimization algorithm, the opening of the flow control valve is adjusted in real time.

Benefits of technology

It improves the accuracy and adaptability of flow regulation, enabling rapid response to hydrological changes, reducing regulation errors, and achieving efficient multi-objective optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121119366A_ABST
    Figure CN121119366A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent regulation and control and flow optimization in hydraulic engineering, in particular to a hydraulic engineering flow regulation and control method based on a machine learning model, and the method comprises the steps: generating a modeling data set for historical hydrological data according to a construction rule, and training a preset first machine learning model through an optimization algorithm, obtaining a trained first machine learning model; the hydrological data comprises downstream flow, downstream target flow and a first hydrological variable; based on the modeling data set, training a preset second machine learning model to obtain a trained second machine learning model; acquiring real-time hydrological data in operation of the water conservancy project; and based on the real-time hydrological data, a trained first machine learning model and a trained second machine learning model, obtaining a final opening adjustment value of the flow control valve for controlling the downstream flow.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent regulation and flow optimization in water conservancy engineering, and in particular to a water conservancy engineering flow regulation method based on a machine learning model. BACKGROUND

[0002] Flow regulation of water conservancy engineering is a key link in water resources management, and its goal is to meet the downstream water demand while ensuring the safety of upstream water supply and the stability of water conservancy engineering operation through scientific and reasonable control strategies. However, the traditional flow regulation method mainly relies on empirical formula, simple rules or manual intervention, and its effect is limited in many ways:

[0003] Hydrological conditions are affected by many factors, including rainfall, river slope, environmental temperature, etc., which have obvious spatio-temporal variability and nonlinear characteristics. Traditional methods often lack deep mining of these complex relationships, making it difficult for the regulation strategy to adapt to the dynamic changes in the hydrological environment.

[0004] Existing flow regulation systems are usually based on static models or single feedback control strategies, which have low response speed and regulation accuracy, making it difficult to meet the real-time control needs of sudden hydrological events such as heavy rain or floods. At the same time, this approach can produce large adjustment errors, affecting the realization of downstream flow targets. With the development of hydrological monitoring technology, a large amount of historical hydrological data and real-time monitoring data has been accumulated during the operation of water conservancy engineering. However, traditional methods of using these data are mostly limited to basic statistical analysis, failing to mine the potential patterns and rules in the data, resulting in low regulation efficiency. Water conservancy engineering flow regulation involves multi-objective optimization problems, such as ensuring downstream target flow while considering water resource conservation, engineering equipment operation life, and rapid response capability to emergency events. Traditional methods lack a unified optimization framework, making it difficult to balance multiple demands. SUMMARY

[0005] In view of the above shortcomings and deficiencies of the prior art, the present application provides a water conservancy engineering flow regulation method based on a machine learning model.

[0006] In order to achieve the above purpose, the main technical solutions adopted by the present application include:

[0007] The present application provides a water conservancy engineering flow regulation method based on a machine learning model, comprising:

[0008] S1, generating a modeling data set from historical hydrological data according to a construction rule, and training a preset first machine learning model through an optimization algorithm to obtain a trained first machine learning model;

[0009] The hydrological data comprises: downstream flow, downstream target flow and first hydrological variable;

[0010] The first hydrological variable comprises: rainfall, river channel slope, ambient temperature, upstream pressure and downstream pressure of the flow control valve;

[0011] S2, training a pre-set second machine learning model based on the modeling data set, to obtain a trained second machine learning model;

[0012] S3, obtaining real-time hydrological data in the operation of the water conservancy project;

[0013] S4, based on the real-time hydrological data, the trained first machine learning model and the trained second machine learning model, obtaining a final opening adjustment value of the flow control valve for controlling the downstream flow.

[0014] Preferably, the S1 specifically comprises:

[0015] S11, taking the historical hydrological data as an initial data set, and generating a modeling data set based on the initial data set by using a set construction rule;

[0016] The historical hydrological data comprises: hydrological data at N different time points collected at a pre-set collection time interval within a historical time period; N is greater than 1000;

[0017] S12, training a pre-set first machine learning model according to the modeling data set and a pre-set fitness function, to obtain a trained first machine learning model;

[0018] S13, training a pre-set second machine learning model according to the modeling data set, to obtain a trained second machine learning model.

[0019] Preferably, the S11 comprises:

[0020] S11-1, for each piece of hydrological data of the initial data set, a feature vector corresponding to each piece of hydrological data is obtained respectively, and all the feature vectors are combined to form a first feature vector set;

[0021] X i =[Δ i , E i , Δ lag (Q i ), Δ lag (V i ), A i , B i , ΔT i , P i1 , P i2 ];

[0022] wherein X i is a feature vector corresponding to the i-th hydrological data in the initial data set;

[0023] Δ i = Q i -T i ;

[0024] Q i is the downstream flow in the i-th hydrological data in the initial data set;

[0025] T i is the downstream target flow in the i-th hydrological data in the initial data set;

[0026]

[0027] Δ lag (Q i ) = Q i -Q i-1 ;

[0028] Δ lag (V i ) = V i -V i-1 ;

[0029] V i is the actual opening adjustment value of the flow control valve corresponding to the i-th hydrological data in the initial data set;

[0030] V i-1 is the actual opening adjustment value of the flow control valve corresponding to the i-1-th hydrological data in the initial data set;

[0031] A i is the rainfall corresponding to the i-th hydrological data in the initial data set;

[0032] B i is the environmental temperature corresponding to the i-th hydrological data in the initial data set;

[0033]

[0034] T i-1 is the downstream target flow in the i-1-th hydrological data in the initial data set;

[0035] P i1 is the upstream pressure of the flow control valve in the i-th hydrological data in the initial data set;

[0036] P i2 is the downstream pressure of the flow control valve in the i-th hydrological data in the initial data set;

[0037] P(i-1)1 is the upstream pressure of the flow control valve in the i-th hydrological data in the initial data set;

[0038] P (i-1)2 is the downstream pressure of the flow control valve in the i-th hydrological data in the initial data set;

[0039] ρ is the density of the fluid;

[0040] C d is the flow coefficient;

[0041] S11-2, eliminating the feature vectors in the first feature vector set that meet the first condition to obtain a second feature vector set;

[0042] The first condition is that the value of |Δ lag (V i )-ΔT i is greater than a first threshold value preset in advance;

[0043] S11-3, extracting part of the feature vectors in the second feature vector set according to a set sampling rule to form a modeling data set.

[0044] Preferably, the S11-3 specifically comprises:

[0045] S11-3-1, dividing the feature vectors in the second feature vector set into M data clusters using a clustering algorithm;

[0046] S11-3-2, randomly selecting F feature vectors in each data cluster, and merging all the selected feature vectors into the modeling data set;

[0047] F is the number of feature vectors in the smallest data cluster of the M data clusters.

[0048] Preferably, the first machine learning model is:

[0049]

[0050] wherein, is the feature vector X i input into the first machine learning model, the opening adjustment value predicted by the first machine learning model;

[0051] β0, β1, β2, β3, β4, β5, β6, β7, β8, β9 are regression coefficients of the first machine learning model;

[0052] wherein, the regression coefficients in the first machine learning model are determined by optimizing the value of a specified fitness function using an optimization algorithm;

[0053] The optimization algorithm is a gradient learning algorithm.

[0054] Preferably, the fitness function in the first machine learning model is MSE.

[0055]

[0056] wherein, is the opening adjustment value predicted by the first machine learning model after inputting the hth feature vector in the modeling data set into the first machine learning model;

[0057] Y h is the actual opening adjustment value of the flow control valve corresponding to the hth feature vector in the modeling data set;

[0058] H = F x M.

[0059] Preferably, in the process of training the first machine learning model using the gradient learning algorithm, the learning rate of the tth iteration is calculated by formula (1);

[0060] The formula (1) is:

[0061]

[0062] σ t is the learning rate at the tth iteration;

[0063] σ0 is the initial learning rate set in advance;

[0064] γ is the learning rate decay coefficient set in advance, and γ > 0;

[0065] t is the iteration number;

[0066] δ is the fluctuation coefficient set in advance;

[0067] α is the fluctuation intensity set in advance.

[0068] Preferably, the S2 specifically comprises:

[0069] inputting the modeling data set into a second machine learning model set in advance, training the second machine learning model using the Adam optimization algorithm, adjusting the parameters in the second machine learning model to minimize the loss function of the second machine learning model, thereby obtaining the trained second machine learning model;

[0070] wherein the loss function is: mean square error loss function;

[0071] The second machine learning model is a convolutional neural network model.

[0072] Preferably, the S4 specifically comprises:

[0073] S41, input the real-time hydrological data into a pre-trained first machine learning model to obtain a first opening degree adjustment value;

[0074] input the real-time hydrological data into a pre-trained second machine learning model to obtain a second opening degree adjustment value;

[0075] S42, based on the first opening degree adjustment value and the second opening degree adjustment value, obtaining a final opening degree adjustment value of the flow control valve for controlling the downstream flow.

[0076] Preferably, the S42 specifically comprises:

[0077] based on the first opening degree adjustment value and the second opening degree adjustment value, using formula (2) to obtain a final opening degree adjustment value of the flow control valve for controlling the downstream flow;

[0078] wherein the formula (2) is:

[0079] A f =ω1A1+ω2A2;

[0080] A1 is the first opening degree adjustment value;

[0081] A2 is the second opening degree adjustment value;

[0082] A f is the final opening degree adjustment value;

[0083] ω1 and ω2 are both weight coefficients, and satisfy ω1+ω2=1.

[0084] The beneficial effects of the present application are:

[0085] The water conservancy project flow regulation method based on machine learning model can more accurately control the downstream flow and avoid the control error caused by experience or single variable in the traditional method, because the first and second machine learning models are used to predict the opening degree adjustment value of the flow control valve by deep mining and modeling of historical hydrological data.

[0086] The first hydrological variable (including rainfall, river slope, environmental temperature, etc.) in the water conservancy project flow regulation method based on machine learning model covers the main factors affecting flow regulation. The machine learning model can capture the nonlinear relationship between these complex variables, significantly improving the adaptability of the regulation system to variable hydrological conditions.

[0087] The water conservancy project flow regulation method based on a machine learning model can quickly calculate the final opening adjustment value by acquiring hydrological data in real time and inputting the trained machine learning model, and meets the high real-time requirement in the operation of the water conservancy project. The feature vector elimination and clustering sampling method is used to generate a modeling data set, so as to ensure the representativeness and diversity of the training data, reduce the calculation complexity of the model training, and improve the data utilization.

[0088] The water conservancy project flow regulation method based on a machine learning model can comprehensively improve the prediction accuracy and reliability by the cooperative optimization of the first machine learning model (based on regression analysis) and the second machine learning model (convolutional neural network). The gradient learning algorithm and the Adam optimization algorithm are used in combination with the dynamic learning rate adjustment mechanism, so as to improve the efficiency and convergence speed of the model training process, and ensure that the model has good generalization performance. BRIEF DESCRIPTION OF DRAWINGS

[0089] Figure 1 The water conservancy project flow regulation method based on a machine learning model is a flow chart. DETAILED DESCRIPTION

[0090] In order to better explain the present application, so as to be understood, the present application is described in detail below by specific embodiments, combined with the accompanying drawings.

[0091] In order to better understand the above technical solutions, the exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a clearer, more thorough understanding of the present application, and to fully convey the scope of the present application to those skilled in the art.

[0092] The water conservancy flow regulation method based on the machine learning model in this embodiment is mainly suitable for water conservancy engineering scenarios that require precise control of water flow. Specifically, this method can be applied to the following typical application scenarios: 1. Reservoir and dam management, such as in reservoirs and dams, precise regulation of downstream river flow is crucial. By using this method, the flow control valve can be automatically adjusted according to real-time hydrological data to ensure that the reservoir release meets the preset target flow, maintains the health of the downstream ecosystem, and meets the needs of agricultural irrigation, urban water supply, etc. 2. Flood control and disaster reduction, such as to cope with flood risks, the flow control valve opening can be adjusted in advance to release an appropriate amount of water to reduce upstream pressure and avoid downstream flood disasters. This method helps to achieve more intelligent and efficient flood control scheduling. 3. Water resource allocation, such as the fair and reasonable allocation of limited water resources among multiple users is one of the important tasks of water management. Using machine learning models to predict and optimize flow in different time periods can help managers develop more scientific water resource allocation plans and improve water resource utilization. 4. Environmental flow protection, such as ensuring sufficient natural flow in rivers is important for protecting biodiversity and maintaining river ecosystems. This method can dynamically adjust the flow according to environmental temperature, rainfall, and other factors to ensure the healthy and stable development of river ecosystems. 5. Hydropower station operation, such as water power stations need to flexibly adjust the operation state of generator sets according to power demand and hydrological conditions. With the help of flow regulation suggestions provided by machine learning models, the operation process of water power stations can be optimized, ensuring the stability of power production while meeting environmental protection requirements. 6. Irrigation system optimization, such as agricultural irrigation systems rely on stable water supply. This method can provide appropriate water volume in different time periods to meet the needs of crop growth, reduce waste, and improve water resource use efficiency. 7. Urban water management, such as for the water supply network within a city, accurate prediction and regulation of water flow in pipes are crucial to prevent water leakage, pipe bursts, and other problems. This method is also suitable for such scenarios, helping city water departments better manage and maintain water supply facilities. In summary, the method in this embodiment is particularly suitable for water conservancy applications that require high precision and high automation, especially when faced with complex and changing natural environments and social and economic demands. It can provide an intelligent solution to enhance the safety and efficiency of water conservancy projects.

[0093] Referring to Figure 1 The embodiment provides a water conservancy flow regulation method based on a machine learning model, comprising:

[0094] S1, generating a modeling data set from historical hydrological data according to a construction rule, and training a preset first machine learning model through an optimization algorithm to obtain a trained first machine learning model;

[0095] The hydrological data includes: downstream flow, downstream target flow and first hydrological variable;

[0096] The first hydrological variable includes: rainfall, river slope, environmental temperature, upstream and downstream pressure of the flow control valve;

[0097] The first hydrological variable (such as rainfall, river slope, environmental temperature, etc.) and the upstream and downstream pressure of the valve in the embodiment fully cover the key factors in flow regulation, making the applicability of the model stronger. For example, in a mountainous reservoir project with variable climate, the influence of environmental temperature and rainfall change on flow is particularly significant. The scheme can comprehensively consider these factors to improve the scientificity of regulation.

[0098] S2, training a pre-set second machine learning model based on the modeling data set to obtain a trained second machine learning model;

[0099] S3, obtaining real-time hydrological data in the operation of the water conservancy project;

[0100] S4, based on the real-time hydrological data, the trained first machine learning model and the trained second machine learning model, obtaining the final opening adjustment value of the flow control valve for controlling the downstream flow.

[0101] In the embodiment, the first machine learning model is used to predict the opening adjustment value, and the second machine learning model is used for supplementary optimization, forming a double-model collaborative working mechanism. This architecture can improve the robustness and accuracy of prediction more than a single model. For example, under extreme conditions of low water level or high water level, the first model may have certain deviation, and through the correction of the second model, the accumulation of prediction error can be effectively avoided. For example, the first model predicts the opening degree to be 60%, and the second model optimizes it to 62% after real-time correction, and the actual running effect is closer to the target value.

[0102] The water conservancy project flow regulation method based on machine learning model provided in the embodiment can fully mine the internal laws between hydrological data by constructing a modeling data set based on historical hydrological data and training using a machine learning model. This data-driven method can better adapt to complex and variable water conservancy engineering environment than the traditional physical model-based regulation method. For example, suppose in a certain area, due to frequent rainfall changes and the complexity of hydrological conditions, the traditional method cannot accurately predict the downstream flow change. The method based on machine learning model can dynamically adjust the valve opening degree, so as to realize accurate control of the downstream flow and reduce the problem of flood risk or water shortage.

[0103] Specifically, the S1 specifically includes:

[0104] S11, the historical hydrological data is taken as an initial data set, and a modeling data set is generated based on the initial data set and by using a set construction rule;

[0105] The historical hydrological data includes hydrological data at N different time points collected at a pre-set collection time interval within a historical time period; N is greater than 1000;

[0106] In this embodiment, by using hydrological data at more than 1000 time points, the diversity of historical hydrological conditions can be captured, the generalization ability of the model can be improved, and different scenarios and abnormal situations can be adapted. In the historical records of a certain river basin, both low flow data in dry years and high flow data in flood seasons are included. Through modeling of these data, the first and second machine learning models can adapt to extreme conditions such as abnormal drought or flood, and the accuracy of flow regulation can be improved.

[0107] Using data at more than 1000 time points, features of different time scales (such as seasonality and daily variation) can be captured, providing more abundant references for real-time regulation. The flow regulation of a reservoir is significantly different between the summer flood season and the winter dry season. By modeling historical data, the model can accurately identify the rules of seasonal changes, for example, it can be predicted that more frequent flow adjustments may be needed during the flood season, while a more stable regulation strategy can be adopted during the dry season.

[0108] S12, according to the modeling data set and the pre-set fitness function, the pre-set first machine learning model is trained to obtain a trained first machine learning model;

[0109] In this embodiment, by setting the fitness function, the target can be quantified, for example, the target is to minimize the error or maximize the flow regulation efficiency, which can guide the model to better adapt to specific scenarios.

[0110] For example, in downstream flow control, the fitness function can be set as "minimizing the deviation of downstream flow from the target value". This means that during the model training process, the parameters are optimized to reduce the regulation error, for example, to reduce the error from ±10% to ±2%.

[0111] S13, according to the modeling data set, the pre-set second machine learning model is trained to obtain a trained second machine learning model.

[0112] In this embodiment, the S11 includes:

[0113] S11-1, for each piece of hydrological data of the initial data set, a feature vector corresponding to each piece of hydrological data is obtained respectively, and all the feature vectors are combined to form a first feature vector set;

[0114] X i = [Δi , E i , Δ lag (Q i ), Δ lag (V i ), A i , B i , ΔT i , P i1 , P i2 ];

[0115] wherein, X i is a feature vector corresponding to the i-th hydrological data in the initial data set;

[0116] Δ i = Q i -T i ; Q i is the downstream flow in the i-th hydrological data in the initial data set; T i is the downstream target flow in the i-th hydrological data in the initial data set;

[0117]

[0118] Δ lag (Q i ) = Q i -Q i-1 ; Δ lag (V i ) = V i -V i-1 ;

[0119] V i is the actual opening adjustment value of the flow control valve corresponding to the i-th hydrological data in the initial data set; V i-1 is the actual opening adjustment value of the flow control valve corresponding to the i-1-th hydrological data in the initial data set; A i is the rainfall corresponding to the i-th hydrological data in the initial data set; B i is the environmental temperature corresponding to the i-th hydrological data in the initial data set;

[0120]

[0121] T i-1 is the downstream target flow in the i-1-th hydrological data in the initial data set; P i1 is the upstream pressure of the flow control valve in the i-th hydrological data in the initial data set; P i2 is the downstream pressure of the flow control valve in the i-th hydrological data in the initial data set; P (i-1)1 is the upstream pressure of the flow control valve in the i-1-th hydrological data in the initial data set; P (i-1)2is the pressure downstream of the flow control valve in the i-1th hydrological data in the initial data set; p is the density of the fluid; C d is the pre-set flow coefficient;

[0122] In this embodiment, the feature vectors of multiple hydrological variables (such as rainfall, ambient temperature, etc.) are extracted, so that the model can comprehensively consider the relationship between complex variables. The feature vectors in this embodiment include multiple key variables related to hydrological data, which can comprehensively reflect the dynamic changes of hydrological data. lag (Q i ) = Q i -Q i-1 ; Δ lag (V i ) = V i -V i-1 The introduction of time dimension information reflects the time sequence dependence between system variables, thereby helping to capture the dynamic characteristics in the data. The feature vectors in contain relative errors, which can quantify the deviation between the actual flow and the target flow. This is very important for error control and system optimization.A i is the rainfall corresponding to the i th hydrological data in the initial data set;B i is the ambient temperature corresponding to the i th hydrological data in the initial data set, so that the feature vector can capture the influence of the external environment on the hydrological system, providing more comprehensive background information for analysis. The feature vector structurally organizes multiple feature quantities, providing a clear and modular input form for subsequent data analysis (such as machine learning or mathematical modeling). Feature quantities can be added or modified as needed to adapt to different application scenarios.

[0123] S11-2, remove the feature vectors in the first feature vector set that meet the first condition to obtain a second feature vector set; the first condition is that the value of |Δ lag (V i )-ΔT i | in the feature vector is greater than a pre-set first threshold value;

[0124] S11-3, extract part of the feature vectors in the second feature vector set according to a set sampling rule to form a modeling data set. In this embodiment, the modeling data set is constructed to reduce the computational complexity and improve the model training efficiency. By sampling rule to extract part of the feature vectors, the computational complexity can be significantly reduced, especially in the case of large data set, the demand for computing resources can be greatly reduced. After reducing the amount of data, the model training time is shortened, and the training efficiency is improved. Through reasonable sampling rule, it is ensured that the extracted feature vectors still contain key information and do not lose important features.

[0125] In practical application of the embodiment, the S11-3 specifically includes:

[0126] S11-3-1, using a clustering algorithm to divide the feature vectors in the second feature vector set into M data clusters;

[0127] S11-3-2, randomly selecting F feature vectors in each data cluster respectively, and merging all the selected feature vectors into a modeling data set;

[0128] F is the number of feature vectors in the smallest data cluster of the M data clusters.

[0129] In the embodiment, the second feature vector set is divided into M data clusters by the clustering algorithm, which can ensure that the similarity between different categories or features is captured. F feature vectors are randomly selected, and F is determined based on the number of feature vectors in the smallest data cluster, which can ensure that an unbalanced modeling data set is not caused by a data cluster being too large or too small. This approach can avoid too many or too few of a certain type of feature in the data set, thereby improving the training effect of the subsequent model, especially when dealing with unbalanced categories.

[0130] Randomly selecting feature vectors can prevent the model from relying on certain specific samples or features, thereby reducing the risk of overfitting. This randomization approach allows the model to better generalize when learning. Preprocessing the feature vector set using a clustering algorithm and dividing it into smaller data clusters can reduce computational complexity. Randomly selecting F feature vectors in each cluster helps reduce the amount of data needed for modeling, further improving computational efficiency. Selecting different feature vectors in each data cluster introduces diversity, which helps the model learn data from multiple perspectives and improves the robustness of the model.

[0131] In the embodiment, the smallest number F in each cluster is selected as the number of selected feature vectors, which helps to avoid the influence of too many features in a large cluster. Through this strategy, the training of the model is not biased towards clusters with more samples, and at the same time, it ensures that each cluster has a relatively fair weight in the modeling data set. This adaptive feature selection method can flexibly handle the imbalance problem between different data clusters without introducing human intervention, thereby improving the intelligent level of data processing. The combination of clustering algorithm and random selection reflects the innovation of meticulous division and selection of data features. Clustering helps to understand the internal structure of the data, while random selection avoids the model's excessive dependence on a certain type of sample to some extent, thereby improving the generalization ability of the model. In summary, the embodiment adaptively selects the number of feature vectors in each data cluster based on the size of the smallest cluster, and combines the clustering and random selection strategies, thereby effectively handling the imbalance problem of the data and improving the diversity and efficiency of the modeling data set.

[0132] wherein the first machine learning model is:

[0133]

[0134] wherein, is the opening adjustment value predicted by the first machine learning model after inputting the feature vector X i to the first machine learning model;

[0135] β0, β1, β2, β3, β4, β5, β6, β7, β8, and β9 are regression coefficients of the first machine learning model.

[0136] wherein the regression coefficients in the first machine learning model are determined by optimizing the value of the specified fitness function using an optimization algorithm.

[0137] The optimization algorithm is a gradient descent algorithm.

[0138] In this embodiment, the opening adjustment value can be accurately predicted by linearly combining multiple feature variables and their corresponding regression coefficients. Each regression coefficient represents the degree of influence of the corresponding feature variable on the predicted value, thereby ensuring that the model can accurately capture the relationships between various feature variables.

[0139] By optimizing the fitness function using the gradient descent algorithm, the combination of parameters that minimizes the model prediction error can be effectively found. The gradient descent algorithm can quickly converge to the optimal solution, thereby improving the prediction performance and stability of the model. By selecting feature variables reasonably and determining regression coefficients through the optimization algorithm, the problem of overfitting can be effectively avoided, and the generalization ability of the model can be improved. By optimizing the model parameters using the gradient descent algorithm, the complexity and prediction accuracy of the model can be balanced, and the overfitting phenomenon caused by overly complex models can be avoided.

[0140] The fitness function in the first machine learning model is MSE.

[0141]

[0142] wherein, is the opening adjustment value predicted by the first machine learning model after inputting the hth feature vector in the modeling data set to the first machine learning model;

[0143] Y h is the actual opening adjustment value of the flow control valve corresponding to the hth feature vector in the modeling data set; H = F x M.

[0144] In this embodiment, MSE is used as the optimization target to ensure that the model can minimize the prediction error and improve the accuracy of the prediction. This is applied to the prediction of the opening adjustment value of the flow control valve, which reflects the targeted optimization for specific application scenarios. After inputting each feature vector in the modeling data set into the first machine learning model, the predicted opening adjustment value is obtained. By comparing it with the actual opening adjustment value of the flow control valve, the prediction performance of the model can be evaluated. H=F x M represents the size of the data set, which facilitates the processing of large-scale data sets and ensures the stability and reliability of the model on a large amount of data.

[0145] In the process of training the first machine learning model using the gradient learning algorithm, the learning rate of the tth iteration is calculated by formula (1);

[0146] The formula (1) is:

[0147]

[0148] σ t is the learning rate at the tth iteration; σ0 is the initial learning rate set in advance;

[0149] γ is the learning rate decay coefficient set in advance, and γ>0; t is the iteration number; δ is the fluctuation coefficient set in advance; α is the fluctuation intensity set in advance.

[0150] In this embodiment, the formula dynamically adjusts the learning rate σ t so that the learning rate gradually decreases during the training process. This adaptive learning rate helps the model converge quickly in the early stage of training and fine-tune the parameters in the later stage. The periodic fluctuation term δ·sin(αt) in the learning rate can prevent the learning rate from becoming too small too soon, which helps the model jump out of the local optimal solution and improve the global optimization ability. By introducing the decay coefficient γ, the learning rate is ensured not to increase indefinitely, thus maintaining the stability of the training process.

[0151] In this embodiment, the S2 specifically includes:

[0152] The modeling data set is input into the second machine learning model set in advance, and the Adam optimization algorithm is used to train the second machine learning model. The parameters in the second machine learning model are adjusted to minimize the loss function of the second machine learning model, thereby obtaining the trained second machine learning model; wherein the loss function is: mean square error loss function;

[0153] The second machine learning model is a convolutional neural network model.

[0154] In this embodiment, the convolutional neural network, Adam optimization algorithm and mean square error loss function are reasonably applied, thereby improving the training efficiency and accuracy of the model.

[0155] In practical applications, the S4 specifically includes:

[0156] S41, inputting the real-time hydrological data into a pre-trained first machine learning model to obtain a first opening adjustment value;

[0157] inputting the real-time hydrological data into a pre-trained second machine learning model to obtain a second opening adjustment value;

[0158] S42, based on the first opening adjustment value and the second opening adjustment value, obtaining a final opening adjustment value of the flow control valve for controlling the downstream flow.

[0159] In this embodiment, two different machine learning models (first and second models) are used to calculate the opening adjustment value, which can improve the accuracy and robustness of the model. Different models may capture different patterns or features in the data, providing more comprehensive prediction results. This method avoids the bias or error that may be produced by a single model, and by fusing the outputs of multiple models, it helps to improve the credibility of the prediction results.

[0160] In this embodiment, the opening of the flow control valve is adjusted by inputting real-time hydrological data into the model, which can respond to hydrological changes in real time, achieve dynamic control, and ensure that the downstream flow always remains within the expected range. Through this real-time feedback mechanism, the system can effectively respond to environmental changes, enhancing the adaptability and flexibility of the system. By combining the opening adjustment values of multiple models, the opening of the valve can be finely adjusted. This method avoids the simple rule setting or excessive reliance on a single model, making the valve adjustment more accurate and helping to better control the downstream flow. This fine control can improve the stability and efficiency of the hydrological scheduling system, especially when facing complex or dynamic hydrological conditions, it can achieve more accurate flow management.

[0161] Since the model is pre-trained, the system can automatically adjust and optimize based on historical data, reducing the need for human intervention. This enhances the adaptability and automation level of the entire system.

[0162] Combining the outputs of the first and second machine learning models as the final adjustment value of the valve opening, this method embodies the innovation of multi-model integration. By integrating the prediction results of different models, it can reduce the errors that may exist in a single model, enhancing the robustness and accuracy of the prediction. This integration strategy has been widely used in many complex decision-making problems, especially in complex and dynamic environments.

[0163] The use of machine learning models to predict and adjust the opening of flow control valves represents an innovative application of modern intelligent control technology in hydrological regulation. Compared to traditional rule-based control systems, the machine learning-based approach can more flexibly adapt to different environmental changes, enabling more precise and efficient flow management. Using real-time hydrological data to dynamically adjust the opening of control valves is an innovative approach to control optimization based on actual data. Through this method, adjustments can be made in real time based on changes in hydrological data, ensuring the response speed and accuracy of the system, and avoiding the limitations of static rules. On the basis of multiple models, the outputs of different models are fused to obtain the final result, realizing cross-model collaborative optimization. This method embodies the innovation of machine learning in modeling and optimizing data in different dimensions, especially in dealing with problems with uncertainty and complexity, which can improve overall performance.

[0164] The S42 specifically includes:

[0165] Based on the first opening adjustment value and the second opening adjustment value, the final opening adjustment value of the flow control valve for controlling the downstream flow is obtained using formula (2);

[0166] wherein the formula (2) is:

[0167] A f = ω1A1 + ω2A2;

[0168] A1 is the first opening adjustment value; A2 is the second opening adjustment value;

[0169] A f is the final opening adjustment value; ω1 and ω2 are both weight coefficients, and satisfy ω1 + ω2 = 1.

[0170] In this embodiment, formula (2) linearly combines two opening adjustment values A1 and A2, and uses weight coefficients ω1 and ω2 to comprehensively consider opening adjustment values from multiple sources by assigning different weights, thereby obtaining a more reasonable final adjustment value. The weight coefficients ω1 and ω2 can be adjusted according to specific application scenarios, making the model highly flexible. By adjusting the weight coefficients, the influence of opening adjustment values from different sources on the final result can be balanced, thereby adapting to different control requirements.

[0171] Embodiment Two

[0172] The water conservancy project flow regulation method based on machine learning model provides a method for water conservancy project flow regulation, which analyzes historical and real-time hydrological data through machine learning models to optimize the opening adjustment value of the flow control valve. The specific steps are as follows:

[0173] Step 100: Constructing a modeling dataset and training a first machine learning model, comprising:

[0174] Step 100-1: Collecting historical hydrological data:

[0175] Collecting N pieces of hydrological data (N > 1000) collected at preset time intervals at different time points within a historical time period. These data include but are not limited to downstream flow, downstream target flow, rainfall, river slope, environmental temperature, upstream and downstream pressures of the flow control valve, etc.

[0176] Step 100-2: Generating a feature vector:

[0177] For each piece of hydrological data, a corresponding feature vector is extracted. For example, for the i-th piece of hydrological data, the feature vector includes downstream flow, downstream target flow, actual opening adjustment value of the flow control valve and its previous time adjustment value, rainfall, environmental temperature, upstream and downstream pressures of the flow control valve, etc.

[0178] Specifically, X i = [Δ i , E i , Δ lag (Q i ), Δ lag (V i ), A i , B i , ΔT i , P i1 , P i2 ];

[0179] Wherein, X i is the feature vector corresponding to the i-th piece of hydrological data in the initial data set;

[0180] Δ i = Q i -T i ; Q i is the downstream flow in the i-th piece of hydrological data in the initial data set; T i is the downstream target flow in the i-th piece of hydrological data in the initial data set;

[0181]

[0182] Δ lag (Q i ) = Q i -Q i-1 ; Δ lag (V i ) = V i -V i-1 ;

[0183] Vi is the actual opening adjustment value of the flow control valve corresponding to the i-th hydrological data in the initial data set; V i-1 is the actual opening adjustment value of the flow control valve corresponding to the i-1-th hydrological data in the initial data set; A i is the rainfall corresponding to the i-th hydrological data in the initial data set; B i is the ambient temperature corresponding to the i-th hydrological data in the initial data set;

[0184]

[0185] T i-1 is the downstream target flow in the i-1-th hydrological data in the initial data set; P i1 is the upstream pressure of the flow control valve in the i-th hydrological data in the initial data set; P i2 is the downstream pressure of the flow control valve in the i-th hydrological data in the initial data set; P (i-1)1 is the upstream pressure of the flow control valve in the i-1-th hydrological data in the initial data set; P (i-1)2 is the downstream pressure of the flow control valve in the i-1-th hydrological data in the initial data set; p is the density of the fluid; C d is the flow coefficient;

[0186] Step 100-3: All feature vectors are grouped into a first feature vector set.

[0187] Step 100-4: Feature vectors in the first feature vector set whose |AV lag (V i )-AT i | are greater than a pre-set threshold value are removed to form a second feature vector set.

[0188] Step 100-5: The second feature vector set is divided into M data clusters using a clustering algorithm (such as K-means), and F feature vectors (F is the number of feature vectors in the smallest data cluster) are randomly selected in each data cluster to construct a final modeling data set.

[0189] Step 100-6: The first machine learning model (such as a linear regression model) is trained using the modeling data set. During the training process, a gradient descent algorithm is used to optimize the fitness function (such as mean square error MSE) to determine the optimal regression coefficient. Finally, a first machine learning model that can predict the opening adjustment value of the flow control valve is obtained.

[0190] Step 200: The second machine learning model is trained, specifically including:

[0191] A second preset machine learning model (e.g., a convolutional neural network, CNN) is trained using the same modeling dataset. During the training process, an Adam optimization algorithm is used to minimize a loss function (e.g., mean squared error) to obtain a second machine learning model that can further improve the prediction accuracy.

[0192] Step 300: During actual operation, real-time hydrological data in the water conservancy project are continuously collected, which also include downstream flow, downstream target flow, rainfall, environmental temperature, and upstream and downstream pressures of the flow control valve.

[0193] Step 400: Calculate the final opening adjustment value, specifically including:

[0194] Step 400-1: Input the real-time hydrological data into the trained first and second machine learning models to obtain the first opening adjustment value A1 and the second opening adjustment value A2.

[0195] Step 400-2: Calculate the final opening adjustment value A according to formula (2) f where the weight coefficients ω1 and ω2 satisfy ω1 + ω2 = 1. The selection of the weight coefficients can be adjusted according to specific circumstances, for example, if the historical performance of a certain model is better, a higher weight can be given.

[0196] Step 400-3: Apply the calculated final opening adjustment value to the flow control valve to effectively control the downstream flow.

[0197] The embodiment also provides a water conservancy project flow regulation system based on a machine learning model, including: at least one processor; and at least one memory in communication connection with the processor, wherein the memory stores program instructions executable by the processor, and the processor invoking the program instructions can execute a water conservancy project flow regulation method based on a machine learning model as described in the above embodiment, and the processor is also connected with a mechanical execution unit for controlling the flow control valve. In this embodiment, the final opening adjustment value calculated by the processor is used as an instruction to control the mechanical execution unit of the flow control valve to adjust to the corresponding opening.

[0198] The specific steps include: transmitting the opening adjustment value to the execution unit of the flow control valve. The execution unit adjusts the actual opening of the valve to ensure consistency with the calculated value.

[0199] Additionally, the embodiment also includes real-time monitoring of downstream flow, pressure, and other related parameters after valve adjustment to ensure that the adjusted valve opening effectively achieves the desired flow control effect. Through the installation of sensors or flow meters and other monitoring devices, relevant flow and pressure data are collected. If there is a difference between the actual flow and the target flow, further adjustment of the valve opening value may be needed.

[0200] The embodiment provides a complete machine learning model-based water conservancy project flow regulation method. By combining historical and real-time hydrological data analysis, two trained machine learning models are used to predict and adjust the opening of the flow control valve, achieving the purpose of optimizing water conservancy project flow management. This method not only improves the accuracy of flow regulation, but also enhances the automation level of the system, suitable for various types of water conservancy project scenarios.

[0201] The machine learning model-based water conservancy project flow regulation method in the embodiment has many beneficial effects, which are embodied in the following aspects:

[0202] By using historical hydrological data to train two different machine learning models (the first is a regression analysis model, and the second is a convolutional neural network), and combining real-time hydrological data for prediction, the prediction accuracy of the flow control valve opening adjustment value can be significantly improved. This helps to more accurately manage the water flow in water conservancy projects.

[0203] The method described in the method realizes the full-process automation from data collection, feature extraction, model training to final opening adjustment value calculation, reduces the need for manual intervention, improves operational efficiency, and reduces the possibility of human error.

[0204] Accurate flow regulation can better meet the needs of different users (such as agricultural irrigation, urban water supply, etc.), while reducing water resource waste, thereby achieving more efficient resource allocation and utilization. By considering factors such as environmental temperature and rainfall, the method can help maintain the healthy and stable development of river ecosystems, ensuring sufficient natural flow to support biodiversity protection.

[0205] Real-time data analysis and rapid adjustment capabilities enable the system to respond quickly in the face of sudden situations (such as flood warnings) and take timely measures to mitigate potential risks.

[0206] Automated and intelligent management reduces the dependence on human and material resources, which helps to reduce the operating and maintenance costs of water conservancy projects in the long run.

[0207] The method in this embodiment proposes a comprehensive data processing procedure including feature vector generation, outlier removal, clustering and sampling, to construct a high-quality modeling dataset, which is the basis for ensuring the effectiveness of subsequent machine learning models.

[0208] Two different types of machine learning models (linear regression model and convolutional neural network) are introduced, and the results of the two models are fused through a specific weight formula to form the final opening adjustment suggestion. This design of dual-model cooperation enhances the robustness and adaptability of the system. In the process of training the first machine learning model, a method of dynamically adjusting the learning rate is adopted, which adaptively changes the learning rate according to the number of iterations, so as to speed up the convergence speed and avoid overfitting problem. The successful application of machine learning technology in the field of water conservancy engineering, especially for the specific task of flow regulation, not only demonstrates the universality of the technology, but also provides reference and reference for other similar application scenarios. In summary, the method provided by the embodiment not only brings significant benefits in practical application, but also makes important contributions in technical innovation, providing new ideas and technical means for solving complex water conservancy projects.

[0209] In the description of the present application, it should be understood that the terms "first", "second" are only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise specifically limited.

[0210] In the present application, unless otherwise specifically defined and limited, the terms "mounting", "connection", "connection", "fixing" and the like should be understood in a broad sense, for example, it can be fixed connection, or detachable connection, or integral; it can be mechanical connection, or electrical connection; it can be directly connected, or indirectly connected through intermediate medium; it can be the internal communication of two elements or the interaction relationship between two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0211] In the present application, unless otherwise explicitly specified and limited, a first feature is "on" or "under" a second feature can mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature is "over", "above" and "on top of" a second feature can mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is horizontally higher than the second feature. A first feature is "under", "below" and "underneath" a second feature can mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is horizontally lower than the second feature.

[0212] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "an embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are contained in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples, without contradiction.

[0213] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and the person skilled in the art can make changes, modifications, replacements and variations to the above-described embodiments within the scope of the present application.

Claims

1. A method for flow regulation in water conservancy projects based on a machine learning model, characterized in that, include: S1. Generate a modeling dataset from historical hydrological data according to the construction rules, and train the preset first machine learning model through the optimization algorithm to obtain the trained first machine learning model. The hydrological data includes: downstream flow, downstream target flow, and the first hydrological variable; The first hydrological variables include: rainfall, river gradient, ambient temperature, and upstream and downstream pressures of the flow control valve; S2. Based on the modeling dataset, train the pre-defined second machine learning model to obtain the trained second machine learning model; S3. Obtain real-time hydrological data during the operation of water conservancy projects; S4. Based on the real-time hydrological data, the trained first machine learning model, and the trained second machine learning model, obtain the final opening adjustment value of the flow control valve used to control the downstream flow.

2. The water conservancy engineering flow regulation method based on a machine learning model according to claim 1, characterized in that, S1 specifically includes: S11. Using the historical hydrological data as the initial dataset, and based on the initial dataset, generating a modeling dataset using the set construction rules; The historical hydrological data includes: hydrological data collected at N different time points within a historical period according to a pre-set collection time interval; N is greater than 1000; S12. Based on the modeling dataset and the pre-defined fitness function, train the pre-defined first machine learning model to obtain the trained first machine learning model. S13. Based on the modeling dataset, train the pre-defined second machine learning model to obtain the trained second machine learning model.

3. The water conservancy engineering flow regulation method based on a machine learning model according to claim 2, characterized in that, S11 includes: S11-1. For each hydrological data point in the initial dataset, obtain the feature vector corresponding to each hydrological data point, and combine all the feature vectors into the first feature vector set. X i =[Δ i ,E i ,Δ lag (Q i ),Δ lag (V i ),A i ,B i ,ΔT i ,P i1 ,P i2 ]; Among them, X i This is the feature vector corresponding to the i-th hydrological data point in the initial dataset; Δ i =Q i -T i ; Q i The downstream flow rate is the value of the i-th hydrological data point in the initial dataset. T i The downstream target flow rate is the value of the i-th hydrological data point in the initial dataset. Δ lag (Q i )=Q i -Q i-1 ; Δ lag (V i )=V i -V i-1 ; V i This represents the actual opening adjustment value of the flow control valve corresponding to the i-th hydrological data point in the initial dataset. V i-1 This represents the actual opening adjustment value of the flow control valve corresponding to the (i-1)th hydrological data point in the initial dataset. A i This represents the rainfall corresponding to the i-th hydrological data point in the initial dataset. B i The ambient temperature corresponding to the i-th hydrological data point in the initial dataset; T i-1 The downstream target flow rate is the value of the (i-1)th hydrological data point in the initial dataset. P i1 Let the upstream pressure of the flow control valve be the value in the i-th hydrological data point in the initial dataset. P i2 Let the downstream pressure of the flow control valve be the value in the i-th hydrological data point in the initial dataset. P (i-1)1 The upstream pressure of the flow control valve in the (i-1)th hydrological data point in the initial dataset; P (i-1)2 The downstream pressure of the flow control valve in the (i-1)th hydrological data point in the initial dataset; ρ is the density of the fluid; C d For flow coefficient; S11-2. Eliminate the feature vectors that satisfy the first condition from the first feature vector set to obtain the second feature vector set; The first condition is |Δ in the eigenvector. lag (V i )-ΔT i The value is greater than a pre-set first threshold; S11-3. Extract a portion of the feature vectors from the second feature vector set according to the set sampling rules to form a modeling dataset.

4. The water conservancy engineering flow regulation method based on a machine learning model according to claim 3, characterized in that, S11-3 specifically includes: S11-3-1. Use a clustering algorithm to divide the feature vectors in the second feature vector set into M data clusters; S11-3-2. Randomly select F feature vectors from each data cluster and combine all the selected feature vectors into a modeling dataset. F represents the number of feature vectors in the smallest of the M data clusters.

5. The water conservancy engineering flow regulation method based on a machine learning model according to claim 4, characterized in that, in, The first machine learning model is: in, It is to model the feature vector X in the dataset. i The opening adjustment value predicted by the first machine learning model after being input into the first machine learning model; β0, β1, β2, β3, β4, β5, β6, β7, β8, and β9 are all regression coefficients of the first machine learning model; The regression coefficients in the first machine learning model are determined by optimizing the value of a specified fitness function using an optimization algorithm. The optimization algorithm is: gradient learning algorithm.

6. The water conservancy engineering flow regulation method based on a machine learning model according to claim 5, characterized in that, The fitness function in the first machine learning model is MSE; in, This refers to the opening adjustment value predicted by the first machine learning model after the h-th feature vector in the modeling dataset is input into the first machine learning model; Y h It is the actual opening adjustment value of the flow control valve corresponding to the h-th feature vector in the modeling dataset; H = F × M.

7. The water conservancy engineering flow regulation method based on a machine learning model according to claim 6, characterized in that, During the training of the first machine learning model using the gradient learning algorithm, the learning rate of the t-th iteration is calculated using formula (1); The formula (1) is: σ t Let be the learning rate at the t-th iteration; σ0 is the preset initial learning rate; γ is a pre-set learning rate decay coefficient, and γ > 0; t is the number of iterations; δ is a pre-set fluctuation coefficient; α is the pre-set wave intensity.

8. The water conservancy engineering flow regulation method based on a machine learning model according to claim 7, characterized in that, S2 specifically includes: The modeling dataset is input into a pre-defined second machine learning model. The second machine learning model is trained using the Adam optimization algorithm. The parameters in the second machine learning model are adjusted to minimize the loss function of the second machine learning model, thereby obtaining the trained second machine learning model. The loss function is: mean squared error loss function; The second machine learning model is a convolutional neural network model.

9. The water conservancy engineering flow regulation method based on a machine learning model according to claim 8, characterized in that, S4 specifically includes: S41. Input the real-time hydrological data into a pre-trained first machine learning model to obtain a first opening adjustment value; The real-time hydrological data is input into a pre-trained second machine learning model to obtain a second opening adjustment value; S42. Based on the first opening adjustment value and the second opening adjustment value, obtain the final opening adjustment value of the flow control valve used to control the downstream flow.

10. The water conservancy engineering flow regulation method based on a machine learning model according to claim 9, characterized in that, S42 specifically includes: Based on the first opening adjustment value and the second opening adjustment value, the final opening adjustment value of the flow control valve used to control the downstream flow is obtained by formula (2); Formula (2) is as follows: A f =ω1A1+ω2A2; A1 is the first opening adjustment value; A2 is the second opening adjustment value; A f This is the final opening adjustment value; ω1 and ω2 are both weighting coefficients, and satisfy ω1+ω2=1.