Intelligent dosing optimization method for water supply engineering based on dual-mode collaborative control

By employing a dual-modal collaborative control method for intelligent chemical dosing optimization in water supply projects, combined with fuzzy self-tuning PID and MPC algorithms, the dosage of sodium hypochlorite is dynamically adjusted, solving the problem of inconsistent sodium hypochlorite dosage in rural water supply projects. This achieves precise control of residual chlorine and microbial indicators, as well as efficient utilization of the chemicals.

CN120309078BActive Publication Date: 2026-01-02CHINA INST OF WATER RESOURCES & HYDROPOWER RES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510367954.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2026-01-02
Estimated Expiration
2045-03-26

AI Technical Summary

Technical Problem

The dosage of sodium hypochlorite in existing rural water supply projects does not match the actual demand, resulting in wasted energy and increased environmental pollution risks. Traditional PID feedback control lacks dynamic adaptability, making it difficult to monitor and optimize dosing strategies in real time, and lacks the ability to respond to emergencies.

Method used

A smart dosing optimization method for water supply engineering based on dual-modal collaborative control is adopted. It combines fuzzy self-tuning PID algorithm and model predictive control MPC algorithm. The machine learning model predicts the control quantity of the dosing pump and dynamically adjusts the prediction window and control quantity under steady-state and unsteady-state conditions of the water supply system. Combined with anti-integral saturation and execution protection mechanisms, the precise control of the dosing quantity is achieved.

Benefits of technology

It enables precise control of the dosage, ensuring that residual chlorine and microbial indicators meet standards, avoiding waste of chemicals, adapting to short-term changes in water quality and quantity, and improving the stability and emergency response capability of the water supply system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120309078B_ABST
    Figure CN120309078B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on dual-mode collaborative control's intelligent dosing optimization method of water supply project, it includes S1, obtains the water quality and quantity data of water supply system and the monitoring index of water supply system operating state in multiple successive control cycles close to current control cycle;S2, according to monitoring index and water quality and quantity data, determine whether the operating state of water supply system is in stable state, if yes, enter step S4, otherwise enter step S3;S3, the control amount of dosing pump in current control cycle is calculated using fuzzy self-tuning PID algorithm;S4, determine dynamic prediction time domain adjustment rule, input water quality and quantity data in time domain into machine learning model, and the control amount of dosing pump is obtained using model predictive control MPC algorithm;S5, according to the control amount of dosing pump of step S3 or step S4 control dosing pump to add reagent to clean water pool, and when water supply system is in operating state, and current control cycle is completed, return to step S1.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of drinking water disinfection, in particular to a water supply engineering intelligent dosing optimization method based on dual-mode collaborative control. BACKGROUND

[0002] Sodium hypochlorite disinfection mainly relies on hypochlorous acid to inhibit and destroy the function of various enzyme systems in the bacterial body, interfere with the oxidation-reduction effect in the bacterial body, and thus achieve the purpose of disinfection. It has high bactericidal capacity, low application cost and mature technology, and is widely used as a disinfection method for urban and rural drinking water.

[0003] Since the "14th Five-Year Plan", rural water supply has developed towards scale, standardization and intelligence. By the end of 2024, the proportion of scale water supply projects covering rural population will reach 65%, which has become the main component of rural water supply projects, but the situation of microbial or disinfection by-product exceeding the standard still occurs. Experience-based dosing is usually based on fixed standards, resulting in a mismatch between sodium hypochlorite dosage and actual demand, wasting energy and increasing the risk of environmental pollution; traditional PID feedback control lacks dynamic adaptability, and if the water quality parameter fluctuates greatly, it is difficult to accurately predict the sodium hypochlorite dosage; it also lacks real-time monitoring and feedback, and cannot evaluate the dosing effect in real time, making it difficult to optimize the dosing strategy, and also lacks the ability to respond to emergency events. SUMMARY

[0004] In view of the above deficiencies in the prior art, the water supply engineering intelligent dosing optimization method based on dual-mode collaborative control provided by the present application solves the problem that the residual chlorine and microorganisms in the existing water supply engineering cannot meet the water quality requirements of effluent.

[0005] In order to achieve the above-mentioned purpose of the application, the technical solution adopted by the present application is:

[0006] A water supply engineering intelligent dosing optimization method based on dual-mode collaborative control is provided, which comprises the following steps:

[0007] S1, obtaining the effluent water quality and quantity data and monitoring indicators of the running state of the water supply system in a plurality of consecutive control periods adjacent to the current control period;

[0008] S2, determining whether the running state of the water supply system is in a stable state according to the monitoring indicators and the effluent water quality and quantity data, if yes, proceeding to step S4, otherwise proceeding to step S3;

[0009] S3, calculating the dosing pump control amount in the current control period by using a fuzzy self-tuning PID algorithm;

[0010] S4, determine a dynamic prediction time domain adjustment rule, input the water quality and quantity data in the time domain into a machine learning model, and obtain a dosing pump control amount by using a model predictive control (MPC) algorithm;

[0011] S5, control the dosing pump to add the medicament to the clear water pool according to the dosing pump control amount in step S3 or step S4, and return to step S1 when the water supply system is in a running state and a current control period is completed.

[0012] Further, the method of obtaining the dosing pump control amount by using the model predictive control (MPC) algorithm comprises:

[0013] According to the water quality and quantity data and monitoring indexes in a plurality of continuous control periods adjacent to a current control period, a rolling optimization objective function is used to determine a dynamic prediction time domain:

[0014]

[0015] wherein, J is an optimization objective function; N p is a dynamic prediction time domain; y pred (k) is a prediction output of the kth step; y ref is a reference target value; Q is a weight matrix of output deviation (fixed as 1.0); Δu k =u(k)―u(k―1) is a control amount change rate of the kth step; u(k) and u(k―1) are control amounts of the kth and (k-1)th steps respectively; λ is a steady-state deviation penalty coefficient (fixed as 0.1); u nom is a nominal value; ‖·‖ 2 is a quadratic norm; N c is a fixed control time domain.

[0016] From a current time t, an N p output sequence {y pred (1),…,y pred (N p )} predicted by the machine learning model is obtained, and the optimal prediction time domain is determined according to a target function change rate <0.1%;

[0017] Further, the dynamic prediction time domain adjustment rule is determined by using a fuzzy rule, and the implementation method comprises:

[0018] When the water inflow deviation ΔQ≥30% and the residual chlorine change rate >0.2 mg / (L·min), N p =8 is set; when the running state of the water supply system is stable, N p =15 is set; when the turbidity suddenly increases by >50% or the pH changes by >0.2, N p =10 is set.

[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 the microbial index and residual chlorine index meet the standard requirements, the purpose at this time is to stabilize the dosage of chemicals and prevent the generation of disinfection byproducts. Through adaptive prediction time domain and machine learning model, when all water quality and quantity parameters fluctuate little, the prediction window can be extended to improve steady-state accuracy. When the flow rate and residual chlorine and other indicators change significantly, the prediction window can be shortened to respond quickly to sudden changes.

[0020] Furthermore, step S3 further includes:

[0021] Read the adjustment amount ΔK of the proportional coefficient, integral coefficient, and derivative coefficient in the fuzzy rule table. p ΔK i ΔK d Calculate the proportional coefficient K of the fuzzy self-tuning PID algorithm. p Integration time K i and differential time K p :

[0022]

[0023] Among them, K p0 K i0 and K d0 K p K i and K p The initial value; μ(·) is the membership function; e is the error level; The rate of change of error;

[0024] According to K p K i and K p Calculate the control quantity of the dosing pump within the current control cycle:

[0025]

[0026] Where u(t) is the control quantity of the dosing pump at time t; e(t) is the error level at time t; This is the cumulative value of the integral term.

[0027] The beneficial effects of the above technical solution are as follows: when residual chlorine or microbial indicators exceed the standard, the control quantity of the dosing pump needs to be increased or decreased immediately. Event-triggered PID control can compensate for the ineffective prediction of MPC and ensure water quality safety in a timely manner.

[0028] Furthermore, the intelligent dosing optimization method for water supply projects also includes anti-integral saturation and execution protection mechanisms:

[0029] A1. Determine whether the control quantity u(t) has reached the control quantity limit u. min =0%orumax = 100%, if yes, go to step A2, otherwise, do not update the dosing pump control amount;

[0030] A2, update the bleeder strategy of the dosing pump:

[0031] ∫e(t)dt = ∫e(t)dt - a e(t)

[0032] wherein a is a bleeder coefficient;

[0033] A3, update the dosing pump control amount according to the bleeder strategy ∫e(t)dt:

[0034]

[0035] The beneficial effects of the above technical solutions are: the anti-integral saturation and execution protection mechanism designed in the scheme can avoid the continuous accumulation of integral items leading to the control amount being unable to exit the saturation state, so that the calculated control amount is too large, which increases the dosing amount and causes water pollution; at the same time, it can also avoid the control amount exceeding the limit, so that the dosing pump runs under high load, affecting the service life of the dosing pump.

[0036] Further, the monitoring indicators include total bacterial count and coliform group number; the operation state determination method of the water supply system includes:

[0037] B1, when the residual chlorine concentration exceeds [0.3, 1.0] mg / L or the total bacterial count is greater than 100 CFU / mL or the coliform group is detected or the dosing amount deviation is greater than a preset threshold in multiple consecutive control periods or the sensor communication state is timeout for more than a preset time, it is considered that the operation state of the water supply system is unstable;

[0038] B2, when the residual chlorine concentration, total bacterial count, coliform group, dosing amount deviation and sensor communication state do not satisfy the conditions corresponding to step B1, it is considered that the operation state of the water supply system is stable;

[0039] In the determination of the operation state of the water supply system, the priority order is microorganism exceeding the standard > residual chlorine exceeding the limit > sensor communication failure > 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 a plurality of neurons, the number of neurons is the same as the number of parameters included in the outlet water quality and quantity data; the hidden layer 1 and the hidden layer 2 each include a plurality of neurons, and the output layer is one neuron, i.e. linear activation.

[0042] Further, the historical effluent quality and quantity data of the water plant is used as a data set, and 70% of the effluent quality and quantity data of the data set is used as a training set and 30% of the effluent quality and quantity data is used as a test set in chronological order; the training of the BP neural network model includes two stages, which are respectively:

[0043] In the first stage, the particle swarm optimization algorithm PSO is used to optimize the BP neural network according to the training set and the test set, and a dynamic inertia weight adjustment strategy is used to update the weight in the optimization process:

[0044]

[0045] wherein, ω(o) is the weight at the oth iteration; o is the iteration number; O max is the maximum iteration number; ω max and ω min are the maximum and minimum values of the weight respectively;

[0046] The particle velocity is updated by using a formula introducing an adaptive mutation factor:

[0047]

[0048] wherein, and are the velocities of the ith particle at the o+1th and oth iterations; c1 and c2 are acceleration constants; r1 and r2 are random numbers in the interval [0, 1]; pbest is the historical optimal position of the particle i; gbest is the global optimal position of the group; η = 0.1·e ―0.05*o is an exponentially decaying mutation coefficient with the iteration number; e is the natural logarithm; N(0, 1) is a standard normal distribution random number, which enhances the global search ability;

[0049] In the second stage, the BP neural network optimized by the particle swarm optimization algorithm PSO is optimized by using a genetic algorithm:

[0050] The number of hidden layer neurons of the BP neural network is encoded as a binary chromosome, the RMSE of the test set is used 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, and the globally optimal PSO-GA-BP neural network is output after a preset number of iterations.

[0051] The beneficial effects of the above technical solution are that the machine learning model of the present scheme breaks through the single optimization method of traditional machine learning, dynamically adjusts the neural network weight and topology structure by fusing the two-stage optimization strategy of particle swarm optimization (PSO) and genetic algorithm (GA), and can significantly improve the prediction accuracy and generalization ability of the model to the control amount of the chemical dosing pump.

[0052] Further, the loss function of the PSO-GA-BP neural network adopts a dynamic function switching mechanism as follows:

[0053] According to the kurtosis of the effluent quality and quantity data input into the PSO-GA-BP neural network, if the kurtosis is greater than 3, the ReLU function is enabled, otherwise the Sigmoid function or the LeakyReLU function is enabled.

[0054] The scheme adopts a dynamic activation function switching mechanism to accurately predict the optimal dosage of sodium hypochlorite.

[0055] Further, the effluent quality and quantity data includes influent pH, influent turbidity, influent flow, effluent flow, effluent pH, effluent turbidity and effluent residual chlorine.

[0056] The beneficial effects of the present application are: the dual-mode control composed of the MPC dominated optimization mode and the PID dominated emergency mode overcomes the defects of single control system, can accurately control the dosage, can avoid waste of reagent while ensuring that residual chlorine and microorganisms meet the effluent quality requirements, and is especially suitable for rural large-scale water supply projects with large short-term changes in water quality and quantity. BRIEF DESCRIPTION OF DRAWINGS

[0057] Figure 1 The flowchart of the intelligent dosing optimization method for water supply engineering based on dual-mode collaborative control. DETAILED DESCRIPTION

[0058] The specific embodiments of the present application are described below to facilitate understanding by those skilled in the art, but it should be clear that the present application is not limited to the scope of the specific embodiments, and for those skilled in the art, it is obvious that various changes are within the spirit and scope of the present application defined and determined by the appended claims, and all applications utilizing the concept of the present application are within the scope of protection.

[0059] REFERENCE Figure 1 , Figure 1 The flowchart of the intelligent dosing optimization method for water supply engineering based on dual-mode collaborative control is shown; as shown in Figure 1 , the method S includes steps S1-S5.

[0060] In step S1, the effluent quality and quantity data of the water supply system and the monitoring indicators of the running state of the water supply system in multiple consecutive control periods immediately adjacent to the current control period are obtained; in the present scheme, the effluent quality and quantity data includes influent pH, influent turbidity, influent flow, effluent flow, effluent pH, effluent turbidity and effluent residual chlorine; the monitoring indicators include dosage, total bacterial count and coliform count.

[0061] The total number of colonies and the number of coliform bacteria are detected in real time by a microorganism online monitor (model JMS-CLMII-A), and communicate with the PLC through an RS-485 interface. The sensors for collecting the water quality and quantity data of the effluent water are connected to the Siemens S7-1200 PLC through the SM1231 (4AI).

[0062] In step S2, whether the running state of the water supply system is in a stable state is determined according to the monitoring indexes and the water quality and quantity data of the effluent water. If yes, step S4 is entered, otherwise step S3 is entered.

[0063] In implementation, the preferred method for determining the running state of the water supply system comprises:

[0064] B1, when the residual chlorine concentration exceeds [0.3, 1.0] mg / L, or the total number of colonies is greater than 100 CFU / mL, or coliform bacteria are detected, or the dosing amount deviation is greater than a preset threshold in multiple consecutive control periods, or the sensor communication state timeout is greater than a preset time, the running state of the water supply system is considered to be unstable;

[0065] B2, when the residual chlorine concentration, the total number of colonies, coliform bacteria, the dosing amount deviation and the sensor communication state do not satisfy the conditions corresponding to step B1, the running state of the water supply system is considered to be stable;

[0066] In the determination of the running state of the water supply system, the priority order is microorganism exceeding the standard > residual chlorine exceeding the limit > sensor communication failure > dosing amount deviation.

[0067] The preferred scheme considers that the water supply system is unstable when the total number of colonies exceeds the standard or coliform bacteria are detected or the residual chlorine concentration exceeds the standard in one control period. For other cases, any one of the conditions corresponding to step B1 is satisfied in three consecutive control periods, and the system is considered to be unstable.

[0068] In step S3, a fuzzy self-tuning PID algorithm is used to calculate the control amount of the dosing pump in the current control period. In the implementation process of the fuzzy self-tuning PID algorithm, the proportional, integral and differential coefficients are dynamically adjusted according to the error level (large, medium and small) and the error change rate (positive, zero and negative). The specific implementation process is as follows:

[0069] Read the adjustment amount ΔK of the proportional coefficient, the integral coefficient and the differential coefficient in the fuzzy rule table p , ΔK i , ΔK d , calculate the proportional coefficient K p , the integral time K i and the differential time K p of the fuzzy self-tuning PID algorithm:

[0070]

[0071] wherein, K p0 , K i0 and K d0 are initial values of K p , K i and K p respectively; μ(·) is a membership function; e is an error level; is a rate of error change;

[0072] According to K p , K i and K p , the control amount of the chemical dosing pump in the current control period is calculated:

[0073]

[0074] wherein, u(t) is the control amount of the chemical dosing pump at time t; e(t) is the error level at time t; is the cumulative value of the integral term.

[0075] In the process of fuzzy self-tuning PID algorithm, anti-integral saturation and execution protection mechanism are also included:

[0076] A1, judge whether the control amount u(t) reaches the control amount limit (u min = 0% or u max = 100%), if yes, go to step A2, otherwise, do not update the control amount of the chemical dosing pump;

[0077] A2, update the discharge strategy of the chemical dosing pump:

[0078] ∫e(t)dt = ∫e(t)dt - α·e(t)

[0079] wherein, α is a discharge coefficient;

[0080] A3, update the control amount of the chemical dosing pump according to the discharge strategy ∫e(t)dt:

[0081]

[0082] When the fuzzy self-tuning PID algorithm is adopted, the motor current of the chemical dosing pump needs to be detected in real time, if it exceeds the rated value of 120% for 2 seconds, it is determined to be stuck, and the standby chemical dosing pump is automatically switched to, and the integral term ∫e(t)dt is reset to 0.

[0083] When the fuzzy self-tuning PID algorithm is executed, the fuzzy rule table involved can refer to Table 1.

[0084] Table 1

[0085]

[0086] In step S4, the dynamic prediction time-domain adjustment rules are determined, and the effluent quality and quantity data within the time domain are input into the machine learning model. The model predictive control (MPC) algorithm is used to obtain the dosing pump control quantity. The specific implementation process of step S4 is as follows:

[0087] First, based on the effluent quality and quantity data and monitoring indicators from multiple consecutive control cycles immediately adjacent to the current control cycle, the dynamic prediction time domain is determined using an optimized objective function:

[0088]

[0089] Where J is the objective function; N p For dynamic prediction in the time domain; y pred (k) represents the predicted output at step k; y ref The reference target value is Q; Q is the weight matrix of the output deviation (fixed at 1.0); Δu k =u(k)―u(k―1) is the rate of change of the control quantity 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 Nominal value; ||·|| 2 It is the quadratic norm; N c R represents the fixed control time domain; R is the weight matrix for the penalty control variable change.

[0090] Starting from the current time t, obtain the N predicted by the PSO-GA-BP neural network. p Step output sequence {y pred (1),…,y pred (N p Based on the objective function's rate of change being <0.1%, the optimal prediction time domain is determined; pred (1) and y pred (N p () for step 1 and N p The predicted output of the step.

[0091] When the optimal prediction time domain is obtained by 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 variable amplitude is 0 ≤ u(k) ≤ 100% (k = 0, 1, ..., N). c —1) For the physical operating range of the dosing pump (0% to 100% opening), the constraint condition for the rate of change of the control quantity is |Δu k |≤20% (k=0,1,…,N) c —1) This setting can prevent the actuator from making frequent and large movements.

[0093] In implementation, this scheme preferably adopts fuzzy rule-based dynamic prediction of time-domain adjustment rules, and its implementation method is as follows:

[0094] When the influent flow rate deviation ΔQ ≥ 30% and the residual chlorine change rate > 0.2 mg / (L·min), N is set. p =8; When the water supply system is in a stable operating state, set N. p =15; When turbidity suddenly increases by more than 50% or pH changes by more than 0.2, set N... p =10.

[0095] An example is used to illustrate the selection of the time domain for dynamic prediction and the method for optimizing drug dosing:

[0096] Assuming that rural residents return to their hometowns for the Spring Festival, causing the inflow rate to increase from 150m³ / h 3 / h suddenly increased to 300m 3 / h, at which point the dynamic prediction time domain is shortened to N p =8, lower the prediction window to prioritize increasing the control volume of the dosing pump, and then make adjustments based on the intelligent dosing optimization method of the water supply project in this scheme. When the influent flow rate changes significantly, the MPC control can still predict the dosing amount to a higher value, and the actual residual chlorine concentration remains stable above 0.75mg / L, with no residual chlorine deficiency.

[0097] In step S5, the dosing pump is controlled to add chemicals to the clear water tank according to the dosing pump control quantity in step S3 or S4. When the water supply system is running and the current control cycle is complete, the process returns to step S1. Theoretically, the water supply system will run continuously; the optimization method in this scheme starts and stops with the water supply system.

[0098] In one 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, which correspond to the influent pH, influent turbidity, influent flow rate, effluent flow rate, effluent pH, effluent turbidity, and effluent residual chlorine in the effluent water quality and quantity data, respectively; the hidden layer 1 includes 15 neurons, i.e., the ReLU activation function, the hidden layer 2 includes 8 neurons, i.e., the LeakyReLU activation function, and the output layer is 1 neuron, i.e., linear activation.

[0100] The scheme uses Raspberry Pi 4B as the upper computer, which is used to arrange the machine learning model, and the operating system is Ubuntu 22.04. The PH, turbidity and flow of the scheme are collected by pH meter, turbidimeter and flowmeter. These sensors are connected to the SM1231 module of the PLC through 4-20mA analog signal, the online microbial monitor (JMS-CLM II-A in this embodiment) is connected to the PLC through RS-485 interface, and the dosing pump is controlled by the 4-20mA signal output by the SM1232 module of the PLC.

[0101] When training the machine learning model, the historical water quality and quantity data of the water plant is used as the data set, the Kolmogorov-Smirnov test is used to clean the data (significance level p<0.05) and remove outliers, the Box-Cox transformation is used for skewness distribution parameters (such as turbidity), and the Z-score standardization is used to make the mean value 0 and the standard deviation 1; then, according to the time sequence, 70% of the water quality and quantity data of the data set is used as the training set, and 30% of the water quality and quantity data is 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, 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 used to update the weight during the optimization process:

[0103]

[0104] Wherein, ω(o) is the weight of the oth iteration; o is the iteration number; O max is the maximum iteration number; ω max and ω min are the maximum and minimum values of the weight respectively;

[0105] The particle velocity is updated by introducing an adaptive mutation factor formula:

[0106]

[0107] Wherein, and are the velocities of the ith particle at the o+1th and oth iterations; 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 mutation coefficient that exponentially decays with the iteration number; e is the natural logarithm; N(0,1) is a standard normal distribution random number, which enhances the global search ability;

[0108] In the second stage, the BP neural network optimized in the first stage is optimized by using a genetic algorithm:

[0109] The number of hidden layer neurons of the BP neural network is coded as a binary chromosome, the RMSE of the test set is used 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, and the globally optimal PSO-GA-BP neural network is output after a preset number of iterations.

[0110] The loss function of the PSO-GA-BP neural network adopts a dynamic function switching mechanism:

[0111] According to the kurtosis of the input PSO-GA-BP neural network water quality and quantity data, if the kurtosis is greater than 3, the ReLU function is enabled, otherwise the Sigmoid function or the LeakyReLU function is enabled.

[0112] The two-stage optimization of the BP neural network will be described in detail below:

[0113] Neural network structure optimization: 7 neurons in the input layer (corresponding to 7 water quality parameters), hidden layer, first stage PSO optimization: dynamic inertia weight adjustment, formula: (T max = 100 iterations, particle number 30, acceleration constant c1 = c2 = 1.5); hidden layer, second stage GA optimization: binary encoding of hidden layer neuron number (hidden layer 1: 8-20, step 2; hidden layer 2: 4-12, step 2), fitness function is test set RMSE, 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 (dosing pump control amount prediction value), linear activation;

[0114] Mixed optimization process: PSO stage iterates 50 times to optimize the initial weight, and the velocity update formula adds an adaptive mutation factor; GA stage retains the top 10% individuals by roulette wheel selection, performs single-point crossover and Gaussian mutation (standard deviation σ = 0.1).

[0115] This scheme preferentially fine-tunes the PSO-GA-BP neural network every 24 hours using the latest water quality and quantity data, updates the weight and topology structure; if the prediction error is greater than 15% for 5 consecutive times, trigger model retraining.

[0116] In summary, the scheme forms a dual-mode collaborative logic and switching strategy through MPC and PID, which ensures that the residual chlorine and microorganisms meet the water quality requirements while avoiding the waste of chemicals.

Claims

1. A water supply engineering intelligent dosing optimization method based on bimodal collaborative control, characterized in that, The method comprises the steps of: S1, obtaining the water quality and quantity data of the water supply system and the monitoring index of the running state of the water supply system in the multiple continuous control periods adjacent to the current control period; the water quality and quantity data of the water supply system includes the pH of the inlet water, the turbidity of the inlet water, the flow of the inlet water, the flow of the outlet water, the pH of the outlet water, the turbidity of the outlet water and the residual chlorine of the outlet water; S2, determining whether the running state of the water supply system is in a stable state according to the monitoring index and the water quality and quantity data of the inlet and outlet water, if yes, proceeding to step S4, otherwise, proceeding to step S3; S3, calculating the control amount of the chemical dosing pump in the current control period by using a fuzzy self-tuning PID algorithm; S4, determining a dynamic prediction time domain adjustment rule, inputting the water quality and quantity data of the inlet and outlet water in the time domain into a machine learning model, and obtaining the control amount of the chemical dosing pump by using a model predictive control (MPC) algorithm; S5, controlling 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 returning to step S1 when the water supply system is in a running state and the current control period is completed; The method for determining the dynamic prediction time domain adjustment rule comprises: determining the dynamic prediction time domain by using a rolling optimization objective function according to the water quality and quantity data of the inlet and outlet water and the monitoring index in the multiple continuous control periods adjacent to the current control period; where J is an optimization objective function; is a dynamic prediction horizon; is a prediction output of the kth step; is a reference target value; Q is a weight matrix of output deviation; is a control amount change rate of the kth step; and are control amounts of the kth and k-1th steps, respectively; is a steady-state deviation penalty coefficient; is a nominal value; is a quadratic norm; is a fixed control horizon; R is a weight matrix of penalizing control amount change. From the current time t, the machine learning model prediction is obtained Step output sequence }, the optimal prediction time domain is determined according to the target function change rate <0.1%.

2. The intelligent dosing optimization method for water supply engineering according to claim 1, characterized in that, Step S3 further comprises: Read the adjustment amount of the proportional coefficient, integral coefficient and differential coefficient in the fuzzy rule table , , , calculate the proportional coefficient of the fuzzy self-tuning PID algorithm , integral time and differential time : wherein, , and are initial values of , and respectively; is a membership function; is an error level; is an error rate of change; According to , and , the dosing pump control quantity in the current control period is calculated: wherein, is the control amount of the pump at time t; is the error level at time t; is the cumulative value of the integral term.

3. The intelligent dosing optimization method for water supply engineering according to claim 2, characterized in that, It also includes an anti-integral saturation and execution protection mechanism: A1, judge control amount whether the control amount limit is reached, if yes, go to step A2, otherwise, do not update the dosing pump control amount; A2, updating the bleeding strategy of the chemical dosing pump: wherein is the bleed-off coefficient; A3. According to the bleed strategy Update the control amount of the charge pump 。 4. The intelligent dosing optimization method for water supply engineering of claim 1, wherein, The monitoring index includes the total number of colonies, the number of coliform bacteria, the chemical dosage deviation and the sensor communication state; the method for determining the running state of the water supply system comprises: B1, when the residual chlorine concentration exceeds [0.3, 1.0] mg / L, or the total number of colonies is greater than 100 CFU / mL, or coliform bacteria are detected, or the chemical dosage deviation is greater than a preset threshold in multiple continuous control periods, or the sensor communication state is timeout for more than a preset time, it is considered that the running state of the water supply system is unstable; B2, when the residual chlorine concentration, the total number of colonies, the coliform bacteria, the chemical dosage deviation and the sensor communication state do not satisfy the conditions corresponding to step B1, it is considered that the running state of the water supply system is stable; When determining the running state of the water supply system, the priority order is microorganism exceeding the standard > residual chlorine exceeding the limit > sensor communication failure > chemical dosage deviation.

5. The intelligent dosing optimization method for water supply engineering of claim 1, wherein, The dynamic prediction time domain adjustment rule is implemented by using a fuzzy rule, and the implementation method comprises: When the water inflow deviation AQ≥30% and the residual chlorine change rate >0.2 mg / (L·min), set When the running state of the water supply system is stable, set When the turbidity suddenly increases by >50% or the pH changes by >0.2, set .

6. The intelligent dosing optimization method for water supply engineering of claim 1, wherein, The machine learning model is a BP neural network model, which comprises an input layer, a hidden layer 1, a hidden layer 2 and an output layer connected in sequence; The input layer comprises a plurality of neurons, the number of neurons is the same as the number of parameters included in the water quality and quantity data of the inlet and outlet water; the hidden layer 1 and the hidden layer 2 each comprise a plurality of neurons, and the output layer is one neuron.

7. The intelligent dosing optimization method for water supply engineering according to claim 6, characterized in that, The historical water quality and quantity data of the inlet and outlet water of the water plant are used as a data set, and 70% of the data set is arranged in time sequence as a training set, and 30% of the data set is arranged in time sequence as a test set; The training of the BP neural network model comprises: In the first stage, the BP neural network is optimized by using a particle swarm optimization (PSO) algorithm according to the training set and the test set, and a dynamic inertia weight adjustment strategy is used to update the weight during the optimization process: wherein, W0is the weight at the 0th iteration; o is the iteration number; is the maximum iteration number; and are the maximum and minimum values of the weights, respectively; The particle velocity is updated by using a formula with an adaptive mutation factor: where, and are the velocities of the ith particle at the (o + 1)th and oth iteration, respectively; and are acceleration constants; and are random numbers in the interval [0, 1]; is the historical best position of particle i; is the global best position of the population; is a mutation coefficient exponentially decaying with the iteration number; e is the natural logarithm; is a standard normal distributed random number; In the second stage, the BP neural network optimized in the first stage is optimized by using a genetic algorithm: The number of hidden layer neurons of the BP neural network is coded as a binary chromosome, the RMSE of the test set is used 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, and the globally optimal PSO-GA-BP neural network is output after a preset number of iterations.

8. The intelligent dosing optimization method for water supply engineering according to claim 7, characterized in that, The loss function of the PSO-GA-BP neural network adopts a dynamic function switching mechanism: According to the kurtosis of the input PSO-GA-BP neural network water quality and quantity data, the distribution form is judged, if the kurtosis is greater than 3, the ReLU function is enabled, otherwise the Sigmoid function or the LeakyReLU function is enabled.

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