Intelligent flocculant adding method and system based on water quality dynamic data

By employing an intelligent flocculant dosing method based on dynamic water quality data in rural water treatment facilities, and utilizing long short-term memory networks and feedforward feedback control, the problems of lag and waste in flocculant dosing have been solved, achieving precise matching of reagents and improved stability of effluent water quality.

CN122079274APending Publication Date: 2026-05-26GUANGZHOU CITY CONSTR COLLEGE +4
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU CITY CONSTR COLLEGE
Filing Date
2026-04-23
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing flocculant dosing technologies suffer from problems such as crude dosing methods, lagging control logic, and lack of intelligent prediction and self-learning capabilities in rural streams and rivers where water quality fluctuates drastically, leading to waste of chemicals and unstable effluent quality.

Method used

A smart flocculant dosing method based on dynamic water quality data is adopted. Turbidity and flow information are obtained through an online water quality monitoring unit. A flocculant dosing prediction model is established using a long short-term memory network. Combined with feedforward and feedback control strategies, precise dosing and dynamic compensation are achieved.

Benefits of technology

It enables precise dosing of flocculants, reduces reagent consumption, improves the stability of effluent quality and the system's shock resistance, and enhances the intelligent operation and maintenance level of water treatment facilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122079274A_ABST
    Figure CN122079274A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of water treatment, discloses an intelligent flocculant adding method and system based on water quality dynamic data, and aims to solve the technical problems that an existing adding mode is extensive, lagged in control and difficult to adapt to dynamic water quality fluctuation. The method comprises the following steps: collecting turbidity and flow data of a water inlet end; carrying out feedforward prediction by utilizing a long-short-term memory network model, calculating a theoretical dosage and driving a metering pump to execute; and the effluent turbidity is monitored in real time, and feedback correction is performed by using a PID algorithm. The system comprises an online monitoring unit, an intelligent control unit, a precise adding execution unit and an effect feedback unit. Through composite control of feedforward prediction and feedback correction, advanced and accurate addition of the flocculant is realized, the drug consumption cost is reduced, the impact load is effectively dealt with, and the stability of the effluent quality and the intelligentization of system operation and maintenance are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of water treatment automatic control technology, specifically relating to an intelligent flocculant dosing method and system based on dynamic water quality data. Background Technology

[0002] With the continuous advancement of ecological civilization construction, water treatment technology plays a vital role in improving the rural water environment and ensuring drinking water safety. Flocculation and sedimentation, as the core physicochemical step in the water purification process, involves adding chemical agents to the raw water to destabilize, coagulate, and settle suspended solids. It is a key step in removing turbidity, suspended solids, and some organic pollutants from water, and its operating efficiency and treatment effect directly affect the load of subsequent filtration and disinfection processes and the overall effluent quality.

[0003] Among these, precise flocculant dosing control technology is the core to ensuring the stability and economic efficiency of the flocculation process. Given the drastic fluctuations in influent water quality and the complex environment of rural streams and rivers, establishing an intelligent control system capable of real-time sensing of influent dynamics, automatic optimization of dosing parameters, and refined management has become a key technological direction for achieving unmanned operation and cost reduction in current miniaturized water treatment facilities.

[0004] Existing technologies for flocculant dosing management suffer from the following main shortcomings: First, dosing methods are generally too crude, relying heavily on manual experience or simple timed and quantitative modes. This fails to respond in real-time to drastic fluctuations in influent flow and turbidity during heavy rain or sudden pollution events, easily leading to significant waste of chemicals or poor treatment results. Second, the control logic exhibits significant time lag. Feedback-based adjustment modes, solely dependent on effluent indicators, are limited by the physical reaction time required for the flocculation and sedimentation process, causing adjustment commands to always lag behind water quality changes, easily triggering frequent system oscillations and unstable effluent quality. Third, the system lacks intelligent forward-looking predictive capabilities, making it difficult to uncover the complex nonlinear correlation between historical water quality parameters and optimal dosing amounts, resulting in a passive response state when dealing with dynamic environments. Finally, the lack of multi-source data fusion, compensation, and self-learning mechanisms makes it difficult to dynamically correct predictive models based on actual treatment effects, leading to insufficient robustness and adaptability of the system in long-term operation. These problems collectively constitute the technical challenges that urgently need to be addressed in the current water treatment field. Summary of the Invention

[0005] The purpose of this invention is to provide an intelligent flocculant dosing method and system based on dynamic water quality data, which can effectively solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A smart flocculant dosing method based on dynamic water quality data, the method comprising the following steps: Step S1: The turbidity and flow information of the raw water are synchronously acquired by the online water quality monitoring unit set at the inlet of the equalization tank, and the captured physical quantity information is converted into a standard electrical signal and sent to the intelligent control unit in real time through the signal transmission link. Step S2: Based on historical monitoring data and experimental data, a basic database is constructed. The basic database contains various water quality feature vectors and corresponding optimal dosage values. The various water quality feature vectors include the turbidity value at the current moment, the average turbidity value of the previous N sampling periods, the first derivative of turbidity over time, and the flow rate value. The basic database is used to train a long short-term memory network for deep learning. The nonlinear features of water quality parameters evolving over time are extracted through the gating mechanism inside the long short-term memory network. The mapping logic between influent water quality parameters and the optimal dosage of flocculant is established, and the flocculant dosage prediction model is completed. Step S3: The intelligent control unit receives the current turbidity data and flow data from the online water quality monitoring unit in real time, inputs the real-time data after cleaning into the pre-trained flocculant dosage prediction model, calculates the theoretical flocculant dosage value corresponding to the current water quality conditions through model reasoning, and outputs the theoretical flocculant dosage value as a feedforward control quantity. Step S4: The precision dosing execution unit receives the feedforward control command signal from the intelligent control unit, adjusts the operating frequency of the drive motor through the variable frequency speed control device, and drives the metering pump to inject flocculant into the water to be treated at a dosing speed that matches the feedforward control quantity. Step S5: The effect feedback unit set at the outlet of the sedimentation tank monitors the turbidity of the treated effluent in real time. The intelligent control unit calculates the deviation between the real-time value of the effluent turbidity and the preset target value, and uses the proportional-integral-derivative algorithm to calculate the deviation to obtain a correction amount. The correction amount is superimposed on the feedforward control amount and together they act on the dosing speed of the metering pump.

[0007] Furthermore, step S1 specifically includes: The online water quality monitoring unit is installed in the flow stabilization tank at the inlet of the regulating tank, and data is collected synchronously through a submersible turbidity sensor and an electromagnetic flow meter. The submersible turbidity sensor adopts the infrared scattering light measurement principle at a preset angle and is equipped with an automatic cleaning and scraping device. The automatic cleaning and scraping device performs cleaning actions at preset time intervals to eliminate the interference of air bubbles and deposits on the optical window. The measurement range of the submersible turbidity sensor is set to a preset range, and the measurement accuracy is within a preset accuracy range. The electromagnetic flowmeter uses the principle of electromagnetic induction, with polytetrafluoroethylene as the inner lining material and tantalum as the electrode material. The measurement error is controlled below a preset error threshold. The online water quality monitoring unit uploads the collected data to the intelligent control unit in real time through a standard current signal within a preset range, and the data sampling frequency is set to a preset sampling frequency.

[0008] Furthermore, the process of constructing the basic database in step S2 specifically includes: Through a six-stage stirring test, gradient dosing tests were conducted on different water samples with turbidity distribution within a preset turbidity range and hydrogen ion concentration index distribution within a preset index range. In each set of experiments, the rotation speed of the rapid stirring stage was set to the first preset rotation speed, and the duration was set to the first preset time, so as to promote the rapid diffusion of flocculant; The rotation speed of the slow flocculation stage is set to the second preset rotation speed, and the duration is set to the second preset time, in order to promote the growth of flocs. Set the settling and sedimentation period to the third preset time; By measuring the turbidity of the supernatant after sedimentation, the minimum amount of reagent to be added when the effluent turbidity is lower than the preset effluent threshold is determined, and the corresponding influent turbidity, flow rate and hydrogen ion concentration index are recorded to form an initial sample set containing a preset amount of valid data.

[0009] Preferably, the process of training the long short-term memory network prediction model in step S2 specifically includes: The initial sample set is divided into a training set and a validation set according to a preset ratio; The Long Short-Term Memory Network consists of an input layer, a hidden layer, and an output layer. The hidden layer contains a preset number of recursive units, and each layer is configured with a preset number of neurons. The preset number of neurons is adapted to the length of the input sequence window, and the number of neurons is set to twice the length of the input window. The Long Short-Term Memory (LSTM) network introduces forget gate, input gate, and output gate mechanisms to process the time-series characteristics of water quality data. The forget gate is used to determine discarded historical information, the input gate is used to determine new information to be stored in the current state, and the output gate is used to determine the output prediction result. During training, mean squared error is used as the loss function, and the adaptive moment estimation algorithm is used for weight optimization. The learning rate is set to a preset learning rate, and the number of iterations is set to a preset number of iterations, until the prediction error on the validation set is less than a preset error threshold.

[0010] Preferably, the flocculant dosage prediction model in step S2 also has algorithm switching logic, specifically including: When the intelligent control unit detects that the computing resource load exceeds 80%, it switches the Long Short-Term Memory network prediction model to a lightweight prediction model based on gradient boosting trees. The gradient boosting tree model consists of 100 to 150 decision trees, with the maximum depth of each decision tree set to 6 to 8. The input features include current turbidity, turbidity change rate, flow rate, and historical dosage. Features are split using the Gini coefficient. During the switching process, a transition period of 2 to 5 minutes is set. During the transition period, a weighted average algorithm is used to smooth the dosage before and after the switch. The weight coefficients of the weighted average algorithm change linearly during the transition period. When the intelligent control unit detects that the water quality fluctuation characteristics have a long-range correlation, a converter model is used as the prediction model for the flocculant dosage. The converter model includes an encoder and a decoder. The encoder is composed of 4 to 6 layers of self-attention mechanism and feedforward neural network stacked together. The length of the input sequence is set to 60 to 120 sampling periods. The self-attention mechanism is used to capture the long-range dependence between water quality parameters. The criterion for determining the long-range correlation is: calculate the autocorrelation function of the influent turbidity sequence. When the autocorrelation coefficient is greater than 0.6 when the delay step is 30 steps, it is determined to have a long-range correlation. When the intelligent control unit is in few-sample learning mode, a support vector regression model is used as the flocculant dosage prediction model, and a radial basis function is selected as the kernel function. The penalty parameter and kernel function parameter are determined by grid search method.

[0011] Furthermore, the process of cleaning the raw data in step S3 specifically includes: High-frequency random noise in sensor signals is eliminated by using a moving average filtering algorithm. The width of the filtering window is set to a preset number of sampling points, and the arithmetic mean of the sampling points within the window is used as the effective signal value at the current moment. The Raida criterion is used to identify outlier data points. The deviation between the current sampling point and the mean of the previous sampling points is calculated. When the deviation exceeds a preset standard deviation multiple, it is determined to be outlier data and a removal operation is performed. The valid data from the previous moment is used to fill the gap. The min-max normalization method is used to map the cleaned data to the interval [0,1].

[0012] Preferably, step S3 further includes feedforward compensation calculation logic, specifically including: The intelligent control unit calculates the rate of change of influent turbidity over time in real time. When the rate of change exceeds a preset rate of change threshold, the current operating condition is determined to be a sudden pollution shock or a rainfall runoff shock. Based on the output of the Long Short-Term Memory Network prediction model, a rapid compensation amount that is directly proportional to the rate of change is superimposed to achieve an advanced response to drastic fluctuations in water quality. The proportional coefficient of the rapid compensation amount is dynamically corrected based on historical rainfall intensity data.

[0013] Furthermore, the operational logic of the precise dosing execution unit in step S4 specifically includes: The frequency converter receives a preset voltage signal from the intelligent control unit and adjusts the output speed of the AC motor, wherein the speed range of the AC motor is adapted to the preset speed range. The metering pump adopts a diaphragm structure, the stroke length is preset to a preset ratio, and the dosing accuracy of a single stroke is within a preset allowable error range. Back pressure valves and pulse dampers are installed in both the inlet and outlet pipelines of the metering pump. The pulse dampers absorb the flow pulsation generated by the reciprocating motion of the diaphragm pump, thereby stabilizing the dosing pressure and flow rate. The injection pressure is monitored in real time by a pressure sensor installed on the pipeline. When the injection pressure exceeds a preset pressure threshold, an alarm is triggered and the system switches to a backup metering pump.

[0014] A smart flocculant dosing system based on dynamic water quality data, the system comprising: The online water quality monitoring unit is used to simultaneously acquire the turbidity and flow information of raw water and convert the turbidity and flow information into standard electrical signals; The intelligent control unit is connected to the online water quality monitoring unit and is used to build and train a flocculant dosage prediction model. Based on the real-time received turbidity data and flow data, the theoretical flocculant dosage is calculated as a feedforward control quantity through the flocculant dosage prediction model. A precision dosing execution unit, connected to the intelligent control unit, is used to receive the command signal of the feedforward control quantity and drive the metering pump to inject flocculant into the water to be treated through frequency conversion speed regulation; The effect feedback unit is used to monitor the turbidity of the effluent from the sedimentation tank outlet in real time. The intelligent control unit is also used to calculate a correction amount using a proportional-integral-derivative algorithm based on the deviation between the effluent turbidity and the preset target value, and to superimpose the correction amount onto the feedforward control amount to dynamically compensate the dosing speed of the metering pump.

[0015] Furthermore, the system also has auxiliary parameter expansion functions and cloud-based iteration logic, specifically including: In addition to turbidity and flow rate, real-time data collected by a hydrogen ion concentration index sensor, a temperature sensor, and a conductivity sensor are also introduced at the input end of the intelligent control unit. The system also includes a cloud management platform and a model iteration and update module. The intelligent control unit uploads the influent parameters, dosing records and effluent effect data generated during operation to the cloud database through a wireless communication network. The model iteration and update module periodically calls the accumulated running data to incrementally retrain the flocculant dosage prediction model and optimize the model weight parameters. After the model iteration update module completes the retraining, the model parameters are sent to the on-site controller via remote commands. The controller then updates its control logic based on the retrained model parameters.

[0016] Compared with the prior art, the present invention has the following beneficial effects: 1. Significantly Improved Dosing Accuracy and Reduced Operating Costs. This invention, by constructing a machine learning prediction model based on a long short-term memory (LSTM) network, changes the outdated method of relying on manual experience or fixed-ratio dosing. Because the LTM network can deeply mine the nonlinear characteristics in historical water quality sequences, the system achieves intelligent and high-precision calculation of flocculant dosage. In actual operation of rural water treatment, this method can adjust the metering pump speed in real time according to minute fluctuations in influent turbidity, achieving precise matching of reagents. Compared with traditional manual control methods, this invention can significantly reduce flocculant consumption and lower the operating costs of rural wastewater treatment facilities.

[0017] 2. Control Response Proactiveness and Effluent Quality Stability. Addressing the inherent long time delay characteristics of flocculation and sedimentation processes, this invention employs a combined feedforward and feedback control strategy. Utilizing sensors and predictive models installed at the inlet, the system can predict and execute dosage adjustments before water quality changes enter the sedimentation tank, achieving a technological leap from passive regulation to proactive prediction. Combined with proportional-integral-derivative feedback correction at the effluent end, it effectively solves the system oscillation problem caused by sudden changes in water quality. Even with drastic fluctuations in influent turbidity, the effluent turbidity can consistently remain stable within the preset compliance range, significantly improving the water treatment system's resistance to shock loads and the effluent compliance rate.

[0018] 3. Highly Automated and Intelligent Operation and Maintenance Capabilities. This invention integrates online water quality monitoring, intelligent logic operations, variable frequency precision execution, and cloud-based self-learning functions to construct a complete closed-loop control system. The system possesses powerful self-processing and self-optimization capabilities, enabling unattended operation of the flocculation dosing process. Through continuous learning of operational data via the cloud management platform, the system can automatically adapt to changes in water quality characteristics under different seasons and climatic conditions, reducing reliance on professional operators. This has significant practical implications for rural water treatment plants with limited technical resources and geographically dispersed locations, substantially reducing the frequency and labor intensity of manual inspections and improving the overall intelligent management level of the facilities.

[0019] 4. Excellent scalability and environmental adaptability. The method and system architecture of this invention are highly flexible. The prediction model is not limited to Long Short-Term Memory networks and can be flexibly switched to algorithms such as Support Vector Regression or Gradient Boosting Trees according to the computing power requirements. Simultaneously, the system supports the input of multiple water quality parameters. By introducing multi-dimensional features such as hydrogen ion concentration index, temperature, and conductivity, the scientific nature of control decisions is further enhanced. This modular design enables this invention to be widely applied in various scenarios such as stream purification, river management, and rural drinking water treatment, demonstrating excellent technical universality and market application prospects. Attached Figure Description

[0020] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.

[0021] Figure 1 This is a schematic diagram of the intelligent flocculant dosing method based on dynamic water quality data provided by the present invention.

[0022] Figure 2 This is a schematic diagram of the composition of the intelligent flocculant dosing system based on dynamic water quality data provided by the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.

[0024] Example 1

[0025] like Figure 1 As shown, Embodiment 1 of the present invention discloses an intelligent flocculant dosing method based on dynamic water quality data, comprising the following steps: Step S1: The turbidity and flow information of the raw water are synchronously acquired by the online water quality monitoring unit set at the inlet of the equalization tank, and the captured physical quantity information is converted into a standard electrical signal and sent to the intelligent control unit in real time through the signal transmission link.

[0026] Specifically, step S1 includes: Step S11: Install the online water quality monitoring unit in the flow stabilization tank at the inlet of the regulating tank, and achieve synchronous data acquisition through a submersible turbidity sensor and an electromagnetic flow meter.

[0027] In step S11, the submersible turbidity sensor employs the principle of infrared scattering light measurement at a preset angle and is equipped with an automatic cleaning and scraping device. For example, the turbidity sensor is an infrared scattering light turbidity meter with a measurement range of 0–1000 scattering turbidity units (NTU). The probe integrates an automatic cleaning and scraping device that automatically performs a cleaning action every 30 minutes to eliminate interference from air bubbles and deposits on the optical window. The measurement range of the submersible turbidity sensor is set to 0–1000 NTU, and the measurement accuracy is controlled within ±2%.

[0028] The electromagnetic flow meter uses the principle of electromagnetic induction, with a PTFE lining and tantalum electrodes. The measurement error is controlled within ±0.5%. For example, the electromagnetic flow meter has a nominal diameter of 50 mm and is installed on the main inlet pipe via a flange connection. Its corrosion-resistant design allows for long-term stable operation in the raw water environment.

[0029] Step S12: The online water quality monitoring unit uploads the collected data to the intelligent control unit in real time through a standard current signal within a preset range, and the data sampling frequency is set to a preset sampling frequency.

[0030] Specifically, both the submersible turbidity sensor and the electromagnetic flowmeter transmit standard current signals of 4 to 20 mA to the intelligent control unit via shielded twisted-pair cables. The sampling frequency is set to once every 5 seconds to ensure real-time capture of water quality fluctuations.

[0031] Through the above steps, the turbidity and flow rate data of raw water can be collected synchronously and accurately, providing a reliable input basis for subsequent prediction models.

[0032] Step S2: Based on historical monitoring data and experimental data, a basic database is constructed. The basic database contains various water quality feature vectors and corresponding optimal dosage values. The various water quality feature vectors include the current turbidity value, the average turbidity value of the previous N sampling periods, the first derivative of turbidity over time, and the flow rate value. The basic database is used to train a long short-term memory network using deep learning. The nonlinear characteristics of water quality parameters evolving over time are extracted through the gating mechanism inside the long short-term memory network. The mapping logic between influent water quality parameters and the optimal dosage of flocculant is established, and the flocculant dosage prediction model is completed.

[0033] Specifically, step S2 includes: Step S21: The process of building the basic database.

[0034] Step S21 includes: Step S211: Through a six-stage stirring test, a gradient dosing test is conducted on different water samples with turbidity distribution within a preset turbidity range and hydrogen ion concentration index distribution within a preset index range.

[0035] For example, stream water samples were collected in the laboratory under different rainfall intensities, and reagent addition gradient tests were conducted for typical turbidity gradients such as 10 NTU, 50 NTU, 100 NTU, 200 NTU, and 500 NTU, as well as pH values ​​ranging from 6.5 to 8.5.

[0036] Step S212: In each group of experiments, the rotation speed of the rapid stirring stage is set to the first preset rotation speed and the duration is set to the first preset time to promote the rapid diffusion of flocculant; the rotation speed of the slow flocculation stage is set to the second preset rotation speed and the duration is set to the second preset time to promote floc growth; and the settling time is set to the third preset time.

[0037] Specifically, the speed of the rapid stirring stage is set to 200 rpm for 1 minute; the speed of the slow flocculation stage is set to 40 rpm for 15 minutes; and the settling stage is set to 20 minutes.

[0038] Step S213: By measuring the turbidity of the supernatant after sedimentation, determine the minimum amount of reagent to be added when the effluent turbidity is lower than the preset effluent threshold, and record the corresponding influent turbidity, flow rate and hydrogen ion concentration index to form an initial sample set containing a preset scale of valid data.

[0039] For example, the preset effluent turbidity threshold is set to 0.8 NTU. The minimum polyaluminum chloride dosage (mg / L) under each operating condition is recorded and combined with influent turbidity, flow rate, and pH value to form a sample. By combining the above experiments with historical operating data, a basic database containing 10,000 samples is constructed.

[0040] Step S22: The process of training a long short-term memory network prediction model.

[0041] Step S22 includes: Step S221: Divide the initial sample set into a training set and a validation set according to a preset ratio. For example, divide them in an 8:2 ratio.

[0042] Step S222: The Long Short-Term Memory (LSTM) network consists of an input layer, a hidden layer, and an output layer. The hidden layer contains a predetermined number of recursive units, each layer configured with a predetermined number of neurons. This predetermined number of neurons is adapted to the length of the input sequence window, and the number of neurons is set to twice the length of the input window. In this embodiment, the LSM network contains two hidden layers, each containing 128 neurons. The input window length is 64 sampling points, and the number of neurons (128) conforms to the relationship of twice the window length.

[0043] Step S223: The Long Short-Term Memory Network introduces forget gate, input gate and output gate mechanisms to process the time series characteristics of water quality data, wherein the forget gate is used to determine the discarded historical information, the input gate is used to determine the new information to be stored in the current state, and the output gate is used to determine the output prediction result.

[0044] Step S224: During training, mean squared error is used as the loss function, and the adaptive moment estimation algorithm is used for weight optimization. The learning rate is set to a preset learning rate, and the number of iterations is set to a preset number of iterations, until the prediction error on the validation set is less than a preset error threshold. For example, the learning rate is set to 0.001, the number of iterations is set to 500, and training stops when the mean squared error on the validation set is less than 0.01.

[0045] Through the above steps, a deep learning model was established that can predict the optimal flocculant dosage based on current and historical water quality parameters.

[0046] Furthermore, to adapt to different working conditions, the flocculant dosage prediction model also has algorithm switching logic, specifically including: When the intelligent control unit detects that the computing resource load exceeds 80%, it switches the Long Short-Term Memory Network prediction model to a lightweight prediction model based on gradient boosting trees. The gradient boosting tree model consists of 100 to 150 decision trees, with the maximum depth of each decision tree set to 6 to 8. The input features include the current turbidity, turbidity change rate, flow rate, and historical dosage. Features are split using the Gini coefficient. During the switching process, a transition period of 2 to 5 minutes is set. During the transition period, a weighted average algorithm is used to smooth the dosage before and after the switch. The weight coefficients of the weighted average algorithm change linearly during the transition period.

[0047] When the intelligent control unit detects that the water quality fluctuation characteristics have a long-range correlation, a converter model is used as the prediction model for the flocculant dosage. The converter model includes an encoder and a decoder. The encoder is composed of 4 to 6 layers of self-attention mechanisms and feedforward neural networks stacked together. The length of the input sequence is set to 60 to 120 sampling periods. The self-attention mechanism is used to capture the long-range dependence between water quality parameters. The criterion for determining the long-range correlation is: calculate the autocorrelation function of the influent turbidity sequence. When the autocorrelation coefficient is greater than 0.6 when the delay step is 30 steps, it is determined to have a long-range correlation.

[0048] When the intelligent control unit is in few-sample learning mode, a support vector regression model is used as the flocculant dosage prediction model, and a radial basis function is selected as the kernel function. The penalty parameter and kernel function parameter are determined by grid search method.

[0049] Through the above algorithm switching logic, the system can flexibly adapt to computing power constraints and different data characteristics while ensuring prediction accuracy.

[0050] Step S3: The intelligent control unit receives the current turbidity data and flow data from the online water quality monitoring unit in real time, inputs the real-time data after cleaning into the pre-trained flocculant dosage prediction model, calculates the theoretical flocculant dosage value corresponding to the current water quality conditions through model reasoning, and outputs the theoretical flocculant dosage value as a feedforward control quantity.

[0051] Specifically, step S3 includes the process of cleaning the raw data: Step S31: Use a moving average filtering algorithm to eliminate high-frequency random noise in the sensor signal. The filtering window width is set to a preset number of sampling points. The arithmetic mean of the sampling points within the window is used as the valid signal value at the current moment. For example, the window width is set to 12 sampling points (corresponding to 1 minute of data), and the arithmetic mean is calculated to filter out high-frequency noise caused by bubble interference.

[0052] Step S32: Identify outlier data points using the Raida criterion, calculate the deviation between the mean of the current sampling point and the mean of the previous sampling points, and when the deviation exceeds a preset standard deviation multiple, it is determined to be outlier data and a removal operation is performed, replacing it with valid data from the previous time step. For example, when the deviation exceeds 3 times the standard deviation, it is determined to be outlier, and valid values ​​from the previous time step are used to fill the gap.

[0053] Step S33: Map the cleaned data to the [0,1] interval using the min-max normalization method. For example, map the turbidity value X (0~1000 NTU) to the normalized turbidity value X' in the [0,1] interval using the following formula: X' = ​​(XX) min ) / (X max -X min ) Where X min =0, X max =1000. Parameters such as flow rate, pH value, temperature, and conductivity are also mapped to the [0,1] interval using the same method.

[0054] Data cleaning ensures that the data input into the prediction model is accurate, smooth, and dimensionless.

[0055] Furthermore, step S3 also includes feedforward compensation calculation logic, specifically including: Step S34: The intelligent control unit calculates the rate of change of influent turbidity over time in real time.

[0056] Step S35: When the rate of change exceeds a preset rate of change threshold, the current operating condition is determined to be a sudden pollution shock or a rainfall runoff shock. For example, when the turbidity rises from 50 NTU to 300 NTU within 5 minutes, and the rate of change exceeds 10 NTU / minute, the sudden mode is triggered.

[0057] Step S36: Based on the output of the Long Short-Term Memory Network prediction model, a rapid compensation amount proportional to the rate of change is superimposed to achieve an advanced response to drastic fluctuations in water quality. For example, the rapid compensation amount = k × rate of change, where the proportionality coefficient k is dynamically adjusted based on historical rainfall intensity data, such as increasing to 1.5 during heavy rain warnings.

[0058] Through feedforward compensation, the system can increase the dosage in advance before water quality changes, significantly shortening the response time.

[0059] Step S4: The precision dosing execution unit receives the feedforward control command signal from the intelligent control unit, adjusts the operating frequency of the drive motor through the variable frequency speed control device, and drives the metering pump to inject flocculant into the water to be treated at a dosing speed that matches the feedforward control quantity.

[0060] Specifically, the operational logic of the precise dosing execution unit in step S4 includes: Step S41: The frequency converter receives a preset voltage signal from the intelligent control unit and adjusts the output speed of the AC motor, wherein the speed range of the AC motor is adapted to the preset speed range. For example, the frequency converter receives a 0-10 volt voltage signal, corresponding to a motor speed of 0-1450 rpm.

[0061] Step S42: The metering pump adopts a diaphragm structure, the stroke length is preset to a preset ratio, and the dosing accuracy of a single stroke is within a preset allowable error range. For example, the maximum rated flow of the metering pump is 5 liters / hour, the stroke length is fixed at 80%, and the dosing accuracy is better than ±0.5%.

[0062] Step S43: A back pressure valve and a pulse damper are installed in both the inlet and outlet lines of the metering pump. The pulse damper absorbs the flow pulsation generated by the reciprocating motion of the diaphragm pump, stabilizing the dosing pressure and flow rate. For example, the pulse damper uses a stainless steel shell and a flexible diaphragm, and is filled with nitrogen to reduce the pulsation rate to below 2%.

[0063] Step S44: The injection pressure is monitored in real time by a pressure sensor installed on the pipeline. When the injection pressure exceeds a preset pressure threshold, an alarm is triggered and the system switches to the standby metering pump. For example, the pressure sensor has a range of 0 to 1 MPa, and an alarm is triggered and the system automatically switches to the standby pump when the pressure exceeds 0.8 MPa.

[0064] Through the above-mentioned execution steps, the theoretical dosage can be accurately converted into the actual drug injection rate, ensuring the stability and reliability of the dosing process.

[0065] Step S5: The effect feedback unit set at the outlet of the sedimentation tank monitors the turbidity of the treated effluent in real time. The intelligent control unit calculates the deviation between the real-time value of the effluent turbidity and the preset target value, and uses the proportional-integral-derivative algorithm to calculate the deviation to obtain the correction amount. The correction amount is superimposed on the feedforward control amount and together they act on the dosing speed of the metering pump.

[0066] Specifically, the effect feedback unit includes a high-precision online turbidity meter with a measurement resolution better than 0.01 NTU, installed at the sedimentation tank outlet collection trough. The intelligent control unit compares the real-time effluent turbidity with a preset target value (e.g., 0.8 NTU) and calculates the deviation e(t). A proportional-integral-derivative (PID) algorithm is used to calculate the correction amount u(t).

[0067] Among them, K p K i K d These are the proportional, integral, and differential coefficients, respectively, with K taken as an example. p =0.6, K i =0.1, K d =0.05. The correction value u(t) is added to the feedforward control value to adjust the metering pump speed in real time, so that the effluent turbidity is stabilized within the target range.

[0068] Furthermore, to prevent integral saturation, this embodiment employs an improved PID algorithm with a dead zone: when |e(t)| < 0.05NTU, the integral term stops accumulating to avoid frequent actuator movements caused by small fluctuations; when |e(t)| ≥ 0.05NTU, the proportional coefficient is dynamically adjusted according to the magnitude of the deviation.

[0069] Through step S5, the system forms a composite control of "feedforward prediction + feedback correction", which can quickly respond to sudden changes in water quality and ensure steady-state accuracy.

[0070] In summary, the method of Embodiment 1 of the present invention achieves intelligent control of the entire process of flocculant addition by constructing a long short-term memory network prediction model and introducing feedforward compensation and feedback closed loop, which significantly improves the addition accuracy and anti-disturbance capability.

[0071] Example 2

[0072] like Figure 2 As shown, Embodiment 2 of the present invention discloses an intelligent flocculant dosing system based on dynamic water quality data, comprising: Water quality online monitoring unit M10: used to synchronously acquire turbidity and flow information of raw water, and convert the turbidity and flow information into standard electrical signals.

[0073] Specifically, the online water quality monitoring unit M10 includes: The M11 submersible turbidity sensor employs an infrared scattering light measurement principle at a preset angle and is equipped with an automatic cleaning and scraping device. This device performs cleaning at preset time intervals to eliminate interference from air bubbles and deposits on the optical window. The submersible turbidity sensor has a preset measurement range and its measurement accuracy is within a preset range. For example, the M11 uses an infrared scattering turbidity meter with a range of 0–1000 NTU, featuring a built-in scraping cleaning function that operates every 30 minutes, with an accuracy of ±2%.

[0074] Electromagnetic flow meter M12: Utilizing the principle of electromagnetic induction, the inner lining material is polytetrafluoroethylene (PTFE), and the electrode material is tantalum. The measurement error is controlled below a preset error threshold. For example, M12 is an electromagnetic flow meter with a nominal diameter of 50 mm and an accuracy of ±0.5%, installed on the main inlet water pipe via a flange connection.

[0075] Signal transmission module M13: Uploads the 4-20 mA standard current signal collected by the turbidity meter and flow meter to the intelligent control unit in real time via shielded twisted pair cable.

[0076] Intelligent control unit M20: connected to the online water quality monitoring unit, used to build and train a flocculant dosage prediction model, and calculate the theoretical flocculant dosage as a feedforward control quantity based on the real-time received turbidity data and flow data.

[0077] Specifically, the intelligent control unit M20 includes: The M21 programmable logic controller employs a modular high-speed processor, responsible for low-level real-time signal acquisition, logic interlock control, and PID calculations. Its analog input module converts 4-20 mA signals into 16-bit digital values.

[0078] Edge computing gateway M22: Equipped with an embedded operating system, it internally deploys a pre-trained long short-term memory network prediction model and other backup models (gradient boosting tree, transformer, support vector regression) for performing deep learning inference. M21 and M22 exchange data via the Industrial Ethernet protocol.

[0079] Data preprocessing module M23: Implements functions such as moving average filtering (window width 12 points), Laida criterion outlier removal (3 times standard deviation), and minimum-maximum normalization (mapped to the [0,1] interval).

[0080] Model training and update module M24: Incrementally retrains the Long Short-Term Memory network using historical data from the cloud or local storage, optimizing the weight parameters. The retrained model parameters are then sent to M22 via remote commands.

[0081] Feedforward compensation module M25: Calculates the rate of change of influent turbidity in real time. When the rate of change exceeds the threshold, it superimposes a rapid compensation amount that is proportional to the rate of change on the output of the prediction model.

[0082] Precision dosing execution unit M30: connected to the intelligent control unit, used to receive the command signal of the feedforward control quantity, and drive the metering pump to inject flocculant into the water to be treated through frequency conversion speed regulation.

[0083] Specifically, the precision dosing execution unit M30 includes: Inverter M31: Receives the 0-10V voltage signal output from M21 and linearly adjusts the speed of the drive motor.

[0084] Metering pump M32: adopts a diaphragm structure, with a pre-set stroke length of 80%, and a single-stroke dosing accuracy better than ±0.5%. Two metering pumps are used, one in operation and one on standby.

[0085] Pulse damper M33 and back pressure valve M34: Installed on the inlet and outlet pipelines of the metering pump, they absorb flow pulsations and stabilize the injection pressure and flow.

[0086] Pressure sensor M35: Real-time monitoring of injection pressure; triggers an alarm and switches to standby pump when the pressure exceeds 0.8 MPa.

[0087] Effect feedback unit M40: Used for real-time monitoring of the turbidity of the effluent from the sedimentation tank outlet.

[0088] Specifically, the effect feedback unit M40 includes a high-precision online turbidimeter with a measurement resolution better than 0.01 NTU, and its output signal is used as a closed-loop feedback input to M21.

[0089] The intelligent control unit is further configured to calculate a correction amount based on the deviation between the effluent turbidity and a preset target value using a proportional-integral-derivative algorithm, and then superimpose the correction amount onto the feedforward control quantity to dynamically compensate for the metering pump's dosing speed. Specifically, the programmable logic controller M21 incorporates a PID controller, employing an improved PID algorithm with dead time, and the correction amount is superimposed onto the feedforward control quantity.

[0090] Furthermore, the system also has auxiliary parameter expansion capabilities and cloud-based iteration logic, specifically including: Auxiliary sensor module M50: At the input end of the intelligent control unit, in addition to turbidity and flow rate, real-time data collected by a hydrogen ion concentration index sensor, a temperature sensor, and a conductivity sensor are also introduced. For example, M50 includes a pH composite electrode (accuracy ±0.05), a platinum resistance temperature sensor (accuracy ±0.1℃), and a conductivity sensor (range 0~2000 μS / cm), all connected to M22 via an industrial bus.

[0091] The cloud management platform M60 and the model iteration update module M70: The intelligent control unit uploads the influent parameters, dosing records, and effluent effect data generated during operation to the cloud database through a wireless communication network; the model iteration update module periodically calls the accumulated operating data to incrementally retrain the long short-term memory network and optimize the model weight parameters; after the model iteration update module completes the retraining, the model parameters are sent to the on-site controller via remote commands, and the controller updates the control logic according to the retrained model parameters.

[0092] Through the above system architecture, a close functional correspondence is formed between the modules: the online water quality monitoring unit corresponds to step S1 in the method embodiment; the intelligent control unit and its internal sub-modules correspond to model building, data cleaning, and feedforward compensation in steps S2 and S3; the precise dosing execution unit corresponds to step S4; the effect feedback unit corresponds to step S5; and the auxiliary parameters and cloud-based iterative logic enhance the system's adaptability and self-learning ability.

[0093] In summary, the system of Embodiment 2 of the present invention, through the collaborative design of hardware and software, provides physical support for the process described in the method embodiment, and has high precision, high reliability and self-optimization capabilities. It can be widely used in the precise dosing control of flocculants in fields such as rural water treatment.

[0094] The foregoing has shown and described the basic principles, main features, and advantages of this invention. Those skilled in the art should understand that this invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of this invention. Various changes and modifications can be made to this invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A smart flocculant dosing method based on dynamic water quality data, characterized in that, The method includes the following steps: Step S1: The turbidity and flow information of the raw water are synchronously acquired by the online water quality monitoring unit set at the inlet of the equalization tank, and the captured physical quantity information is converted into a standard electrical signal and sent to the intelligent control unit in real time through the signal transmission link. Step S2: Based on historical monitoring data and experimental data, a basic database is constructed. The basic database contains various water quality feature vectors and corresponding optimal dosage values. The various water quality feature vectors include the turbidity value at the current moment, the average turbidity value of the previous N sampling periods, the first derivative of turbidity over time, and the flow rate value. The basic database is used to train a long short-term memory network for deep learning. The nonlinear features of water quality parameters evolving over time are extracted through the gating mechanism inside the long short-term memory network. The mapping logic between influent water quality parameters and the optimal dosage of flocculant is established, and the flocculant dosage prediction model is completed. Step S3: The intelligent control unit receives the current turbidity data and flow data from the online water quality monitoring unit in real time, inputs the real-time data after cleaning into the pre-trained flocculant dosage prediction model, calculates the theoretical flocculant dosage value corresponding to the current water quality conditions through model reasoning, and outputs the theoretical flocculant dosage value as a feedforward control quantity. Step S4: The precision dosing execution unit receives the feedforward control command signal from the intelligent control unit, adjusts the operating frequency of the drive motor through the variable frequency speed control device, and drives the metering pump to inject flocculant into the water to be treated at a dosing speed that matches the feedforward control quantity. Step S5: The effect feedback unit set at the outlet of the sedimentation tank monitors the turbidity of the treated effluent in real time. The intelligent control unit calculates the deviation between the real-time value of the effluent turbidity and the preset target value, and uses the proportional-integral-derivative algorithm to calculate the deviation to obtain a correction amount. The correction amount is superimposed on the feedforward control amount and together they act on the dosing speed of the metering pump.

2. The intelligent flocculant dosing method based on dynamic water quality data according to claim 1, characterized in that, Step S1 specifically includes: The online water quality monitoring unit is installed in the flow stabilization tank at the inlet of the regulating tank, and data is collected synchronously through a submersible turbidity sensor and an electromagnetic flow meter. The submersible turbidity sensor adopts the infrared scattering light measurement principle at a preset angle and is equipped with an automatic cleaning and scraping device. The automatic cleaning and scraping device performs cleaning actions at preset time intervals to eliminate the interference of air bubbles and deposits on the optical window. The measurement range of the submersible turbidity sensor is set to a preset range, and the measurement accuracy is within a preset accuracy range. The electromagnetic flowmeter uses the principle of electromagnetic induction, with polytetrafluoroethylene as the inner lining material and tantalum as the electrode material. The measurement error is controlled below a preset error threshold. The online water quality monitoring unit uploads the collected data to the intelligent control unit in real time through a standard current signal within a preset range, and the data sampling frequency is set to a preset sampling frequency.

3. The intelligent flocculant dosing method based on dynamic water quality data according to claim 1, characterized in that, The process of constructing the basic database in step S2 specifically includes: Through a six-stage stirring test, gradient dosing tests were conducted on different water samples with turbidity distribution within a preset turbidity range and hydrogen ion concentration index distribution within a preset index range. In each set of experiments, the rotation speed of the rapid stirring stage was set to the first preset rotation speed, and the duration was set to the first preset time, so as to promote the rapid diffusion of flocculant; The rotation speed of the slow flocculation stage is set to the second preset rotation speed, and the duration is set to the second preset time, in order to promote the growth of flocs. Set the settling and sedimentation period to the third preset time; By measuring the turbidity of the supernatant after sedimentation, the minimum amount of reagent to be added when the effluent turbidity is lower than the preset effluent threshold is determined, and the corresponding influent turbidity, flow rate and hydrogen ion concentration index are recorded to form an initial sample set containing a preset amount of valid data.

4. The intelligent flocculant dosing method based on dynamic water quality data according to claim 3, characterized in that, The process of training the long short-term memory network prediction model in step S2 specifically includes: The initial sample set is divided into a training set and a validation set according to a preset ratio; the long short-term memory network consists of an input layer, a hidden layer and an output layer, wherein the hidden layer contains a preset number of recursive units, each layer is configured with a preset number of neurons, the preset number of neurons is adapted to the length of the input sequence window, and the number of neurons is set to twice the length of the input window; The Long Short-Term Memory (LSTM) network introduces forget gate, input gate, and output gate mechanisms to process the time-series characteristics of water quality data. The forget gate is used to determine discarded historical information, the input gate is used to determine new information to be stored in the current state, and the output gate is used to determine the output prediction result. During training, mean squared error is used as the loss function, and the adaptive moment estimation algorithm is used for weight optimization. The learning rate is set to a preset learning rate, and the number of iterations is set to a preset number of iterations, until the prediction error on the validation set is less than a preset error threshold.

5. The intelligent flocculant dosing method based on dynamic water quality data according to claim 1, characterized in that, The flocculant dosage prediction model in step S2 also has algorithm switching logic, specifically including: When the intelligent control unit detects that the computing resource load exceeds 80%, it switches the Long Short-Term Memory network prediction model to a lightweight prediction model based on gradient boosting trees. The gradient boosting tree model consists of 100 to 150 decision trees, with the maximum depth of each decision tree set to 6 to 8. The input features include current turbidity, turbidity change rate, flow rate, and historical dosage. Features are split using the Gini coefficient. During the switching process, a transition period of 2 to 5 minutes is set. During the transition period, a weighted average algorithm is used to smooth the dosage before and after the switch. The weight coefficients of the weighted average algorithm change linearly during the transition period. When the intelligent control unit detects that the water quality fluctuation characteristics have a long-range correlation, a converter model is used as the prediction model for the flocculant dosage. The converter model includes an encoder and a decoder. The encoder is composed of 4 to 6 layers of self-attention mechanism and feedforward neural network stacked together. The length of the input sequence is set to 60 to 120 sampling periods. The self-attention mechanism is used to capture the long-range dependence between water quality parameters. The criterion for determining the long-range correlation is: calculate the autocorrelation function of the influent turbidity sequence. When the autocorrelation coefficient is greater than 0.6 when the delay step is 30 steps, it is determined to have a long-range correlation. When the intelligent control unit is in few-sample learning mode, a support vector regression model is used as the flocculant dosage prediction model, and a radial basis function is selected as the kernel function. The penalty parameter and kernel function parameter are determined by grid search method.

6. The intelligent flocculant dosing method based on dynamic water quality data according to claim 1, characterized in that, The process of cleaning the raw data in step S3 specifically includes: High-frequency random noise in sensor signals is eliminated by using a moving average filtering algorithm. The width of the filtering window is set to a preset number of sampling points, and the arithmetic mean of the sampling points within the window is used as the effective signal value at the current moment. The Raida criterion is used to identify outlier data points. The deviation between the current sampling point and the mean of the previous sampling points is calculated. When the deviation exceeds a preset standard deviation multiple, it is determined to be outlier data and a removal operation is performed. The valid data from the previous moment is used to fill the gap. The min-max normalization method is used to map the cleaned data to the interval [0,1].

7. The intelligent flocculant dosing method based on dynamic water quality data according to claim 1, characterized in that, Step S3 also includes feedforward compensation calculation logic, specifically including: The intelligent control unit calculates the rate of change of influent turbidity over time in real time. When the rate of change exceeds a preset rate of change threshold, the current operating condition is determined to be a sudden pollution shock or a rainfall runoff shock. Based on the output of the Long Short-Term Memory Network prediction model, a rapid compensation amount that is directly proportional to the rate of change is superimposed to achieve an advanced response to drastic fluctuations in water quality. The proportional coefficient of the rapid compensation amount is dynamically corrected based on historical rainfall intensity data.

8. The intelligent flocculant dosing method based on dynamic water quality data according to claim 1, characterized in that, The operational logic of the precise application execution unit in step S4 specifically includes: The frequency converter receives a preset voltage signal from the intelligent control unit and adjusts the output speed of the AC motor, wherein the speed range of the AC motor is adapted to the preset speed range. The metering pump adopts a diaphragm structure, the stroke length is preset to a preset ratio, and the dosing accuracy of a single stroke is within a preset allowable error range. Back pressure valves and pulse dampers are installed in both the inlet and outlet pipelines of the metering pump. The pulse dampers absorb the flow pulsation generated by the reciprocating motion of the diaphragm pump, thereby stabilizing the dosing pressure and flow rate. The injection pressure is monitored in real time by a pressure sensor installed on the pipeline. When the injection pressure exceeds a preset pressure threshold, an alarm is triggered and the system switches to a backup metering pump.

9. A smart flocculant dosing system based on dynamic water quality data, characterized in that, The system includes: The online water quality monitoring unit is used to simultaneously acquire the turbidity and flow information of raw water and convert the turbidity and flow information into standard electrical signals; The intelligent control unit is connected to the online water quality monitoring unit and is used to build and train a flocculant dosage prediction model. Based on the real-time received turbidity data and flow data, the theoretical flocculant dosage is calculated as a feedforward control quantity through the flocculant dosage prediction model. A precision dosing execution unit, connected to the intelligent control unit, is used to receive the command signal of the feedforward control quantity and drive the metering pump to inject flocculant into the water to be treated through frequency conversion speed regulation; The effect feedback unit is used to monitor the turbidity of the effluent from the sedimentation tank outlet in real time. The intelligent control unit is also used to calculate a correction amount using a proportional-integral-derivative algorithm based on the deviation between the effluent turbidity and the preset target value, and to superimpose the correction amount onto the feedforward control amount to dynamically compensate the dosing speed of the metering pump.

10. The intelligent flocculant dosing system based on dynamic water quality data according to claim 9, characterized in that, The system also has auxiliary parameter expansion capabilities and cloud-based iteration logic, specifically including: In addition to turbidity and flow rate, real-time data collected by a hydrogen ion concentration index sensor, a temperature sensor, and a conductivity sensor are also introduced at the input end of the intelligent control unit. The system also includes a cloud management platform and a model iteration and update module. The intelligent control unit uploads the influent parameters, dosing records and effluent effect data generated during operation to the cloud database through a wireless communication network. The model iteration and update module periodically calls the accumulated running data to incrementally retrain the flocculant dosage prediction model and optimize the model weight parameters. After the model iteration update module completes the retraining, the model parameters are sent to the on-site controller via remote commands. The controller then updates its control logic based on the retrained model parameters.