Hardness control method and system for deep water treatment inclined plate sedimentation tank
Patent Information
- Application Number
- CN202610678733.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-18
- Publication Date
- 2026-10-20
AI Technical Summary
[0007]为解决或部分解决相关技术中存在的问题,本申请提供一种深度水处理斜板沉淀池硬度调控方法及系统,旨在解决现有废水硬度处理方法难以同时兼顾化学反应计量约束、时变反应效率补偿、长时间依赖关系捕捉及多目标冲突优化的问题
通过基于化学反应当量和辅助参数修正理论投加量,采用扩展卡尔曼滤波在线联合估计反应利用率与水力滞后时间,有效补偿反应效率的时变性与水力停留时间的滞后影响,提升复杂工况下的调控精度;利用经树结构帕尔森估计器贝叶斯优化算法自动寻优的Stacking集成学习模型预测出水硬度和浊度,增强模型的鲁棒性与泛化能力;进一步以出水硬度达标、药剂成本和澄清风险为目标函数滚动求解优选控制变量,实现了多目标冲突的动态平衡,在保证出水硬度合格的前提下,最小化药剂消耗、防止因过量投加导致的出水浊度上升和污泥负荷异常,有效降低了膜系统结垢和斜板堵塞的风险,实现了处理效果、运行成本与设备安全的多目标动态平衡。
Smart Images

Figure FT_1 
Figure SMS_1 
Figure SMS_2
Abstract
Description
Technical Field
[0001] This application relates to the field of wastewater hardness treatment technology, and in particular to a method and system for controlling the hardness of inclined plate sedimentation tanks in deep water treatment. Background Technology
[0002] In the field of advanced wastewater treatment for industries such as non-ferrous metal smelting, the inclined plate sedimentation tank softening unit is a crucial component for removing calcium and magnesium hardness from water and ensuring the long-term stable operation of subsequent membrane systems, heat exchangers, and other equipment. In actual operation, parameters such as total influent hardness, calcium-magnesium hardness ratio, carbonate alkalinity, pH value, turbidity, temperature, and influent flow rate often exhibit wide, rapid, and coupled fluctuations, resulting in significant time-varying and nonlinear characteristics between the actual demand for sodium carbonate reagent and the precipitation reaction efficiency.
[0003] Existing technologies for addressing such problems often rely on manual laboratory results and fixed-ratio dosing strategies, failing to respond in real-time to drastic fluctuations in influent water quality. While simple stoichiometric models can provide theoretical dosages based on reaction equivalence relationships, they struggle to estimate actual reaction utilization rates online, which dynamically change with sludge concentration, water temperature, reagent purity, and mixing conditions. Furthermore, the inherent hydraulic retention time in sedimentation tanks leads to a delayed effect of dosing, which conventional methods often cannot effectively compensate for, easily resulting in "over-dosing" or "response lag" leading to excessive effluent hardness.
[0004] Secondly, there are also technologies that use neural network models to predict effluent hardness and achieve feedforward control, such as neural networks or decision tree models. However, when faced with extreme conditions such as influent hardness shocks, especially when dealing with high-dimensional sparse water quality characteristics, capturing long-term dependencies across sedimentation reaction cycles, and avoiding information leakage due to time-sequencing, conventional model structures are inadequate. Furthermore, these models have numerous hyperparameters, making it difficult to efficiently find the globally optimal combination using human experience or grid search, thus limiting the actual deployment effectiveness of the models.
[0005] Meanwhile, existing effluent control strategies typically only focus on whether the effluent hardness meets the standard, neglecting the clarification risks represented by the amount of reagent added, the increase in effluent turbidity, the increase in inter-tank pressure difference, and the impact of sludge discharge cycle on sludge load. When sodium carbonate is added in excess, although the hardness meets the standard, it may lead to an increase in effluent pH, scaling on inclined plates, and deterioration of floc settling performance, affecting the normal operation of subsequent membrane systems.
[0006] Therefore, there is an urgent need for a method and system for controlling the hardness of inclined plate sedimentation tanks that can simultaneously take into account stoichiometric constraints of chemical reactions, compensation for time-varying reaction efficiency, capture of long-term dependencies, and optimization of multi-objective conflicts. Summary of the Invention
[0007] To address or partially address the problems existing in related technologies, this application provides a method and system for controlling the hardness of an inclined plate sedimentation tank in deep water treatment. The aim is to solve the problem that existing wastewater hardness treatment methods cannot simultaneously take into account chemical reaction metric constraints, time-varying reaction efficiency compensation, long-term dependency capture, and multi-objective conflict optimization.
[0008] The first aspect of this application provides a method for controlling the hardness of an inclined plate sedimentation tank in advanced water treatment, comprising: Real-time acquisition of operating data of the softening unit in the inclined plate sedimentation tank, and calculation of derived indices; operating data includes at least influent hardness, effluent hardness, influent flow rate and auxiliary parameters affecting reaction efficiency; derived indices include total hardness removal rate, calcium and magnesium removal rate, sodium carbonate dosing coefficient, sufficient sedimentation reaction time, effluent turbidity rise rate, cross-tank pressure difference change rate and flow fluctuation coefficient. Based on the equivalent relationship of softening chemical reaction, the theoretical dosage is calculated according to the influent hardness, effluent hardness and influent flow rate. The theoretical dosage is then corrected according to auxiliary parameters to obtain the physical dosage. Extended Kalman filtering is used to treat the reaction utilization rate and hydraulic lag time, which cannot be directly measured, as state variables. These variables are then combined with operational data for online joint estimation to compensate for the time-varying effects of reaction efficiency and the lag effect of hydraulic retention time in the sedimentation tank. Based on operational data and estimated values of state variables, effluent hardness and turbidity are predicted using an ensemble learning model. The ensemble learning model is a Stacking model, with base learners including at least two of XGBoost, LightGBM, CatBoost, and extreme random trees, and meta-learners being temporal convolutional networks or Transformer encoders. The hyperparameters of the Stacking model are automatically optimized using a tree-structured Parsons estimator Bayesian optimization algorithm. Using the objectives of achieving the required effluent hardness, reagent cost, and clarification risk as represented by effluent turbidity or pressure difference, the optimal control variables for sodium carbonate dosage, pump frequency, stirring intensity, and sludge discharge cycle are solved on a rolling basis based on the physical dosage and prediction results.
[0009] Optional, ensemble learning models include: Four base learners and one second-order meta-learner; Four base learners are used: XGBoost, LightGBM, CatBoost, and Extreme Random Tree. XGBoost is used to learn nonlinear and variable interaction features, LightGBM is used to handle high-dimensional sparse water quality features, CatBoost is used to reduce target leakage caused by operating condition category features and time ordering, and Extreme Random Tree is used to improve robustness to sensor noise and short-term spikes. A two-dimensional learner, employing a temporal convolutional network or a Transformer encoder, utilizes causal convolution, dilated convolution, or self-attention mechanisms to capture long-term dependencies across precipitation reaction cycles and pH regulation cycles. The outputs of each base learner serve as the inputs to the second-order learner, which outputs the final predicted values for effluent hardness and turbidity.
[0010] Optionally, the hyperparameters of the Stacking model can be automatically optimized, including: The validation error of each set of candidate parameters is used as the observation value. The distribution of candidate parameters with validation errors below the quantile threshold is modeled as a good parameter density function, and the distribution of candidate parameters with validation errors not below the quantile threshold is modeled as a bad parameter density function. The quantile threshold is determined by the historical validation error ranking. In the next round of search, the parameter region for the next round of search is determined by maximizing the expected improvement criterion. The parameter region that can improve the expected improvement is selected first. The parameters include learning rate, tree depth, number of leaf nodes, regularization coefficient, sampling ratio, time window length and prediction step size.
[0011] Optional objective functions include: Minimize the sum of the squared deviation of effluent hardness from the target value, sodium carbonate dosage, squared deviation of effluent turbidity from the target value, and sludge load; The constraints include physical limits of the equipment, upper limit of safe effluent hardness, upper limit of turbidity, and range of sludge discharge frequency; The solution is obtained by using an evolutionary algorithm based on the Pareto front or a sequential quadratic programming algorithm to output the optimal sodium carbonate dosage, pump frequency, stirring intensity, and sludge discharge cycle.
[0012] Optionally, online joint estimation can be performed, including: Based on the material balance and hardness removal kinetics of sedimentation tank, the following state equations and observation equations are established: In the formula, T represents temperature; Let A be the prior state estimate at the current moment; A is the state transition matrix. This represents the state variables of the previous moment, such as reaction utilization. and hydraulic lag time The vector formed; Represents process noise, used to describe uncertainties in state transition models; Represents a nonlinear observation function; express The hardness of the incoming water at any given time, among which Hydraulic lag time reflects the time delay required for the reagent to be added and for the precipitation reaction to occur and affect the quality of the effluent. express The amount of sodium carbonate added at any given time; This represents the pH value at time t; Represents the temperature at time t; To observe noise; The reaction utilization rate and hydraulic lag time are used as state variables, and a two-stage computational framework of standard prediction step and update step of extended Kalman filter is used for recursive estimation.
[0013] Optionally, the theoretical dosage can be corrected based on auxiliary parameters, including: The theoretical dosage that satisfies the reaction equivalence relationship is calculated based on the hardness difference and the treatment flow rate: In the formula, Indicates the inflow rate. Indicates the hardness of the incoming water. Indicates the target effluent hardness. Indicates the molar mass of sodium carbonate. Indicates the molar mass of calcium carbonate. Indicates the purity of sodium carbonate preparations. Indicates reaction utilization rate; Correcting the reaction efficiency: In the formula, Indicates the pH correction factor. This indicates the lower limit of the optimal pH required for the reaction. This indicates the pH measurement value at the current moment. This represents the temperature correction factor. T represents the reference temperature, and T represents the current temperature. Indicates the turbidity correction factor. This represents the turbidity value at the current moment. Indicates the alkalinity correction factor. This indicates the current carbonate alkalinity. Indicates reference alkalinity; Calculate the physical dosage: .
[0014] Optionally, the hardness control method for inclined plate sedimentation tanks in advanced water treatment also includes: The candidate model mechanism regularly trains candidate models using the latest data. The online model is only replaced when the candidate model outperforms the current online model in terms of prediction error, false negative rate, and false positive rate over the validation window. Otherwise, only the statistical baseline and safety threshold are updated. The verification window is set up according to the time sequence of historical data, and future data is not visible.
[0015] Optionally, the hardness control method for inclined plate sedimentation tanks in advanced water treatment also includes: Feedback rhythm control utilizes the sufficient sedimentation reaction time to constrain the feedback rhythm. During operation, if the current hydraulic residence time has not yet reached the sufficient sedimentation reaction time, the current effluent hardness deviation is judged as a delayed response, and the sodium carbonate dosage is not directly adjusted. Feedback adjustments are only made based on deviations when the hydraulic residence time exceeds the sufficient time for sedimentation reaction.
[0016] A second aspect of this application provides a hardness control system for an inclined plate sedimentation tank in advanced water treatment, comprising: The hardness water quality sensing module is used to collect real-time operating data of the inclined plate sedimentation tank softening unit. The operating data includes total hardness of influent and effluent, calcium hardness, magnesium hardness, carbonate alkalinity, pH, turbidity, suspended solids, conductivity, total dissolved solids, temperature, oxidation-reduction potential, particle count, sludge density index and influent flow rate. The derived index calculation module is used to calculate the total hardness removal rate, calcium and magnesium removal rate, sodium carbonate dosage coefficient, sufficient sedimentation reaction time, effluent turbidity rise rate, cross-tank pressure difference change rate, and flow fluctuation coefficient based on the operating data. The sodium carbonate reaction metering module is used to calculate the theoretical dosage that satisfies the reaction equivalence relationship based on the hardness difference and the processing flow rate, and to correct the reaction efficiency according to pH, temperature, turbidity and alkalinity to calculate the physical dosage. The online reaction efficiency estimation module is used to estimate the reaction utilization rate and hydraulic lag time as state variables online using extended Kalman filtering. The TPE-optimized Stacking prediction module is used to optimize the hyperparameters of the Stacking ensemble learning model by taking running data and derived indices as input, and employing a tree-structured Parsons estimator and Bayesian optimization algorithm to predict effluent hardness and turbidity. The base learners of the Stacking model include XGBoost, LightGBM, CatBoost, and extreme random trees, while the second-order meta-learners use temporal convolutional networks or Transformer Encoders. The multi-objective dosing optimization module is used to solve the sodium carbonate dosage, pump frequency, stirring intensity and sludge discharge cycle in a rolling manner with the objective functions of achieving effluent hardness standards, reagent cost, sludge load and clarification risk. The execution control module is used to issue execution commands to the variable frequency dosing pump and sludge discharge valve according to the dosage, and to perform secondary verification of the output results under equipment constraints and process constraints. The execution control module is also equipped with three-layer boundary treatment: the early warning layer is used to give early warning of influent hardness impact; the control layer is used to increase the dosage and optimize sludge discharge; and the protection layer is used to switch to conservative operating conditions when hardness and turbidity are abnormal at the same time. The feedback self-learning module is used to correct the reaction efficiency correction coefficient online based on the feedback of effluent hardness, and uses a candidate model mechanism to decide whether to replace the online model.
[0017] The technical solution provided in this application may include the following beneficial effects: By correcting the theoretical dosage based on chemical reaction equivalence and auxiliary parameters, and employing extended Kalman filtering for online joint estimation of reaction utilization and hydraulic lag time, the time-varying nature of reaction efficiency and the lag effect of hydraulic residence time are effectively compensated, improving the control accuracy under complex operating conditions. A Stacking ensemble learning model, automatically optimized by a tree-structured Parsons estimator and Bayesian optimization algorithm, is used to predict effluent hardness and turbidity, enhancing the model's robustness and generalization ability. Furthermore, by using effluent hardness compliance, reagent cost, and clarification risk as objective functions, the optimal control variables are selected through rolling solutions, achieving a dynamic balance of multiple objectives. While ensuring effluent hardness compliance, reagent consumption is minimized, and effluent turbidity increases and sludge load abnormalities caused by overdosing are prevented, effectively reducing the risk of membrane system scaling and inclined plate blockage. This achieves a dynamic balance of multiple objectives: treatment effect, operating cost, and equipment safety.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0019] The above and other objects, features and advantages of this application will become more apparent from the more detailed description of exemplary embodiments thereof in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments thereof.
[0020] Figure 1 This is a schematic flowchart illustrating a method for controlling the hardness of an inclined plate sedimentation tank in deep water treatment, as shown in an embodiment of this application. Detailed Implementation
[0021] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.
[0022] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.
[0023] In some implementations, see Figure 1 A method for controlling the hardness of an inclined plate sedimentation tank in deep water treatment, comprising: S101. Real-time acquisition of the operating data of the softening unit of the inclined plate sedimentation tank, and calculation of derived indices; Specifically, at the inlet of the inclined plate sedimentation tank, ion-selective electrodes for total hardness, calcium hardness, and magnesium hardness, a pH meter, an alkalinity titrator, a turbidity meter, a TDS meter, a temperature sensor, an ORP meter, a particle counter, a sludge density index meter, and an electromagnetic flow meter are installed. At the effluent end, instruments for total hardness, calcium hardness, magnesium hardness, turbidity, and pH feedback are installed. All instruments are connected to a programmable logic controller and a data acquisition and monitoring control system, with a unified sampling frequency setting to ensure real-time data consistency and synchronization.
[0024] The above instruments are used to collect real-time operating data of the softening unit in the inclined plate sedimentation tank, including total hardness of influent, total hardness of effluent, calcium hardness, magnesium hardness, carbonate alkalinity, pH, turbidity NTU, suspended solids SS, conductivity EC, total dissolved solids TDS, temperature T, oxidation-reduction potential ORP, particle count PC, sludge density index SDI, and influent flow rate Q.
[0025] For the calculation of derived indicators, the original data often cannot directly reflect the dynamics of the process. Therefore, a series of derived indicators are calculated based on the original operating data, including: Total hardness removal rate: ,in, The hardness of the incoming water. The hardness of the output water; Calcium removal rate: ,in, For the calcium hardness of the influent, For the calcium hardness of the effluent, To calculate the time interval; Rate of increase in effluent turbidity: ,in, Time interval Changes in turbidity of the effluent; Rate of change of cross-pool pressure differential: ,in, Time interval The change in the pressure difference between the inlet and outlet water of the inclined plate sedimentation tank; Flow fluctuation coefficient: ,in, The standard deviation of the influent flow rate series. This represents the mean of the influent flow rate sequence; Derived indicators are used to evaluate softening effects, identify floc abnormalities, and assess operational stability, providing more direct process information for subsequent optimization decisions.
[0026] S102. Based on the equivalent relationship of softening chemical reaction, calculate the theoretical dosage according to the influent hardness, effluent hardness and influent flow rate, and correct the theoretical dosage according to the auxiliary parameters to obtain the physical dosage. Specifically, based on the stoichiometric relationship of the softening chemical reaction According to the hardness of the incoming water Target water hardness Calculate the theoretical dosage based on the flow rate Q: In the formula, Indicates the inflow rate. This indicates the total hardness of the incoming water. Indicates the target effluent hardness. Indicates the molar mass of sodium carbonate. Indicates the molar mass of calcium carbonate. Indicates the purity of sodium carbonate preparations. Indicates reaction utilization rate; However, the actual reaction efficiency is affected by pH, temperature, turbidity, and alkalinity, and a correction formula is needed to dynamically adjust the theoretical dosage to correct for the reaction efficiency. In the formula, Indicates the pH correction factor. This indicates the lower limit of the optimal pH required for the reaction. This indicates the pH measurement value at the current moment. This represents the temperature correction factor. T represents the reference temperature, and T represents the current temperature. Indicates the turbidity correction factor. This represents the turbidity value at the current moment. Indicates the alkalinity correction factor. This indicates the current carbonate alkalinity. Indicates reference alkalinity; Calculate the physical dosage: This ensures the physical rationality of the dosage under conditions of significant fluctuations.
[0027] S103. Extended Kalman filtering is adopted to treat the reaction utilization rate and hydraulic lag time, which cannot be directly measured, as state variables and combine them with the operating data for online joint estimation to compensate for the time-varying effect of reaction efficiency and the lag effect of hydraulic retention time in the sedimentation tank. Specifically, the reaction utilization rate in the sedimentation tank and hydraulic lag time These are key state variables that cannot be directly measured. The Extended Kalman Filter (EKF) is used to perform online joint estimation of these two state variables. The EKF establishes state equations and observation equations and uses real-time feedback of effluent hardness data to recursively correct the estimated values.
[0028] Define state variables: Establish state equations Establish the observation equation: In the formula, T represents temperature; Let A be the prior state estimate at the current moment; A is the state transition matrix. This represents the state variables of the previous moment, such as reaction utilization. and hydraulic lag time The vector formed; Represents process noise, used to describe uncertainties in state transition models; Represents a nonlinear observation function; express The hardness of the incoming water at any given time, among which Hydraulic lag time reflects the time delay required for the reagent to be added and for the precipitation reaction to occur and affect the quality of the effluent. express The amount of sodium carbonate added at any given time; This represents the pH value at time t; Represents the temperature at time t; To observe noise; Using reaction utilization rate and hydraulic lag time as state variables, a recursive estimation is performed using a two-stage computational framework of standard prediction step and update step with extended Kalman filtering. The prediction step is based on the state at the previous time step. Given the state transition matrix A, predict the current state. and its covariance; the update step obtains the actual measured value of the effluent hardness at the current moment. The Kalman gain is calculated, and then the measurement residuals are used to correct the predicted values to obtain the optimal estimate. and its covariance.
[0029] In specific estimations, the input vector is composed of influent hardness, sodium carbonate dosage, pH, temperature, flow rate, turbidity, and alkalinity. And based on the standard prediction step and update step two-stage computational framework of extended Kalman filtering, recursive estimation is performed: In the prediction step, the current prior state is first calculated based on the posterior state of the previous time step, and then the Jacobian matrix is obtained from the nonlinear state equation. Prior state estimation: In the formula, The state transition function corresponds to the discretized state equation. ; Calculate the state Jacobian matrix: Prior covariance estimation: In the formula, The process noise covariance matrix; Update step: Obtain the actual hardness measurement value of the effluent at the current moment. The observation residuals, innovation covariance, and Kalman gain are calculated. Then, the predicted values are corrected using the measurement residuals to obtain the optimal posterior estimate and its covariance. Observation residuals: In the formula, Represents a nonlinear observation function. This represents the current runtime data; Observation of the Jacobian matrix: Innovation covariance: In the formula, To observe the noise covariance matrix; Kalman gain: Posterior state estimation: Posterior covariance update: In the formula, I represents the identity matrix; After the update is complete, physical constraints are applied to the state variables, including the reaction utilization rate. Limiting the hydraulic lag time to the interval [0,1] The hydraulic retention time is limited to the allowable range of the sedimentation tank. If the actual effluent hardness is higher than the model prediction for several consecutive cycles, it indicates that the reaction utilization rate may decrease or the hydraulic lag may increase. The Extended Kalman Filter (EKF) will then gradually lower the estimated reaction utilization rate and raise the estimated hydraulic lag time, thus dynamically tracking the changes in unmeasurable physicochemical processes within the sedimentation tank. This addresses the time-varying nature of reaction efficiency caused by changes in sludge concentration, temperature, and chemical concentration, as well as the lag problem caused by hydraulic retention time.
[0030] S104. Based on the estimated values of operating data and state variables, predict the hardness and turbidity of the effluent through an ensemble learning model. The ensemble learning model is a Stacking model, and the base learners include at least two of XGBoost, LightGBM, CatBoost, and Extremely Random Tree, while the meta-learners are temporal convolutional networks or Transformer encoders. The hyperparameters of the Stacking model are automatically optimized using a tree-structured Parsons estimator Bayesian optimization algorithm. Specifically, the ensemble learning model includes four base learners and one second-order meta-learner. The four base learners are XGBoost, LightGBM, CatBoost, and Extremely Random Tree. XGBoost is used to learn nonlinear and variable interaction features, LightGBM is used to handle high-dimensional sparse water quality features, CatBoost is used to reduce target leakage caused by operational category features and time ranking, and Extremely Random Tree is used to improve robustness to sensor noise and short-term spikes. Base learner training involves training the four models XGBoost, LightGBM, CatBoost, and Extremely Random Tree respectively. Each model is responsible for learning different patterns in the data. For example, XGBoost learns nonlinear interactions, and CatBoost handles categorical features.
[0031] The second-level meta-learner employs a temporal convolutional network or a Transformer encoder, utilizing causal convolution, dilated convolution, or self-attention mechanisms to capture long-term dependencies across precipitation reaction cycles and pH regulation cycles. Meta-learner training involves using the predictions of the four base learners on the validation set samples as new features, which are then input into the temporal convolutional network (TCN) or the Transformer encoder for training.
[0032] The outputs of each base learner serve as the input to the second-order learner, which outputs the final predicted values for effluent hardness and turbidity. A sample is formed by combining the current time and historical window data of length L. The prediction targets are the effluent hardness and turbidity for the next k steps: In the formula, k is the prediction step size; Base learner training: Four base learners are trained respectively: XGBoost, LightGBM, CatBoost, and Extra Trees; taking XGBoost as an example, the objective function for boosting the tree in the q-th round is: In the formula, To account for the prediction errors of hardness and turbidity, Let be the number of leaf nodes of the q-th tree. The weights of the leaf nodes are... and This is the complexity penalty coefficient; LightGBM employs a histogram-based leaf growth strategy, CatBoost utilizes ordered class encoding to process class features, and Extreme Random Tree enhances robustness to sensor noise by randomly selecting features and threshold splitting.
[0033] Each base learner outputs complementary prediction results. The output of the m-th base learner is: In the formula, The hyperparameters of the base learner; The training of the two-dimensional meta-learners is conducted by dividing the training window, validation window, and test window in chronological order to ensure that future data is not visible. Each base learner is trained separately, and out-of-fold predictions are generated for the validation window. These out-of-fold predictions are then compared with the response utilization estimated by the extended Kalman filter. and hydraulic lag time Together they constitute the secondary input features: When using TCN, causal convolution and dilatational convolution are used to extract long-term dependencies across sedimentation reaction cycles; when using Transformer encoder, the outputs of different time steps and different base learners are fused using a self-attention mechanism to finally obtain the joint predicted values of effluent hardness and effluent turbidity.
[0034] TPE hyperparameter optimization uses the validation error of each set of candidate parameters as an observation. The distribution of candidate parameters with validation errors below the quantile threshold is modeled as a good parameter density function, while the distribution of candidate parameters with validation errors not below the quantile threshold is modeled as a bad parameter density function. The quantile threshold is determined by the historical validation error ranking. In the next round of search, the parameter region for the next round of search is determined by maximizing the expected improvement criterion. The parameter region that can improve the expected improvement is selected first. The parameters include learning rate, tree depth, number of leaf nodes, regularization coefficient, sampling ratio, time window length, and prediction step size.
[0035] The parameter optimization process is as follows: Initialize several sets of candidate parameters. Training yields validation loss Historical samples were divided into superior and inferior sets based on the quantile threshold γ, and their densities were estimated separately. In the next round of search, the parameter region for the next round of search is determined by maximizing the expected improvement criterion, and the parameter region that can improve the expected improvement is selected first, that is: The search parameters include learning rate, tree depth, number of leaf nodes, regularization coefficient, sampling ratio, time window length L, and prediction step size k; after each training iteration, a new... Historical samples are written in, and the process is repeated until the maximum number of iterations is reached or the verification error no longer decreases. The optimal combination of hyperparameters is then obtained and used to train the final Stacking prediction model.
[0036] S105. Taking the effluent hardness compliance, reagent cost, and clarification risk characterized by effluent turbidity or pressure difference as objective functions, the optimal control variables of sodium carbonate dosage, pump frequency, stirring intensity, and sludge discharge cycle are solved in a rolling manner based on the physical dosage and prediction results.
[0037] Specifically, to balance multiple conflicting objectives, a multi-objective optimization problem is constructed within the rolling time domain. First, a method combining safety priority and entropy weight correction is used to dynamically determine the weights of each sub-item. Within the rolling window, four types of indicators—hardness deviation, reagent consumption, turbidity deviation, and sludge load—are calculated separately to obtain normalized sequences. Where i represents the sample number and k represents the indicator type; calculate the information entropy of the k-th indicator: This refers to the entropy weight base weight based on data-driven principles.
[0038] Subsequently, the basic weights are adjusted based on the current safety margin. When the predicted effluent hardness is close to the safety upper limit, the weight of the hardness index is increased; when the predicted turbidity or inter-pool pressure difference is close to the upper limit, the weight of the clarification risk index is increased. The correction factor is denoted as... The final weights are: Within the prediction time domain (NN), the following objective function is constructed: In the formula, and These are the effluent hardness and turbidity predicted by the ensemble learning model, respectively. Indicates the amount of sodium carbonate added; This indicates the costs associated with sludge load; , The target value; , , , This is a normalized reference value; This is a penalty term for changes in the control quantity, used to suppress frequent actions of the actuator.
[0039] Decision variables , respectively, represent the amount of sodium carbonate added, pump frequency, stirring intensity, and sludge discharge cycle.
[0040] The constraints include physical limits of the equipment, upper limit of safe effluent hardness, upper limit of turbidity, and range of sludge discharge frequency.
[0041] The solution is obtained by using an evolutionary algorithm based on the Pareto front or a sequential quadratic programming algorithm to output the optimal sodium carbonate dosage, pump frequency, stirring intensity, and sludge discharge cycle.
[0042] Based on the Pareto front-based evolutionary algorithm, candidate control sequences are first generated by considering the current control quantity and the physical dosage calculated by the sodium carbonate reaction metering module. An ensemble learning prediction model is then invoked to calculate the hardness, turbidity, and sludge load responses corresponding to each candidate sequence. Next, non-dominated sorting and crowding degree filtering are performed on each candidate solution to obtain the Pareto front. Finally, a weighted objective is selected from the front. The smallest sequence that satisfies all safety constraints is the optimal solution.
[0043] Sequence quadratic programming uses the current control variable as the initial value, performs local quadratic approximation on the objective function and constraints, and iteratively solves for the feasible optimal solution. This method has a fast convergence speed and is suitable for scenarios with high real-time requirements.
[0044] Regardless of the solver used, a rolling time-domain control strategy is employed, which sends only the first step of the optimal control sequence to the actuator. After the next sampling time arrives, the latest data is collected again, and the rolling solution is performed. If the actual hardness of the effluent exceeds the safety limit for several consecutive cycles, and the model prediction also shows that it exceeds the standard, the safety protection logic is triggered, and open-loop control is performed directly according to the preset safety dosage until the operating condition is restored.
[0045] Based on the calculated optimal sodium carbonate dosage, pump frequency, stirring intensity, and sludge discharge cycle, control commands are generated and sent to the field actuators. For example, the speed of the dosing pump is controlled by a frequency converter, and the opening and closing of the sludge discharge valve is controlled by a switch.
[0046] Simultaneously, a safety verification logic is designed so that any control quantity output by the AI model must undergo secondary verification under equipment and process constraints before taking effect. If the model output exceeds the pump frequency, reagent concentration, valve action frequency, pressure safety line, or effluent quality safety line, the system will not directly execute the AI result, but will instead truncate the control quantity to the safety boundary and record the reason for the truncation on the host computer. At the same time, three layers of boundaries are set: early warning, control, and protection, corresponding to three response strategies: prompting, active adjustment, and emergency switching, respectively.
[0047] By constraining the feedback rhythm with the sufficient sedimentation reaction time, if the current hydraulic residence time has not yet reached the sufficient sedimentation reaction time during operation, the current effluent hardness deviation is judged as a delayed response, and the sodium carbonate dosage is not directly adjusted; only when the hydraulic residence time exceeds the sufficient sedimentation reaction time will feedback adjustment be made based on the deviation.
[0048] Corresponding to the aforementioned application function implementation method embodiments, this application also provides a hardness control system for an inclined plate sedimentation tank in deep water treatment and corresponding embodiments.
[0049] A hardness control system for an inclined plate sedimentation tank in advanced water treatment includes: The hardness water quality sensing module is used to collect real-time operating data of the softening unit in the inclined plate sedimentation tank. This data includes total hardness, calcium hardness, magnesium hardness, carbonate alkalinity, pH, turbidity, suspended solids, conductivity, total dissolved solids, temperature, oxidation-reduction potential, particle count, sludge density index, and influent flow rate. The hardware foundation for the hardness water quality sensing module consists of various online instruments deployed at the inlet, outlet, and dosing ends of the inclined plate sedimentation tank. Specifically, these include: online total hardness / calcium hardness / magnesium hardness ion-selective electrodes, pH meter, alkalinity titrator, turbidity meter, conductivity / TDS meter, temperature sensor, ORP meter, particle counter, SDI meter, and electromagnetic flow meter at the inlet end; and online hardness, turbidity, and pH feedback instruments at the outlet end. The hardness water quality sensing module collects real-time operating data of the softening unit, including total hardness, calcium hardness, magnesium hardness, carbonate alkalinity, pH, turbidity, SS, conductivity, TDS, temperature, ORP, particle count, SDI, and influent flow rate.
[0050] The derived index calculation module is used to calculate the total hardness removal rate, calcium and magnesium removal rate, sodium carbonate dosage coefficient, sufficient sedimentation reaction time, effluent turbidity rise rate, cross-tank pressure difference change rate, and flow fluctuation coefficient based on operating data. These derived indices are used to evaluate softening effect, identify floc abnormalities, judge operational stability, and provide more direct process information for subsequent optimization decisions.
[0051] The sodium carbonate reaction metering module is used to calculate the theoretical dosage that satisfies the reaction equivalence relationship based on the hardness difference and the processing flow rate, and to correct the reaction efficiency according to pH, temperature, turbidity and alkalinity to calculate the physical dosage.
[0052] The online reaction efficiency estimation module uses an extended Kalman filter to estimate the reaction utilization rate and hydraulic lag time as state variables online. It also uses an extended Kalman filter (EKF) to perform online joint estimation of these two state variables. By establishing state equations and observation equations, the estimated values are recursively corrected using real-time feedback of effluent hardness data.
[0053] The TPE-optimized Stacking prediction module is used to optimize the hyperparameters of the Stacking ensemble learning model using running data and derived indices as inputs, employing a tree-structured Parsons estimator and a Bayesian optimization algorithm to predict effluent hardness and turbidity. The base learners of the Stacking model include XGBoost, LightGBM, CatBoost, and extreme random trees, while the second-order meta-learners employ temporal convolutional networks or Transformer Encoders.
[0054] The multi-objective dosing optimization module is used to solve for the optimal sodium carbonate dosage, pump frequency, stirring intensity, and sludge discharge cycle within a rolling time domain, with the objective functions being effluent hardness compliance, reagent cost, sludge load, and clarification risk. This module does not simply pursue hardness compliance; rather, it simultaneously optimizes multiple conflicting objectives within a rolling time domain. Its objectives are to minimize the sum of the squared deviations of effluent hardness from the target value, sodium carbonate dosage, the squared deviations of effluent turbidity from the target value, and sludge load. Constraints include equipment physical limits, safe upper limits for effluent hardness, and upper limits for turbidity. Based on current operating conditions, physical dosage, and future hardness and turbidity predictions provided by the module, the optimal sodium carbonate dosage, dosing pump frequency, stirring intensity, and sludge discharge cycle are determined through evolutionary algorithms or sequential quadratic programming.
[0055] The execution control module is used to issue execution commands to the variable frequency dosing pump and sludge discharge valve according to the dosage, and to perform secondary verification of the output results under equipment constraints and process constraints. If the safety boundary is exceeded, the control quantity will be truncated to the boundary value, and the reason for truncation will be recorded on the host computer. The execution control module is also equipped with three-layer boundary handling: the early warning layer is used to give advance notice of influent hardness impact; the control layer is used to increase the dosage and optimize sludge discharge; and the protection layer is used to switch to conservative operating conditions when hardness and turbidity are abnormal at the same time.
[0056] The feedback self-learning module is used to correct the reaction efficiency correction coefficient online based on the effluent hardness feedback, and employs a candidate model mechanism to determine whether to replace the online model. It performs rapid correction by comparing the actual effluent hardness with the predicted value in real time. If a persistent deviation exists, it fine-tunes relevant terms in the reaction efficiency correction coefficient online. When continuous chemical deficiency occurs, it increases the pH or temperature correction coefficient accordingly. The candidate model mechanism periodically triggers candidate model training, using all historical data up to the current moment, divided into training, validation, and test sets in chronological order. The performance of the newly trained candidate model is evaluated on the validation set against the current online model, with evaluation metrics including root mean square error, false negative rate for hardness exceeding limits, and false positive rate. Model hot replacement is only performed when all evaluation metrics of the candidate model are superior to the current online model; otherwise, only the statistical baseline and safety threshold are updated. A validation window is reserved, divided chronologically from historical data, and future data is not visible.
[0057] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for controlling the hardness of an inclined plate sedimentation tank in deep water treatment, characterized in that, include: Real-time acquisition of operating data of the softening unit in the inclined plate sedimentation tank, and calculation of derived indices; the operating data includes at least influent hardness, effluent hardness, influent flow rate and auxiliary parameters affecting reaction efficiency; the derived indices include total hardness removal rate, calcium and magnesium removal rate, sodium carbonate dosing coefficient, sedimentation reaction duration, effluent turbidity rise rate, cross-tank pressure difference change rate and flow fluctuation coefficient. Based on the equivalent relationship of softening chemical reaction, the theoretical dosage is calculated according to the influent hardness, effluent hardness and influent flow rate. The theoretical dosage is then corrected according to the auxiliary parameters to obtain the physical dosage. Extended Kalman filtering is used to treat the reaction utilization rate and hydraulic lag time, which cannot be directly measured, as state variables. These variables are then combined with the operating data for online joint estimation to compensate for the time-varying effects of reaction efficiency and the lag effect of hydraulic retention time in the sedimentation tank. Based on the estimated values of operational data and state variables, the hardness and turbidity of the effluent are predicted using an ensemble learning model to obtain the prediction results. The ensemble learning model is a Stacking model, and the base learners include at least two of XGBoost, LightGBM, CatBoost, and Extremely Random Tree, while the meta-learners are temporal convolutional networks or Transformer encoders. The hyperparameters of the Stacking model are automatically optimized using a tree-structured Parsons estimator Bayesian optimization algorithm. Using the objectives of achieving the required effluent hardness, reagent cost, and clarification risk as represented by effluent turbidity or pressure difference, the optimal control variables for sodium carbonate dosage, pump frequency, stirring intensity, and sludge discharge cycle are solved on a rolling basis based on the physical dosage and the prediction results.
2. The method for controlling the hardness of an inclined plate sedimentation tank in deep water treatment according to claim 1, characterized in that, The ensemble learning model includes: Four base learners and one second-order meta-learner; Four base learners are used: XGBoost, LightGBM, CatBoost, and Extreme Random Tree. XGBoost is used to learn nonlinear and variable interaction features, LightGBM is used to handle high-dimensional sparse water quality features, CatBoost is used to reduce target leakage caused by operating condition category features and time ordering, and Extreme Random Tree is used to improve robustness to sensor noise and short-term spikes. A two-dimensional learner, employing a temporal convolutional network or a Transformer encoder, utilizes causal convolution, dilated convolution, or self-attention mechanisms to capture long-term dependencies across precipitation reaction cycles and pH regulation cycles. The outputs of each base learner serve as the inputs to the second-order learner, which outputs the final predicted values for effluent hardness and turbidity.
3. The method for controlling the hardness of an inclined plate sedimentation tank in deep water treatment according to claim 1, characterized in that, The automatic optimization of the hyperparameters of the Stacking model includes: The verification error of each set of candidate parameters is used as the observation value. The distribution of candidate parameters with verification errors below the quantile threshold is modeled as a superior parameter density function, and the distribution of candidate parameters with verification errors not lower than the quantile threshold is modeled as a non-superior parameter density function; the quantile threshold is determined by the historical verification error ranking. In the next round of search, the parameter region for the next round of search is determined by maximizing the expected improvement criterion. The parameter region that can improve the expected improvement is selected first. The parameters include learning rate, tree depth, number of leaf nodes, regularization coefficient, sampling ratio, time window length and prediction step size.
4. The method for controlling the hardness of an inclined plate sedimentation tank in deep water treatment according to claim 1, characterized in that, The objective function includes: Minimize the sum of the squared deviation of effluent hardness from the target value, sodium carbonate dosage, squared deviation of effluent turbidity from the target value, and sludge load; The constraints include physical limits of the equipment, upper limit of safe effluent hardness, upper limit of turbidity, and range of sludge discharge frequency; The solution is obtained by using an evolutionary algorithm based on the Pareto front or a sequential quadratic programming algorithm to output the optimal sodium carbonate dosage, pump frequency, stirring intensity, and sludge discharge cycle.
5. The method for controlling the hardness of an inclined plate sedimentation tank in deep water treatment according to claim 1, characterized in that, The online joint estimation includes: Based on the material balance and hardness removal kinetics of sedimentation tank, the following state equations and observation equations are established: In the formula, T represents temperature; Let A be the prior state estimate at the current moment; A is the state transition matrix. This represents the state variables of the previous moment, such as reaction utilization. and hydraulic lag time The vector formed; Represents process noise, used to describe uncertainties in state transition models; Represents a nonlinear observation function; express The hardness of the incoming water at any given time, among which Hydraulic lag time reflects the time delay required for the reagent to be added and for the precipitation reaction to occur and affect the quality of the effluent. express The amount of sodium carbonate added at any given time; This represents the pH value at time t; Represents the temperature at time t; To observe noise; The reaction utilization rate and hydraulic lag time are used as state variables, and a two-stage computational framework of standard prediction step and update step of extended Kalman filter is used for recursive estimation.
6. The method for controlling the hardness of an inclined plate sedimentation tank in deep water treatment according to claim 1, characterized in that, The step of correcting the theoretical dosage based on the auxiliary parameters includes: The theoretical dosage that satisfies the reaction equivalence relationship is calculated based on the hardness difference and the treatment flow rate: In the formula, Indicates the inflow rate. This indicates the total hardness of the incoming water. Indicates the target effluent hardness. Indicates the molar mass of sodium carbonate. Indicates the molar mass of calcium carbonate. Indicates the purity of sodium carbonate preparations. Indicates reaction utilization rate; Correcting the reaction efficiency: In the formula, Indicates the pH correction factor. This indicates the lower limit of the optimal pH required for the reaction. This indicates the pH measurement value at the current moment. This represents the temperature correction factor. T represents the reference temperature, and T represents the current temperature. Indicates the turbidity correction factor. This represents the turbidity value at the current moment. Indicates the alkalinity correction factor. This indicates the current carbonate alkalinity. Indicates reference alkalinity; Calculate the physical dosage: 。 7. The method for controlling the hardness of an inclined plate sedimentation tank in deep water treatment according to claim 1, characterized in that, Also includes: The candidate model mechanism regularly trains candidate models using the latest data. The online model is only replaced when the candidate model outperforms the current online model in terms of prediction error, false negative rate, and false positive rate over the validation window. Otherwise, only the statistical baseline and safety threshold are updated. The reserved verification window is divided from historical data in chronological order, and future data is not visible.
8. The method for controlling the hardness of an inclined plate sedimentation tank in deep water treatment according to claim 1, characterized in that, Also includes: Feedback rhythm control utilizes the sufficient sedimentation reaction time to constrain the feedback rhythm. During operation, if the current hydraulic residence time has not yet reached the sufficient sedimentation reaction time, the current effluent hardness deviation is judged as a delayed response, and the sodium carbonate dosage is not directly adjusted. Feedback adjustments are only made based on deviations when the hydraulic residence time exceeds the sufficient time for sedimentation reaction.
9. A hardness control system for an inclined plate sedimentation tank in deep water treatment, used to execute the hardness control method for an inclined plate sedimentation tank in deep water treatment according to any one of claims 1-9, characterized in that, include: The hardness water quality sensing module is used to collect real-time operating data of the inclined plate sedimentation tank softening unit. The operating data includes total hardness of influent and effluent, calcium hardness, magnesium hardness, carbonate alkalinity, pH, turbidity, suspended solids, conductivity, total dissolved solids, temperature, oxidation-reduction potential, particle count, sludge density index and influent flow rate. The derived index calculation module is used to calculate the total hardness removal rate, calcium and magnesium removal rate, sodium carbonate dosage coefficient, sufficient sedimentation reaction time, effluent turbidity rise rate, cross-tank pressure difference change rate, and flow fluctuation coefficient based on the operating data. The sodium carbonate reaction metering module is used to calculate the theoretical dosage that satisfies the reaction equivalence relationship based on the hardness difference and the processing flow rate, and to correct the reaction efficiency according to pH, temperature, turbidity and alkalinity to calculate the physical dosage. The online reaction efficiency estimation module is used to estimate the reaction utilization rate and hydraulic lag time as state variables online using extended Kalman filtering. The TPE-optimized Stacking prediction module is used to optimize the hyperparameters of the Stacking ensemble learning model using the aforementioned operating data and derived indices as input, and employs a tree-structured Parsons estimator and Bayesian optimization algorithm to predict effluent hardness and effluent turbidity. The base learners of the Stacking model include XGBoost, LightGBM, CatBoost, and extreme random trees, while the second-order learners employ temporal convolutional networks or Transformer Encoders. The multi-objective dosing optimization module is used to solve the sodium carbonate dosage, pump frequency, stirring intensity and sludge discharge cycle in a rolling manner with the objective functions of achieving effluent hardness standards, reagent cost, sludge load and clarification risk. The execution control module is used to issue execution commands to the variable frequency dosing pump and sludge discharge valve according to the dosage, and to perform secondary verification of the output results under equipment constraints and process constraints. The execution control module is also equipped with three-layer boundary treatment: the early warning layer is used to give early warning of influent hardness impact; the control layer is used to increase the dosage and optimize sludge discharge; and the protection layer is used to switch to conservative operating conditions when hardness and turbidity are abnormal at the same time. The feedback self-learning module is used to correct the reaction efficiency correction coefficient online based on the feedback of effluent hardness, and uses a candidate model mechanism to decide whether to replace the online model.