Water supply project intelligent dosing optimization method based on bimodal cooperative control
The dual-mode control system with MPC and Fuzzy PID algorithms, integrated with optimized BP neural networks, addresses inconsistencies in rural water treatment by dynamically adjusting chlorine dosing, ensuring water quality and safety.
Patent Information
- Application Number
- CN202510367954.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-03-26
AI Technical Summary
In the existing water supply projects, sodium hypochlorite disinfection has the inconsistent amount of dosage and actual demand, resulting in the risk of energy waste and environmental pollution. Traditional PID feedback control lacks dynamic adaptability, it is difficult to optimize the dosing strategy in real time, and it is impossible to deal with fluctuations in water quality parameters and emergencies.
The intelligent dosing optimization method of water supply engineering based on dual-mode collaborative control is adopted, combined with the fuzzy self-tuning PID algorithm and the model prediction control MPC algorithm, the dosing pump control volume is predicted through machine learning models, and the prediction window and control volume are dynamically adjusted in the steady state and unstable state of the water supply system, and combined with the anti-integral saturation and execution protection mechanism to achieve accurate control of dosing volume.
It achieves precise control of dosage, ensures that residual chlorine and microbial indicators meet the standards, avoids waste of drugs, adapts to rapid changes in water quality and water volume, and improves the stability and emergency response capabilities of the water supply system.
Smart Images

Figure CN120309078A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of drinking water disinfection, and specifically relates to an intelligent chemical dosing optimization method for water supply projects based on bimodal collaborative control. Background Art
[0002] Sodium hypochlorite disinfection mainly relies on the function of hypochlorous acid to inhibit and destroy various enzyme systems in bacteria, interfering with the oxidation-reduction reaction in bacteria, thereby achieving the disinfection purpose. It has high bactericidal ability, low application cost and mature technology, and is widely used in urban and rural drinking water disinfection.
[0003] As of the end of 2024, the proportion of rural population covered by large-scale water supply projects reached 65%, which has become the main component of rural water supply projects. However, the situation of exceeding the standard of microorganisms or disinfection by-products still often occurs. Empirical chemical dosing usually based on fixed standards leads to the mismatch between the dosage of sodium hypochlorite and the actual demand, wasting energy and increasing the risk of environmental pollution; traditional PID feedback control lacks dynamic adaptability. If the water quality parameters fluctuate greatly, it is difficult to accurately predict the dosage of sodium hypochlorite; it also lacks real-time monitoring and feedback, unable to evaluate the chemical dosing effect in real time, difficult to optimize the chemical dosing strategy, and lacks the ability to respond to sudden emergency events. Summary of the Invention
[0004] Aiming at the above deficiencies in the prior art, the intelligent chemical dosing optimization method for water supply projects based on bimodal collaborative control provided by the present invention solves the problem that the residual chlorine and microorganisms in the existing water supply projects are difficult to meet the effluent water quality requirements.
[0005] In order to achieve the above invention purpose, the technical solution adopted by the present invention is as follows:
[0006] Provide an intelligent chemical dosing optimization method for water supply projects based on bimodal collaborative control, which includes the steps of:
[0007] S1. Obtain the effluent water quality and quantity data of the water supply system and the monitoring indicators of the operation state of the water supply system within a plurality of consecutive control cycles adjacent to the current control cycle;
[0008] S2. According to the monitoring indicators and the effluent water quality and quantity data, judge whether the operation state of the water supply system is in a stable state. If so, enter step S4; otherwise, enter step S3;
[0009] S3. Calculate the control quantity of the chemical dosing pump within the current control cycle by using the fuzzy self-tuning PID algorithm;
[0010] S4. Determine the dynamic prediction time domain adjustment rule, input the effluent water quality and quantity data within the time domain into the machine learning model, and use the model predictive control MPC algorithm to obtain the control quantity of the chemical dosing pump;
[0011] S5. Control the chemical dosing pump to add chemicals to the clear water tank according to the chemical dosing pump control quantity in step S3 or step S4, and when the water supply system is in an operating state and the current control cycle is completed, return to step S1.
[0012] Further, the method for obtaining the chemical dosing pump control quantity by using the model predictive control MPC algorithm includes:
[0013] Determine the dynamic prediction time domain by using the rolling optimization objective function according to the water quality and quantity data and monitoring indicators of the effluent water in multiple consecutive control cycles adjacent to the current control cycle:
[0014]
[0015] where, J is the optimization objective function; N p is the dynamic prediction time domain; y pred (k) is the predicted output at the k-th step; y ref is the reference target value; Q is the weight matrix of the output deviation (fixed at 1.0); Δu k = u(k) ― u(k―1) is the control quantity change rate at the k-th step; u(k) and u(k―1) are the control quantities at the k-th and k-1-th steps respectively; λ is the steady-state deviation penalty coefficient (fixed at 0.1); u nom is the nominal value; ‖·‖ 2 is the quadratic norm; N c is the fixed control time domain.
[0016] Starting from the current moment t, obtain the N p step output sequence {y pred (1), …, y pred (N p )}, and determine the optimal prediction time domain according to the objective function change rate < 0.1%;
[0017] Further, use the fuzzy rules to determine the dynamic prediction time domain adjustment rules, and its implementation method includes:
[0018] When the influent water flow deviation ΔQ ≥ 30%, and the residual chlorine change rate > 0.2 mg / (L·min), set N p = 8; when the operating state of the water supply system is stable, set N p = 15; when the turbidity suddenly increases > 50% or the pH changes > 0.2, set N p = 10.
[0019] The beneficial effects of the above technical solution are as follows: When the water supply system is in a steady state, that is, when both the microbial index and the residual chlorine index meet the standard requirements, the purpose at this time is to stabilize the chemical dosage and prevent the generation of disinfection by-products. Through the adaptive prediction time domain and the machine learning model, when all water quality and quantity parameters fluctuate slightly, the prediction window can be extended to improve the steady-state accuracy. When indicators such as flow and residual chlorine change greatly, the prediction window can be shortened to quickly respond to mutations.
[0020] Further, step S3 further includes:
[0021] Read the adjustment amounts ΔK p , ΔK i , ΔK d of the proportional coefficient, integral coefficient, and differential coefficient in the fuzzy rule table, and calculate the proportional coefficient K p , integral time K i , and differential time K p of the fuzzy self-tuning PID algorithm:
[0022]
[0023] Among them, K p0 , K i0 , and K d0 are the initial values of K p , K i , and K p respectively; μ(·) is the membership function; e is the error level; is the error change rate;
[0024] According to K p , K i , and K p , calculate the chemical dosing pump control amount in the current control period:
[0025]
[0026] Among them, u(t) is the chemical dosing pump control amount at time t; e(t) is the error level at time t; is the cumulative value of the integral term.
[0027] The beneficial effects of the above technical solution are as follows: When the residual chlorine or microbial index exceeds the standard, it is necessary to immediately increase or decrease the chemical dosing pump control amount. The event-triggered PID control can make up for the ineffective prediction of the MPC and ensure the water quality safety in a timely manner.
[0028] Further, the intelligent chemical dosing optimization method for water supply projects further includes an anti-integral saturation and execution protection mechanism:
[0029] A1. Judge whether the control amount u(t) reaches the control amount limit u min = 0% or umax = 100%, if so, go to step A2; otherwise, do not update the chemical dosing pump control amount;
[0030] A2. Update the discharge strategy of the chemical dosing pump:
[0031] ∫e(t)dt = ∫e(t)dt ― α·e(t)
[0032] where α is the discharge coefficient;
[0033] A3. Update the chemical dosing pump control amount according to the discharge strategy ∫e(t)dt:
[0034]
[0035] The beneficial effects of the above technical solution are as follows: The anti-integral saturation and execution protection mechanism designed in this solution can prevent the integral term from continuously accumulating, resulting in the control amount being unable to exit the saturation state, making the calculated control amount too large, increasing the chemical dosing amount, and causing water quality pollution; at the same time, it can also prevent the control amount from exceeding the limit, enabling the chemical dosing pump to operate under high load and affecting the service life of the chemical dosing pump.
[0036] Further, the monitoring indicators include the total number of colonies and the number of coliforms; the method for determining the operating state of the water supply system includes:
[0037] B1. When the residual chlorine concentration exceeds [0.3, 1.0] mg / L, or the total number of colonies > 100 CFU / mL, or coliforms are detected, or the chemical dosing amount deviation is greater than the preset threshold in multiple consecutive control cycles, or the sensor communication status timeout is greater than the preset time, it is considered that the operating state of the water supply system is unstable;
[0038] B2. When the residual chlorine concentration, the total number of colonies, coliforms, the chemical dosing amount deviation, and the sensor communication status do not meet the conditions corresponding to step B1, it is considered that the operating state of the water supply system is stable;
[0039] When determining the operating state of the water supply system, the priority order is microbial exceedance > residual chlorine overlimit > sensor communication failure > chemical dosing amount deviation.
[0040] Further, the machine learning model is a BP neural network model, which includes an input layer, a hidden layer 1, a hidden layer 2, and an output layer connected in sequence;
[0041] The input layer includes multiple neurons, and the number of neurons is the same as the number of multiple parameters included in the effluent water quality and quantity data; both hidden layer 1 and hidden layer 2 include several neurons, and the output layer is 1 neuron, that is, linear activation.
[0042] Furthermore, the historical water quality and quantity data of the water plant are used as the data set, and 70% of the water quality and quantity data of the data set are used as the training set in chronological order, and 30% of the water quality and quantity data are used as the test set; training the BP neural network model includes two stages, namely:
[0043] In the first stage, according to the training set and the test set, the particle swarm optimization algorithm PSO is used to optimize the BP neural network, and the dynamic inertia weight adjustment strategy is adopted to update the weights during the optimization process:
[0044]
[0045] Among them, ω(o) is the weight at the o-th iteration; o is the number of iterations; O max is the maximum number of iterations; ω max and ω min are the maximum and minimum values of the weights respectively;
[0046] The particle velocity is updated using a formula introducing an adaptive mutation factor:
[0047]
[0048] Among them, and are the velocities of the i-th particle at the (o + 1)-th and o-th iterations respectively; c1 and c2 are both acceleration constants; r1 and r2 are random numbers in the interval [0, 1]; pbest is the historical best position of particle i; gbest is the global best position of the population; η = 0.1·e ―0.05*o is the mutation coefficient that decays exponentially with the number of iterations; e is the natural logarithm; N(0, 1) is a standard normal distribution random number, enhancing the global search ability;
[0049] In the second stage, the genetic algorithm is used to optimize the BP neural network optimized by the particle swarm optimization algorithm PSO:
[0050] The number of neurons in the hidden layer of the BP neural network is encoded as a binary chromosome, and the RMSE of the test set is used as the fitness value. Single-point crossover and Gaussian mutation are performed, and then the roulette wheel selection method is used to retain the optimal individual. After iterating the preset number of times, the globally optimal PSO-GA-BP neural network is output.
[0051] The beneficial effects of the above technical solution are as follows: The machine learning model of this solution breaks through the traditional single optimization method of machine learning. Through the dual-stage optimization strategy of integrating particle swarm optimization (PSO) and genetic algorithm (GA), the neural network weights and topological structure are dynamically adjusted, which can significantly improve the prediction accuracy and generalization ability of the model for the control amount of the dosing pump.
[0052] Furthermore, the loss function of the PSO-GA-BP neural network adopts a dynamic function switching mechanism as follows:
[0053] Judge the distribution form according to the kurtosis of the effluent water quality and quantity data input into the PSO-GA-BP neural network. If the kurtosis > 3, enable the ReLU function; otherwise, enable the Sigmoid function or the LeakyReLU function.
[0054] This solution adopts a dynamic activation function switching mechanism, which can accurately predict the optimal dosage of sodium hypochlorite.
[0055] Furthermore, the effluent water quality and quantity data include influent pH, influent turbidity, influent flow rate, effluent flow rate, effluent pH, effluent turbidity, and effluent residual chlorine.
[0056] The beneficial effects of the present invention are as follows: This solution constitutes a dual-mode control composed of an optimization mode dominated by MPC and an emergency mode dominated by PID, overcomes the defects of a single control system, can accurately control the dosage of chemicals, can avoid waste of chemicals while ensuring that the residual chlorine and microorganisms meet the effluent water quality requirements, and is especially applicable to rural large-scale water supply projects with large short-term changes in water quality and quantity. Description of the Drawings
[0057] Figure 1 It is a flowchart of an intelligent chemical dosing optimization method for a water supply project based on dual-mode cooperative control. Specific Embodiments
[0058] The specific embodiments of the present invention will be described below to facilitate those skilled in the art of the present technology to understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art of the present technology, as long as various changes are within the spirit and scope of the present invention defined and determined by the appended claims, these changes are obvious, and all inventions and creations using the concept of the present invention are within the scope of protection.
[0059] Refer to Figure 1 , Figure 1 which shows a flowchart of an intelligent chemical dosing optimization method for a water supply project based on dual-mode cooperative control; as Figure 1 shown, this method S includes steps S1 to S5.
[0060] In step S1, obtain the effluent water quality and quantity data of the water supply system and the monitoring indicators of the operating state of the water supply system within multiple consecutive control cycles adjacent to the current control cycle; in this solution, the effluent water quality and quantity data include influent pH, influent turbidity, influent flow rate, effluent flow rate, effluent pH, effluent turbidity, and effluent residual chlorine; the monitoring indicators include the chemical dosage, total number of colonies, and number of coliforms.
[0061] The total number of colonies and the number of coliforms are detected in real time by a microbial online monitor (model JMS-CLMⅡ-A) and communicated with the PLC through the RS-485 interface. The sensors for collecting the water quality and quantity data of the effluent in this solution are connected to the Siemens S7-1200PLC through SM1231(4AI).
[0062] In step S2, according to the monitoring indicators and the water quality and quantity data of the effluent, it is judged whether the operating state of the water supply system is in a stable state. If so, go to step S4; otherwise, go to step S3;
[0063] During implementation, the method for determining the operating state of the water supply system preferably adopted in this solution includes:
[0064] B1. When the residual chlorine concentration exceeds [0.3, 1.0] mg / L, or the total number of colonies > 100 CFU / mL, or coliforms are detected, or the deviation of the chemical dosage in multiple consecutive control cycles is greater than the preset threshold, or the sensor communication status timeout is greater than the preset time, it is considered that the operating state of the water supply system is unstable;
[0065] B2. When the residual chlorine concentration, the total number of colonies, coliforms, the deviation of the chemical dosage, and the sensor communication status do not meet the conditions corresponding to step B1, it is considered that the operating state of the water supply system is stable;
[0066] When determining the operating state of the water supply system, the priority order is microbial exceeding the standard > residual chlorine exceeding the limit > sensor communication failure > chemical dosage deviation.
[0067] In this solution, it is preferably considered that the water supply system is operating unstably when the total number of colonies exceeds the standard, or coliforms are detected, or the residual chlorine concentration exceeds the standard within one control cycle; for other situations, any one of them meets the conditions corresponding to step B1 in three consecutive control cycles before it is considered that the system is operating unstably.
[0068] In step S3, the fuzzy self-tuning PID algorithm is used to calculate the control amount of the chemical dosing pump in the current control cycle. During the implementation of the fuzzy self-tuning PID algorithm, the proportional, integral, and differential coefficients are dynamically adjusted according to the error level (large, medium, small) and the error change rate (positive, zero, negative); the specific implementation process is as follows:
[0069] Read the adjustment amounts ΔK p 、ΔK i 、ΔK d of the proportional coefficient, integral coefficient, and differential coefficient in the fuzzy rule table, and calculate the proportional coefficient K p 、integral time K i and differential time K p of the fuzzy self-tuning PID algorithm:
[0070]
[0071] Among them, K p0 , K i0 and K d0 are the initial values of K p , K i and K p respectively; μ(·) is the membership function; e is the error level; is the error change rate;
[0072] According to K p , K i and K p , calculate the dosing pump control amount within the current control cycle:
[0073]
[0074] Among them, u(t) is the dosing pump control amount at time t; e(t) is the error level at time t; is the integral term cumulative value.
[0075] When performing the fuzzy self-tuning PID algorithm, it also includes an anti-integral saturation and execution protection mechanism:
[0076] A1. Judge whether the control amount u(t) reaches the control amount limit (u min =0% or u max =100%), if so, go to step A2, otherwise do not update the dosing pump control amount;
[0077] A2. Update the discharge strategy of the dosing pump:
[0078] ∫e(t)dt = ∫e(t)dt ― α·e(t)
[0079] Among them, α is the discharge coefficient;
[0080] A3. Update the dosing pump control amount according to the discharge strategy ∫e(t)dt:
[0081]
[0082] When adopting the fuzzy self-tuning PID algorithm, it is also necessary to detect the current of the dosing pump motor in real time. If it exceeds 120% of the rated value for 2 seconds, it is determined to be stuck, automatically switch to the standby dosing pump, and reset the integral term ∫e(t)dt = 0.
[0083] When executing the fuzzy self-tuning PID algorithm, the fuzzy rule table involved can refer to Table 1.
[0084] Table 1
[0085]
[0086] In step S4, a dynamic prediction time domain adjustment rule is determined, and the water quality and quantity data of the effluent within the time domain are input into the machine learning model, and the dosing pump control quantity is obtained by using the model predictive control MPC algorithm; the specific implementation process of step S4 is as follows:
[0087] First, according to the water quality and quantity data of the effluent and the monitoring indexes within multiple consecutive control cycles adjacent to the current control cycle, an optimization objective function is used to determine the dynamic prediction time domain:
[0088]
[0089] where J is the optimization objective function; N p is the dynamic prediction time domain; y pred (k) is the predicted output at the k-th step; y ref is the reference target value; Q is the weight matrix of the output deviation (fixed at 1.0); Δu k = u(k)―u(k―1) is the control quantity change rate at the k-th step; u(k) and u(k―1) are the control quantities at the k-th and k-1-th steps respectively; λ is the steady-state deviation penalty coefficient (fixed at 0.1); u nom is the nominal value; ‖·‖ 2 is the quadratic norm; N c is the fixed control time domain; R is the weight matrix for penalizing the control quantity change.
[0090] Starting from the current time t, obtain the N p step output sequence {y pred (1),…,y pred (N p )} predicted by the PSO-GA-BP neural network, and determine the optimal prediction time domain according to the change rate of the objective function < 0.1%; y pred (1) and y pred (N p ) are the predicted outputs at the 1st step and the N p th step.
[0091] When the optimal prediction time domain is obtained in this scheme, the corresponding u(k) is the predicted dosing pump control quantity.
[0092] In the above optimization objective function, the constraint condition for the control quantity amplitude is 0 ≤ u(k) ≤ 100% (k = 0, 1,…, N c ―1), corresponding to the physical working range of the dosing pump (0%~100% opening), and the constraint condition for the control quantity change rate is |Δu k | ≤ 20% (k = 0, 1,…, N c ―1), and such setting can prevent the actuator from moving frequently and significantly.
[0093] During implementation, this solution preferably adopts a fuzzy rule dynamic prediction time domain adjustment rule, and its implementation method is as follows:
[0094] When the influent flow deviation ΔQ ≥ 30%, and the chlorine residual change rate > 0.2 mg / (L·min), set N p = 8; when the operating state of the water supply system is stable, set N p = 15; when the turbidity suddenly increases > 50% or the pH changes > 0.2, set N p = 10.
[0095] An example is used to illustrate the selection of the dynamic prediction time domain and the chemical dosing optimization method:
[0096] Suppose the return of rural residents during the Spring Festival causes the influent flow to suddenly increase from 150 m 3 / h to 300 m 3 / h. At this time, shorten the dynamic prediction time domain to N p = 8, reduce the prediction window to preferentially increase the control amount of the chemical dosing pump, and then adjust based on the intelligent chemical dosing optimization method of the water supply project of this solution. When the influent flow changes greatly, the control of MPC can still predict the chemical dosing amount to a higher value, and the actual chlorine residual concentration has been stable above 0.75 mg / L, without the phenomenon of insufficient chlorine residual.
[0097] In step S5, control the chemical dosing pump to add chemicals to the clear water tank according to the control amount of the chemical dosing pump in step S3 or step S4, and when the water supply system is in operation and the current control cycle is completed, return to step S1. Theoretically, the water supply system will run continuously, and the optimization method of this solution starts with the start of the water supply system and shuts down with the shutdown.
[0098] In an embodiment of the present invention, the machine learning model is a BP neural network model, which includes an input layer, a hidden layer 1, a hidden layer 2, and an output layer connected in sequence;
[0099] The input layer includes 7 neurons, and the 7 neurons respectively correspond to the influent pH value, influent turbidity, influent flow, effluent flow, effluent pH, effluent turbidity, and effluent chlorine residual of the effluent water quality and quantity data; the hidden layer 1 includes 15 neurons, that is, the activation function ReLU, the hidden layer 2 includes 8 neurons, that is, the activation function LeakyReLU, and the output layer is 1 neuron, that is, linear activation.
[0100] This solution uses Raspberry Pi 4B as the host computer, which is used to deploy the machine learning model, and its operating system is Ubuntu 22.04. The pH, turbidity and flow rate of this solution are collected through pH meter, turbidity meter and flow meter. These sensors are connected to the SM1231 module of PLC through 4-20mA analog signal, and the microbial online monitor (JMS-CLMⅡ-A in this embodiment) is connected to PLC through RS-485 interface. The dosing pump is controlled by the 4-20mA signal output by the SM1232 module of PLC.
[0101] This scheme uses the historical effluent water quality and quantity data of the water plant as the data set when training the machine learning model. The Kolmogorov-Smirnov test is used to clean the historical effluent water quality and quantity data (significance level p<0.05) to remove outliers, and the skewed distribution parameters (such as turbidity) are Box-Cox transformed. The Z-score is used for standardization to make the mean 0 and the standard deviation 1; then 70% of the effluent water quality and quantity data of the data set are used as the training set in chronological order, and 30% of the effluent water quality and quantity data are used as the test set; then, the training set and the test set are used to train the BP neural network model:
[0102] In the first stage, based on the training set and the test set, the particle swarm optimization algorithm PSO is used to optimize the BP neural network. During the optimization process, the dynamic inertia weight adjustment strategy is used to update the weight:
[0103]
[0104] Among them, ω(o) is the weight at the oth iteration; o is the number of iterations; O max is the maximum number of iterations; ω max and ω min are the maximum and minimum values of the weight respectively;
[0105] The particle velocity is updated using a formula that introduces an adaptive mutation factor:
[0106]
[0107] in, and are the velocities of the i-th particle at the o+1th and oth iterations, respectively; c1 and c2 are acceleration constants; r1 and r2 are random numbers in the interval [0,1]; pbest is the historical optimal position of particle i; gbest is the global optimal position of the group; η=0.1·e ―0.05*o is the coefficient of variation that decays exponentially with the number of iterations; e is the natural logarithm; N(0,1) is a standard normal distribution random number, which enhances the global search capability;
[0108] In the second stage, the genetic algorithm is used to optimize the BP neural network optimized in the first stage:
[0109] Encode the number of neurons in the hidden layer of the BP neural network into a binary chromosome, use the RMSE of the test set as the fitness value, perform single-point crossover and Gaussian mutation, and then use the roulette wheel selection method to retain the optimal individuals. After iterating the preset number of times, output the globally optimal PSO-GA-BP neural network.
[0110] The loss function of the PSO-GA-BP neural network adopts a dynamic function switching mechanism:
[0111] Judge the distribution form according to the kurtosis of the effluent water quality and quantity data input into the PSO-GA-BP neural network. If the kurtosis > 3, enable the ReLU function; otherwise, enable the Sigmoid function or the LeakyReLU function.
[0112] The two-stage optimization of the BP neural network is described in detail below in combination with its network structure:
[0113] Neural network structure optimization: 7 neurons in the input layer (corresponding to 7 water quality parameters), PSO optimization in the first stage of the hidden layer: dynamic inertia weight adjustment, formula: (T max = 100 iterations, 30 particles, acceleration constants c1 = c2 = 1.5); GA optimization in the second stage of the hidden layer: binary encoding of the number of neurons in the hidden layer (hidden layer 1: 8 - 20, step size 2; hidden layer 2: 4 - 12, step size 2), the fitness function is the RMSE of the test set, crossover probability P c = 0.8, mutation probability P m = 0.1; final topology: hidden layer 1 (15 neurons, activation function ReLU) → hidden layer 2 (8 neurons, activation function LeakyReLU, negative interval slope 0.01); output layer: 1 neuron (predicted value of the dosing pump control amount), linear activation;
[0114] Hybrid optimization process: Iterate 50 times in the PSO stage to optimize the initial weights, and add an adaptive mutation factor to the velocity update formula; in the GA stage, retain the top 10% of individuals with fitness through roulette wheel selection, and perform single-point crossover and Gaussian mutation (standard deviation σ = 0.1).
[0115] This solution preferentially fine-tunes the PSO-GA-BP neural network every 24 hours using the latest effluent water quality and quantity data, updating the weights and topological structure; if the prediction error is > 15% for 5 consecutive times, trigger model retraining.
[0116] In summary, this solution forms a dual-mode collaborative logic and switching strategy through MPC and PID, which ensures that the residual chlorine and microorganisms meet the effluent water quality requirements while avoiding the waste of chemicals.
Claims
1. An intelligent chemical dosing optimization method for water supply projects based on bimodal collaborative control, characterized in that Including the steps: S1. Obtain the water quality and quantity data of the water supply system and the monitoring indicators of the operating status of the water supply system within multiple consecutive control cycles adjacent to the current control cycle; S2. According to the monitoring indicators and the water quality and quantity data of the effluent, determine whether the operating status of the water supply system is in a stable state. If so, go to step S4; otherwise, go to step S3; S3. Calculate the control quantity of the chemical dosing pump within the current control cycle by using the fuzzy self-tuning PID algorithm; S4. Determine the dynamic prediction time domain adjustment rule, input the water quality and quantity data within the time domain into the machine learning model, and obtain the control quantity of the chemical dosing pump by using the model predictive control (MPC) algorithm; S5. Control the chemical dosing pump to add chemicals to the clear water tank according to the control quantity of the chemical dosing pump in step S3 or step S4, and when the water supply system is in operation and the current control cycle is completed, return to step S1.
2. The intelligent chemical dosing optimization method for a water supply project according to claim 1, wherein The method for determining the dynamic prediction time domain adjustment rule includes: According to the water quality and quantity data of the effluent and the monitoring indicators within multiple consecutive control cycles adjacent to the current control cycle, determine the dynamic prediction time domain by using the rolling optimization objective function; Among them, J is the optimization objective function; N p is the dynamic prediction time domain; y pred (k) is the predicted output at the k-th step; y ref is the reference target value; Q is the weight matrix of the output deviation; Δu k = u(k) - u(k - 1) is the control quantity change rate at the k-th step; u(k) and u(k - 1) are the control quantities at the k-th and (k - 1)-th steps respectively; λ is the steady-state deviation penalty coefficient; u nom is the nominal value; ‖·‖ 2 is the quadratic norm; N c is the fixed control time domain; R is the weight matrix that penalizes the change of the control quantity; Starting from the current time t, obtain the N p -step output sequence {y pred (1), …, y pred (N p )}, and determine the optimal prediction horizon according to the change rate of the objective function < 0.1%.
3. The intelligent chemical dosing optimization method for a water supply project according to claim 1, wherein, Step S3 further includes: Read the adjustment amounts ΔK of the proportional coefficient, integral coefficient, and differential coefficient in the fuzzy rule table p , ΔK i , ΔK d , and calculate the proportional coefficient K p , integral time K i , and differential time K p : Among them, K p0 , K i0 and K d0 are the initial values of K p , K i and K p respectively; μ(·) is the membership function; e is the error level; is the error change rate; According to K p , K i and K p , calculate the dosing pump control amount in the current control cycle: where, u(t) is the control quantity of the medicine adding pump at time t; e(t) is the error level at time t; is the cumulative value of the integral term.
4. The intelligent chemical dosing optimization method for water supply projects according to claim 3, characterized in that It also includes an anti-integral saturation and execution protection mechanism: A1. Judge whether the control quantity u(t) reaches the control quantity limit. If so, go to step A2; otherwise, do not update the control quantity of the chemical dosing pump; A2. Update the discharge strategy of the chemical dosing pump: ∫e(t)dt = ∫e(t)dt - α·e(t) where α is the discharge coefficient; A3. Update the control quantity of the chemical dosing pump according to the discharge strategy ∫e(t)dt; 5. The intelligent chemical dosing optimization method for a water supply project according to claim 1, wherein The monitoring indicators include the total number of colonies and the number of coliforms; the method for determining the operating status of the water supply system includes: B1. When the residual chlorine concentration exceeds [0.3, 1.0] mg / L, or the total number of colonies > 100 CFU / mL, or coliforms are detected, or the chemical dosing amount deviation is greater than the preset threshold within multiple consecutive control cycles, or the sensor communication status timeout is greater than the preset time, it is considered that the operating status of the water supply system is unstable; B2. When the residual chlorine concentration, the total number of colonies, the coliforms, the chemical dosing amount deviation, and the sensor communication status do not meet the conditions corresponding to step B1, it is considered that the operating status of the water supply system is stable; When determining the operating status of the water supply system, the priority order is microbial exceeding the standard > residual chlorine exceeding the limit > sensor communication failure > chemical dosing amount deviation.
6. The intelligent chemical dosing optimization method for a water supply project according to claim 2, wherein, Adopt the fuzzy rule dynamic prediction time domain adjustment rule, and its implementation method includes: When the inlet water flow deviation ΔQ ≥ 30%, and the residual chlorine change rate > 0.2 mg / (L·min), set N p = 8; when the operating state of the water supply system is stable, set N p = 15; when the turbidity suddenly increases > 50% or the pH changes > 0.2, set N p = 10.
7. The intelligent chemical dosing optimization method for water supply projects according to claim 1, characterized in that The machine learning model is a BP neural network model, which includes an input layer, a hidden layer 1, a hidden layer 2, and an output layer connected in sequence; The input layer includes multiple neurons, and the number of neurons is the same as the number of multiple parameters included in the water quality and quantity data of the effluent; both the hidden layer 1 and the hidden layer 2 include several neurons, and the output layer is 1 neuron.
8. The intelligent chemical dosing optimization method for a water supply project according to claim 7, wherein Use the historical water quality and quantity data of the water treatment plant as the data set, and take 70% of the water quality and quantity data of the data set as the training set and 30% of the water quality and quantity data as the test set in chronological order; Training the BP neural network model includes: In the first stage, according to the training set and the test set, the particle swarm optimization algorithm (PSO) is used to optimize the BP neural network. During the optimization process, a dynamic inertia weight adjustment strategy is adopted to update the weights: Among them, ω(o) is the weight at the o-th iteration; o is the number of iterations; O max is the maximum number of iterations; ω max and ω min are the maximum and minimum values of the weight, respectively; The particle velocity is updated using a formula that introduces an adaptive mutation factor: wherein, and are the velocities of the i-th particle at the (o + 1)-th and o-th iterations, respectively; c1 and c2 are both acceleration constants; r1 and r2 are random numbers within the interval [0, 1]; pbest is the historical optimal position of particle i; gbest is the global optimal position of the population; η = 0.1·e ―0.05*o is the mutation coefficient that decays exponentially with the number of iterations; e is the natural logarithm; N(0, 1) is a standard normal distribution random number; In the second stage, the genetic algorithm is used to optimize the BP neural network optimized in the first stage: The number of hidden layer neurons in the BP neural network is encoded as a binary chromosome. Using the RMSE of the test set as the fitness value, single-point crossover and Gaussian mutation are performed. Then, the roulette wheel selection method is used to retain the optimal individual. After iterating the preset number of times, the globally optimal PSO-GA-BP neural network is output.
9. The intelligent chemical dosing optimization method for a water supply project according to claim 8, characterized in that, The loss function of the PSO-GA-BP neural network adopts a dynamic function switching mechanism: The distribution form is judged according to the kurtosis of the effluent water quality and quantity data input into the PSO-GA-BP neural network. If the kurtosis > 3, the ReLU function is enabled; otherwise, the Sigmoid function or the LeakyReLU function is enabled.
10. The intelligent chemical dosing optimization method for a water supply project according to any one of claims 1-9, characterized in that, The effluent water quality and quantity data include the influent pH, influent turbidity, influent flow rate, effluent flow rate, effluent pH, effluent turbidity, and effluent residual chlorine.
Citation Information
Patent Citations
Intelligent coagulation chemical dosing control system for water plant and control method thereof
CN102385315A
Method for controlling automatic chemical dosing of high-turbidity water system
CN103011356A
Intelligent dosing system and method for high-fluorine wastewater treatment
CN117326751A
Cited By
Intelligent dosing dynamic optimization system for landfill leachate treatment
CN121044653A
Intelligent dosing dynamic optimization system for landfill leachate treatment
CN121044653B
Chlorination method and device for water supply network
CN121929796A
Chlorination method and apparatus for water supply network
CN121929796B