Channel pi controller parameter prediction method and device based on model fine-tuning transfer learning
By employing a model-based fine-tuning transfer learning approach, utilizing particle swarm optimization and neural network models, and combining measured and simulated data, an inverted pyramid-structured prediction model was constructed. This approach solved the nonlinear and time-varying characteristics issues in channel PI controller parameter tuning, achieving high-precision channel PI control parameter prediction and improving channel control performance and operational stability.
Patent Information
- Application Number
- CN202610582793.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-29
- Publication Date
- 2026-07-10
AI Technical Summary
Existing methods for tuning PI controller parameters in canals rely on linear simplification models and technical experience, which are difficult to describe the complex nonlinear and time-varying characteristics of canal systems. Intelligent tuning is computationally expensive and lacks generalization ability, failing to meet the control requirements of variable water intake conditions.
A model-based fine-tuning transfer learning approach is adopted, which utilizes prior knowledge of existing channel PI controller parameters and constructs an inverted pyramid structure prediction model through particle swarm optimization algorithm and neural network model. The model is then trained and fine-tuned using measured and simulation data to predict the PI control parameters of the target channel.
It achieves high-precision PI control parameter prediction under multiple water intake conditions, improves channel control performance, avoids system oscillation, shortens the channel system stabilization time, and ensures the safe and stable operation of the water conveyance system.
Smart Images

Figure CN122363174A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of water conservancy and machine learning, specifically relating to a method and device for predicting channel PI controller parameters based on model fine-tuning transfer learning. Background Technology
[0002] Currently, for water diversion projects, automated control of water conveyance channels can significantly reduce manpower input and operational losses, and improve water resource utilization efficiency. The main automated control methods for water conveyance channels currently employed are: PID-based control algorithms based on feedback control, such as P, PI, and PID; and modern control algorithms based on state space, such as LQR and MPC. The PID control algorithm consists of the linear addition of the proportional (P), integral (I), and derivative (D) terms of the system deviation. In practical engineering, considering the applicability and operability of the control algorithm, the PI control algorithm, which discards the derivative term (D), is currently primarily used in the automated control of water conveyance channels. The core performance of the PI control algorithm depends on the settings of two parameters: proportional gain (Kp) and integral time (Ti). Improper parameter settings can cause system oscillations, instability, decreased channel water supply stability, and even system instability, leading to risks such as water level overflow.
[0003] Currently, methods for tuning PI controller parameters are mainly divided into two categories: conventional parameter tuning and intelligent parameter tuning. Conventional parameter tuning mainly includes classic methods such as the ZN tuning method and empirical trial-and-error methods. Intelligent parameter tuning mainly includes methods based on genetic algorithms, particle swarm optimization algorithms, and distributed gradient methods. However, both of these categories of tuning methods have obvious limitations: conventional parameter tuning relies too heavily on the linear simplification model of the controlled object and the experience of technicians, making it difficult to describe the complex nonlinear and time-varying characteristics of canal systems; intelligent parameter tuning can solve nonlinear problems, but it is computationally expensive, and the tuned parameters are only applicable to a single operating condition, failing to meet the diverse water intake conditions in actual engineering projects and lacking generalization ability.
[0004] In summary, given the large number of water diversion projects, the diverse types of canals and pools, and the varied water intake demands of water users, a pressing technical problem that needs to be addressed by those skilled in the art is to propose a channel PI controller parameter prediction model based on transfer learning. This model needs to solve the following problems: 1) At the model level, it should be able to utilize a large amount of existing prior knowledge of channel PI controller parameters, transferring this prior knowledge to the target project channel to complete the parameter prediction of the target project channel PI controller; 2) At the control level, it should be able to be applied to the prediction of PI controller parameters under multiple water intake conditions in the target project channel, and the predicted controller parameters should achieve good channel control performance; 3) The prediction model should have a simple structure, few parameters, and input data that is existing measured data from the project, thus facilitating practical application. Summary of the Invention
[0005] To address the shortcomings of existing PI controller parameter tuning methods for water channels, this application proposes a transfer learning-based PI control parameter prediction model that utilizes prior knowledge of existing PI controller parameters. This prediction model is built upon a neural network model and fully leverages prior knowledge of existing PI controller parameters, considering multiple water channel examples and varying water intake conditions. This enables high-precision prediction of PI control parameters for the target channel under multiple water intake conditions, thereby improving control performance during water channel operation and scheduling.
[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution.
[0007] Firstly, a method for predicting channel PI controller parameters based on model fine-tuning transfer learning is provided, including: Prior knowledge of channel PI control parameters is obtained to obtain a first dataset; the dataset includes channel parameters as features and PI controller parameters as labels. Construct a first prediction model, train the first prediction model using the first dataset, and obtain a second prediction model; Collect measured data of PI controller parameters from the target channel, and use transfer learning to tune the parameters of the second prediction model to obtain the third prediction model; Based on the third prediction model, the channel PI controller parameters for different operating conditions of the target channel are predicted.
[0008] In one possible implementation, the source of the first dataset includes both measured data and simulation data.
[0009] In one possible implementation, the method for obtaining the simulation data includes: Set up channels with different characteristic parameters; By using the particle swarm optimization algorithm and combining the simulation results of the simulation model, the optimal PI controller parameters under a certain characteristic parameter are found. The simulation data is obtained by combining the features and labels under all feature parameters.
[0010] In one possible implementation, the features include channel hydraulic parameters, channel geometric parameters, and operating parameters; wherein the channel hydraulic parameters include roughness and gradient, the channel geometric parameters include bottom width, bottom slope, and length, and the operating parameters include channel operating flow rate, water intake flow rate, and water intake variation time. The label includes the PI controller parameter K. p and T i .
[0011] In one possible implementation, the first prediction model includes an input layer, a hidden layer, and an output layer; the hidden layer has an inverted pyramid structure, an activation function of ReLU, and a loss function of MSE.
[0012] In one possible implementation, the measured data of the PI controller parameters of the target channel are collected, and the second prediction model is tuned using a transfer learning method to obtain a third prediction model, including: Collect measured data of PI controller parameters for the target channel; The contribution of the hidden layer in the second prediction model was calculated using measured data. Fine-tune the hidden layer based on its contribution. The second prediction model, which has been finely tuned, is used as the third prediction model.
[0013] Secondly, a channel PI controller parameter prediction device based on model fine-tuning transfer learning is provided, comprising: The acquisition module is used to acquire prior knowledge of the channel PI control parameters to obtain the first dataset; the dataset includes channel parameters as features and PI controller parameters as labels. The building module is used to build the first prediction model, and train the first prediction model using the first dataset to obtain the second prediction model; The transfer module is used to collect measured data of PI controller parameters from the target channel, and use transfer learning to tune the parameters of the second prediction model to obtain the third prediction model. The prediction module is used to predict the channel PI controller parameters under different operating conditions of the target channel based on the third prediction model.
[0014] Thirdly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the channel PI controller parameter prediction method based on model fine-tuning transfer learning as described in the first aspect.
[0015] Fourthly, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the channel PI controller parameter prediction method based on model fine-tuning transfer learning as described in the first aspect.
[0016] Fifthly, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the channel PI controller parameter prediction method based on model fine-tuning transfer learning as described in the first aspect.
[0017] The beneficial effects of this application are as follows: (1) The prediction model provided by the method of this application is based on a neural network model, which is of great significance for improving the water transmission and distribution efficiency of water diversion projects and ensuring the safe operation of the projects.
[0018] (2) The prediction model established by the method of this application can make full use of the prior knowledge of the existing channel PI controller parameter tuning, which is conducive to improving the tuning efficiency of the target channel pool / new engineering channel pool PI controller parameter and quickly predicting a better controller parameter.
[0019] (3) The prediction model established by the method of this application has a simple structure, fewer parameters, and is easy to calculate. It can be directly used for tuning the parameters of the channel PI controller. The predicted parameters have a good control effect, such as avoiding system oscillation and shortening the stability time of the channel system. This is conducive to improving the operation and management level of water diversion projects and improving the efficiency of water resource utilization. Attached Figure Description
[0020] Figure 1 A flowchart illustrating the channel PI controller parameter prediction method based on model fine-tuning transfer learning provided in this application embodiment; Figure 2 A schematic diagram of a PI controller provided in an embodiment of this application; Figure 3 A schematic diagram illustrating the principle of the water conveyance channel system operation simulation and control platform provided in the embodiments of this application; Figure 4 This is a schematic diagram of the particle swarm optimization algorithm provided in an embodiment of this application; Figure 5 This is a schematic diagram of a coupled simulation system for particle swarm optimization algorithm provided in an embodiment of this application; Figure 6 A schematic diagram of the structure of the first prediction model provided in the embodiments of this application; Figure 7 This is a schematic diagram of PSO operating condition settings provided in the embodiments of this application; Figure 8 The result diagram of the neural network prediction model based on prior knowledge provided in the embodiments of this application is shown.
[0021] Figure 9 Four transfer learning fine-tuning strategies are provided for embodiments of this application; Figure 10 The result diagram of the target channel PI control parameter prediction model provided in the embodiments of this application; Figure 11 The control performance result diagram provided in the embodiments of this application; wherein, Figure 11 (a) shows the flow control performance results for operating condition 1. Figure 11 (b) shows the water level control performance results for operating condition 1. Figure 11(c) shows the flow control performance results for operating condition 2. Figure 11 (d) shows the water level control performance results for operating condition 2; Figure 12 A schematic diagram of the structure of the channel PI controller parameter prediction device based on model fine-tuning transfer learning provided in the embodiments of this application; Figure 13 This is a schematic diagram of the electronic device structure provided in an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0024] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "set up," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this technology based on the specific circumstances.
[0025] In the description of this application, spatial relation terms such as "below," "under," "below," "below," "above," "over," etc., are used herein to describe the relationship between one element or feature shown in the figures and other elements or features. It should be understood that, in addition to the orientation shown in the figures, spatial relation terms also include different orientations of the device in use and operation. For example, if the device in the figures is flipped, an element or feature described as "below" or "under" or "below" of other elements or features will be oriented "above" other elements or features. Therefore, the exemplary terms "below" and "under" can include both upper and lower orientations. Furthermore, the device may also include other orientations (e.g., rotated 90 degrees or other orientations), and the spatial descriptive terms used herein are interpreted accordingly.
[0026] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid unnecessarily obscuring the description of this application. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0027] Currently, existing methods for tuning PI controller parameters have obvious limitations: conventional parameter tuning relies too much on the linear simplification model of the controlled object and the experience of technicians, making it difficult to describe the complex nonlinear and time-varying characteristics of the canal system; intelligent parameter tuning can solve nonlinear problems, but the computational cost is high, the tuned parameters are only applicable to a single operating condition, and cannot meet the changing water intake conditions in actual engineering, lacking generalization ability.
[0028] In view of this, this application provides a method and apparatus for predicting channel PI controller parameters based on model fine-tuning transfer learning.
[0029] See Figure 1 The channel PI controller parameter prediction method based on model fine-tuning transfer learning provided in this application includes: S101. Obtain prior knowledge of the channel PI control parameters to obtain the first dataset; the dataset includes channel parameters as features and PI controller parameters as labels.
[0030] In one possible implementation, the source of the first dataset includes both measured data and simulation data.
[0031] Furthermore, the method for obtaining the simulation data includes: (1) Set up channels with different characteristic parameters; (2) Using the particle swarm optimization algorithm and the simulation results of the simulation model, find the optimal PI controller parameters under a certain characteristic parameter; (3) Find the union of features and labels under all feature parameters to obtain simulation data.
[0032] In one possible implementation, the features include channel hydraulic parameters, channel geometric parameters, and operating parameters; wherein the channel hydraulic parameters include roughness and gradient, the channel geometric parameters include bottom width, bottom slope, and length, and the operating parameters include channel operating flow rate, water intake flow rate, and water intake variation time. The label includes the PI controller parameter K. p and T i .
[0033] Understandably, given the difficulty in obtaining channel PI control parameters in reality, using a mix of measured and simulated data can significantly increase the size of the dataset, thereby improving the accuracy of subsequent training.
[0034] The following section will introduce the relevant principles of the PI controller.
[0035] See Figure 2 This is a schematic diagram of a PI controller. Figure 2 It can be seen that the deviation e(t) between the expected given value r(t) and the actual output value u(t) is proportional to K. p And integral T i The amplification is applied to the controlled object, and the final amplified value obtained by summing the two terms is used as the output value c(t) of the PI controller.
[0036] The PI controller calculation formula is shown below:
[0037] In the formula, K p T represents the proportional gain. i The integral time constant is represented by t, which represents a continuous time variable. e(t) This is the deviation value; r(t) The target value; c(t) This refers to the water level value. u(t) This is the output value.
[0038] Specifically, in this embodiment, the open channel hydraulic simulation system developed by the School of Hydraulic and Hydropower Engineering of Wuhan University, "Simulation and Control of Water Conveyance Channel System Operation (SCCS) Software", is used to replace the real physical field. The particle swarm optimization algorithm is coupled to optimize the channel PI control parameters, obtain a large number of channel PI control parameters, and build prior knowledge for solving the target channel PI control parameters.
[0039] The simulation platform used in this embodiment is the "Simulation and Control Platform for Water Conveyance Channel System Operation" (Wang Changde, *Simulation and Control Software for Water Conveyance Channel System Operation*, China, 2011SR034392[P].2011-0301), based on the MATLAB programming language. Its main function is to simulate various operating conditions that a real, automatically controlled channel might encounter, including constant flow and unsteady flow states. It outputs data such as water level, flow rate, and gate opening changes under feedforward and feedback regulation of the simulated channel under various operating conditions. The main working principle is as follows: Figure 3 First, the physical parameters of the channel and the water intake plan are set in the program package according to the actual working conditions. Then, the main program is entered. First, the constant flow calculation is performed, and then the unsteady flow calculation is performed. During this process, a feedforward controller and a feedback controller are introduced to adjust the gate opening so that the system can operate smoothly.
[0040] It should be noted that the multi-channel pool channel simulation model is merely one carrier for the technical solution implemented in this application. The embodiments of this application are not limited to the specific form of the simulation model. Any simulation model with basic channel pool parameters can be used in this application.
[0041] The calculation formula for the particle swarm optimization algorithm is shown below: Speed update formula:
[0042] Position update formula:
[0043] In the formula: K = 1, 2, 3, ..., M; N=1,2,3,...,n; M Population size; N is the parameter dimension; , For learning factors; , A random number between [0,1]; Inertial weights; For the i-th iteration, the optimal solution for the k-th particle; For the i-th iteration, the optimal solution for the entire population is given. The position of the k-th particle in the i-th iteration; Let be the velocity of the k-th particle in the i-th iteration.
[0044] The simulation system is coupled with a particle swarm optimization algorithm, with the optimization object being K. p T i The parameters and objective function are calculated using a simulation system.
[0045] Objective function:
[0046] Where NISE is the dimensionless integral of the square of the water level deviation, and NISQ is the dimensionless integral of the square of the flow rate deviation. This is the weighting coefficient. Preferably, α = 0.5.
[0047] Specifically, see Figure 4 , Figure 5 The particle swarm optimization algorithm includes: (1) Set up channels with different characteristic parameters; (2) Select K p T i The search range is determined, the optimization algorithm initializes the population, and the initialized Kp and Ti parameters are passed into the simulation system to calculate the value of the objective function. (3) Return the calculated objective function value to the optimization algorithm, which updates and iterates until the optimized K is finally output. p T i Two control parameters.
[0048] The constraints include: water level fluctuation exceeding the limit in 1 / 24h; water level downstream of the gate being higher than water level upstream of the gate; and water level at the calculated section being negative.
[0049] In summary, by setting multiple operating conditions for different channels and running optimization algorithms, a large amount of prior knowledge of the channel's PI control parameters can be obtained.
[0050] S102. Construct the first prediction model, and train the first prediction model using the first dataset to obtain the second prediction model.
[0051] In one possible implementation, see Figure 6 The first prediction model includes an input layer, a hidden layer, and an output layer; the hidden layer has an inverted pyramid structure, the activation function is ReLU, and the loss function is MSE.
[0052] Furthermore, the first prediction model comprises an input layer, four hidden layers, and an output layer, all fully connected. The input layer has a state dimension of 8, the four hidden layers have state dimensions of 128, 64, 32, and 16 respectively, and the output layer has a state dimension of 2.
[0053] Specifically, the data undergoes uniform standardization before model training, calculated using the following formula: Standardization Formula:
[0054] In the formula: Data before processing; The processed data; The minimum value in the data before processing; This represents the maximum value in the data before processing.
[0055] Specifically, the activation function in the hidden layer is ReLU.
[0056] S103. Collect measured data of PI controller parameters for the target channel, and use transfer learning to adjust the parameters of the second prediction model to obtain the third prediction model.
[0057] In one possible implementation, S103 includes: S103a. Collect measured data of the target channel PI controller parameters; S103b: Calculate the contribution of the hidden layer in the second prediction model using measured data; S103c, Fine-tune the hidden layer based on contribution; S103d, The second prediction model with optimal fine-tuning is used as the third prediction model.
[0058] Furthermore, the formula for calculating contribution in S103b is as follows:
[0059] in, The contribution of the k-th hidden layer; For the model R after only fine-tuning the k-th hidden layer 2 ; For the non-fine-tuned model R 2 .
[0060] It should be noted that, For the non-fine-tuned model R 2 The measured data is then input into the second prediction model (without fine-tuning), and the R-squared of this model is calculated. 2 . To fine-tune the k-th hidden layer of the second prediction model, calculate the R-squared of this fine-tuned model. 2 .
[0061]
[0062]
[0063]
[0064] Where SSE is the sum of squared residuals. For the first The true value of each sample Here, SST represents the model's predicted value; SST represents the total sum of squares, where... , which is the mean of the true values.
[0065] Further, see Figure 9 S103c includes: (1) After calculating the contribution of each hidden layer after fine-tuning, sort the four hidden layers according to their contribution; (2) Formulate four fine-tuning strategies: ① fine-tuning the hidden layer with the highest contribution ② fine-tuning the hidden layers with the highest contribution ③ fine-tuning the hidden layers with the highest contribution ④ fine-tuning all four hidden layers. (3) Select the fine-tuned model R 2 The highest-level strategy is the optimal strategy.
[0066] It should be noted that, for ease of practical application and parameter dimensionality reduction, the R calculated in S103 is... 2 For K p T i R with two parameters 2 The average value, which is also the R-value of the two parameters calculated after each fine-tuning. 2 After directly adding them together, take the average value as the final R after this fine-tuning. 2 Therefore, the fine-tuning strategy targets the average performance of the two parameters.
[0067] S104. Based on the third prediction model, predict the channel PI controller parameters for different operating conditions of the target channel.
[0068] Understandably, given the difficulty of verifying the control effect in real-world scenarios, a simulation system is chosen to verify the control effect. The predicted K... p T i Input parameters into the simulation system and observe whether there is overshoot or oscillation in the water level and flow rate process lines to determine whether the control effect is good. The predicted K... p T i After the parameter control effect was satisfactory, the PI control parameter prediction model was considered reliable and could be used for PI control parameter prediction in the target channel.
[0069] The method provided in this application can be used to predict the parameters of the channel PI controller in actual engineering. It achieves the prediction of the target channel PI controller parameters by using a large amount of prior knowledge of the target channel that is similar to the target channel, thereby achieving better control effect of the target channel, such as avoiding system oscillation and shortening the stability time of the channel system, thus ensuring the safe, stable and efficient operation of the water conveyance system.
[0070] The following detailed embodiments illustrate this point.
[0071] A channel PI controller parameter prediction method based on model fine-tuning transfer learning includes: I. Process of establishing the channel PI controller parameter prediction model: (1) Obtain prior knowledge of channel PI control parameters This application uses the "Simulation and Control of Water Conveyance Channel System (SCCS) Software" developed by the School of Hydraulic and Hydropower Engineering of Wuhan University to replace the real physical field, and couples the particle swarm optimization algorithm to optimize the channel PI control parameters, obtain a large number of channel PI control parameters, and construct prior knowledge for solving the target channel PI control parameters.
[0072] The channel hydraulic simulation system is a highly nonlinear system with time-varying characteristics. Some studies have shown that optimizing the channel PI control parameters is a non-convex optimization problem, meaning that multiple local optima exist. To avoid the particle swarm optimization algorithm getting trapped in local optima, three aspects are designed: initial population diversification, dynamic parameter adjustment, and an adaptive mechanism. The design diagram is shown below. Figure 5 As shown.
[0073] The PI control parameters of the channels were optimized using a particle swarm optimization algorithm coupled with a simulation system. Multiple channel types and operating conditions were set up to obtain rich prior knowledge of the channel PI control parameters. The channel types are shown in Table 1, which includes 15 different types of channel pools. The operating conditions included 3 operating flow rates, 10 water intake flow rates, and 4 water intake flow rate change times, such as... Figure 7 As shown.
[0074] Table 1 Parameter Table for Different Types of Channels
[0075] Note: Table 1 shows the hydraulic and geometric parameters of the canals. Operating condition parameters are not included. Since each canal pool has 3*10*4=120=120 operating conditions, and 15 types of canals pools have 15*120=1800 sets of conditions, it is impossible to list them all. Operating condition parameters are shown below. Figure 7 .
[0076] (2) Construct a neural network prediction model based on prior knowledge The prediction model provided in this application is implemented in Python and consists of one input layer, four hidden layers, and one output layer, with fully connected layers. The input layer has a state dimension of 8; the hidden layers adopt an inverted pyramid structure with state dimensions of 128, 64, 32, and 16 respectively; and the output layer has a state dimension of 2. A schematic diagram of the neural network prediction model is shown below. Figure 3 As shown. The neural network parameters are set as follows: learning rate 0.001, number of iterations 200, mini-batch gradient descent 16, activation function ReLU, loss function MSE, and data partitioning using five-fold cross-validation.
[0077] (3) Transfer prior knowledge to construct a prediction model for the PI control parameters of the target channel. A model-fine-tuning-based transfer learning method is used to transfer prior knowledge to the target channel.
[0078] Specifically, the migration methods include: 1) Collect measured data of PI controller parameters for the target channel; 2) Calculate the contribution of the hidden layer of the neural network using measured data, and formulate a fine-tuning strategy based on the contribution. 3) Fine-tune the hidden layers using the optimal fine-tuning strategy (model R). 2 The model trained at the highest level serves as the PI control parameter prediction model for the final target channel.
[0079] (4) Verify the control effect of the target channel PI control parameter prediction model.
[0080] II. Description of Prediction Model Inputs and Outputs (1) Neural network prediction model based on prior knowledge In the neural network model, the input variables are eight variables: channel hydraulic parameters (roughness, gradient), channel geometric parameters (bottom width, bottom slope, length), and operating parameters (channel operating flow rate, water intake flow rate, water intake change time); the output variable is K. p T i Two PI controller parameters. The inputs are all existing measured or design values at the current moment, without involving unknown input values, thus simplifying the prediction model implementation.
[0081] (2) Prediction model of PI control parameters for target channels Compared to neural network prediction models based on prior knowledge, the target channel PI control parameter prediction model only fine-tunes the hidden layers of the former, without involving other adjustments to the model. Therefore, the model's inputs and outputs remain consistent with the former. The model's inputs are also all existing measured or design values at the current moment, without involving unknown input values, thus simplifying the prediction model implementation.
[0082] III. Illustrate the prediction accuracy and control performance of the prediction model using examples. The target channel is described using a canal pool in the Third Main Canal of the Zhanghe Irrigation District in Hubei Province. The parameters of the target channel are shown in Table 2.
[0083] Table 2 Target Channel Parameter Table
[0084] To illustrate the prediction accuracy of the prediction model, the modeling determination coefficient R is introduced. 2 The evaluation is based on two indicators: mean absolute error (MAE), and the calculation formula is as follows.
[0085]
[0086]
[0087] In the formula: K predicted by the model p T i value; For the actual K p T i value; For the actual K p T i The average value; n R represents the total amount of data. 2 The larger the value, the smaller the MAE, indicating higher model prediction accuracy.
[0088] (1) Explanation of the results of the neural network prediction model based on prior knowledge To illustrate the prediction accuracy and control performance of the target channel PI control parameter prediction model in this application embodiment, it is first necessary to verify the model before fine-tuning, that is, the neural network prediction model based on prior knowledge, because this is the basic model for transfer learning.
[0089] Model effect as follows Figure 8 As shown in Table 3, it can be seen that K p T i The prediction results were all excellent, K p R 2 Reaching 0.891, MAE equals 0.125, T i R 2 Reaching 0.963, MAE equals 3.183. Using K... p Analysis of the prediction results: 1) K p Forecast scatter plot: The vast majority of blue dots are close to the red regression dotted line, indicating that the predicted values and actual values are almost identical. 2) K pError distribution histogram: We can see that the errors are concentrated around 0, and the peak value is very high, indicating that the prediction errors of the vast majority of samples are very small, with only a very small number of samples having errors. The overall error distribution is very concentrated. 3) K p Residual distribution plot: The residuals fluctuate around the red 0 line, without showing a trend of increasing or decreasing with the size of the predicted value, indicating that the residuals are random and no important feature information is missed.
[0090] Table 3 Results of the Neural Network Prediction Model Based on Prior Knowledge
[0091] (2) Explanation of the prediction model results for the target channel PI control parameters After verifying the performance of the neural network prediction model based on prior knowledge, a transfer learning method based on model fine-tuning is used to construct a prediction model for the PI control parameters of the target channel.
[0092] First, the contribution of the hidden layers in the neural network is calculated. Based on the contribution magnitude, a fine-tuning strategy is formulated. Four fine-tuning strategies are formulated as follows: Figure 9 As shown in the figure. The model trained using the optimal fine-tuning strategy is then used as the prediction model for the PI control parameters of the final target channel.
[0093] Model effect as follows Figure 10 As shown, the model fine-tuned using target channel data performs excellently. K p and T i R 2 All reached 0.93, K p The MAE is equal to 0.204, T i The MAE is 5.229. K p and T i The errors are all distributed around 0, and the residuals fluctuate around the 0 line.
[0094] (3) Control performance description This application embodiment sets up two sets of operating conditions to illustrate the control performance. The two operating conditions represent two extreme test conditions: high flow rate and low flow rate. Operating condition 1 is high flow rate and high water intake, with the operating flow rate being 80% of the channel design flow rate and the water intake flow rate being 30% of the channel design flow rate, with the water intake change time being a 1-hour slope change. Operating condition 2 is low flow rate and low water intake, with the operating flow rate being 40% of the channel design flow rate and the water intake flow rate being 10% of the channel design flow rate, with the water intake change time being a 0-hour step change.
[0095] The two sets of test conditions and channel parameters are input into the prediction model together, and the predicted K is then used. p T iThe parameters are input into the simulation system, as shown in Table 4. Performance evaluation indicators are calculated, and the presence of overshoot and oscillations in the water level and flow rate process lines is observed to determine the effectiveness of the control.
[0096] Table 4 Comparison of Water Level Prediction Results
[0097] Similarly, to illustrate the control performance of the target channel PI control parameter prediction model on the target channel water conveyance system, two performance evaluation indicators, dimensionless water level deviation square integral (NISE) and dimensionless flow deviation square integral (NISQ), are introduced for explanation, and their calculation formulas are as follows.
[0098]
[0099]
[0100] In the formula: Let be the observed or simulated water depth at time t, in meters. The target water depth is in meters (m). Let t be the observed or simulated flow rate at time t, in m³ / s; The design flow rate is m³ / s; t The simulation time is in seconds. t is the time step, in seconds; T is the total simulation time, in seconds; the smaller the values of the above two performance evaluation indicators, the better the model control performance.
[0101] The results are shown in the following chart, from Table 5 and Figure 11 The calculation results show that, under both working conditions, the predicted K p T i The control performance is good. Under operating condition 1, NISE equals 1.39 × 10⁻⁶. -4 NISQ equals 6.98 × 10 -5 Under operating condition 2, NISE equals 1.39 × 10⁻⁶. -4 NISQ equals 6.98 × 10 -5 Neither the flow rate nor the water level process lines exhibited overshoot or oscillation under either operating condition. The system quickly reached stability after the water intake change ended, demonstrating good control performance. (See also...) Figure 11As can be seen from the flow rate process lines and water level error process lines under the two operating conditions, the system exhibits no overshoot or continuous oscillation during the gate flow regulation process under water intake disturbance, and the water level fluctuation amplitude at the control point of the channel is small. After the water intake disturbance ends, the system can quickly recover to stable operation, and the water level rapidly returns to the target value. The control process is smooth and responsive, and the control effect meets the operational requirements of the water conveyance channel, fully demonstrating the excellent dynamic control performance and steady-state control accuracy of the controller parameters. In summary, the channel PI control parameter prediction model proposed in this application can predict a set of excellent control parameters, thereby achieving good control of the target channel water conveyance system.
[0102] Table 5 Control performance results
[0103] The channel PI controller parameter prediction model proposed in this application can make full use of the prior knowledge of existing channel PI controller parameter tuning, consider multiple types of channel cases and variable water intake conditions, thereby achieving channel PI controller parameter prediction under multiple target water intake conditions, which is conducive to enhancing the safety and efficiency of channel water conveyance system operation.
[0104] The channel PI controller parameter prediction device based on model fine-tuning transfer learning provided in this application is described below. The channel PI controller parameter prediction device based on model fine-tuning transfer learning described below can be referred to in correspondence with the channel PI controller parameter prediction method based on model fine-tuning transfer learning described above.
[0105] Figure 12 This is a schematic diagram of the structure of the channel PI controller parameter prediction device based on model fine-tuning transfer learning provided in the embodiments of this application, as shown below. Figure 12 As shown, it includes: an acquisition module 121, a construction module 122, a migration module 123, and a prediction module 124, wherein: The acquisition module 121 is used to acquire prior knowledge of the channel PI control parameters to obtain a first dataset; the dataset includes channel parameters as features and PI controller parameters as labels. Module 122 is used to build a first prediction model and train the first prediction model using a first dataset to obtain a second prediction model. The transfer module 123 is used to collect measured data of PI controller parameters of the target channel, and use the transfer learning method to tune the parameters of the second prediction model to obtain the third prediction model. The prediction module 124 is used to predict the channel PI controller parameters under different operating conditions of the target channel based on the third prediction model.
[0106] Figure 13An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 13 As shown, the electronic device may include a processor 1310, a communications interface 1320, a memory 1330, and a communications bus 1340. The processor 1310, communications interface 1320, and memory 1330 communicate with each other via the communications bus 1340. The processor 1310 can call logic instructions from the memory 830 to execute a channel PI controller parameter prediction method based on model fine-tuning transfer learning.
[0107] Furthermore, the logical instructions in the aforementioned memory 1330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0108] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the channel PI controller parameter prediction method based on model fine-tuning transfer learning provided by the above methods.
[0109] In another aspect, this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the channel PI controller parameter prediction method based on model fine-tuning transfer learning provided by the above methods.
[0110] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0111] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0112] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for predicting channel PI controller parameters based on model fine-tuning transfer learning, characterized in that, include: Prior knowledge of the channel PI control parameters is obtained to obtain the first dataset; the first dataset includes channel parameters as features and PI controller parameters as labels. Construct a first prediction model, train the first prediction model using the first dataset, and obtain a second prediction model; Collect measured data of PI controller parameters from the target channel, and use transfer learning to tune the parameters of the second prediction model to obtain the third prediction model; Based on the third prediction model, the channel PI controller parameters for different operating conditions of the target channel are predicted.
2. The method according to claim 1, characterized in that, The first dataset comes from both measured data and simulation data.
3. The method according to claim 2, characterized in that, The method for obtaining the simulation data includes: Set up channels with different characteristic parameters; By using the particle swarm optimization algorithm and combining the simulation results of the simulation model, the optimal PI controller parameters under a certain characteristic parameter are found. The simulation data is obtained by combining the features and labels under all feature parameters.
4. The method according to claim 1, characterized in that, The features include channel hydraulic parameters, channel geometric parameters, and operating parameters; wherein, the channel hydraulic parameters include roughness and gradient, the channel geometric parameters include bottom width, bottom slope, and length, and the operating parameters include channel operating flow rate, water intake flow rate, and water intake change time. The label includes the PI controller parameter K. p and T i K p T represents the proportional gain. i This represents the integration time constant.
5. The method according to claim 1, characterized in that, The first prediction model includes an input layer, a hidden layer, and an output layer; the hidden layer has an inverted pyramid structure, the activation function is ReLU, and the loss function is MSE.
6. The method according to claim 5, characterized in that, The measured data of PI controller parameters from the target channel are collected, and the second prediction model is tuned using transfer learning to obtain the third prediction model, which includes: Collect measured data of PI controller parameters for the target channel; The contribution of the hidden layer in the second prediction model was calculated using measured data. Fine-tune the hidden layer based on its contribution. The second prediction model, which has been finely tuned, is used as the third prediction model.
7. A channel PI controller parameter prediction device based on model fine-tuning transfer learning, characterized in that, include: The acquisition module is used to acquire prior knowledge of the channel PI control parameters to obtain the first dataset; the first dataset includes channel parameters as features and PI controller parameters as labels. The building module is used to build the first prediction model, and train the first prediction model using the first dataset to obtain the second prediction model; The transfer module is used to collect measured data of PI controller parameters from the target channel, and use transfer learning to tune the parameters of the second prediction model to obtain the third prediction model. The prediction module is used to predict the channel PI controller parameters under different operating conditions of the target channel based on the third prediction model.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the channel PI controller parameter prediction method based on model fine-tuning transfer learning as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the channel PI controller parameter prediction method based on model fine-tuning transfer learning as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the channel PI controller parameter prediction method based on model fine-tuning transfer learning as described in any one of claims 1 to 6.