An intelligent dosing control method based on a deep learning prediction model
The intelligent dosing control method based on deep learning prediction models solves the problem of inaccurate dosage and timing of chemical dosing in tap water treatment, enabling timely response to changes in water quality and efficient use of chemicals, thus reducing chemical waste.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING LANJIE GUANGSHUN WATER PURIFICATION MATERIAL
- Filing Date
- 2022-12-16
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies make it difficult to accurately control the dosage and timing of chemical dosing in tap water treatment, resulting in water quality that does not meet standards or waste of chemicals.
An intelligent dosing control method based on a deep learning prediction model is adopted, including a data processing system, a learning system, and an MPC control system. Through multi-source data acquisition, anomaly handling, data regularization, Kalman filtering, offline pre-training, and online learning models, an optimizer objective function is constructed to achieve precise control of the dosing amount.
It enables timely response and accurate prediction of water quality changes, reduces chemical waste, and improves water quality stability and chemical usage efficiency.
Smart Images

Figure CN115857355B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, and more specifically, relates to an intelligent dosing control method based on a deep learning prediction model. Background Technology
[0002] Coagulant dosing is the most important step in the tap water treatment process, as it directly affects the water purification effect. Insufficient dosing will result in the water quality failing to meet standards, mainly manifested as excessive turbidity in the effluent. Conversely, excessive dosing will increase chemical consumption and lead to waste.
[0003] Most domestic water treatment plants typically employ traditional manual dosing and feedback-based dosing technologies. Manual dosing control techniques (such as empirical methods, statistical methods, beaker tests, and proportional dosing) struggle to accurately and promptly adjust dosing based on changes in source water quality and quantity. This not only affects water treatment efficiency but also leads to coagulant waste. Feedback-based dosing technologies utilize a feedforward-feedback cascade control loop based on "source water flow rate, source water turbidity, and sedimentation tank effluent turbidity." While these two technologies have seen some application, they suffer from significant lag, poor real-time performance, inaccurate metering, and high maintenance costs, making it difficult to achieve ideal dosing results.
[0004] Based on the problems existing in the prior art, the present invention provides an intelligent dosing control method based on a deep learning prediction model, which solves the problem that the prior art cannot accurately control the dosage and timing of water treatment agents when treating tap water. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides an intelligent dosing control method based on a deep learning prediction model, which solves the problem that existing technologies cannot accurately control the dosage and timing of water treatment chemicals during tap water treatment.
[0006] The purpose and effectiveness of the intelligent dosing control method based on a deep learning prediction model of this invention are achieved by the following specific technical means:
[0007] A smart dosing control method based on a deep learning prediction model includes:
[0008] Data processing system, learning system, and MPC control system;
[0009] The data processing system includes the following steps:
[0010] Step 11, Multi-source data acquisition: The system acquires various sensor data every 3 to 60 seconds, including source water turbidity, source water flow rate, pH, temperature, pre-sedimentation turbidity, sedimentation turbidity, chemical dosing flow rate, vehicle addition / reduction signal, and sludge discharge signal.
[0011] Step 12, Abnormal Data Handling: Limit the feature data from Step 11 to the corresponding normal range. Where [f min ,f max [This represents the normal range of the feature data; missing data is filled using linear interpolation, and the interpolation algorithm is as follows:] where k∈N * This indicates the number of interpolations required, where i <= k and i ∈ N. * This indicates the position of the interpolation, where y0 represents the starting position and the magnitude of the feature value. k+1 Indicates the magnitude of the feature value at the end position, y i This indicates interpolated output.
[0012] Step 13, Data Regularization: Different data sources have different dimensions, so the data is normalized to the range [0,1]. The normalization formula is: Among them, f min f max These are the minimum and maximum values of the feature data;
[0013] Step 14, Kalman filtering: The regularized feature data still contains many abrupt changes and interferences, which need to be filtered and smoothed. The Kalman filter is an algorithm that uses the state equation of a linear system to make the optimal estimate of the system state through the system input and output observation data.
[0014] The model and observation results can be written as:
[0015] x k+1 =φ k x k +B k u k +w k
[0016] y k =H k x k +v k
[0017] Where x, u, and y represent the system's internal state, system input, and measurement output, respectively; v is the process noise; w is the measurement noise; φ is the transition matrix; B is the input matrix; H is the measurement matrix; and k represents the sequence number. It is assumed that these noise processes are zero-mean Gaussian.
[0018] Step 15, Queue Cache: Establish a fixed-size queue cache, with a cache size equal to one month's data volume, i.e., 86400. The queue cache data is first-in, first-out.
[0019] Step 16, Persist data: If the queue cache data exceeds the set size, save the queue cache data to the historical database;
[0020] The learning system includes offline pre-trained models and online learning models:
[0021] Offline pre-trained models include the following steps:
[0022] Step 21, Serialize data: Read data in batches from the historical database and perform time-series serialization, extracting features from multiple consecutive time points [x1, x2, ... x]. i ...x n As the model input, n is the time series length, n∈N * The value range is [1, 10]; x i For a feature input at a certain time point, let [f1, f2, ... f i ...f m ], where f i Here are water quality-related characteristic parameters, m∈N * The number of characteristic values is adjusted according to the actual situation of the waterworks; take x. n The turbidity y of the sedimentation tank effluent at time t is the model output;
[0023] Step 22, Train the model: Create a model structure containing two layers of LSTM, such as... Figure 3 The first layer takes time-series data as input and has 32 hidden nodes (h). The second layer takes the output of the first layer as input and has 16 hidden nodes. L2 regularization is used to prevent overfitting. Finally, a fully connected layer with 1 output node is added. The Adam optimizer is used to iteratively train the model to obtain a pre-trained model.
[0024] The online learning model includes the following steps:
[0025] Online learning aims to improve prediction accuracy and enhance model control performance. Starting with the model parameters trained in the offline phase, data is read from the real-time queue cache at intervals of 12 to 72 hours, and the prediction model is updated through batch training using the Adam optimizer. The online learning and offline training phases must have the same model structure, initial learning rate, batch size, and optimizer.
[0026] Figure 4 The red curve represents the actual turbidity of the sedimentation tank effluent, while the blue curve represents the predicted effluent turbidity. It can be seen that the blue curve shows an earlier trend, indicating that the model can predict water quality changes in advance.
[0027] The MPC control system includes the following steps:
[0028] Step 31: Construct the objective function of the optimizer as follows:
[0029]
[0030] sty i+1 =Φ(y i ,u i )
[0031] Where α and β are regularization parameters that penalize the control input and its changes, u i For control input, in this invention, it is the regularized dosing flow rate value, u. i -u i-1 Φ represents the change in drug flow rate before and after administration, and describes the output relationship of the system over a time step given the current state and control input.
[0032] Step 32: Serialize the multiple data points collected at the current moment and input them into the LSTM prediction model Φ. Calculate the predicted turbidity sequence of the sedimentation tank effluent within the future prediction time domain N at the current moment t using a rolling method; [y m (t+1),y m (t+2); ...,y m Substituting (t+N)] into the objective optimization function, the optimal control sequence [u0, u1, ... u] is calculated. N-1 ], and output u0 as the optimization result of the system.
[0033] Furthermore, in step 21, n takes the value of 6.
[0034] Furthermore, in step 11, the system collects data from various sensors every half minute.
[0035] Furthermore, in step 22, the time interval for reading data from the real-time queue cache is 24 hours.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] This invention utilizes deep learning technology to learn and predict the causal relationship between chemical dosing and water quality, forecasting future effluent water quality and enabling precise control of chemical dosage in advance. This solves the problem of severe delays in chemical dosing in existing systems. It can also respond promptly to sudden changes in source water quality, adjusting the dosage to ensure water quality stability. Furthermore, the system obtains the optimal dosage based on current water quality conditions, reducing chemical consumption and achieving rational chemical use. Attached Figure Description
[0038] Figure 1 This is a flowchart illustrating the present invention.
[0039] Figure 2This is a schematic diagram of the filtering results of the present invention.
[0040] Figure 3 This is a schematic diagram of the LSTM model structure of the present invention.
[0041] Figure 4 This is a schematic diagram of the model prediction output of the present invention.
[0042] Figure 5 This is a schematic diagram comparing the predicted dosage results of the present invention. Detailed Implementation
[0043] The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and should not be construed as limiting the scope of the invention.
[0044] In the description of this invention, unless otherwise stated, "a plurality of" means two or more; the terms "upper," "lower," "left," "right," "inner," "outer," "front end," "rear end," "head," "tail," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0045] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0046] Example:
[0047] As attached Figure 1 To be continued Figure 5 As shown:
[0048] This invention provides an intelligent dosing control method based on a deep learning prediction model, comprising:
[0049] Data processing system, learning system, and MPC control system;
[0050] The data processing system includes the following steps:
[0051] Step 11, Multi-source data acquisition: The system acquires various sensor data every half minute, including source water turbidity, source water flow rate, pH, temperature, pre-sedimentation turbidity, sedimentation turbidity, chemical dosing flow rate, vehicle dosing / reducing signals, and sludge discharge signals.
[0052] Step 12, Abnormal Data Handling: Limit the feature data from Step 11 to the corresponding normal range. Where [f min ,f max [This represents the normal range of the feature data; missing data is filled using linear interpolation, and the interpolation algorithm is as follows:] where k∈N * This indicates the number of interpolations required, where i <= k and i ∈ N. * This indicates the position of the interpolation, where y0 represents the starting position and the magnitude of the feature value. k+1 Indicates the magnitude of the feature value at the end position, y i This indicates interpolated output.
[0053] Step 13, Data Regularization: Different data sources have different dimensions, so the data is normalized to the range [0,1]. The normalization formula is: Among them, f min f max These are the minimum and maximum values of the feature data;
[0054] Step 14, Kalman filtering: The regularized feature data still contains many abrupt changes and interferences, which need to be filtered and smoothed. The Kalman filter is an algorithm that uses the state equation of a linear system to make the optimal estimate of the system state through the system input and output observation data.
[0055] The model and observation results can be written as:
[0056] x k+1 =φ k x k +B k u k +w k
[0057] y k =H k x k +v k
[0058] Where x, u, and y represent the system's internal state, system input, and measurement output, respectively; v is the process noise; w is the measurement noise; φ is the transition matrix; B is the input matrix; H is the measurement matrix; and k represents the sequence number. It is assumed that these noise processes are zero-mean Gaussian.
[0059] Step 15, Queue Cache: Establish a fixed-size queue cache, with a cache size equal to one month's data volume, i.e., 86400. The queue cache data is first-in, first-out.
[0060] Step 16, Persist data: If the queue cache data exceeds the set size, save the queue cache data to the historical database;
[0061] The learning system includes offline pre-trained models and online learning models:
[0062] Offline pre-trained models include the following steps:
[0063] Step 21, Serialize data: Read data in batches from the historical database and perform time-series serialization, extracting features from multiple consecutive time points [x1, x2, ... x]. i ...x n As the model input, n is the time series length, and n takes a value of 6; x i For a feature input at a certain time point, let [f1, f2, ... f i ...f m ], where f i Here are water quality-related characteristic parameters, m∈N * The number of characteristic values is adjusted according to the actual situation of the waterworks; take x. n The turbidity y of the sedimentation tank effluent at time t is the model output;
[0064] Step 22, Train the model: Create a model structure containing two layers of LSTM, such as... Figure 3 The first layer takes time-series data as input and has 32 hidden nodes (h). The second layer takes the output of the first layer as input and has 16 hidden nodes. L2 regularization is used to prevent overfitting. Finally, a fully connected layer with 1 output node is added. The Adam optimizer is used to iteratively train the model to obtain a pre-trained model.
[0065] The online learning model includes the following steps:
[0066] Online learning aims to improve prediction accuracy and enhance model control performance. Starting with the model parameters trained in the offline phase, data is read from the real-time queue cache at 24-hour intervals, and the prediction model is updated through batch training using the Adam optimizer. The online learning and offline training phases must have the same model structure, initial learning rate, batch size, and optimizer.
[0067] Figure 4 The red curve represents the actual turbidity of the sedimentation tank effluent, while the blue curve represents the predicted effluent turbidity. It can be seen that the blue curve shows an earlier trend, indicating that the model can predict water quality changes in advance.
[0068] The MPC control system includes the following steps:
[0069] Step 31: Construct the objective function of the optimizer as follows:
[0070]
[0071] sty i+1 =Φ(y i ,u i )
[0072] Where α and β are regularization parameters that penalize the control input and its changes, u i For control input, in this invention, it is the regularized dosing flow rate value, u. i -u i-1 Φ represents the change in drug flow rate before and after administration, and describes the output relationship of the system over a time step given the current state and control input.
[0073] Step 32: Serialize the multiple data points collected at the current moment and input them into the LSTM prediction model Φ. Calculate the predicted turbidity sequence of the sedimentation tank effluent within the future prediction time domain N at the current moment t using a rolling method; [y m (t+1),y m (t+2); ...,y m Substituting (t+N)] into the objective optimization function, the optimal control sequence [u0, u1, ... u] is calculated. N-1 ], and output u0 as the optimization result of the system.
[0074] It is particularly noteworthy that the inventors verified the technical effectiveness of this solution through experiments:
[0075] Figure 5 The figures show the control results obtained from a simulation test at a water plant. The curves representing the changes in influent flow rate, actual manual dosing, pre-sedimentation effluent turbidity, source water turbidity, and simulated predicted dosing are all labeled in the figures. It can be seen that when the source water flow rate changes suddenly, the model can predict future water quality changes, thus the predicted dosing can respond promptly, with the dosing rapidly changing from 0.3 to above 0.5. However, the actual manual dosing, due to its slower response, results in larger fluctuations in effluent turbidity.
[0076] from Figure 5It can be seen that when the source water flow is large and operates stably for a period of time, the pre-sedimentation turbidity decreases slowly. At this time, the dosage of chemicals is also gradually adjusted and reduced to ensure that the effluent water quality fluctuates less. It can be seen that this chemical dosing control scheme can achieve rational use of chemicals, and its predictive mechanism can pre-dose water treatment agents, greatly reducing the lag in water treatment.
[0077] The embodiments of the present invention are given for illustrative and descriptive purposes only, and are not intended to be exhaustive or to limit the invention to the forms disclosed. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of the invention, and to enable those skilled in the art to understand the invention and to design various embodiments with various modifications suitable for a particular purpose.
Claims
1. A smart dosing control method based on a deep learning prediction model, characterized in that: include: Data processing system, learning system, and MPC control system; The data processing system includes the following steps: Step 11, Multi-source data acquisition: The system acquires data from various sensors every 3 to 60 seconds, including source water turbidity, source water flow rate, etc. Temperature, pre-sedimentation turbidity, settling turbidity, chemical dosing flow rate, vehicle loading / unloading signal, sludge discharge signal; Step 12, Abnormal Data Handling: Limit the feature data from Step 11 to the corresponding normal range. ,in The feature data is within the normal range; missing data is filled using linear interpolation, and the interpolation algorithm is as follows: ,in Indicates the number of interpolations required. and Indicates the position of the interpolation. Indicates the magnitude of the feature value at the starting position. Indicates the magnitude of the feature value at the end position. Indicates interpolation output; Step 13, Data Regularization: Different data sources have different dimensions, so the data is normalized to the range [0,1]. The normalization formula is: ,in, , These are the minimum and maximum values of the feature data; Step 14, Kalman Filtering: Regularized feature data still contains many abrupt changes and interferences, requiring filtering and smoothing processes. The model and observation results can be written as: in , , These are the system's internal state, system input, and measurement output, respectively. It's process noise. To measure noise, It is a transition matrix. It is the input matrix. This is a measurement matrix, where k represents the sequence number; it is assumed that these noisy processes are zero-mean Gaussian. Step 15, Queue Cache: Establish a fixed-size queue cache, with a cache size equal to one month's worth of data. The queue cache data is first-in, first-out. Step 16, Persist Data: If the queue cache data exceeds the set size, save the queue cache data to the historical database; The learning system includes offline pre-trained models and online learning models: Offline pre-trained models include the following steps: Step 21, Serialize data: Read data in batches from the historical database and perform time-series serialization, extracting features from multiple consecutive time points. As model input, For timing length, The value range is [1, 10]; The feature input for a certain time point is ,in These are water quality-related characteristic parameters. The number of eigenvalues; take Turbidity of effluent from sedimentation tank at any time Output for the model; Step 22, Training the model: Create a two-layer model The model structure has a first layer input of time series data and a hidden node count of [number missing]. Set to 32, the second layer input is the first layer node output, the number of hidden nodes is 16, and to prevent overfitting, use... Regularization is performed; finally, a fully connected layer is added with 1 output node; the model is iteratively trained using the Adam optimizer to obtain the pre-trained model; The online learning model includes the following steps: Starting with the model parameters trained in the offline phase, data is read from the real-time queue cache at intervals of 12 to 72 hours, and the prediction model is updated by batch training using the Adam optimizer; the online learning and offline training phases must have the same model structure, initial learning rate, batch size, and optimizer. The MPC control system includes the following steps: Step 31: Construct the objective function of the optimizer as follows: in, and It is a regularization parameter that penalizes the control input and its changes. The input is the regularized dosing flow rate value. This represents the change in drug flow rate before and after administration. Describe the output relationship of the system over one time step, given the current state and control input; Step 32: Serialize the multiple data entries collected at the current moment and send them in. Predictive Model Calculate the current time in a scrolling manner. For future prediction time domain Predicted sequence of turbidity in sedimentation tank effluent; Substituting the values into the objective function, the optimal control sequence is calculated. and put This is output as the optimization result of the system.
2. The intelligent dosing control method based on a deep learning prediction model as described in claim 1, characterized in that: In step 21, n takes the value 6.
3. The intelligent dosing control method based on a deep learning prediction model as described in claim 2, characterized in that: In step 11, the system collects data from various sensors every half minute.
4. The intelligent dosing control method based on a deep learning prediction model as described in any one of claims 1-3, characterized in that: In step 22, the time interval for reading data from the real-time queue cache is 24 hours.
Citation Information
Patent Citations
Intelligent dosing system and method based on mathematical model and predictive control
CN114217529A
Apparatus for water quality prediction, and method for water quality prediction
JP2014124569A