Polyferric chloride intelligent dosing control system and multi-parameter feedback control method
Through the intelligent dosing control system and multi-parameter feedback method, the PFC dosing amount is optimized by LSTM neural network and fuzzy PID control, which solves the lag and adaptability problems of the dosing amount of polymer ferric chloride, and achieves efficient and accurate sewage treatment, reducing costs and improving water quality stability.
Patent Information
- Application Number
- CN202510803626.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-07-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing wastewater treatment, there are problems of large errors, delayed response time and poor control adaptability, which cannot achieve time, efficient and accurate regulation, resulting in high treatment costs and unstable water quality.
A smart dosing control system for polymer ferric chloride is adopted, combining multi-parameter prediction and feedback control methods, and real-time data is collected using industrial-grade sensor arrays, and water quality parameter changes are predicted through improved LSTM neural network model, combined with fuzzy PID control and Q-learning reinforcement learning to optimize PID parameters, to dynamically adjust the amount of PFC dosing, and ensure control accuracy and real-time through edge computing and feedback optimization modules.
It significantly improves water quality stability and drug utilization rate, reduces PFC consumption by 29%, reduces operation and maintenance costs by 89%, and shortens the response time from minute to second level, effectively avoiding the risk of excessive phosphorus emissions.
Smart Images

Figure CN120383374A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent control in sewage treatment, and particularly to an intelligent dosing control system for polyferric chloride and a multi-parameter feedback control method. Background Art
[0002] In municipal sewage treatment, polyferric chloride (PFC) is widely used as an efficient coagulant. The Fe in polyferric chloride (PFC) 3+ can react with PO4 in sewage 3- to form FePO4 precipitate. If the dosage of polyferric chloride is insufficient, the total phosphorus (TP) in the treated sewage will exceed the standard (i.e., greater than 0.5 mg / L). However, excessive dosing will increase the iron content in the sludge (iron content > 8% (dry weight)), affecting the dewatering performance and increasing the treatment cost at the same time (it should be noted that PFC accounts for 35 - 50% of the sewage treatment chemical cost). To ensure the effect of sewage treatment, the staff must accurately control the dosage of polyferric chloride (PFC). However, the traditional control method for the dosage of polyferric chloride (PFC) has problems such as large errors, lag in response time, and poor control adaptability.
[0003] To solve the above technical problems, those skilled in the art proposed a patent application named an intelligent dosing control method and system for phosphorus removal based on a big data prediction model, with the publication number CN119596686A (hereinafter referred to as the 1st background art). It can be seen from paragraphs
[0047] -
[0089] disclosed in the specification of the 1st background art that the 1st background art analyzes the production operation and maintenance data of the sewage treatment plant, establishes a big data prediction model to predict the concentration in the chemical phosphorus removal process of sewage treatment, and optimizes the dosing amount of the phosphorus removal agent through the PO intelligent dosing control system, achieving the purpose of timely dosing the phosphorus removal agent as needed and accurately, and solving the problems of the long lag in detection time of the on-line detection instrument and the data accuracy. However, the 1st background art has the following deficiencies in the implementation process:
[0004] Firstly, the technical solution of the 1st background art relies on off-line data to calibrate on-line detection data (such as off-line data manually input), resulting in lag in data update, unable to meet the real-time control requirements, and the system needs to wait for the input of off-line data to optimize the model, with a delay in response during sudden water quality fluctuations;
[0005] Secondly, the big data prediction model constructed based on historical data in the 1st background art involves multi-dimensional parameters (such as MLSS, HRT, SRT, etc.), with high computational complexity and insufficient edge computing ability, affecting the real-time decision-making speed, long prediction time-consuming (relying on cloud computing delay > 1.5 s), and unable to meet the high-frequency control requirements (such as minute-level adjustment).
[0006] In addition, those skilled in the art have proposed a patent named "A Method for Dosage of Chemical Phosphorus Removal Agents in a Reclaimed Water Plant Based on Fuzzy Control" with the publication number CN103570190B (hereinafter referred to as the second background technology). It can be seen from paragraphs
[0044] -
[0104] disclosed in the specification of the second background technology that the second background technology constructs a feedforward control link based on a phosphorus removal dosing model, and takes the outlet phosphorus content, influent flow rate, and inlet phosphorus content as the inputs of the fuzzy system, and outputs a control quantity compensation value. The introduction of the compensation value enables the system to have a certain adaptive ability, which is beneficial to excluding the interference of subsequent phosphorus removal processes such as biological phosphorus removal. Since other influencing factors are considered in the fuzzy system of this method, the system can achieve a more accurate dosing process than general feedforward-feedback control methods, reducing the system operation cost; further promoting the absorption of organic matter, phosphorus, and nitrogen by microorganisms, reducing the consumption of chemical phosphorus removal reagents required, and at the same time, optimizing the biological colony structure in the biological tank to a certain extent; this method can not only reduce the economic burden of the sewage treatment plant, but also have a positive impact on the activated sludge process. However, the second background technology also has the following deficiencies in the implementation process:
[0007] First of all, the feedforward model parameters (such as b1-b6) adopted by the second background technology need to be manually fitted, and cannot dynamically adapt to water quality fluctuations (such as the non-linear relationship between COD / TP). The model generalization ability is insufficient. When the influent TP suddenly changes (such as suddenly increasing from 2mg / L to 8mg / L), the parameter segmentation interval switching is discontinuous, and the dosing amount jump error reaches 15%.
[0008] Secondly, the fuzzy rule base of the second background technology is statically constructed relying on expert experience, and no adaptive learning mechanism (such as Q-learning) is introduced. After long-term operation, the rule confidence decreases. When the wastewater components to be treated are complex (such as containing heavy metal interference), the fuzzy output compensation value (Δk) cannot accurately match the actual requirements.
[0009] In summary, those skilled in the art need an intelligent control system and control method that can timely, efficiently, and accurately regulate the PFC dosing amount according to the sewage treatment situation. Summary of the Invention
[0010] The purpose of the present invention is to solve the technical problem that the PFC dosing amount cannot be intelligently regulated in the existing sewage treatment process. The present invention designs an intelligent dosing control system for polyferric chloride and a multi-parameter feedback control method.
[0011] To achieve the above purpose, the technical solution of the present invention is that an intelligent dosing control system for polyferric chloride, the system includes the following parts:
[0012] A data acquisition module, used for real-time acquisition of parameter data;
[0013] A multi-parameter prediction module that predicts the changing trend of water quality parameters based on the collected multiple parameter data and the time series of the multiple parameter data, and obtains a prediction result;
[0014] A dynamic dosage calculation module that calculates the control parameters corresponding to the optimal PFC dosage according to the prediction result;
[0015] An execution control module that precisely controls the dosage of PFC based on the control parameters;
[0016] A feedback optimization module that analyzes the sewage treatment result, optimizes the multi-parameter prediction module, and simultaneously corrects the data acquisition module;
[0017] A human-computer interaction module that can provide a visual operation interface and a remote monitoring function, and perform data interaction with the data acquisition module, the dynamic dosage calculation module, and the feedback optimization module.
[0018] The data acquisition module uses an industrial-grade sensor array to collect multiple water quality parameters during the sewage treatment process and form a time-series water quality parameter sequence, and then transmits the time-series water quality parameter sequence to the multi-parameter prediction module.
[0019] The multi-parameter prediction module uses an improved LSTM neural network model with an introduced Attention mechanism to predict the changing trend of water quality parameters;
[0020] Among them, the improved LSTM neural network model with an introduced Attention mechanism adopts a four-layer time series prediction model structure, which includes:
[0021] Input layer: used to receive and process the time-series water quality parameter sequence to obtain a three-dimensional tensor with dimensions of batch size , time steps , features;
[0022] LSTM hidden layer: used to capture the long-term and short-term dependencies in the time series, and the capture process includes:
[0023] First, use the forget gate to determine whether to retain the state of the historical cell (C t-1 ), and the mathematical expression of the forget gate parameter is:
[0024] f t =σ(W f ·[h t-1 , x t +b f ) (1)
[0025] In the formula, f t is the forget gate parameter, W f is the weight matrix of the forget gate, h t-1is the hidden layer state at a historical moment, b f is the bias term of the forget gate, x t is the input vector at the current moment, and σ is the standard deviation;
[0026] Secondly, the input gate is used to generate a new candidate cell state. The mathematical expression of the input gate parameters is:
[0027] i t = σ(W i · [h t-1 , x t + b i ) (2)
[0028] The mathematical expression of the new candidate cell state is:
[0029]
[0030] where i t is the input gate parameter, W i is the weight matrix of the input gate, b i is the bias term of the input gate, is the new candidate cell state parameter, W c is the weight matrix of the new candidate cell state, b c is the bias term of the new candidate cell state, and tanh is the hyperbolic tangent function;
[0031] Finally, the output gate is used to output the long short-term dependence. The mathematical expression of the output gate parameters is:
[0032] o t = σ(W o · [h t-1 , x t + b o ) (4)
[0033] where o t is the input gate parameter, W o is the weight matrix of the input gate, b o is the bias term of the input gate,
[0034] The mathematical expression of the long short-term dependence is:
[0035] h t = o t ⊙ tanh(C t ) (5)
[0036] where h t is the hidden layer state at the current moment, C t is the cell state at the current moment, ⊙ is the Hadamard product, and tanh is the hyperbolic tangent function;
[0037] Attention layer: used to dynamically calculate the water quality characteristics at key time points. The calculation process is as follows:
[0038] First, calculate the attention weights. The mathematical expression is:
[0039]
[0040] where, e t is the attention weight, h T is the hidden layer state at the last moment, W a is the weight matrix, U a is the context correlation matrix, v a is the attention score vector;
[0041] Secondly, normalize the weights. The mathematical expression is:
[0042]
[0043] In the formula, α t is the attention weight at time step t, e k is the attention score;
[0044] Finally, generate the context vector. The mathematical expression is:
[0045]
[0046] In the formula, c is the context vector;
[0047] Fully connected layer: used to output the prediction result to the dynamic dosage calculation module. The mathematical expression is:
[0048] y t = W y ·c + b y (9)
[0049] In the formula, y t is the prediction result, W y is the output layer weight matrix, b y is the output layer bias term.
[0050] The process of the dynamic dosage calculation module calculating the control parameters corresponding to the optimal PFC dosage includes:
[0051] First, perform fuzzy processing on the received prediction result to obtain the input parameters e(t), Δe(t) and ω,
[0052] where,
[0053] e(t) is the current TP deviation, e(t) = TP set - TPpred , TP set is the target total phosphorus concentration (set value), TP pred : is the total phosphorus concentration predicted by the model;
[0054] Δe(t) is the deviation change rate, Δe(t) = e(t) - e(t - 1),
[0055] ω is the water quality weight coefficient, ω = 0.3COD + 0.4TP + 0.2pH + 0.1Turbidity;
[0056] Secondly, establish a fuzzy rule base, divide e(t), Δe(t) and ω into 3 levels each, and establish fuzzy rules as follows:
[0057] IF e(t) = High AND Δe(t) = Positive AND ω = High
[0058] THEN ΔK p = LargeIncrease, ΔK i = NoChange, ΔK d = SmallDecrease,
[0059] Optimize the fuzzy rule base using an adaptive learning mechanism and update the confidence of the fuzzy rules;
[0060] It should be noted that the process of updating the confidence of the fuzzy rules using the adaptive learning mechanism is as follows:
[0061] a. Update the learning objective in an incremental learning manner. The update period is triggered every 30 minutes. The learning objective is to minimize the dosage error. The expression for incremental learning is:
[0062]
[0063] In the formula, is the actual dosage, is the predicted dosage.
[0064] It should be noted that the calculation process of the predicted dosage is as follows:
[0065] Input: The dynamic dosage calculation module receives the predicted values of water quality parameters output by the multi-parameter prediction module (such as TP, COD in the next 15 minutes, obtained through formula (9));
[0066] Calculation:
[0067] 1. The fuzzy PID controller calculates according to the prediction deviation e(t) = TP set - TP pred(The difference between the target and the predicted value) and the dynamic weight ω, and outputs the PID parameter adjustment amount (ΔK p , ΔK i , ΔK d ) through the fuzzy rule base;
[0068] 2. Based on the adjusted parameters (Formula (13)), the fuzzy PID controller combines the real-time deviation e(t) and the deviation change rate Δe(t) to calculate the theoretical chemical dosage in real time:
[0069]
[0070] This theoretical value D pred (t) is the predicted dosing dose used for the incremental learning target of Formula (10) (compared and optimized with the actual dose D actual ).
[0071] The parameter adjustment expression for incremental learning is:
[0072]
[0073] where the learning rate η = 0.01, θ new is the updated model parameter, and θ old is the original model parameter before update;
[0074] b. Optimize the rule base and update the fuzzy rule confidence through Q-learning reinforcement learning:
[0075]
[0076] In the formula, the state s is the combination of water quality parameters, the action a is the PID parameter adjustment strategy, r is the reward function, r = -∣T Preal -T Pset ∣; α is the learning rate, with a value of 0.10.1, γ is the discount factor, usually taking 0.9, Q(s,a) represents the expected long-term cumulative reward for choosing action a in state s, is the expected reward for choosing the optimal action a' in the next state s';
[0077] It should be noted that using Q-learning to update the fuzzy rule confidence (Formula (12)), its effectiveness depends on the following design:
[0078] State design:
[0079] The state s = the combination of water quality parameters (such as "high COD, low TP"), which needs to be discretized into finite states (such as grading: Low / Medium / High).
[0080] Risk: If there are many parameters (COD / TP / pH / turbidity / heavy metals), the state space may explode (3 4 = 81 combinations).
[0081] Action design:
[0082] Action a = PID parameter adjustment strategy (such as "ΔK p = LargeIncrease").
[0083] The 9 rules of the fuzzy rule base (3 levels for each of e / Δe / ω) correspond to finite actions, which can avoid an overly large action space.
[0084] Reward function:
[0085] r = -∣TP real -TP set ∣ (Formula (12)), which is directly related to the control objective (TP compliance) and guides the learning direction correctly.
[0086] Actual effect verification:
[0087] In Example 2, the TP compliance rate of the system in the industrial wastewater scenario increased from 68% to 95%, proving that Q-learning effectively optimized the rule confidence and adapted to complex working conditions such as heavy metal interference.
[0088] Adjustment suggestions:
[0089] A neural network can be used to fit the Q function (DQN) to replace the table-lookup Q-learning to handle the high-dimensional state space.
[0090] Finally, output the control parameters in the dynamically adjusted state to the execution control module:
[0091]
[0092] In the formula, K p0 = 0.8, which is the reference proportionality coefficient; K i0 = 0.05, which is the reference integral coefficient; K d0 = 0.3, which is the reference differential coefficient, ΔK p ∈[-0.2, +0.5] (belongs to the fuzzy inference output parameter); K p (t) is the proportionality coefficient adjusted with time; K i (t) is the integral coefficient adjusted with time; K d (t) is the differential coefficient adjusted with time.
[0093] It should be noted that the present application dynamically adjusts the PID parameters through fuzzy rules (Formula (13)), and its effectiveness is reflected in:
[0094] Dynamic adaptability:
[0095] Proportional coefficient K p (t) Introduce water quality weight ω (such as the turbidity weight increases during rainstorms), enhancing the response to mutations (Implementation case: The rainstorm response time is reduced from 45 minutes to 8 minutes);
[0096] Integral coefficient K i (t) Is positively correlated with the deviation change rate ∣Δe∣, suppressing integral saturation and avoiding over - dosing;
[0097] Synergy of fuzzy rules and reinforcement learning:
[0098] Q - learning dynamically updates the confidence of the rule (such as "high e + positive Δe + high ω → greatly increase K p "), making the PID parameter adjustment more in line with the current water quality state;
[0099] Actual effect:
[0100] The PFC consumption is reduced by 29% (from 120 ± 50 kg to 85 ± 15 kg), proving that the fuzzy PID hybrid control significantly optimizes the dosing accuracy ( Figures 5-6 ).
[0101] Potential risk:
[0102] If the initial fuzzy rule base does not cover extreme working conditions (such as "extremely high" water quality parameters at the same time), it may lead to control failure. However, this application continuously optimizes the model through online self - calibration (formulas (14) - (15)), reducing this risk.
[0103] The execution control module includes: a variable - frequency speed - regulating peristaltic pump and a PLC closed - loop control system. Among them, the accuracy requirement of the variable - frequency speed - regulating peristaltic pump is ±1%, and the PLC closed - loop control system controls the dosing amount of PFC output by the variable - frequency speed - regulating peristaltic pump based on the received control parameters.
[0104] The optimization process of the feedback optimization module is to correct the prediction parameters in the multi - parameter prediction module using an online self - calibration algorithm, and then correct the standard of the water quality parameters collected in the data acquisition module using a data anomaly detection method;
[0105] Among them,
[0106] The self - calibration algorithm corrects the prediction parameters in the multi - parameter prediction module using a loss function, and the expression of the loss function is:
[0107] J(θ) = λ1·MSE pred +λ2·∣D opt -D real ∣ (14)
[0108] Among them, λ1 = 0.7, λ2 = 0.3, both of which are loss weight coefficients, J(θ) is the loss function, and MSE pred is the predicted mean squared error, D opt is the optimal dose, and D real is the actual dose;
[0109] The parameters of the loss function are updated as follows:
[0110]
[0111] Introduce a momentum term β = 0.9 to accelerate convergence, where θ (k+1) is the model parameter at the (k + 1)-th iteration, and θ (k) is the parameter updated at the k-th iteration, is the gradient of the loss function, and θ (k-1) is the historical parameter at the (k - 1)-th iteration;
[0112] The data anomaly detection method uses dynamic threshold calculation to correct the standard of the water quality parameters collected in the data acquisition module. The expression for calculating the water quality parameter x i is:
[0113]
[0114] In the formula, μ t is the mean value of the water quality parameter x within the time window t, σ t is the standard deviation of the water quality parameter x within the time window t, and x k is the input data at the k-th moment in the time series;
[0115] The anomaly judgment condition of the data anomaly detection method is:
[0116] |x new - μ t | > 3σ t (17)
[0117] The anomaly handling method of the data anomaly detection method is:
[0118] a. Trigger the sensor calibration program,
[0119] b. Enable historical data interpolation,
[0120] c. Freeze model updates until the data returns to normal.
[0121] The human-computer interaction module uses a WebGL 3D visualization engine and a multi-terminal adaptation framework, which can support the human-computer interaction needs of the PC, mobile, and PAD terminals.
[0122] A multi-parameter feedback control method, which includes the following steps:
[0123] Step 1, fusion processing. Use the data standardization processing matrix to standardize the multi-source data collected, solve the problems of asynchronous sensor detection data and inconsistent dimensions, and then adjust the time correlation of the multi-source data after standardization through the time alignment algorithm (the time alignment algorithm uses the cubic spline interpolation method to compensate for the time delay of the multi-source data), and finally complete the fusion processing process of the multi-source data;
[0124] Step 2, dynamic prediction. Based on the multi-source data after fusion processing, use the improved LSTM neural network model to predict the change trend of water quality parameters (this prediction process includes predicting the weight relationship between water quality parameters, and eliminating the coupling interference problem between multi-source water quality parameters through the prediction of the weight relationship), and obtain the prediction result;
[0125] Step 3, feedback control. Based on the prediction result, use the fuzzy PID control algorithm to calculate the control parameters of the optimal PFC dosing amount, and then optimize the prediction parameters in the multi-parameter prediction module according to the change of the sewage water quality parameters after dosing, and at the same time correct the standard of the water quality parameters collected in the data acquisition module to realize the feedback control process of the whole system.
[0126] The data standardization processing matrix in Step 1 is:
[0127]
[0128] In the formula, μ is the historical mean, and σ is the standard deviation.
[0129] Compared with the prior art, the present invention has the following beneficial effects:
[0130] 1. The present invention adopts multi-parameter collaborative prediction and control, significantly improving the water quality stability in the sewage treatment process. By using the method of multi-source data fusion (mainly the data acquisition module + multi-parameter prediction module), while realizing the monitoring of parameters such as influent flow rate, COD, TP, pH, turbidity, etc., the improved LSTM-Attention model is used to predict the water quality change trend in the next 15 minutes. Compared with the traditional single-parameter (such as only TP) feedback control, the prediction dimension is increased by more than 4 times; then, through dynamic weight adjustment, the water quality weight coefficient is introduced to dynamically allocate the influence weight of each parameter on the dosing amount, reducing the water quality fluctuation coefficient from 0.35 to 0.12 (a decrease of 65.7%), solving the control lag problem caused by the traditional method relying on a single parameter (detection lag of 45 - 60 minutes), and increasing the TP compliance rate from 82.5% to 98.7%, effectively avoiding the risk of excessive phosphorus discharge;
[0131] 2. The present invention significantly reduces the consumption of chemical agents through intelligent dosage decision-making and adaptive optimization. Specifically, a three-dimensional fuzzy rule base (with three levels for e, Δe, and ω respectively) is designed through a fuzzy-PID hybrid control (dynamic dosage calculation module), and the PID parameters are dynamically optimized by combining Q-learning reinforcement learning, enabling automatic enhancement of the proportional action at high loads (Kp is increased by 40%), suppressing differential oscillation during sudden shocks (Kd is decreased by 35%). Meanwhile, based on the gradient descent method and 3σ anomaly detection, the model parameters are updated every 30 minutes to continuously optimize the prediction accuracy. As a result, the daily average consumption of PFC is reduced from 120±50 kg to 85±15 kg (a 29% reduction), solving the problem of excessive dosing caused by manual experience (the peak value reaches 220% of the design value). At the same time, the frequency of manual intervention is reduced from 18 times per day to 2 times per day, reducing the operation and maintenance cost by 89%.
[0132] 3. The present invention adopts an edge-cloud collaborative architecture to ensure real-time performance and reliability. An improved LSTM model is deployed locally based on an edge computing device (NVIDIA Jetson Nano), with a single prediction time < 200 ms (the traditional cloud solution > 1.5 s), which can better meet the real-time control requirements. It has a 12-hour local cache built-in to ensure continuous operation during network interruptions, shortening the system response time from the minute level to within 30 seconds, and responding more promptly to sudden working conditions such as rainstorm impacts. BRIEF DESCRIPTION OF THE DRAWINGS
[0133] Figure 1 is a structural block diagram of an intelligent polyferric chloride dosing control system according to the present invention;
[0134] Figure 2 is a flowchart of a multi-parameter feedback control method according to the present invention;
[0135] Figure 3 is a comparative analysis table between an intelligent polyferric chloride dosing control system according to the present invention and the prior art;
[0136] Figure 4 is an analysis table of the functions of key parameters of an intelligent polyferric chloride dosing control system according to the present invention;
[0137] Figure 5 is a comparative analysis table between a multi-parameter feedback control method according to the present invention and a traditional control method;
[0138] Figure 6 is a performance analysis table of the transformation in Example 1 according to the present invention;
[0139] Figure 7 is a performance analysis table of the transformation in Example 2 according to the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0140] The present invention will be specifically described below with reference to the accompanying drawings, as Figures 1-5 shown;
[0141] An intelligent dosing control system for polymeric ferric chloride and a multi-parameter feedback control method. The system includes the following parts:
[0142] A data acquisition module for real-time acquisition of multiple parameters related to sewage treatment, such as influent flow rate, COD, TP, pH, turbidity, etc.;
[0143] A multi-parameter prediction module, based on the collected multiple parameter data and the time series of the multiple parameter data, predicts the change trend of water quality parameters in a future time period and obtains a prediction result; wherein, the time length of the time period is 1 - 15 minutes;
[0144] A dynamic dosage calculation module, which calculates the control parameters corresponding to the optimal PFC (abbreviation of Polymeric Ferric Chloride) dosage according to the prediction result;
[0145] An execution control module, which accurately controls the PFC dosing amount based on the control parameters corresponding to the optimal PFC dosage;
[0146] A feedback optimization module, based on the actual dosing amount, analyzes the sewage treatment result, that is, the change of sewage water quality parameters, and optimizes the prediction parameters in the multi-parameter prediction module according to the analysis result, and at the same time corrects the standard for collecting water quality parameters in the data acquisition module, thereby completing the feedback control process of the entire system;
[0147] A human-computer interaction module, which can provide a visual operation interface and remote monitoring function, display the data received from the data acquisition module, the dynamic dosage calculation module and the feedback optimization module, and at the same time remotely monitor the data acquisition module, the dynamic dosage calculation module and the feedback optimization module.
[0148] The data acquisition module uses an industrial-grade sensor array (such as a HACH multi-parameter probe) to collect multiple parameters in the sewage treatment process and form a time-series water quality parameter sequence, and then transmits the time-series water quality parameter sequence to the multi-parameter prediction module through the LoRa wireless transmission protocol.
[0149] The multi-parameter prediction module uses an improved LSTM neural network model with an Attention mechanism combined with an edge computing device (NVIDIA Jetson Nano) to predict the change trend of water quality parameters in a future time period;
[0150] Among them, the improved LSTM neural network model with an Attention mechanism adopts a four-layer time series prediction model structure, which includes:
[0151] Input layer: It is used to receive and process the time-series water quality parameter sequence. After receiving the time-series water quality parameter sequence (COD, TP, pH, turbidity, etc.) transmitted by the data acquisition module, it analyzes the time-series water quality parameter sequence to obtain a three-dimensional tensor with dimensions of batch size , time steps , and features. The main purpose of the input layer to process the time-series water quality parameter sequence is to standardize the data and establish the time dimension correlation of the data;
[0152] LSTM hidden layer: It is used to capture the long-term and short-term dependencies in the time series, and its capture process includes:
[0153] First, use the forget gate to determine the state of the historical cell (C t-1 ). The mathematical expression of the forget gate parameter is:
[0154] f t =σ(W f ·[h t-1 , x t +b f ) (1)
[0155] In the formula, f t is the forget gate parameter, W f is the weight matrix of the forget gate, and its dimension is R d×(d+n) (where d is the dimension of the hidden layer and n is the number of input features), h t-1 is the hidden layer state at time t-1, with a dimension of R d , b f is the bias term of the forget gate, with a dimension of R d , x t is the input vector at the current moment (including water quality parameters such as COD, TP, pH, turbidity, etc.), with a dimension of R n , and σ is the standard deviation;
[0156] Secondly, use the input gate to generate a new candidate cell state. The mathematical expression of the input gate parameter is:
[0157] i t =σ(W i ·[h t-1 , x t +b i ) (2)
[0158] The mathematical expression of the new candidate cell state is:
[0159]
[0160] In the formula, i t is the input gate parameter, W iis the weight matrix of the input gate, with dimension R d×(d+n) (where d is the hidden layer dimension and n is the number of input features), b i is the bias term of the input gate, with dimension R d , is the new candidate cell state parameter, W c is the weight matrix of the new candidate cell state, with dimension R d×(d+n) (where d is the hidden layer dimension and n is the number of new candidate cell state features), b c is the bias term of the new candidate cell state, with dimension R d ;
[0161] Finally, the long short-term dependencies are output using the output gate. The mathematical expression for the output gate parameters is:
[0162] o t = σ(W o ·[h t-1 , x t +b o ) (4)
[0163] In the formula, o t is the input gate parameter, W o is the weight matrix of the input gate, with dimension R d×(d+n) (where d is the hidden layer dimension and n is the number of input features), b o is the bias term of the input gate, with dimension R d ,
[0164] The mathematical expression for the long short-term dependencies is:
[0165] h t = o t ⊙ tanh(C t ) (5)
[0166] In the formula, h t is the hidden layer state at the current time, C t is the cell state at the current time, with dimension R d , ⊙ is the Hadamard product, and tanh is the hyperbolic tangent function;
[0167] Attention layer: Used to dynamically calculate the water quality characteristics at key time points. The calculation process is as follows:
[0168] First, calculate the attention weights. The mathematical expression is:
[0169]
[0170] where e t is the attention weight, h T is the hidden layer state at the last time, Wa is the weight matrix with a dimension of R d×d (where d is the dimension of the hidden layer), U a is the context correlation matrix with a dimension of ∈R d×d , v a is the attention score vector with a dimension of ∈R d ;
[0171] Secondly, normalize the weights, and its mathematical expression is:
[0172]
[0173] In the formula, α t is the attention weight at time step t, indicating the importance of the current moment for the prediction result, e k is the attention score;
[0174] Finally, generate the context vector, and its mathematical expression is:
[0175]
[0176] In the formula, c is the context vector, which aggregates the hidden state information of all time steps and is used for the final prediction;
[0177] Fully connected layer: used to output the prediction result to the dynamic dose calculation module. The prediction result is the predicted value of water quality parameters (such as COD, TP) in the next 1 - 15 minutes, and its mathematical expression is:
[0178] y t = W y ·c + b y (9)
[0179] In the formula, y t is the prediction result, W y is the output layer weight matrix with a dimension of R m×d (where m is the number of prediction parameters (such as COD, TP)), b y is the output layer bias term with a dimension of R m .
[0180] It should be noted that the core functions of the edge computing device include:
[0181] (1) Real - time computing guarantee
[0182] Deploy NVIDIA Jetson Nano embedded GPU, providing 4 TFLOPS computing power, and the single - prediction time consumption < 200ms (the traditional cloud transmission delay > 1.5s);
[0183] (2) Data privacy protection
[0184] Localize sensitive water quality data to prevent the leakage of original data;
[0185] (3) Offline operation ability
[0186] The built-in cache mechanism supports continuous operation for 12 hours in the event of a network outage.
[0187] The process by which the dynamic dose calculation module calculates the control parameters corresponding to the optimal PFC dosage includes:
[0188] First, perform fuzzification processing on the received prediction results to obtain the input parameters e(t), Δe(t), and ω,
[0189] where,
[0190] e(t) is the current TP deviation, e(t) = TP set -TP pred , TP set is the target total phosphorus concentration (set value), TP pred : is the total phosphorus concentration predicted by the model;
[0191] Δe(t) is the deviation change rate, Δe(t) = e(t) - e(t - 1),
[0192] ω is the water quality weight coefficient, ω = 0.3COD + 0.4TP + 0.2pH + 0.1Turbidity;
[0193] Secondly, establish a fuzzy rule base, divide e(t), Δe(t), and ω into 3 levels each, and establish the fuzzy rule as:
[0194] IF e(t) = High (high) AND Δe(t) = Positive (positive) AND ω = High (high)
[0195] THEN ΔK p = LargeIncrease (substantially increase), ΔK i = NoChange (unchanged), ΔK d = SmallDecrease (slightly decrease),
[0196] Use the adaptive learning mechanism to optimize the fuzzy rule base and update the confidence level of the fuzzy rules;
[0197] It should be noted that the process of updating the confidence level of the fuzzy rules using the adaptive learning mechanism is:
[0198] a. Update the learning objective in an incremental learning manner. The update period is triggered every 30 minutes. The learning objective is to minimize the dosage error. The expression for incremental learning is:
[0199]
[0200] In the formula, is the actual dosing amount, is the predicted dosing amount.
[0201] The parameter adjustment expression for incremental learning is:
[0202]
[0203] where the learning rate η = 0.01, θ new is the updated model parameter, and θ old is the original model parameter before update;
[0204] b. Optimize the rule base and update the fuzzy rule confidence through Q-learning reinforcement learning:
[0205]
[0206] In the formula, the state s is a combination of water quality parameters (such as high COD, low TP), the action a is the PID parameter adjustment strategy (such as increasing K p ), r is the reward function, r = -∣T Preal -T Pset ∣; α is the learning rate, with a value of 0.10.1, γ is the discount factor, usually taking 0.9, Q(s,a) represents the expected long-term cumulative reward for choosing action a in state s, is the expected reward for choosing the optimal action a' in the next state s';
[0207] Finally, output the control parameters in the dynamically adjusted state to the execution control module:
[0208]
[0209] In the formula, K p0 = 0.8, which is the reference proportionality coefficient; K i0 = 0.05, which is the reference integral coefficient; K d0 = 0.3, which is the reference differential coefficient, ΔK p ∈[-0.2,+0.5] (belongs to the fuzzy inference output parameter); K p (t) is the proportionality coefficient adjusted with time; K i (t) is the integral coefficient adjusted with time; K d (t) is the differential coefficient adjusted with time.
[0210] The execution control module includes: a variable-frequency speed-regulating peristaltic pump and a PLC closed-loop control system. Among them, the accuracy requirement of the variable-frequency speed-regulating peristaltic pump is ±1%, and the PLC closed-loop control system controls the dosing amount of PFC output by the variable-frequency speed-regulating peristaltic pump based on the received control parameters.
[0211] The optimization process of the feedback optimization module is to use an online self-correction algorithm (i.e., based on the gradient descent method) to correct the prediction parameters in the multi-parameter prediction module, and then use a data anomaly detection method (3σ criterion) to correct the standard for collecting water quality parameters in the data acquisition module;
[0212] Among them,
[0213] The self-correction algorithm (gradient descent method) corrects the prediction parameters in the multi-parameter prediction module using the loss function. The expression of the loss function is:
[0214] J(θ) = λ1·MSE pred +λ2·∣D opt -D real ∣ (14)
[0215] Among them, λ1 = 0.7, λ2 = 0.3, both are loss weight coefficients, J(θ) is the loss function, MSE pred is the predicted mean square error, D opt is the optimal dose, D real is the actual dose;
[0216] The parameters of the loss function are updated as:
[0217]
[0218] Introduce a momentum term β = 0.9 to accelerate convergence, θ (k+1) is the model parameter of the (k + 1)-th iteration, θ (k) is the parameter updated after the k-th iteration, is the gradient of the loss function, θ (k-1) is the historical parameter of the (k - 1)-th iteration;
[0219] The data anomaly detection method (3σ criterion) corrects the standard for collecting water quality parameters in the data acquisition module using dynamic threshold calculation. The expression for calculating the water quality parameter x i is:
[0220]
[0221] In the formula, μ t is the mean value of the water quality parameter x within the time window t, σ t is the standard deviation of the water quality parameter x within the time window t, x k$x_k$ is the input data at the $k$-th moment in the time series, including water quality parameters (COD, TP, pH, turbidity, etc.);
[0222] The abnormal judgment condition of the data anomaly detection method is:
[0223] ∣x new -μ t ∣>3σ t (17)
[0224] The abnormal handling method of the data anomaly detection method is:
[0225] a. Trigger the sensor calibration program,
[0226] b. Enable historical data interpolation (Lagrange interpolation method),
[0227] c. Freeze model updates until the data returns to normal.
[0228] The human-computer interaction module adopts a WebGL three-dimensional visualization engine and a multi-terminal adaptation framework, and can support the human-computer interaction requirements of the PC side, the mobile side, and the PAD side.
[0229] A multi-parameter feedback control method, as Figure 2 shown, this method is applied to the intelligent polyferric chloride dosing system described in any one of claims 1-7, and this method includes the following steps:
[0230] Step 1, fusion processing. Use the data standardization processing matrix to standardize the multi-source data collected, solve the problems of asynchronous sensor detection data and inconsistent dimensions, and then adjust the time correlation of the multi-source data after standardization through the time alignment algorithm (the time alignment algorithm uses the cubic spline interpolation method to compensate for the time delay of the multi-source data), and finally complete the fusion processing process of the multi-source data;
[0231] The data standardization processing matrix is:
[0232]
[0233] In the formula, μ is the historical mean, and σ is the standard deviation;
[0234] Step 2, dynamic prediction. Based on the multi-source data after fusion processing, use the improved LSTM neural network model to predict the change trend of water quality parameters (this prediction process includes predicting the weight relationship between water quality parameters, and eliminating the coupling interference problem between multi-source water quality parameters through the prediction of the weight relationship), and obtain the prediction result;
[0235] Step 3: Feedback control. Based on the predicted results, use the fuzzy PID control algorithm to calculate the control parameters for the optimal PFC dosage, and then optimize the prediction parameters in the multi-parameter prediction module according to the changes in the sewage water quality parameters after dosing. At the same time, correct the standards for collecting water quality parameters in the data acquisition module to achieve the feedback control process of the entire system.
[0236] This invention application adopts a multi-parameter collaborative prediction mechanism, introduces the turbidity change rate as a dynamic correction term for the LSTM model, and establishes a cross-influence factor matrix for COD / TP / pH. Then, based on a fuzzy-PID hybrid controller, a 9×9×9 three-dimensional fuzzy rule base is designed, and the self-tuning period of the PID parameters is shortened to 5 minutes, which more effectively improves the accuracy and timeliness of the PFC dosing amount.
[0237] Example 1
[0238] Application of the intelligent dosing system in a municipal sewage treatment plant
[0239] Specific application scenarios
[0240] A municipal sewage treatment plant with a daily treatment capacity of 100,000 tons, mainly treating domestic sewage, has the following problems:
[0241] 1. The influent flow fluctuates greatly (the peak value from 6:00 to 9:00 reaches 150% of the design value).
[0242] 2. The TP concentration in the influent suddenly increases during the rainy season (up to 3.5 mg / L at most).
[0243] 3. The daily average consumption of PFC fluctuates by ±40% due to manual adjustment of the PFC dosing amount.
[0244] The specific deployment process of the system is as follows:
[0245] Hardware deployment:
[0246] Install a multi-parameter sensor array (HACH COD / TP / pH / turbidity probe) at the influent.
[0247] Deploy an edge computing device (NVIDIA Jetson Nano) in the dosing room.
[0248] Transform the dosing pump into a variable-frequency peristaltic pump (flow accuracy ±1%).
[0249] Software configuration:
[0250] Train the LSTM-Attention model: Use data from the past 3 months (sampling interval 5 minutes).
[0251] Set the fuzzy PID control rule base: 9×9×3 (e, Δe, ω).
[0252] Configure the 3σ anomaly detection threshold (μ±3σ, confidence level 99.7%);
[0253] Actual operation process
[0254] 1. Data fusion:
[0255] Normalize the influent COD (200 - 400 mg / L → [0, 1]) and TP (0.5 - 3.5 mg / L → [0, 1]), and align the turbidity sensor data through cubic spline interpolation (delay compensation of 2 minutes);
[0256] 2. Dynamic prediction:
[0257] The LSTM model predicts the TP concentration in the next 15 minutes (input dimensions: COD, TP, pH, turbidity), and the Attention mechanism assigns weights: the turbidity weight is increased to 0.35 during rainstorm periods (0.1 usually);
[0258] 3. Feedback control:
[0259] When the predicted TP > 1.2 mg / L, the fuzzy PID outputs ΔK p = +0.4, and the variable frequency pump accurately adds PFC at the calculated dosage (85 L / h)
[0260] 4. Online optimization:
[0261] Update the LSTM model weights every 30 minutes (learning rate η = 0.01), and automatically enable data interpolation when abnormal pH data (beyond the 3σ range) is detected
[0262] The final effect of Example 1 is as Figure 6 shown.
[0263] Example 2:
[0264] Application of the intelligent chemical dosing system in the sewage treatment station of an industrial park
[0265] Specific application scenario
[0266] A centralized sewage treatment station in an electronic industrial park treats mixed industrial wastewater (including electroplating and PCB wastewater) and faces challenges:
[0267] 1. The water quality components are complex (heavy metals and complexing agents interfere with coagulation)
[0268] 2. The COD and TP are non-linearly related (traditional single-parameter control fails)
[0269] 3. It is necessary to meet strict discharge standards (TP ≤ 0.3 mg / L)
[0270] Deployment process
[0271] Customized transformation:
[0272] Install a heavy metal ion sensor (Cu 2 +, Ni 2 +)
[0273] Use a corrosion-resistant pump head (polytetrafluoroethylene-ceramic composite material)
[0274] Deploy a cloud backup system (AWS IoT Core)
[0275] Model optimization:
[0276] Add heavy metal concentration features to the input layer of LSTM
[0277] Design a 4D fuzzy rule base (e, Δe, ω, heavy metal weight)
[0278] Add a heavy metal penalty term to the reinforcement learning reward function
[0279] Actual operation process
[0280] Multi-parameter fusion:
[0281] Establish a COD-TP-heavy metal correlation matrix (weight coefficient ω = 0.3COD + 0.3TP + 0.3Cu 2 ++, 0.1pH), when Cu 2 + > 0.5mg / L, automatically increase the TP prediction weight by 30%;
[0282] Anti-interference prediction:
[0283] Use the Attention mechanism to identify the interference period of the complexing agent (turbidity decreases abnormally but TP increases), and the LSTM output compensates the coefficient (+15% dosage);
[0284] Adaptive control:
[0285] Use Q-learning to dynamically adjust the confidence of fuzzy rules (learning rate α = 0.2). When TP reaches the standard for 2 consecutive hours, automatically reduce the K i coefficient by 20%;
[0286] Abnormal handling:
[0287] When 3σ detects that pH > 9.5, trigger an emergency neutralization procedure (parallel addition of HCl);
[0288] It should be noted that in Example 2, by adding heavy metal characteristics and reinforcement learning, the non-linear problem of industrial wastewater is solved, the TP compliance rate is increased by 27%, and at the same time, the Attention mechanism is used to identify abnormal patterns (such as the reverse change of turbidity-TP), and the dosing compensation accuracy reaches ±5%; then, through the online self-calibration algorithm, the decay rate of the model prediction accuracy is <2% / month (for the traditional system >10% / month).
[0289] The final effect is as Figure 7 shown.
[0290] The above technical solutions only reflect the preferred technical solutions of the technical solutions of the present invention. Some changes that those skilled in the art in this technical field may make to some parts thereof all reflect the principles of the present invention and fall within the protection scope of the present invention.
Claims
1. A polyferric chloride intelligent dosing control system, characterized in that: The system includes the following parts: A data acquisition module for real-time acquisition of parameter data; A multi-parameter prediction module that predicts the change trend of water quality parameters based on the collected multiple parameter data and the time series of the multiple parameter data, and obtains a prediction result; A dynamic dosage calculation module that calculates the control parameters corresponding to the optimal PFC dosage according to the prediction result; An execution control module that accurately controls the dosage of PFC based on the control parameters; A feedback optimization module that analyzes the sewage treatment results, optimizes the multi-parameter prediction module, and simultaneously corrects the data acquisition module; A human-computer interaction module that can provide a visual operation interface and remote monitoring function, and perform data interaction with the data acquisition module, the dynamic dosage calculation module, and the feedback optimization module.
2. A polyferric chloride intelligent dosing control system according to claim 1, characterized in that, The data acquisition module uses an industrial-grade sensor array to collect multiple water quality parameters during the sewage treatment process and form a time-series water quality parameter sequence, and then transmits the time-series water quality parameter sequence to the multi-parameter prediction module.
3. The intelligent dosing control system of polyferric chloride according to claim 2, wherein, The multi-parameter prediction module uses an improved LSTM neural network model with an Attention mechanism to predict the change trend of water quality parameters, and transmits the prediction result to the dynamic dosage extreme module.
4. A polyferric chloride intelligent dosing control system according to claim 3, characterized in that, The process of the dynamic dosage calculation module calculating the control parameters corresponding to the optimal PFC dosage includes: First, perform fuzzy processing on the received prediction result to obtain input parameters e(t), Δe(t), and ω; Secondly, establish a fuzzy rule base, divide e(t), Δe(t), and ω into 3 levels each, and establish fuzzy rules as: IF e(t) = High AND Δe(t) = Positive AND ω = High THENΔK p =LargeIncrease,ΔK i =NoChange,ΔK d =SmallDecrease, Use an adaptive learning mechanism to optimize the fuzzy rule base and update the confidence of the fuzzy rules; Among them, the process of using the adaptive learning mechanism to update the confidence of the fuzzy rules is: a. Update the learning target in an incremental learning manner, with an update period triggered every 30 minutes, and the learning target is to minimize the dosage error; b. Optimize the rule base and update the confidence of the fuzzy rules through Q-learning reinforcement learning; Finally, output the control parameters in the dynamically adjusted state to the execution control module.
5. A polyferric chloride intelligent dosing control system according to claim 4, characterized in that, The execution control module includes: a variable-frequency speed-regulating peristaltic pump and a PLC closed-loop control system, and the PLC closed-loop control system controls the dosage of PFC transported by the variable-frequency speed-regulating peristaltic pump based on the received control parameters.
6. The intelligent dosing control system of polyferric chloride according to claim 1, wherein The optimization process of the feedback optimization module is to correct the multi-parameter prediction module using a self-tuning algorithm, and then correct the data acquisition module using a data anomaly detection method.
7. A polyferric chloride intelligent dosing control system according to claim 1, characterized in that: The human-computer interaction module uses a WebGL three-dimensional visualization engine and a multi-terminal adaptation framework, and can support the human-computer interaction requirements of the PC side, the mobile side, and the PAD side.
8. A multi-parameter feedback control method, characterized in that, This method is applied to the intelligent polyferric chloride dosing system described in any one of claims 1-7.
9. The multi-parameter feedback control method according to claim 8, characterized in that: This method includes the following steps: Step 1, fusion processing, use a data standardization processing matrix to perform standardization processing on the collected multi-source data, and then adjust the time correlation of the standardized multi-source data through a time alignment algorithm; Step 2, dynamic prediction: Use the improved LSTM neural network model to predict the change trend of water quality parameters and obtain the prediction results; Step 3, feedback control: Based on the prediction results, use the fuzzy PID control algorithm to calculate the control parameters of the optimal PFC dosage, and then optimize the multi-parameter prediction module according to the change of sewage water quality parameters after dosing, and at the same time correct the data acquisition module to realize the feedback control process of the whole system.
Citation Information
Patent Citations
Method for controlling feeding amount of chemical phosphorus removal reagents of water reclamation plants based on fuzzy control
CN103570190B
Phosphorus removal intelligent dosing control method and system based on big data prediction model
CN119596686A
Cited By
Heavy metal wastewater treatment method and system
CN121225828A