Flocculation dosing control method and device, electronic equipment and storage medium

By constructing a sample set covering various operating conditions to train a prediction model, selecting the optimal model, and combining it with real-time data to calculate flocculation process parameters, the problems of reliance on operator experience and poor dynamic adaptability in existing technologies have been solved, realizing intelligent and economical control of wastewater treatment.

CN121894773AActive Publication Date: 2026-04-21BEIJING JINDAYU ENVIRONMENT TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING JINDAYU ENVIRONMENT TECH CO LTD
Filing Date
2026-01-09
Publication Date
2026-04-21

Smart Images

  • Figure CN121894773A_ABST
    Figure CN121894773A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of sewage treatment, and discloses a flocculation dosing control method and device, electronic equipment and a storage medium, and the method comprises the following steps: extracting sample operation data and sample medicament parameters based on a preset time window, fusing to obtain a plurality of sample fusion data, calculating sample mechanism characteristics corresponding to the sample fusion data, and calculating the sample mechanism characteristics according to the sample mechanism characteristics; taking as a sample set of a preset time window; training a plurality of initial prediction models based on the sample set, repeating the above process until a preset stop condition is reached, determining an intermediate prediction model, and screening to obtain a target prediction model; real-time operation data and real-time medicament parameters are collected and fused, and real-time mechanism characteristics are calculated; a target prediction model is adopted to predict the effluent turbidity to obtain predicted effluent turbidity; and when the predicted effluent turbidity does not reach the preset condition, under the constraint of the multi-objective optimization function, searching to obtain flocculation process parameters. According to the invention, the dependence on professional technicians can be reduced, the generalization ability to dynamic working conditions is improved, and the sewage treatment effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wastewater treatment technology, specifically to a flocculation dosing control method, device, electronic equipment, and storage medium. Background Technology

[0002] Flocculation and chemical dosing is a crucial step in wastewater treatment. Wastewater contains a large number of tiny suspended particles invisible to the naked eye. These particles are highly stable and difficult to settle and separate naturally. The core function of flocculation and chemical dosing is to add specific agents to the wastewater, causing the agents to react with the tiny particles and promote their aggregation into larger and heavier flocs. Subsequent processes such as sedimentation and filtration separate the flocs from the water, ultimately purifying the wastewater to meet discharge or reuse standards.

[0003] Currently, the main methods for controlling flocculant dosing fall into three categories: First, automatic dosing systems based on PLCs (Programmable Logic Controllers), which consist of a PLC controller paired with metering pumps, sensors, and other equipment to form a closed-loop control system; second, intelligent PID (Proportional-Integral-Derivative) control systems, which add intelligent algorithms to the PLC and can automatically adjust PID parameters according to water quality parameters; and third, mechanism-based expert control models, such as BioWin and SUMO.

[0004] However, the above three methods are highly dependent on the experience and intervention of the operators. In the flocculation and dosing scenario of sewage treatment, the process conditions are always in dynamic change. When new operating conditions occur, the control logic or algorithm of the above methods is difficult to adapt quickly, resulting in unstable sewage treatment effect or even failure of effluent to meet standards. Summary of the Invention

[0005] This invention provides a flocculation dosing control method, device, electronic equipment, and storage medium to solve the problems of existing technologies that rely heavily on the experience and intervention of operators, and the fact that in wastewater treatment flocculation dosing scenarios, the process conditions are constantly changing and it is difficult to adapt quickly when new operating conditions occur, resulting in unstable wastewater treatment effects or even substandard effluent.

[0006] In a first aspect, the present invention provides a method for controlling flocculation dosing, the method comprising: Acquire historical operating data of the flocculation tank and historical reagent parameters of the reagents, and extract multiple sample operating data and multiple sample reagent parameters corresponding to each preset time window from the historical operating data and historical reagent parameters; Multiple sample operation data and multiple sample drug parameters are fused to obtain multiple sample fusion data. The multiple sample mechanism features corresponding to each sample fusion data are calculated and used as a sample set for a preset time window. Multiple initial prediction models are trained based on a sample set within a preset time window. The process of building a sample set and training within the preset time window is repeated until a preset stopping condition is met. Each initial prediction model obtained from the last training is then identified as a corresponding intermediate prediction model. Multiple intermediate prediction models are then selected to obtain the target prediction model. Real-time operating data of the flocculation tank and real-time reagent parameters of the reagents are collected and fused to obtain real-time fused data. Based on the real-time fused data, multiple real-time mechanism characteristics are calculated. A target prediction model based on multiple real-time mechanism features was used to predict the turbidity of the effluent. When the predicted effluent turbidity does not meet the preset conditions, the flocculation process parameters are obtained by searching under the constraints of the multi-objective optimization function. The flocculation process parameters are controllable parameters from the real-time operation data and real-time reagent parameters.

[0007] This invention collects sample operation data and reagent parameters within a preset time window, covering various typical operating conditions and ensuring comprehensive coverage of the main operating scenarios of the flocculation process, providing comprehensive operating condition support for model training. By fusing the above data, each sample's fused data fully encompasses all dimensions of information, including wastewater operating status and key reagent indicators. Based on this, the mechanistic characteristics of the sample are calculated, replacing the original, coarse-grained time-series data in model training. This reduces reliance on large-scale samples, adapts to training needs in small-sample scenarios, and better reflects the essence of the flocculation reaction, contributing to improved model prediction accuracy. Multiple initial prediction models are trained using an automatically constructed sample set, resulting in corresponding intermediate prediction models. The target prediction model with the best performance is then selected, providing reliable support for subsequent actual predictions and parameter optimization. In practical applications, real-time operation data and real-time reagent parameters are collected, fused, and the calculated mechanistic characteristics are input into the target prediction model to obtain the predicted effluent turbidity. When the predicted effluent turbidity does not meet the preset conditions, the flocculation process parameters are searched under the constraints of a multi-objective optimization function. Compared with the traditional trial-and-error method, no physical experiment is required, which not only significantly reduces costs but also allows for rapid parameter search, dynamic response to influent water quality fluctuations and load shocks, and reduces reliance on professional technicians. This enables intelligent and economical recommendation of flocculation process parameters, thereby improving the quality of wastewater treatment.

[0008] Secondly, the present invention provides a flocculation dosing control device, the device comprising: The first acquisition module is used to acquire historical operating data of the flocculation tank and historical reagent parameters of the reagents, and extract multiple sample operating data and multiple sample reagent parameters corresponding to each preset time window from the historical operating data and historical reagent parameters. The fusion module is used to fuse multiple sample running data and multiple sample drug parameters to obtain multiple sample fusion data, calculate the multiple sample mechanism features corresponding to each sample fusion data, and use them as a sample set for a preset time window; The training module is used to train multiple initial prediction models based on a sample set within a preset time window. The process of building the sample set and training within the preset time window is repeated until a preset stopping condition is met. Each initial prediction model obtained from the last training is determined as the corresponding intermediate prediction model, and multiple intermediate prediction models are selected to obtain the target prediction model. The second acquisition module is used to acquire real-time operating data of the flocculation tank and real-time reagent parameters of the reagents, fuse them to obtain real-time fused data, and calculate multiple real-time mechanism features based on the real-time fused data; The prediction module is used to make predictions based on multiple real-time mechanism features using a target prediction model to obtain the predicted effluent turbidity. The search module is used to search for flocculation process parameters under the constraints of a multi-objective optimization function when the predicted effluent turbidity does not meet the preset conditions. The flocculation process parameters are controllable parameters from real-time operating data and real-time reagent parameters.

[0009] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the flocculation dosing control method of the first aspect or any corresponding embodiment described above.

[0010] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the flocculation dosing control method of the first aspect or any corresponding embodiment described above. Attached Figure Description

[0011] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0012] Figure 1 This is a flowchart of a flocculation dosing control method according to an embodiment of the present invention; Figure 2 This is a flowchart of another flocculation dosing control method according to an embodiment of the present invention; Figure 3 This is a flowchart of another flocculation dosing control method according to an embodiment of the present invention; Figure 4 This is a structural block diagram of a flocculation dosing control device according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0014] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0015] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0016] For the crucial step of flocculation dosing in wastewater treatment, three main control methods are currently employed: First, PLC-based automatic dosing systems, consisting of a PLC controller paired with metering pumps, sensors, and other equipment to form a closed-loop control system; second, intelligent PID control systems, which add intelligent algorithms to the PLC to automatically adjust PID parameters based on water quality parameters; and third, mechanism-based expert control models, such as BioWin and SUMO. However, these three methods are highly dependent on operator experience and intervention. Furthermore, in wastewater treatment flocculation dosing scenarios, the process conditions are constantly changing. When new operating conditions arise, the control logic or algorithms of these methods struggle to adapt quickly, leading to unstable wastewater treatment results or even substandard effluent.

[0017] This invention automatically constructs a sample set covering various typical operating conditions to adapt to dynamic changes in operating conditions, while reducing reliance on large-scale samples and better reflecting the nature of flocculation reactions. By training multiple initial prediction models and selecting the optimal target prediction model, reliable support is provided for subsequent actual predictions and parameter optimization. When the effluent turbidity predicted by the model does not meet preset conditions, flocculation process parameters are searched under the constraints of a multi-objective optimization function, reducing reliance on professional technicians and achieving intelligent and economical recommendation of flocculation process parameters, thereby improving wastewater treatment quality.

[0018] According to an embodiment of the present invention, a method for controlling flocculation dosing is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0019] This embodiment provides a method for controlling flocculation dosing, which can be used on a terminal device such as a computer. Figure 1 This is a flowchart of a flocculation dosing control method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain historical operating data of the flocculation tank and historical reagent parameters of the reagents. Based on each preset time window, extract multiple sample operating data and multiple sample reagent parameters corresponding to the preset time window from the historical operating data and historical reagent parameters.

[0020] Specifically, operational data for multiple dynamic parameters during the operation of the flocculation tank are continuously collected at a preset sampling frequency (e.g., once every 5 seconds). These dynamic parameters include instantaneous wastewater inflow rate, wastewater pH, wastewater temperature, wastewater conductivity, influent turbidity, mixer power, instantaneous PFS (Polyferric Sulfate) flow rate, PAM (Polyacrylamide) flow rate, and sodium hydroxide flow rate. The operational data is time-series data with timestamps, for example: time = 08:00:00, instantaneous wastewater inflow rate = 100 m³ / h. The reagents added to the flocculation tank must be tested by a laboratory. Multiple reagent parameters for PFS and PAM, including reagent density, effective reagent content, and reagent concentration, are collected at a preset testing frequency. Each parameter is recorded with a dilution sampling timestamp, and stored in the same format of time + parameter value. It should be noted that all of the above data are historical data, which are collected from the actual production process in the past 30 days according to the above preset collection and testing frequencies. The historical operating data and historical reagent parameters are collected, covering typical operating conditions such as high load, low temperature, and sudden changes in water quality, to ensure coverage of the main operating scenarios of the flocculation process and to provide comprehensive operating condition support for model training.

[0021] Due to the mixing effect of wastewater in the flocculation tank, the wastewater entering at time T will interact with the wastewater entering within the 30 minutes before T. Furthermore, the treatment effect is also affected by the quality of the influent within the 30 minutes after T. In other words, the influent from both the preceding and following time periods jointly determines the final effluent state. Therefore, based on the hydraulic retention time (approximately 30 minutes) of the flocculation tank, multiple preset time windows are designed. Each preset time window consists of the target time T, 30 minutes before the target time, and 30 minutes after the target time, denoted as T-30→T→T+30. The duration of a single preset time window is 1 hour. For example, if the target time is 09:00:00, the corresponding preset time window is 08:30:00-09:30:00. Sample operation data and sample reagent parameters with timestamps falling within this preset time window are extracted from the historical data. This comprehensively captures the entire process of wastewater entering the flocculation tank and completing the flocculation reaction, laying the foundation for subsequent training sample construction and solving the problems of asynchronous data, difficulty in sample construction, and high labor costs.

[0022] Step S102: Merge multiple sample running data and multiple sample drug parameters to obtain multiple sample fusion data, calculate the multiple sample mechanism features corresponding to each sample fusion data, and use them as a sample set for a preset time window.

[0023] Specifically, the sample operational data (dynamic time-series indicators) and sample reagent parameters (static laboratory indicators) are scattered, single-dimensional data that lack effective correlation and cannot directly support model training and feature calculation. By fusing these two types of data, each sample's fused data comprehensively covers all dimensions of information, including wastewater operational status and key reagent indicators. By replacing the original, coarse-grained time-series data with high-value mechanistic features, redundant input dimensions are reduced, effectively avoiding model overfitting and decreasing reliance on large-scale samples, thus adapting to training needs in small-sample scenarios. Furthermore, the physical meaning of mechanistic features is clear, better reflecting the essence of flocculation reactions and significantly enhancing the causal relationship between input features and output. Finally, the fused data of each sample and its corresponding multiple sample mechanistic features are integrated to form a sample set corresponding to a preset time window, providing high-quality input for model training.

[0024] Step S103: Train multiple initial prediction models based on a sample set within a preset time window. Repeat the process of constructing a sample set within the preset time window and training until a preset stopping condition is met. Determine each initial prediction model obtained from the last training as the corresponding intermediate prediction model. Select multiple intermediate prediction models to obtain the target prediction model.

[0025] Specifically, to address the issues of weak generalization ability and difficulty in adapting to complex operating conditions using traditional single models, and considering the availability of multiple algorithms suitable for the scenario of flocculation and dosing, this invention constructs a multi-algorithm initial prediction model system. Five algorithms suitable for time-series data are selected: LSTM (Long Short-Term Memory), GRU (Gated Recurrent Unit), RNN (Recurrent Neural Network), CNN (Convolutional Neural Network), and Transformer. All models uniformly embed attention mechanisms in both the time and feature dimensions to enhance the ability to capture mechanistic features.

[0026] The training process uses a sample set within a preset time window as its data foundation. The model learns the core laws of the flocculation reaction and predicts effluent turbidity based on mechanistic characteristics. After training on the sample set within the current preset time window is complete, a new sample set is constructed based on the next preset time window, and the sample construction and model training process is repeated to continuously optimize model parameters. The preset stopping condition can be set to the number of training iterations reaching a preset threshold, etc., but this embodiment of the invention does not impose any restrictions on this. After training terminates, the various initial prediction models obtained from the last training iteration are determined as the corresponding intermediate prediction models. To ensure the engineering practicality and prediction accuracy of the target prediction model, all intermediate prediction models are dynamically optimized to select the target prediction model with the best performance, providing reliable support for subsequent actual predictions and parameter optimization.

[0027] Step S104: Collect real-time operating data of the flocculation tank and real-time reagent parameters of the reagents, fuse them to obtain real-time fused data, and calculate multiple real-time mechanism characteristics based on the real-time fused data.

[0028] Specifically, to achieve real-time dynamic control of flocculant dosing, real-time data consistent with historical operational data and historical reagent parameters needs to be collected. It should be noted that since reagent parameters are obtained through periodic laboratory testing, real-time data collection is unnecessary; only the latest laboratory data needs to be selected, i.e., the latest record whose dilution sampling timestamp is ≤ the current collection time. Referring to step S102, the real-time operational data and real-time reagent parameters are fused to form complete real-time fused data, and multiple real-time mechanistic characteristics corresponding to the real-time fused data are calculated.

[0029] Step S105: The target prediction model is used to predict the turbidity of the effluent based on multiple real-time mechanism features.

[0030] Specifically, the target prediction model is the selected optimal model, which has fully learned the correlation between mechanistic characteristics and effluent turbidity by integrating training samples from the process mechanism. This model is used to predict multiple real-time mechanistic characteristics, accurately outputting the predicted effluent turbidity 30 minutes after the current data collection time. This time point matches the hydraulic retention time characteristics of the flocculation tank, directly reflecting the flocculation treatment effect under the current process parameters.

[0031] Step S106: When the predicted effluent turbidity does not meet the preset conditions, the flocculation process parameters are searched and obtained under the constraints of the multi-objective optimization function. The flocculation process parameters are controllable parameters from the real-time operation data and real-time reagent parameters.

[0032] Specifically, the preset condition is that the effluent turbidity is within the optimal range of 1 NTU to 3 NTU, with 3 NTU being the core compliance threshold. This range satisfies water quality discharge requirements while avoiding reagent waste and secondary pollution. If the predicted effluent turbidity does not meet this preset condition, there are two scenarios: one is predicted effluent turbidity > 3 NTU (water quality not meeting standards, mainly due to insufficient reagent dosage and poor agitation intensity matching leading to incomplete destabilization of colloids); the other is predicted effluent turbidity < 1 NTU (over-compliance). In both scenarios, the optimal flocculation process parameters need to be searched under the constraints of a multi-objective optimization function. These flocculation process parameters are controllable parameters in the operating data and reagent parameters, that is, parameters that can be adjusted during flocculation and dosing, specifically including the effective content of PFS, the effective content of PAM, and the agitator power. If the predicted effluent turbidity is in the range of 1 NTU to 3 NTU, it indicates that the current flocculation process parameters are well adapted to the real-time operating conditions. This ensures that the effluent quality meets the standards stably and can control the cost of chemicals and energy. No adjustments are needed, and the current process parameters can continue to be used.

[0033] Compared to traditional trial-and-error methods, the embodiments of this invention do not require physical experiments, which not only significantly reduces reagent consumption and experimental costs, but also enables rapid parameter search, dynamic response to fluctuations in influent water quality and load shocks, and ultimately achieves intelligent and economical recommendation of flocculation process parameters, providing a scientific and feasible technical path for cost reduction and efficiency improvement in the wastewater treatment industry.

[0034] This invention collects sample operation data and reagent parameters within a preset time window, covering various typical operating conditions and ensuring comprehensive coverage of the main operating scenarios of the flocculation process, providing comprehensive operating condition support for model training. By fusing the above data, each sample's fused data fully encompasses all dimensions of information, including wastewater operating status and key reagent indicators. Based on this, the mechanistic characteristics of the sample are calculated, replacing the original, coarse-grained time-series data in model training. This reduces reliance on large-scale samples, adapts to training needs in small-sample scenarios, and better reflects the essence of the flocculation reaction, contributing to improved model prediction accuracy. Multiple initial prediction models are trained using an automatically constructed sample set, resulting in corresponding intermediate prediction models. The target prediction model with the best performance is then selected, providing reliable support for subsequent actual predictions and parameter optimization. In practical applications, real-time operation data and real-time reagent parameters are collected, fused, and the calculated mechanistic characteristics are input into the target prediction model to obtain the predicted effluent turbidity. When the predicted effluent turbidity does not meet the preset conditions, the flocculation process parameters are searched under the constraints of a multi-objective optimization function. Compared with the traditional trial-and-error method, no physical experiment is required, which not only significantly reduces costs but also allows for rapid parameter search, dynamic response to influent water quality fluctuations and load shocks, and reduces reliance on professional technicians. This enables intelligent and economical recommendation of flocculation process parameters, thereby improving the quality of wastewater treatment.

[0035] This embodiment provides a method for controlling flocculation dosing, which can be used in the aforementioned terminal, such as a computer. The method specifically includes the following steps: Step S201: Obtain historical operating data of the flocculation tank and historical reagent parameters. Based on each preset time window, extract multiple sample operating data and multiple sample reagent parameters corresponding to the preset time window from the historical operating data and historical reagent parameters. For details, please refer to... Figure 1 Step S101 of the illustrated embodiment will not be described again here.

[0036] Step S202: Merge multiple sample operation data and multiple sample drug parameters to obtain multiple sample fusion data, calculate multiple sample mechanism features corresponding to each sample fusion data, and use them as a sample set for a preset time window. The sample mechanism features include drug load features, pH features, temperature features, ionic strength features, concentration features, stirring speed features, stirring ability features, and drug synergistic factors.

[0037] Specifically, step S202 above fuses multiple sample operational data and multiple sample drug parameters to obtain multiple sample fusion data, including: Step S2021: For each sample running data, determine other sample running data whose timestamps differ from the sample running data by less than a preset threshold from multiple sample running data.

[0038] Specifically, to address the parameter correlation failure issue caused by asynchronous multi-source time-series data, for each sample of operational data extracted within a preset time window, based on its timestamp, other sample operational data with timestamp differences less than a preset threshold (e.g., 10 seconds) are selected from all sample operational data within the same window. This threshold is set based on the dynamic response characteristics of the flocculation process, ensuring that the selected data reflects the process operation status within the same time period.

[0039] Step S2022: Merge other sample running data with the sample running data, retain the latest timestamp between the sample running data and other sample running data, and obtain the corresponding merged running data.

[0040] Specifically, sample data with similar timestamps are merged, while the latest timestamp among all merged data is retained as a unified time identifier for the merged data to ensure the accuracy of data timing.

[0041] Suppose we have sample operational data A: time T1 = 08:00:00, instantaneous wastewater inflow rate = 100 m³ / h; and sample operational data B: T2 = 08:00:05, instantaneous PFS flow rate = 5 L / h. The timestamps of these two samples differ by 5 seconds, which is less than the preset threshold of 10 seconds, and therefore need to be merged. After merging, the latest timestamp of the two, 08:00:05, is retained. The final merged operational data is: time = 08:00:05, instantaneous wastewater inflow rate = 100 m³ / h, instantaneous PFS flow rate = 5 L / h.

[0042] It should be noted that the sample running data can be verified before step S202. If a sample running data is missing, it may be due to a sensor malfunction causing key indicators to be empty; in this case, it will be automatically marked as an invalid sample and removed. Alternatively, if the parameter value in a sample running data is far outside the normal range of its corresponding process, it will be automatically marked as an abnormal sample and removed. By removing invalid and abnormal samples, data quality can be ensured, and poor-quality data can be avoided from affecting the accuracy of subsequent mechanism feature calculations and model training.

[0043] Step S2023: For each merged run data, determine all the drug parameters to be determined from the multiple sample drug parameters that are no later than the timestamp of the merged run data.

[0044] Specifically, the merged operational data has integrated all dynamic parameters of the flocculation tank through time-series alignment. For each merged operational data point, based on its timestamp, all reagent parameters to be determined are selected from all sample reagent parameters if their "dilution sampling timestamp ≤ merged operational data timestamp".

[0045] Step S2024: Determine the drug parameter with the latest timestamp among all the drug parameters to be determined, merge the drug parameters to be determined and the merged running data to obtain the corresponding sample fusion data.

[0046] Specifically, to ensure data synchronization, the latest dilution sampling timestamp was selected from the screened reagent parameters to be determined as the optimal matching item, as it is the most recent test data and best reflects the current actual state of the reagent. This reagent parameter was then merged with the corresponding combined operational data, integrating dynamic operational indicators and static reagent indicators to ultimately form a sample fusion data that simultaneously contains full-dimensional information on wastewater conditions and reagent status, providing a complete and reliable data source for subsequent calculations of mechanistic characteristics.

[0047] Assume the timestamp of the merged run data is T0 = 08:00:00. The MySQL database stores all the reagent parameters obtained from the tests. There are sample reagent parameters G: T1 = 07:50:00, PFS effective content = 10%, and sample reagent parameter H: T2 = 08:10:00, PFS effective content = 8%. Since the timestamp of sample reagent parameter G is no later than the timestamp of the merged run data, the sample reagent parameter G with a PFS effective content of 10% needs to be merged into the merged run data.

[0048] Specifically, step S202 above calculates multiple sample mechanism features corresponding to each sample fusion data, including: Step S2025: For each sample fusion data, calculate the chemical load characteristics based on the instantaneous flow rate of wastewater entering the pool, influent turbidity, instantaneous flow rate of the chemical agent, effective chemical content, and chemical density in the sample fusion data.

[0049] Specifically, the reagent load is the amount of effective reagent added per unit volume of wastewater, which directly determines the sufficiency of reagents in the flocculation reaction. If the load is too low, the colloids cannot be fully destabilized, and if it is too high, it will lead to reagent waste and secondary pollution. It is the core indicator for measuring the rationality of reagent addition. Considering that PFS, as an inorganic flocculant, and PAM, as an organic flocculant, play different roles in the flocculation reaction, namely charge neutralization and adsorption bridging, the corresponding reagent load characteristics of the two core reagents are calculated by the following formula (1).

[0050] (1) Optionally, the product of the instantaneous flow rate of the drug, the effective content of the drug, and the density of the drug in the above formula (1) is the effective drug dose. The unit of the drug density needs to be converted during the calculation.

[0051] Step S2026: Calculate pH characteristics based on the isoelectric point of colloidal particles and the wastewater pH and conductivity in the sample fusion data.

[0052] Specifically, colloidal particles in wastewater form a stable dispersion system due to surface charges (such as negative charges). The stability of this system directly affects the flocculation efficiency. Destabilization and coagulation can only be achieved by neutralizing the colloidal charge with agents such as PFS. pH characteristics, as the core sub-characteristic of the colloidal stability coefficient, can be quantified by the following formula (2) or (3). This formula comprehensively reflects the synergistic influence of wastewater pH and conductivity on the colloidal charge state. The higher the coefficient, the stronger the stability of the colloidal particles, and the more neutralizing agent is required. This provides mechanistic support for the model to capture the causal relationship between agent addition and colloidal destabilization.

[0053] (2) (3) In the formula, Indicates pH characteristics; Indicates the pH of the wastewater; This indicates the isoelectric point of colloidal particles.

[0054] Step S2027: Calculate temperature characteristics based on preset wastewater temperature, preset maximum wastewater temperature, preset minimum wastewater temperature, and wastewater temperature in sample fusion data.

[0055] Specifically, temperature is a key factor affecting the stability of colloids and the efficiency of flocculation reaction, and it changes the flocculation reaction process through multiple dimensions. From a kinetic perspective, an increase in temperature will accelerate the Brownian motion of colloidal particles and increase the frequency of collisions between particles. If the dosage of the agent is insufficient, the colloids are prone to re-aggregate, leading to a decrease in stability. At the same time, temperature changes will directly affect the reaction rate and solubility of chemical substances in wastewater, such as changing the hydrolysis rate of flocculants and adjusting the surface charge characteristics of colloids. At higher temperatures, the hydration film on the surface of some colloids will become thinner, weakening the protective effect on the colloids and making them more prone to destabilization and aggregation. At low temperatures, the chemical reaction rate will be slowed down, resulting in a delay or weakening of the effect of the flocculant, and the stability of the colloids will remain at a high level. Temperature characteristics, as the core characteristics of the colloid stability coefficient, can be quantified by the following formula (4) to determine the effect of temperature on colloid destabilization and flocculation, providing mechanistic support for the model to capture the correlation between temperature and agent compatibility.

[0056] (4) In the formula, Indicates temperature characteristics; The wastewater temperature can be obtained from a temperature sensor; This indicates the preset wastewater temperature, which is the temperature at which the wastewater achieves the best flocculation effect. It needs to be determined through previous experiments or historical data accumulation. and These represent the preset maximum and minimum wastewater temperatures, respectively, which are determined by the process design and local climate conditions.

[0057] Step S2028: Calculate ion intensity characteristics based on preset ion intensity, preset maximum ion intensity, preset minimum ion intensity, and wastewater ion intensity in sample fusion data.

[0058] Specifically, ionic strength is a key factor affecting colloidal stability, mainly stemming from the dissolution of various inorganic salts in wastewater. It regulates flocculation efficiency by altering the double-layer structure on the surface of colloidal particles. When ionic strength increases, the double-layer thickness is compressed, reducing electrostatic repulsion between colloidal particles, making them more prone to aggregation and decreasing colloidal stability. Conversely, when ionic strength is low, the double-layer remains thicker, enhancing electrostatic repulsion and improving colloidal stability. Furthermore, the type and valence state of ions affect the double-layer compression effect, with high-valence ions exhibiting significantly stronger compression than low-valence ions. Ionic strength, as a core sub-feature of the colloidal stability coefficient, is quantified using the following equation (5) to assess the influence of ionic strength on colloidal destabilization, providing mechanistic support for the model to capture the correlation between the ionic environment and reagent compatibility.

[0059] (5) In the formula, Indicates ionic strength characteristics; Indicates the ionic strength of wastewater; This represents the preset ionic strength, which is the ionic strength at which wastewater achieves the best flocculation effect. It needs to be determined through previous experiments or historical data accumulation. and These represent the preset maximum ionic strength and the preset minimum ionic strength, respectively, which are determined by the source of the wastewater and the treatment process.

[0060] Step S2029: Calculate the concentration characteristics based on the preset baseline turbidity, preset maximum turbidity, preset minimum turbidity, and wastewater turbidity in the sample fusion data.

[0061] Specifically, the concentration characteristic, with wastewater turbidity as the core indicator, directly reflects the number and distribution density of colloidal particles per unit volume, and is a key factor affecting colloidal stability and flocculant compatibility. When the wastewater concentration increases, the collision frequency of colloidal particles increases. If the flocculant dosage is insufficient, colloids with unneutralized charges are prone to re-aggregate, leading to decreased stability. At the same time, other solutes in high-concentration wastewater may compete with the flocculant, consuming effective agents and weakening the destabilization effect of colloids. In addition, changes in the concentration of dissolved organic matter in wastewater will change the chemical environment of the solution, thereby adjusting the properties and distribution of the surface charge of colloids and indirectly affecting the flocculation reaction efficiency. As the core sub-characteristic of the colloidal stability coefficient, this characteristic quantifies the influence of wastewater concentration on colloid destabilization and flocculation effect through the following formula (6), providing mechanistic support for the model to capture the compatibility correlation between water quality concentration and agent dosage.

[0062] (6) In the formula, Indicates concentration characteristics; Turbidity of wastewater can be obtained through water quality monitoring equipment (such as an online turbidity analyzer); This represents the preset baseline turbidity, indicating the wastewater concentration under normal treatment load, and is determined by the process design. and These represent the preset maximum turbidity and the preset minimum turbidity, respectively, which are determined by the source of the wastewater and the treatment process. If the turbidity of the wastewater exceeds the range defined by these two values, the treatment effect may deteriorate.

[0063] Step S20210: Calculate the stirring speed characteristics based on the effective volume and liquid level of the flocculation tank, the dynamic viscosity of the wastewater, and the mixer power in the sample fusion data.

[0064] Specifically, the flocculation reaction relies on the precise control of agitation for reagent mixing and particle aggregation. Rapid agitation is required during the mixing stage to ensure uniform contact between the reagent and wastewater, while gentle agitation is needed during the flocculation stage to promote floc growth and prevent breakage. The agitation speed characteristic, i.e., the agitation intensity G value (velocity gradient), is an indicator that quantifies the intensity of agitation and directly determines the process adaptability of the two stages. The G value is precisely quantified using the following equations (7) and (8), providing mechanistic support for the model to capture the correlation between agitation intensity and flocculation effect.

[0065] (7) (8) In the formula, Indicates the characteristics of stirring speed; The power of the mixer is represented by the product of its rated power and power efficiency. Indicates the effective volume of the flocculation tank; The liquid level height in the flocculation tank is calculated as the ratio of the effective volume of the flocculation tank to the bottom area. This indicates the dynamic viscosity of wastewater.

[0066] Optionally, since the actual wastewater temperature is not 20℃, the dynamic viscosity of the wastewater needs to be corrected. This correction involves using the dynamic viscosity coefficient of water as an approximation, followed by interpolation using a formula to calculate a relatively accurate dynamic viscosity of the wastewater at different temperatures. The dynamic viscosity coefficient of water at different temperatures can be obtained from online resources.

[0067] If the wastewater temperature is between 5-35℃, use the following formula (9) for interpolation; if the wastewater temperature is below 5℃ or above 35℃, use the following formula (10) for interpolation.

[0068] (9) (10) In the formula, Indicates the temperature of the wastewater; and These represent the higher and lower values ​​between 20℃ and the wastewater temperature, respectively.

[0069] Step S20211: Calculate the stirring capacity characteristics based on the effective volume of the flocculation tank, the stirring speed characteristics, and the instantaneous flow rate of wastewater entering the tank.

[0070] Specifically, the G value only quantifies the instantaneous intensity of agitation, while the quality of flocculation depends on the combined effect of agitation intensity and reaction time. The agitation capacity characteristic, namely the agitation intensity Gt value, measures the total agitation energy obtained per unit volume of wastewater in the flocculation tank, directly determining the floc formation efficiency. A Gt value that is too low will result in insufficient collision of colloidal particles, making it difficult to aggregate into large flocs; a Gt value that is too high will destroy the structure of the already formed flocs, affecting the sedimentation effect. The agitation capacity characteristic is calculated using the following formula (11), providing mechanistic support for the model to capture the correlation between agitation intensity, time, and flocculation effect.

[0071] (11) In the formula, This indicates the characteristics of mixing ability.

[0072] Optionally, the ratio of effective volume to instantaneous flow rate of wastewater entering the tank is the hydraulic retention time in the wastewater flocculation tank.

[0073] Step S20212: Calculate the drug synergistic factor based on the instantaneous flow rate of the drug, the effective content of the drug, and the drug density.

[0074] Specifically, PFS neutralizes the surface charge of colloidal particles to achieve destabilization, while PAM promotes the aggregation of destabilized colloidal particles into large flocs through adsorption bridging effect. The ratio of the two dosages directly determines the synergistic efficiency of the flocculation reaction. The synergistic factor of the two agents is calculated by the following formula (12) to quantify the compatibility between the two types of agents, accurately reflect the rationality of the dosage ratio, and provide mechanistic support for the model to capture the correlation between agent ratio and flocculation efficiency.

[0075] (12) By constructing mechanistic features based on classical water treatment mechanisms, the model can learn core correlations without training with a large number of samples. This provides high-quality and highly reliable input for the turbidity prediction model of flocculated effluent in small sample scenarios. Moreover, these mechanistic features have clear physical meanings, and the model prediction results can guide the adjustment of process parameters.

[0076] Step S203: The effluent turbidity of the fused data of the sample with the latest timestamp in the sample set is determined as the output label of the sample set.

[0077] Specifically, the sample set corresponds to a unique preset time window (T-30→T→T+30), containing the sample mechanism characteristics corresponding to all sample fusion data within this window, fully covering the entire process of wastewater flocculation reaction. Considering the hydraulic retention time characteristics, the effluent state at the final time node within the window needs to match the wastewater's entry into the flocculation tank to the completion of the reaction and the output of the treatment effect. Therefore, the effluent turbidity corresponding to the latest timestamp of the sample fusion data in the sample set is detected by online instruments and used as the output label of this sample set, i.e., the model's predicted target value.

[0078] Step S204: Determine the multiple sample mechanism features corresponding to each sample fusion data in the sample set, excluding the sample fusion data with the latest timestamp, as the input features of the sample set.

[0079] Specifically, the sample fusion data with the latest timestamp was used to match the effluent turbidity at T+30 minutes, while the remaining sample fusion data fully covered the operational evolution process from the early to the middle stages of the reaction. Therefore, the sample mechanism features corresponding to these sample fusion data were selected as the input features of the sample set, ensuring that the input feature sequence highly matches the flocculation reaction time sequence. This allows the model to learn the correlation between operational changes and effluent turbidity based on the evolution trend of the mechanism features throughout the entire process, thereby achieving accurate prediction of the effluent turbidity at T+30 minutes.

[0080] Assuming the output label is the effluent turbidity at 10:30, then the input features are the sample mechanism features within 60 minutes from 9:30 to 10:00 to 10:30.

[0081] Step S205: Train multiple initial prediction models based on a sample set within a preset time window. Repeat the process of constructing a sample set within the preset time window and training until a preset stopping condition is met. Determine each initial prediction model obtained from the last training as the corresponding intermediate prediction model. Select multiple intermediate prediction models to obtain the target prediction model.

[0082] Specifically, step S205 above trains multiple initial prediction models based on a sample set within a preset time window, including: Step S2051: For each input feature, normalize the input feature to obtain preprocessed features.

[0083] Specifically, the number of input features equals the number of fused sample data in the sample set minus 1. Each input feature encompasses multiple types of mechanistic features, and the physical dimensions and numerical magnitudes of different features differ significantly. Direct input would interfere with model training. Therefore, Min-Max normalization is used to normalize all input features, mapping feature values ​​uniformly to the [0,1] interval to eliminate differences in dimensions and magnitude interference.

[0084] Step S2052: Divide all preprocessed features into training set, validation set and test set.

[0085] Specifically, the preprocessed feature data is divided according to a preset ratio (e.g., 7:2:1): the training set accounts for 70% and is used for model training; the validation set accounts for 20% and is used for model tuning to avoid overfitting; and the test set accounts for 10% and is used for verifying the model's generalization ability.

[0086] Step S2053: For multiple preprocessed features in the training set, each initial prediction model is used to make predictions based on multiple preprocessed features to obtain the sample prediction results corresponding to each preprocessed feature.

[0087] Specifically, the initial prediction models all embed an attention mechanism to enhance the ability to capture key features. Multiple preprocessed features used in this batch of training are input into all initial prediction models one by one. Each model combines its own algorithm characteristics to achieve accurate prediction and finally outputs the prediction result of the effluent turbidity at T+30 minutes.

[0088] If the initial prediction model is an RNN+attention mechanism model: It leverages the temporal feature capture capability of RNNs to alleviate short-term memory deficiencies, and embeds an additive attention mechanism to strengthen the feature weights of key time steps such as sudden changes in influent turbidity. By calculating the correlation between the hidden state and the query vector at each time step, it focuses on core operating condition information and outputs the sample prediction results.

[0089] If the initial prediction model is an LSTM + attention mechanism model: the gating structure of LSTM (input gate, forget gate, output gate) is used to solve the gradient vanishing problem of RNN, and a multi-head attention mechanism is embedded to simultaneously capture multi-dimensional feature coupling relationships (such as the correlation between drug loading and colloidal stability coefficient). A normalization layer is added after the output of the LSTM hidden layer to accelerate training convergence, and the attention weights are visualized to support the importance analysis of core features such as drug synergy factors, and finally output the prediction results.

[0090] If the initial prediction model is a GRU + attention mechanism model: the LSTM structure is simplified by using GRU (merging the input gate and forget gate into an update gate) to reduce computational complexity, and a self-attention mechanism is embedded to capture the internal dependencies of features such as the hysteresis correlation between Gt value and effluent turbidity. Furthermore, this model is suitable for scenarios with limited computing resources, has a faster training speed than LSTM, and retains key temporal features through the self-attention mechanism, with generalization ability approaching that of LSTM.

[0091] If the initial prediction model is a CNN + attention mechanism model: leveraging the local feature extraction capability of CNN, a 3×7 convolutional kernel (time step=3, feature dimension=9) is used to capture feature mutations within short time steps, such as sudden drops in pH, while simultaneously covering local temporal changes (such as flow fluctuations) over three consecutive time steps (15 seconds). An embedded channel attention mechanism strengthens the weights of important feature channels such as the colloidal stability coefficient.

[0092] If the initial prediction model is a Transformer model: relying on its built-in self-attention mechanism, it captures long-term time-series dependencies such as the cumulative effect of drug load within half an hour before and after the event through multi-head attention. This model does not require a loop structure, has high parallel computing efficiency, and can fully explore the mechanistic feature correlations within the entire time window, outputting sample prediction results.

[0093] Optionally, for time-series models (RNN / LSTM / GRU / Transformer), the input features are reshaped into a format of number of samples × time step × feature dimension before input. All of the above models are existing models, and the model processing procedures are existing technologies, which will not be elaborated upon here.

[0094] Step S2054: Calculate the training loss based on the prediction results of multiple samples and the output labels.

[0095] Specifically, after each initial prediction model completes predictions for all preprocessed features in its batch, it generates multiple sample prediction results corresponding to the number of samples. To quantify the deviation between the model's predicted values ​​and actual operating conditions, the mean squared error between all sample prediction results in this batch and their corresponding output labels is calculated, reflecting the model's current fitting effect.

[0096] Step S2055: Optimize the initial prediction model based on the training loss.

[0097] Specifically, the Adam optimizer is used, with the training loss calculated in the above steps as the objective function, to optimize the parameters of the initial prediction model through backpropagation. To balance training efficiency and generalization ability, the initial learning rate of the Adam optimizer is set to 0.001, and a cosine annealing strategy is used to dynamically adjust the learning rate. That is, a higher learning rate is maintained in the early stage of training to accelerate parameter iteration, and the learning rate is gradually reduced in the later stage for fine optimization, effectively avoiding parameter oscillation and overfitting problems caused by excessively high learning rates in the later stage of model training.

[0098] Step S2056: Calculate the validation loss of the optimized initial prediction model on the validation set.

[0099] Specifically, the optimized initial prediction model is used to predict the preprocessed features in the validation set, and the mean square error between the prediction result and the output label is calculated as the validation loss to reflect the model's fitting accuracy on independent data that were not used in training. This can effectively determine whether the model is overfitting.

[0100] Step S2057: Return to the step of using each initial prediction model to predict based on multiple preprocessed features in the training set, and obtaining the sample prediction result corresponding to each preprocessed feature, until the verification loss reaches the training stopping condition, and use the initial prediction model obtained by the last optimization as the initial prediction model obtained in this training.

[0101] Specifically, return to step S2053, use multiple preprocessed features from the next batch in the training set for training until the verification loss reaches the training stopping condition, such as not decreasing for 5 consecutive rounds. Stop training through an early stopping strategy to avoid model overfitting, and ensure that the model achieves a balance between generalization ability and fitting accuracy. Use the model obtained from the last optimization as the initial prediction model obtained in this training.

[0102] In some optional implementations, the process of building a sample set and training within a preset time window is repeated until a preset stopping condition is met, such as 50 training iterations. The initial prediction model obtained from the last training iteration is then used as an intermediate prediction model. Optionally, the loss curves, learning rate changes, model parameters, etc., of the training and validation sets are monitored in real time during each training iteration to generate a training log, ensuring reproducibility.

[0103] Specifically, step S205 above involves filtering multiple intermediate prediction models to obtain the target prediction model, including: Step S2058: For each intermediate prediction model, use the intermediate prediction model to make predictions based on the test set to obtain multiple sample prediction results.

[0104] Specifically, each intermediate prediction model is used to predict the preprocessed features in the test set to obtain the corresponding sample prediction results. The test set consists of independent data that did not participate in model training and includes typical process scenarios such as high load, low temperature, and sudden changes in water quality, which can objectively verify the generalization ability of the model.

[0105] Step S2059: Based on the output labels and prediction results of all samples, calculate the root mean square error and mean absolute error of the intermediate prediction model on the test set.

[0106] Specifically, based on the error between the output labels and the sample prediction results, the root mean square error (RMSE) and mean absolute error (MAE) are calculated. The RMSE amplifies the impact of larger errors, reflecting the overall dispersion between the model's predicted and actual values; a smaller value indicates higher overall prediction accuracy. The MAE calculates the average absolute error between the predicted and actual values, avoiding the amplification of extreme errors by the squared term, and more directly reflects the model's average prediction bias; a smaller value indicates a smaller average error. When the model has a small number of extreme errors, the RMSE will increase significantly, while the MAE will change more gradually. Combining the two can determine whether the error is dominated by extreme values ​​(e.g., if the RMSE is much larger than the MAE, it indicates a large number of large error samples, suggesting insufficient model robustness).

[0107] Step S20510: Determine the prediction error between the prediction result of each sample and the output label, and determine the proportion of all preprocessed features whose prediction error exceeds a preset range in the test set as the model failure rate.

[0108] Specifically, the sample prediction result is the predicted value of effluent turbidity, and the output label is the actual value of effluent turbidity. The absolute value of the difference between the two is calculated as the prediction error. For each preprocessed feature in the test set, its prediction error is calculated. The proportion of preprocessed features with prediction errors exceeding a preset range in the test set is statistically analyzed and defined as the model failure rate. This directly relates to actual production risks (e.g., excessive errors may lead to over / underdosing of chemicals, affecting effluent quality or increasing costs). The lower the failure rate, the stronger the model's engineering applicability. Generally, the model failure rate should not exceed 5%.

[0109] Step S20511: Based on the root mean square error and mean absolute error of the intermediate prediction model on the test set and training set, determine the overfitting verification index of the intermediate prediction model, and eliminate intermediate prediction models whose overfitting verification index is overfitting.

[0110] Specifically, referring to step S2059, calculate the root mean square error and mean absolute error of the initial prediction model corresponding to the intermediate prediction model on the test set. If the root mean square error on the test set minus the root mean square error on the training set is ≤0.3NTU, and the mean absolute error on the test set minus the mean absolute error on the training set is ≤0.2NTU, the model is determined to be without overfitting; if neither of the above conditions is met, the model is determined to be overfitting and unable to adapt to actual process fluctuations, and the model is directly removed.

[0111] Step S20512: For each intermediate prediction model after elimination, calculate the evaluation score based on the root mean square error, mean absolute error, and model failure rate of the intermediate prediction model on the test set.

[0112] Specifically, weights are assigned to the root mean square error, mean absolute error, and model failure rate. Optionally, the model failure rate is usually given the highest weight, for example, 45%, because it is directly related to production risks and should be prioritized to ensure that the model prediction error is within the allowable range of the process. The root mean square error can be set to 30%, and the mean absolute error can be set to 25%, taking into account both the overall error and the average error to avoid a single error dominating. For each intermediate prediction model remaining after elimination, the evaluation score is calculated using the following formula (13) based on the root mean square error, mean absolute error, and model failure rate and their corresponding weights.

[0113] (13) In the formula, Indicates the evaluation score; Indicates the root mean square error; The weights representing the root mean square error; Indicates the mean absolute error; The weights representing the mean absolute error; Indicates the model failure rate; The weights represent the mean absolute error.

[0114] Assuming a Transformer model has a root mean square error of 0.6 NTU, a mean absolute error of 0.4 NTU, and a model failure rate of 3%, substituting these values ​​into equation (13) yields an evaluation score of 0.6815. Assuming an LSTM model has a root mean square error of 0.5 NTU, a mean absolute error of 0.3 NTU, and a model failure rate of 2%, substituting these values ​​into equation (13) yields an evaluation score of 0.74725.

[0115] Step S20513: The intermediate prediction model with the highest evaluation score is determined as the target prediction model.

[0116] Specifically, for all intermediate prediction models remaining after fitting and validation, they are sorted from highest to lowest evaluation score, and the model with the highest score is determined as the target prediction model. This model combines high accuracy, strong generalization, and low engineering risk, and can accurately support the intelligent recommendation of subsequent flocculation process parameters.

[0117] By determining the evaluation score based on multiple indicators, taking into account both error quantification and engineering risks, and avoiding the one-sidedness of a single indicator, the target prediction model that provides guidance for process adjustment is prioritized, rather than simply pursuing theoretical accuracy.

[0118] Optionally, each model is trained in a GPU (Graphics Processing Unit Cluster) cluster. The training of each model is independent, and multiple models can be trained simultaneously or sequentially based on available computing resources. The GPU cluster uses Kubernetes for task orchestration, allocating independent computing resources to different models (e.g., 1 GPU for an LSTM model, 2 GPUs for a Transformer model due to its higher computational demands). The number of preprocessed features used in each batch for training can be set according to the available GPU memory, typically 16 or 32, to balance training speed and stability. After model training is complete, the weight file (.pth format) and training logs (including loss curves, parameter configurations, etc.) are automatically saved. The weight file of the optimal target prediction model is converted to ONNX format. ONNX is a cross-platform model format that supports seamless integration between the training framework and the inference engine, resolving compatibility issues between application hardware and the training framework. After conversion, the model structure integrity is verified to ensure there are no operator incompatibility issues. If a new target prediction model scores 10% higher or has a 5% lower failure rate than the target prediction model currently used by the industrial-grade edge computing device, the new model will be pushed to the industrial-grade edge computing device to avoid frequent pushes that could affect production stability. If the new model fails to infer within 10 minutes of loading (e.g., the predicted effluent turbidity exceeds the process range), it will automatically switch to the most recently backed-up stable version to ensure uninterrupted inference. During the loading of the new model, the current inference task continues to use the old model to ensure no data loss. By default, the model is updated a maximum of once per day to avoid frequent adjustments that could affect process stability. The deviation between the model inference results and the actual effluent turbidity is recorded in real time, and the operational effect is evaluated periodically. If the error is too large, incremental learning and model evaluation are triggered. By using a GPU cluster on the training end to focus on high-computation tasks, the model iteration cycle is shortened from weekly to daily, adapting to scenarios with rapid water quality fluctuations. The application end adopts a lightweight deployment to reduce hardware costs and meet the needs of real-time process control. By adopting a training-application separation architecture and a standardized push process, the entire chain from training to application deployment is automated, which not only ensures the efficiency of model training, but also meets the real-time and stability requirements of industrial scenarios, providing reliable support for intelligent control of flocculation dosing.

[0119] In some alternative implementations, because wastewater treatment processes may fluctuate due to factors such as season and influent water quality, the model's applicability needs to be verified periodically. Therefore, the evaluation score is recalculated every 7 days. Alternatively, a re-evaluation is triggered when the evaluated recommendation effect is less than expected to prevent the original optimal model from becoming invalid. A re-evaluation is also triggered after the model undergoes incremental learning.

[0120] Step S206: Collect real-time operating data of the flocculation tank and real-time reagent parameters, fuse them to obtain real-time fused data, and calculate multiple real-time mechanistic characteristics based on the real-time fused data. For details, please refer to... Figure 1 Step S104 of the illustrated embodiment will not be described again here.

[0121] Step S207: The target prediction model is used to predict the effluent turbidity based on multiple real-time mechanism features. For details, please refer to [link to relevant documentation]. Figure 1 Step S105 of the illustrated embodiment will not be described again here.

[0122] Step S208: When the predicted effluent turbidity does not meet the preset conditions, the flocculation process parameters are searched and obtained under the constraints of the multi-objective optimization function. The flocculation process parameters are controllable parameters from the real-time operation data and real-time reagent parameters.

[0123] Specifically, step S208 includes: Step S2081: When the predicted effluent turbidity does not meet the preset conditions, multiple sets of process parameters are generated. Each set of process parameters includes the effective content of the reagent and the power of the mixer.

[0124] Specifically, the PSO (Particle Swarm Optimization) algorithm is used to generate multiple sets of candidate process parameters within the allowable range of the process, and each set of process parameters is treated as a particle.

[0125] Step S2082 uses the constraint that the predicted effluent turbidity is not greater than the preset turbidity.

[0126] Specifically, the constraint condition for PSO search is that the predicted effluent turbidity is no greater than a preset turbidity (e.g., 3 NTU), which clearly defines the feasible domain for particle flight. This constraint ensures that the PSO algorithm searches for parameters only within the range where the water quality meets the standard.

[0127] Step S2083: Calculate the flocculation dosing cost based on the unit price of the reagent, the effective content of the reagent, the unit price of energy consumption, and the power of the mixer, and use minimizing the flocculation dosing cost as the optimization function.

[0128] Specifically, the cost of flocculant dosing is calculated using the following formula (14), and the optimization function is to minimize this cost. This optimization function works in conjunction with the above constraints to provide a clear optimization direction for the PSO algorithm, guiding particles to gather in the optimal area where water quality meets standards and costs are lowest.

[0129] (14) In the formula, This indicates the cost of flocculant dosing; This indicates the unit price of the PFS drug; Indicates the effective content of PFS; This indicates the unit price of PAM reagent; Indicates the effective content of PAM; Indicates the unit price of energy consumption; This indicates the power of the mixer.

[0130] Step S2084: For each set of process parameters, update the real-time operating data and real-time reagent parameters based on the process parameters, return to the fusion to obtain real-time fused data, and calculate multiple real-time mechanism characteristics based on the real-time fused data to obtain the predicted effluent turbidity corresponding to the process parameters.

[0131] Specifically, for each set of generated process parameters, the agitator power in the real-time operating data and the effective reagent content in the real-time reagent parameters are replaced with these parameters. The process is then returned to step S206, where the new real-time operating data and new real-time reagent parameters are fused together to recalculate the real-time mechanism characteristics and input into the model for prediction, resulting in a new predicted effluent turbidity. Through this iterative process, the PSO algorithm can continuously obtain the effect-cost feedback for each particle and gradually adjust its flight direction.

[0132] Step S2085: Under the constraints of the constraints, determine the flocculation process parameters from multiple sets of process parameters with the optimization function as the objective.

[0133] Specifically, within the feasible region of the constraints, the PSO algorithm, with the cost optimization function as the objective, uses the cooperative flight and iterative updates of the particle swarm to ultimately select the particle with the lowest cost. The process parameters corresponding to this particle are the optimal flocculation process parameters that meet water quality standards and are cost-effective, thus achieving intelligent and economical recommendation of flocculation unit process parameters. Optionally, the implementation process of the PSO algorithm is existing technology and will not be elaborated here. Without conducting substantial production tests, the algorithm simulates the production effects under different combinations of process parameters, ultimately outputting the optimal controllable parameters that meet effluent quality requirements and minimize reagent and energy costs. This also reduces the risk of abnormal shocks such as water quality fluctuations, achieving economical and stable operation of the process unit and providing a feasible technical path for cost reduction and efficiency improvement in the wastewater treatment industry.

[0134] In some optional implementations, flocculation process parameters are pushed to the flocculation unit PLC control system via the MQTT (Message Queuing Telemetry Transport) protocol, automatically adjusting the parameters of the reagent dosing pump and the stirring motor. The predicted effluent turbidity corresponding to each search of flocculation process parameters is stored in a database. The error between the predicted value using the search parameters and the actual effluent turbidity is periodically compared, serving as one of the conditions for triggering online incremental learning. This also triggers PSO parameter adjustment or a re-search, ensuring the effectiveness of the search parameters.

[0135] In some alternative implementations, while selecting the optimal model from multiple models may lead to performance degradation, new operational data is generated during production. Therefore, an online incremental self-learning mechanism can be employed. This mechanism generates new sample sets using new data, reloads the model trained on historical data, and uses the newly constructed samples for learning. This allows the incrementally learned model to understand the process patterns within the new samples, thereby improving its generalization and applicability to various process conditions. During incremental learning, the lower layers of the model (such as the hidden layers of LSTM and the convolutional layers of CNN) are frozen, and only the top layers (fully connected layers and attention weight layers) are updated. The lower layers are responsible for extracting general process features (such as the correlation between reagent load and turbidity), requiring less frequent updates. The top layers are responsible for adapting to new operational details (such as parameter fine-tuning under water quality fluctuations). Targeted updates reduce computational consumption and prevent the model from forgetting historical knowledge, mitigating catastrophic forgetting problems. The incrementally learned model does not directly replace the current model but enters the model library as a competitor. It participates in the selection of target prediction models by calculating evaluation scores, ensuring stable system iteration. The model library retains only the N highest-scoring models from each category as candidate models. Both the incrementally learned models and the original models participate in this competition. If a new optimal model is generated, the old models are automatically archived for easy rollback, and the new optimal model is pushed to the application. Incremental learning solves the accuracy decay problem caused by the unchanging nature of traditional models, providing core support for long-term stable intelligent process control.

[0136] In some alternative implementations, Figure 2 This is a flowchart of another flocculation dosing control method according to an embodiment of the present invention, such as... Figure 2 As shown, sample operation data and sample reagent parameters are collected according to a preset time window, and fused to obtain sample fusion data. Based on this, the sample mechanism characteristics are calculated, thereby constructing a sample set corresponding to the preset time window. The sample set is input into the initial prediction model for training to obtain intermediate prediction models. By calculating the evaluation score of each intermediate prediction model, the target prediction model is determined. Real-time operation data and real-time reagent parameters are collected and fused to obtain real-time fusion data, and real-time mechanism characteristics are calculated. This data is input into the target prediction model to obtain the predicted effluent turbidity. When the predicted effluent turbidity does not meet the preset conditions, under the constraints of the constraints, a search is performed with the optimization function as the objective to determine the flocculation process parameters. The target prediction model can be updated through incremental learning.

[0137] In some alternative implementations, Figure 3 This is a flowchart of another flocculation dosing control method according to an embodiment of the present invention, such as... Figure 3As shown, the predicted effluent turbidity obtained after each search of flocculation process parameters is predicted by the target prediction model is compared with the actual effluent turbidity to determine whether incremental learning is needed for model optimization. The model parameters of the current target prediction model are stored, and the target prediction model is redefined through incremental learning, converted to ONNX format, and pushed to the application, allowing the application to continue searching for flocculation process parameters using the new model. Optionally, Figure 3 This only illustrates one scenario for triggering incremental learning. Incremental learning can also be triggered by other methods mentioned in the above embodiments, which will not be elaborated here.

[0138] This invention collects sample operation data and reagent parameters within a preset time window, covering various typical operating conditions and ensuring comprehensive coverage of the main operating scenarios of the flocculation process, providing comprehensive operating condition support for model training. By fusing the above data, each sample's fused data fully encompasses all dimensions of information, including wastewater operating status and key reagent indicators. Based on this, the mechanistic characteristics of the sample are calculated, replacing the original, coarse-grained time-series data in model training. This reduces reliance on large-scale samples, adapts to training needs in small-sample scenarios, and better reflects the essence of the flocculation reaction, contributing to improved model prediction accuracy. Multiple initial prediction models are trained using an automatically constructed sample set, resulting in corresponding intermediate prediction models. The target prediction model with the best performance is then selected, providing reliable support for subsequent actual predictions and parameter optimization. In practical applications, real-time operation data and real-time reagent parameters are collected, fused, and the calculated mechanistic characteristics are input into the target prediction model to obtain the predicted effluent turbidity. When the predicted effluent turbidity does not meet the preset conditions, the flocculation process parameters are searched under the constraints of a multi-objective optimization function. Compared with the traditional trial-and-error method, no physical experiment is required, which not only significantly reduces costs but also allows for rapid parameter search, dynamic response to influent water quality fluctuations and load shocks, and reduces reliance on professional technicians. This enables intelligent and economical recommendation of flocculation process parameters, thereby improving the quality of wastewater treatment.

[0139] This embodiment also provides a flocculation dosing control device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0140] This embodiment provides a flocculation dosing control device, such as... Figure 4 As shown, it includes: The first acquisition module 401 is used to acquire historical operating data of the flocculation tank and historical reagent parameters of the reagents, and extract multiple sample operating data and multiple sample reagent parameters from the historical operating data and historical reagent parameters based on each preset time window.

[0141] The fusion module 402 is used to fuse multiple sample running data and multiple sample drug parameters to obtain multiple sample fusion data, calculate the multiple sample mechanism features corresponding to each sample fusion data, and use them as a sample set for a preset time window.

[0142] The training module 403 is used to train multiple initial prediction models based on a sample set within a preset time window. The process of building the sample set and training within the preset time window is repeated until a preset stopping condition is met. Each initial prediction model obtained from the last training is determined as the corresponding intermediate prediction model, and multiple intermediate prediction models are selected to obtain the target prediction model.

[0143] The second acquisition module 404 is used to acquire real-time operating data of the flocculation tank and real-time reagent parameters of the reagents, fuse them to obtain real-time fused data, and calculate multiple real-time mechanism characteristics based on the real-time fused data.

[0144] The prediction module 405 is used to make predictions based on multiple real-time mechanism features using a target prediction model to obtain the predicted effluent turbidity.

[0145] The search module 406 is used to search for flocculation process parameters under the constraints of a multi-objective optimization function when the predicted effluent turbidity does not meet the preset conditions. The flocculation process parameters are controllable parameters from real-time operating data and real-time reagent parameters.

[0146] In some alternative implementations, the fusion module 402 includes: The first determining unit is used to determine, for each sample running data, other sample running data whose timestamps differ from the sample running data by less than a preset threshold from multiple sample running data.

[0147] The first merging unit is used to merge other sample running data with the sample running data, retaining the latest timestamp between the sample running data and other sample running data to obtain the corresponding merged running data.

[0148] The second determining unit is used to determine, for each merged run data, all the drug parameters to be determined from multiple sample drug parameters that are no later than the timestamp of the merged run data.

[0149] The second merging unit is used to determine the drug parameter with the latest timestamp among all the drug parameters to be determined, merge the drug parameters to be determined and the merged running data to obtain the corresponding sample fusion data.

[0150] In some optional implementations, the sample mechanism characteristics include drug loading characteristics, pH characteristics, temperature characteristics, ionic strength characteristics, concentration characteristics, stirring speed characteristics, stirring capacity characteristics, and drug synergistic factors; Fusion module 402 includes: The first calculation unit is used to calculate the chemical load characteristics for each sample fusion data, based on the instantaneous flow rate of wastewater entering the pool, the turbidity of the influent, the instantaneous flow rate of the chemical agent, the effective content of the chemical agent, and the density of the chemical agent in the sample fusion data.

[0151] The second calculation unit is used to calculate pH characteristics based on the isoelectric point of colloidal particles and the pH and conductivity of wastewater in the sample fusion data.

[0152] The third calculation unit is used to calculate temperature characteristics based on preset wastewater temperature, preset maximum wastewater temperature, preset minimum wastewater temperature, and wastewater temperature in sample fusion data.

[0153] The fourth calculation unit is used to calculate ion intensity characteristics based on preset ion intensity, preset maximum ion intensity, preset minimum ion intensity, and wastewater ion intensity in the sample fusion data.

[0154] The fifth calculation unit is used to calculate concentration characteristics based on preset baseline turbidity, preset maximum turbidity, preset minimum turbidity, and wastewater turbidity in sample fusion data.

[0155] The sixth calculation unit is used to calculate the stirring speed characteristics based on the effective volume and liquid level of the flocculation tank, the dynamic viscosity of the wastewater, and the mixer power in the sample fusion data.

[0156] The seventh calculation unit is used to calculate the stirring capacity characteristics based on the effective volume of the flocculation tank, the stirring speed characteristics, and the instantaneous flow rate of sewage entering the tank.

[0157] The eighth calculation unit is used to calculate the drug synergy factor based on the instantaneous flow rate of the drug, the effective content of the drug, and the drug density.

[0158] In some alternative implementations, prior to training module 403, the device further includes: The first determination module is used to determine the effluent turbidity of the fused data of the sample with the latest timestamp in the sample set as the output label of the sample set.

[0159] The second determining module is used to determine the multiple sample mechanism features corresponding to each sample fusion data in the sample set, excluding the sample fusion data with the latest timestamp, as the input features of the sample set.

[0160] In some alternative implementations, training module 403 includes: The preprocessing unit is used to normalize the input features for each input feature to obtain preprocessed features.

[0161] The partitioning unit is used to divide all preprocessed features into training, validation, and test sets.

[0162] The first prediction unit is used to predict the sample prediction result corresponding to each preprocessed feature by using each initial prediction model based on multiple preprocessed features in the training set.

[0163] The ninth computational unit is used to calculate the training loss based on the prediction results and output labels of multiple samples.

[0164] The optimization unit is used to optimize the initial prediction model based on the training loss.

[0165] The tenth computational unit is used to calculate the validation loss of the optimized initial prediction model on the validation set.

[0166] The training unit is used to return to the steps of using each initial prediction model based on multiple preprocessed features in the training set to make predictions, and obtaining the sample prediction results corresponding to each preprocessed feature, until the verification loss reaches the training stopping condition. The initial prediction model obtained from the last optimization is used as the initial prediction model obtained in this training.

[0167] In some alternative implementations, training module 403 includes: The second prediction unit is used to make predictions based on the test set for each intermediate prediction model, thereby obtaining prediction results for multiple samples.

[0168] The error calculation unit is used to calculate the root mean square error and mean absolute error of the intermediate prediction model on the test set based on the output label and the prediction results of all samples.

[0169] The third determining unit is used to determine the prediction error between the prediction result of each sample and the output label, and to determine the proportion of all preprocessed features whose prediction error exceeds a preset range in the test set, as the model failure rate.

[0170] The elimination unit is used to determine the overfitting check index of the intermediate prediction model based on the root mean square error and mean absolute error of the intermediate prediction model on the test set and training set, and to eliminate intermediate prediction models whose overfitting check index is overfitting among multiple intermediate prediction models.

[0171] The scoring unit is used to calculate an evaluation score for each intermediate prediction model after elimination, based on the root mean square error, mean absolute error, and model failure rate of the intermediate prediction model on the test set.

[0172] The fourth determination unit is used to determine the intermediate prediction model with the highest evaluation score as the target prediction model.

[0173] In some alternative implementations, the search module 406 includes: The generation unit is used to generate multiple sets of process parameters when the predicted effluent turbidity does not meet the preset conditions. Each set of process parameters includes the effective content of the reagent and the power of the agitator.

[0174] The fifth determining unit is used to constrain the predicted effluent turbidity to be no greater than the preset turbidity.

[0175] The sixth determining unit is used to calculate the cost of flocculation dosing based on the unit price of the agent, the effective content of the agent, the unit price of energy consumption, and the power of the mixer, with minimizing the cost of flocculation dosing as the optimization function.

[0176] The third prediction unit is used to update the real-time operating data and real-time reagent parameters based on the process parameters for each set of process parameters, return to the fusion to obtain real-time fused data, and calculate multiple real-time mechanism characteristics based on the real-time fused data to obtain the predicted effluent turbidity corresponding to the process parameters.

[0177] The seventh determining unit is used to determine the flocculation process parameters from multiple sets of process parameters under the constraints of the constraints, with the optimization function as the objective.

[0178] The flocculation dosing control device provided in this embodiment of the invention can execute the flocculation dosing control method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as in the corresponding embodiments described above, and will not be repeated here.

[0179] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0180] The following is a detailed reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from memory 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device. The processor 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0181] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0182] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a memory 508, or installed from a ROM 502. When the computer program is executed by the processor 501, it performs the functions defined in the flocculation dosing control method of the embodiments of the present invention.

[0183] Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0184] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the flocculation dosing control method shown in the above embodiments is implemented.

[0185] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0186] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and all such modifications and variations fall within the scope defined by the appended claims.

Claims

1. A method for controlling flocculation dosing, characterized in that, The method includes: Acquire historical operating data of the flocculation tank and historical reagent parameters of the reagents, and extract multiple sample operating data and multiple sample reagent parameters corresponding to each preset time window from the historical operating data and the historical reagent parameters. Multiple sample fusion data are obtained by fusing the multiple sample operation data and the multiple sample drug parameters, and multiple sample mechanism features corresponding to each sample fusion data are calculated as the sample set of the preset time window; Multiple initial prediction models are trained based on the sample set of the preset time window. The process of building the sample set and training within the preset time window is repeated until the preset stopping condition is met. Each initial prediction model obtained from the last training is determined as the corresponding intermediate prediction model. Multiple intermediate prediction models are selected to obtain the target prediction model. Real-time operating data of the flocculation tank and real-time reagent parameters of the reagent are collected and fused to obtain real-time fused data. Based on the real-time fused data, multiple real-time mechanism features are calculated. The target prediction model is used to make predictions based on the multiple real-time mechanism features to obtain the predicted effluent turbidity. When the predicted effluent turbidity does not meet the preset conditions, flocculation process parameters are searched under the constraints of a multi-objective optimization function. The flocculation process parameters are controllable parameters among the real-time operating data and the real-time reagent parameters.

2. The method according to claim 1, characterized in that, The fusion of the multiple sample operational data and the multiple sample drug parameters to obtain multiple sample fusion data includes: For each sample running data, other sample running data whose timestamps differ from the sample running data by less than a preset threshold are determined from the plurality of sample running data; Merge the running data of other samples with the running data of the sample, and retain the latest timestamp between the running data of the sample and the running data of other samples to obtain the corresponding merged running data; For each merged run data, determine all the drug parameters to be determined from the plurality of sample drug parameters no later than the timestamp of the merged run data; The drug parameter with the latest timestamp among all the drug parameters to be determined is identified, and the drug parameter to be determined and the merged running data are combined to obtain the corresponding sample fusion data.

3. The method according to claim 1, characterized in that, The sample mechanism characteristics include drug loading characteristics, pH characteristics, temperature characteristics, ionic strength characteristics, concentration characteristics, stirring speed characteristics, stirring capacity characteristics, and drug synergistic factors; The calculation of multiple sample mechanism features corresponding to each sample fusion data includes: For each sample fusion data, the chemical load characteristics are calculated based on the instantaneous flow rate of wastewater entering the pool, the turbidity of the influent, the instantaneous flow rate of the chemical agent, the effective content of the chemical agent, and the density of the chemical agent in the sample fusion data. pH characteristics are calculated based on the isoelectric point of colloidal particles and the wastewater pH and wastewater conductivity in the sample fusion data. The temperature feature is calculated based on the preset wastewater temperature, the preset maximum wastewater temperature, the preset minimum wastewater temperature, and the wastewater temperature in the sample fusion data. The ion intensity feature is calculated based on the preset ion intensity, the preset maximum ion intensity, the preset minimum ion intensity, and the wastewater ion intensity in the sample fusion data. The concentration characteristics are calculated based on the preset baseline turbidity, preset maximum turbidity, preset minimum turbidity, and the wastewater turbidity in the sample fusion data; The stirring speed characteristics are calculated based on the effective volume and liquid level of the flocculation tank, the dynamic viscosity of the wastewater, and the mixer power in the sample fusion data. The stirring capacity characteristics are calculated based on the effective volume of the flocculation tank, the stirring speed characteristics, and the instantaneous flow rate of the wastewater entering the tank. The drug synergistic factor is calculated based on the instantaneous flow rate of the drug, the effective content of the drug, and the density of the drug.

4. The method according to claim 1, characterized in that, Before training multiple initial prediction models based on the sample set within the preset time window, the method further includes: The effluent turbidity of the fused data of the sample with the latest timestamp in the sample set is determined as the output label of the sample set; The multiple sample mechanism features corresponding to each sample fusion data in the sample set, excluding the sample fusion data with the latest timestamp, are determined as the input features of the sample set.

5. The method according to claim 4, characterized in that, The training of multiple initial prediction models based on the sample set within the preset time window includes: For each input feature, the input feature is normalized to obtain preprocessed features; All preprocessed features are divided into training set, validation set, and test set; For multiple preprocessed features in the training set, each initial prediction model is used to make predictions based on the multiple preprocessed features to obtain the sample prediction results corresponding to each preprocessed feature. The training loss is calculated based on the prediction results of multiple samples and the output label; The initial prediction model is optimized based on the training loss. Calculate the validation loss of the optimized initial prediction model on the validation set; Returning to the step of using each initial prediction model to predict based on the multiple preprocessed features in the training set, and obtaining the sample prediction result corresponding to each preprocessed feature, until the validation loss reaches the training stopping condition, the initial prediction model obtained in the last optimization is used as the initial prediction model obtained in this training.

6. The method according to claim 5, characterized in that, The process of filtering the multiple intermediate prediction models to obtain the target prediction model includes: For each intermediate prediction model, prediction is made based on the test set using the intermediate prediction model to obtain multiple sample prediction results; Based on the output labels and all sample prediction results, calculate the root mean square error and mean absolute error of the intermediate prediction model on the test set. Determine the prediction error between the prediction result of each sample and the output label, and determine the proportion of all preprocessed features whose prediction error exceeds a preset range in the test set as the model failure rate; Based on the root mean square error and mean absolute error of the intermediate prediction model on the test set and the training set, the overfitting check index of the intermediate prediction model is determined, and the intermediate prediction models with the overfitting check index of overfitting are eliminated from the multiple intermediate prediction models. For each intermediate prediction model after elimination, an evaluation score is calculated based on the root mean square error, mean absolute error, and model failure rate of the intermediate prediction model on the test set. The intermediate prediction model with the highest evaluation score is determined as the target prediction model.

7. The method according to claim 1, characterized in that, When the predicted effluent turbidity does not meet the preset conditions, the flocculation process parameters are searched and obtained under the constraints of a multi-objective optimization function, including: When the predicted effluent turbidity does not meet the preset conditions, multiple sets of process parameters are generated, each set of process parameters including the effective content of the reagent and the power of the agitator; The constraint is that the predicted effluent turbidity is not greater than the preset turbidity. The cost of flocculation dosing is calculated based on the unit price of the agent, the effective content of the agent, the unit price of energy consumption, and the power of the mixer, with minimizing the cost of flocculation dosing as the optimization function. For each set of process parameters, the real-time operating data and the real-time reagent parameters are updated based on the process parameters, and the results are returned to the fusion to obtain real-time fused data. Based on the real-time fused data, multiple real-time mechanism characteristics are calculated to obtain the predicted effluent turbidity corresponding to the process parameters. Under the constraints of the aforementioned constraints, the flocculation process parameters are determined from the multiple sets of process parameters with the optimization function as the objective.

8. A flocculation dosing control device, characterized in that, The device includes: The first acquisition module is used to acquire historical operating data of the flocculation tank and historical reagent parameters of the reagents, and extract multiple sample operating data and multiple sample reagent parameters corresponding to the preset time window from the historical operating data and the historical reagent parameters based on each preset time window. The fusion module is used to fuse the multiple sample operation data and the multiple sample drug parameters to obtain multiple sample fusion data, and calculate the multiple sample mechanism features corresponding to each sample fusion data as the sample set of the preset time window; The training module is used to train multiple initial prediction models based on the sample set of the preset time window, repeat the process of building the sample set of the preset time window and training until the preset stopping condition is reached, and determine each initial prediction model obtained from the last training as the corresponding intermediate prediction model, and filter multiple intermediate prediction models to obtain the target prediction model. The second acquisition module is used to acquire the real-time operating data of the flocculation tank and the real-time reagent parameters of the reagent, fuse them to obtain real-time fused data, and calculate multiple real-time mechanism features based on the real-time fused data; The prediction module is used to make predictions based on the multiple real-time mechanism features using the target prediction model to obtain the predicted effluent turbidity. The search module is used to search for flocculation process parameters under the constraints of a multi-objective optimization function when the predicted effluent turbidity does not meet the preset conditions. The flocculation process parameters are controllable parameters among the real-time operating data and the real-time reagent parameters.

9. An electronic device, characterized in that, include: The system includes a memory and a processor, which are interconnected and the memory stores computer instructions. The processor executes the computer instructions to perform the flocculation dosing control method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the flocculation dosing control method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Coagulant putting prediction method, device, equipment and medium

    CN118607706A

  • Water quality treatment device control method, system and equipment and storage medium

    CN119143256A

  • Biochemical sludge on-line monitoring device and automatic water feeding control method

    CN119376440A

  • Prediction method for coagulation dosing of sewage treatment high-density pool

    CN119626384A

  • Water supply plant water production process unit dosing method, system and equipment based on intelligent sensing and self-adaptive regulation and control and medium

    CN120065935A