A sewage treatment carbon source dosing control method
By deploying multi-node sensors and machine learning models in wastewater treatment plants, precise dynamic adjustment of carbon source addition is achieved, solving the problem of difficulty in matching carbon source addition, improving the stability and economy of wastewater treatment, and realizing intelligent management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING XINFENG HONGYUAN ENVIRONMENTAL PROTECTION ENGINEERING CO LTD
- Filing Date
- 2025-12-16
- Publication Date
- 2026-06-26
AI Technical Summary
Existing wastewater treatment methods cannot accurately match the amount of carbon source added in real time when dealing with dynamic fluctuations in influent water quality, resulting in excessive or insufficient carbon source addition, which increases treatment costs and affects the stability of effluent water quality.
A multi-node sensor network is deployed in the wastewater treatment plant to collect water quality data in real time. Machine learning algorithms are used to build a carbon source dosage analysis model and a denitrification demand prediction model. The two models work together to generate an optimized dosage scheme. Through simulation verification and an automatic control system, the carbon source dosage is accurately and dynamically adjusted, and a closed-loop mechanism for continuous optimization is established.
It achieves precise and reduced carbon source addition, lowers costs, improves the system's control stability and effluent quality stability under complex operating conditions, reduces reliance on human experience, and realizes intelligent management of wastewater treatment.
Smart Images

Figure CN121698475B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wastewater treatment technology, and mainly relates to a method for controlling the addition of carbon sources in wastewater treatment. Background Technology
[0002] Wastewater treatment is a crucial component of water resource protection and environmental governance. Denitrification, in particular, removes nitrogenous substances from water, preventing eutrophication. Denitrification typically relies on the addition of an external carbon source, which provides the necessary energy for denitrifying bacteria. Common carbon sources include organic compounds such as methanol and ethanol. Appropriate carbon source addition can improve denitrification efficiency, effectively remove nitrogenous compounds from water, and improve water quality. The rational control of carbon source dosage is of great significance for ensuring effective wastewater treatment and resource utilization.
[0003] In Chinese patent application CN202510732917.9, a method for controlling carbon source addition in wastewater treatment is provided. This method relates to the field of wastewater treatment technology and includes the following steps: obtaining influent parameters at the influent end of the wastewater to be treated and process parameters of the treatment section. The influent parameters include chemical oxygen demand (COD), total nitrogen (TNO), total phosphorus (TP), and flow rate. The process parameters include phosphate concentration at the end of the anaerobic tank, nitrate concentration at the end of the anoxic tank, and total nitrogen and COD in the denitrification filter influent. The system dynamically calculates and predicts the carbon-nitrogen ratio and the carbon-phosphorus ratio in real time based on the influent parameters and the process parameters. Based on the predicted carbon-nitrogen ratio, the predicted carbon-phosphorus ratio, and the preset effluent water quality standards, it determines the carbon source addition point and the first carbon source addition amount. The carbon source addition point includes at least one of the anaerobic tank, anoxic tank, and denitrification filter. According to the carbon source addition point and the first carbon source addition amount, the system controls the carbon source addition device to perform the corresponding addition operation. Through segmented addition and closed-loop control, it avoids excessive carbon source leading to COD exceeding the standard and effectively suppresses secondary pollution.
[0004] The aforementioned patents have provided a relatively complete method for controlling carbon source addition. However, in municipal wastewater treatment, there is a general lack of readily degradable carbon sources in domestic sewage, resulting in a persistently low influent carbon-to-nitrogen ratio. This significantly increases the dependence of the denitrification process on external carbon sources, and carbon source addition has become a typical bottleneck for the stable operation of the system. Existing control methods still have shortcomings in dealing with complex influent fluctuations and achieving dynamic and precise matching of carbon sources. They often result in incomplete denitrification due to "insufficient" carbon source addition, or resource waste and secondary pollution risks due to "excessive" addition. This not only increases the operating costs of wastewater treatment but also puts pressure on achieving stable discharge standards.
[0005] To address the aforementioned issues, this invention proposes a control method for carbon source addition in wastewater treatment. This method involves deploying a sensor network across multiple nodes to collect water quality data in real time, utilizing machine learning algorithms to construct a carbon source addition analysis model and a denitrification demand prediction model, generating an optimized addition scheme based on the collaborative operation of the two models, and achieving precise dynamic adjustment of carbon source addition through simulation verification and an automatic control system. Simultaneously, a continuously optimized closed-loop mechanism is established to effectively cope with complex operating conditions such as influent fluctuations and temperature changes. Under the premise of ensuring stable effluent quality compliance, this method significantly reduces the cost of carbon source addition, achieving refined and intelligent control of the wastewater treatment process. Summary of the Invention
[0006] This invention provides a method for controlling carbon source addition in wastewater treatment, aiming to solve the problems of existing control methods, such as the difficulty in accurately matching the amount of carbon source added in real time when dealing with dynamic fluctuations in influent water quality, and the difficulty in balancing the increased treatment costs and the stability of effluent water quality caused by excessive or insufficient carbon source addition.
[0007] To solve the above problems, the present invention employs the following technology:
[0008] A method for controlling carbon source addition in wastewater treatment:
[0009] Step S1: Deploy various types of data sensors at multiple key nodes in the wastewater treatment plant to collect water quality data in real time, and transmit the collected data to the central processing unit for centralized processing;
[0010] Step S2: The central processing unit processes the real-time multimodal data collected from the wastewater treatment plant and uses machine learning algorithms to analyze the required amount of carbon source to be added.
[0011] Step S3: Train the denitrification demand prediction model to predict water quality change trends, optimize carbon source dosage, formulate a carbon source dosage scheme, simulate the carbon source dosage scheme, and optimize and adjust the scheme based on the simulation results. Specifically, this includes:
[0012] To train the denitrification demand prediction model, a large number of known water quality data changes and carbon source addition amounts in different time windows were selected as samples, standardized, and grouped according to continuous time to form a training set.
[0013] Random forest is used as the base model, and the model is trained using a training set. During the training process, the relationship between time series, changes in water quality parameters, changes in carbon source dosage and water quality response is learned. During validation, the model is based on the previous day's water quality data to predict subsequent water quality data, carbon source dosage and water quality change results.
[0014] A denitrification demand prediction model is used to predict water quality data and carbon source dosage in the future to form a preliminary prediction sequence. Each set of predicted future water quality data and the set water quality target are input into the carbon source dosage analysis model to calculate the theoretical carbon source dosage required to achieve the target under the water quality conditions.
[0015] A consistency check is performed by comparing the theoretical dosage derived from the analysis model with the original predicted dosage output by the prediction model. If the difference exceeds the set tolerance range, the prediction result is determined to have a significant deviation. The prediction model is then corrected using the analysis model data. The corresponding values in the prediction sequence are replaced and corrected using the theoretical values derived from the analysis model. All data points after the above checks and corrections are integrated and smoothed to generate a coherent, reliable, and long-term carbon source dosing plan.
[0016] Next, the scheme was verified. The water quality data of the sewage treatment system at the current moment was used as the starting point of the simulation. The obtained long-term addition scheme was converted into a periodic addition amount. The denitrification demand prediction model was used to simulate the changes in water quality data and compared with the changes in water quality data in the carbon source addition scheme. The main evaluation objectives were whether the addition scheme could reliably achieve the preset water quality target under the actual system dynamics and the smoothness and stability of the scheme execution process.
[0017] When the results show that the predetermined target was not achieved, the carbon source dosage analysis model is used to analyze the unreasonable part of the water quality data for carbon source dosage, and replacement is carried out in the prediction and simulation is continued to optimize the treatment plan until the water quality data in the simulation meets the requirements, thus forming a reliable carbon source dosage plan.
[0018] Step S4: Based on the optimized carbon source addition scheme, the carbon source addition amount is precisely adjusted through the automatic control system to achieve precise addition;
[0019] Step S5: Monitor and collect actual water quality change data in real time, compare it with the data generated by the prediction model, analyze the deviation, continuously optimize the machine learning algorithm and prediction model, and optimize the model analysis effect.
[0020] As a preferred implementation, the deployment of various types of data sensors at multiple key nodes of the wastewater treatment plant to collect water quality data in real time specifically includes:
[0021] Based on the layout of the wastewater treatment plant, at key nodes, ensure that the deployment of sensors can reflect the real-time water quality changes at each stage of the wastewater treatment process; set up various types of data sensors at corresponding key nodes, including direct parameters of denitrification and environmental parameters affecting the denitrification process; after collecting water quality data at the corresponding nodes, upload the data to the central processing unit.
[0022] In a preferred embodiment, the central processing unit processes the real-time collected multimodal data from the wastewater treatment plant, specifically including:
[0023] Data is cleaned to remove missing values, outliers, and duplicate data to ensure data integrity and accuracy. For missing values, linear interpolation is used to fill in the missing data by inferring the missing data based on the linear relationship between the data points before and after the missing point, thus ensuring data continuity. For outliers, the standard deviation method is used to identify and correct them. Data exceeding the set threshold is identified as outliers and replaced or corrected to values within a reasonable range.
[0024] Subsequently, the data collected by each sensor are aligned according to the timestamp to ensure that all data points have the same timestamp; when the sampling frequency of the data is inconsistent, linear interpolation is used to supplement the sampling data of different time periods to ensure the temporal consistency and smoothness of the data.
[0025] To standardize the data scale, Z-score standardization is applied to different types of water quality data to eliminate dimensional differences between parameters. Moving average method is used to smooth noise in the data, and the mean of the data within a certain time window is calculated to reduce the interference of short-term fluctuations on data analysis.
[0026] Feature engineering extracts meaningful features from the raw data, calculates other features, and converts all data into a unified structured JSON format to ensure that the input data format is consistent for subsequent analysis and machine learning models.
[0027] As a preferred embodiment, the step of using machine learning algorithms to analyze the required carbon source dosage specifically includes:
[0028] To train the carbon source dosage analysis model, a large number of known water quality data changes and carbon source dosages were selected as samples, including water quality data consistent with the types of sensors deployed, carbon source dosages under the water quality conditions, and changes in water quality data after the deployment. The collected data were converted into a standard format through a consistent preprocessing step to form a training set.
[0029] Random forest model was chosen as the base model to learn nonlinear relationships. Water quality parameters, carbon source dosage, and water quality changes after dosage were input into the random forest model for multiple rounds of iterative training. This allowed the model to gradually learn the regular relationship between carbon source dosage and water quality response under different water quality conditions and operating conditions. During training, the sample space was repeatedly divided using multiple decision trees to solidify the mapping relationship between water quality parameter combination, carbon source dosage, and water quality response effect in the model structure. The splitting was performed by minimizing the mean square error, and the complexity and generalization ability of the trees were controlled by hyperparameter optimization until the model's fitting error for various typical operating conditions in the training set converged to a reasonable range.
[0030] After training is completed, the current water quality data and water quality target are obtained every half hour. The data is then input into the model, and the model calculates the ideal carbon source addition amount based on the learned mapping relationship, according to the water quality target and the current water quality data.
[0031] As a preferred embodiment, the step of precisely adjusting the carbon source dosage through an automatic control system based on the optimized carbon source dosage scheme to achieve accurate dosage specifically includes:
[0032] Deploying an automatic carbon source dosing control system in a wastewater treatment plant requires adding a complete set of control equipment to the existing carbon source dosing equipment, including sensors, flow meters, and regulating valves or metering pumps as actuators. Based on this, appropriate PLC control algorithms are configured for the actuators according to actual process requirements, and a stable connection is established with the central processing unit via an industrial network, forming a control system capable of receiving central commands in real time and dynamically adjusting the carbon source dosing. The central processing unit, based on the established scheme, sends corresponding control commands to the control unit to regulate the control equipment and achieve dosing control.
[0033] As a preferred implementation, the real-time monitoring and collection of actual water quality change data, comparison with data generated by the prediction model, analysis of deviations, and continuous optimization of the machine learning algorithm and prediction model, specifically include:
[0034] Continuously collect actual water quality change results through data acquisition sensors and record the actual carbon source dosage to evaluate the actual water quality change results;
[0035] Calculate the deviation between the actual value and the predicted value for the same period, using the root mean square error as the key performance indicator, and incorporate the water quality data... Concentration is used as the primary evaluation criterion;
[0036] When the root mean square error does not exceed 0.5 mg / L, it indicates that the model performance is excellent and no intervention is needed at this time.
[0037] When the root mean square error is higher than 0.5 mg / L but lower than 1.0 mg / L, the model is automatically optimized. The actual water quality data is recorded and used for incremental training of the model. At the same time, the parameters of the carbon source dosage analysis model are optimized based on the water quality response results, and the training weight of recent data is increased in the denitrification demand prediction model.
[0038] When the root mean square error is higher than 1.5 mg / L, there is a significant difference between the model training environment and the actual operating conditions. The operation and maintenance personnel should be notified to optimize the training set, while reducing the weight of the training data and significantly increasing the weight of the actual data.
[0039] Under the premise of stable model operation, continuously optimize the model analysis effect based on actual data, and formulate a reasonable and long-term carbon source addition plan.
[0040] As a preferred implementation method, in the case of low-temperature environments, in terms of hardware, temperature sensors and controllable heating devices are installed in key units of the sewage treatment plant to automatically regulate the temperature.
[0041] Regarding the models, for both models, a learning objective on the relationship between temperature and denitrification is introduced during their training. The actual denitrification efficiency under different temperature ranges in historical data is analyzed, and an empirical correction curve or lookup table is fitted to extract the temperature-activity compensation function. In the calculation of carbon source dosage and water quality changes, the calculation logic of carbon source dosage and the prediction results of water quality changes are corrected according to the temperature conditions to compensate for the inhibitory effect of low temperature on the denitrification rate.
[0042] The beneficial effects of this invention are:
[0043] 1. Achieve precise and reduced carbon source addition: Real-time water quality data is collected through a multi-node sensor network, and a dual-model collaborative mechanism of carbon source addition analysis model and denitrification demand prediction model is combined to dynamically match the actual carbon source demand of the denitrification process, improve carbon source utilization, and effectively reduce carbon source addition costs while ensuring that the effluent water quality meets the standards.
[0044] 2. It has anti-interference and adaptive capabilities: The prediction model built based on machine learning algorithms can learn the complex nonlinear relationship between water quality parameters and carbon source response, and has good prediction and adaptation capabilities to dynamic changes such as influent fluctuations; at the same time, through scheme simulation verification and closed-loop continuous optimization mechanism, the control stability and reliability of the system under complex working conditions are further improved.
[0045] 3. Enhance the intelligence level of the control process: From data perception, model prediction, scheme optimization to automatic execution, a complete intelligent decision-making and control system has been formed, which greatly reduces the reliance on human experience and realizes the refined, automated and intelligent management of the carbon source addition process, providing technical support for the low-carbon and stable operation of wastewater treatment plants. Attached Figure Description
[0046] Figure 1 This is a flowchart of the method of the present invention;
[0047] Figure 2 This is a comparison diagram of the effects of the present invention compared to the traditional method. Detailed Implementation
[0048] To make the technical means, creative features, and achieved objectives and effects of this invention easier to understand, the invention is further described below with reference to specific embodiments. However, the following embodiments are merely preferred embodiments of this invention and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments described herein without creative effort are all within the protection scope of this invention. Unless otherwise specified, the experimental methods in the following embodiments are conventional methods, and the materials and reagents used in the following embodiments are commercially available unless otherwise specified.
[0049] Example 1 Figure 1 A flowchart of a method for controlling carbon source addition in wastewater treatment is shown. This embodiment provides a method for controlling carbon source addition in wastewater treatment, specifically including the following steps:
[0050] Step S1: Deploy various types of data sensors at multiple key nodes in the wastewater treatment plant to collect water quality data in real time, and transmit the collected data to the central processing unit for centralized processing;
[0051] Specifically, based on the layout of the wastewater treatment plant, key nodes, including the inlet, reaction tank, sedimentation tank or biological filter, and effluent, should be equipped with sensors to ensure that they reflect real-time water quality changes at each stage of the wastewater treatment process. Various types of data sensors should be installed at these key nodes, including: chemical oxygen demand (COD) sensors, dissolved oxygen (DO) sensors, pH sensors, and ammonia nitrogen sensors. The system collects direct parameters of denitrification, such as those from sensors (turbidity, temperature, conductivity, etc.), as well as environmental parameters affecting the denitrification process. After collecting water quality data from the corresponding nodes, the data is uploaded to the central processing unit.
[0052] Step S2: The central processing unit processes the real-time multimodal data collected from the wastewater treatment plant and uses machine learning algorithms to analyze the required amount of carbon source to be added.
[0053] Specifically, after receiving multimodal water quality data from the wastewater treatment plant, the central processing unit preprocesses the data, converting it into a standardized data format. The preprocessing steps include: cleaning the data to remove missing values, outliers, and duplicates, ensuring data integrity and accuracy; imputing missing values using linear interpolation by inferring the missing data based on adjacent data points to ensure data continuity; identifying and correcting outliers using the standard deviation method, identifying data exceeding a set threshold (typically the mean ± 3 times the standard deviation) as outliers and replacing or correcting them to values within a reasonable range; subsequently, aligning the data collected by each sensor according to timestamps to ensure all data points have the same timestamp; and addressing inconsistent sampling frequencies. Linear interpolation was used to supplement the sampling data from different time periods, ensuring the temporal consistency and smoothness of the data. Then, the data scale was standardized by performing Z-score standardization on different types of water quality data (including COD, DO, ammonia nitrogen, etc.), converting the data into a standard normal distribution with a mean of 0 and a standard deviation of 1, eliminating dimensional differences between parameters and facilitating comprehensive data evaluation in subsequent analysis. Moving averages were used to smooth noise in the data, reducing the interference of short-term fluctuations on data analysis by calculating the mean of data within a certain time window. Finally, feature engineering was used to extract meaningful features from the original data, calculating new features such as parameter ratios and rates of change, and converting all data into a unified structured JSON format to ensure consistency with the input data format for subsequent analysis and machine learning models.
[0054] A carbon source dosage analysis model was trained by selecting a large amount of known water quality data changes and carbon source dosage as samples. This included water quality data consistent with the types of sensors deployed, carbon source dosage under specific water quality conditions, and changes in water quality data after dosage. The collected data were converted to a standard format through a consistent preprocessing step to form the training set. A random forest model was chosen as the base model to learn nonlinear relationships. The water quality parameters, carbon source dosage, and post-dosage water quality changes from the training set were input into the random forest model for multiple rounds of iterative training. This allowed the model to gradually learn the relationship between carbon source dosage and water quality response under different water quality conditions and operating scenarios. The model employs a systematic approach: during training, the sample space is repeatedly divided using multiple decision trees. This solidifies the mapping relationship between water quality parameter combinations, carbon source dosage, and water quality response within the model structure. The splitting is performed by minimizing the mean square error, and hyperparameter optimization controls the tree's complexity and generalization ability until the model's fitting error for various typical operating conditions in the training set converges to a reasonable range. After training, every half hour, when the current water quality data and the target water quality data (the water quality standard required in actual treatment) are acquired, this data is input into the model. Based on the learned mapping relationship, the model calculates the ideal carbon source dosage according to the water quality target and the current water quality data.
[0055] Step S3: Train the denitrification demand prediction model, predict water quality change trends, optimize carbon source dosage, formulate carbon source dosage scheme, simulate the carbon source dosage scheme, and optimize and adjust the scheme based on the simulation results.
[0056] Specifically, to train the denitrification demand prediction model, a large number of known water quality data changes and carbon source dosages from different time windows were selected as samples. After standardization, the samples were grouped according to continuous time, with each group lasting two to three days and the time interval between data within a group being half an hour, forming a training set. Random forest was used as the base model, and the training set was used to train the model. During the training process, the relationship between time series, water quality parameter changes, carbon source dosage changes, and water quality response was learned. During validation, the model was used as the water quality data from the previous day to predict the water quality data, carbon source dosage, and water quality changes for each subsequent half hour.
[0057] A denitrification demand prediction model is used to predict water quality data and carbon source dosage every half hour over a future period, forming a preliminary prediction sequence. Each set of predicted future water quality data and the set water quality target are input into a carbon source dosage analysis model to calculate the theoretical carbon source dosage required to achieve the target under specific water quality conditions. A consistency check is performed by comparing the theoretical dosage derived from the analysis model with the original predicted dosage output by the prediction model. If the difference exceeds a set tolerance range (a difference in specific dosage greater than 10%), the prediction result is considered to have a significant deviation. The prediction model is then corrected using the analysis model data. Simultaneously, theoretical values derived from the analysis model that better align with the water quality target are used to replace and correct the corresponding values in the prediction sequence. All data points after the above verification and correction are integrated and smoothed to generate a coherent, reliable, and long-term executable carbon source dosage plan.
[0058] Next, the scheme was validated. Using the current water quality data of the wastewater treatment system as the starting point for simulation, the obtained long-term dosing scheme was converted into a periodic dosing amount. A denitrification demand prediction model was used to simulate the changes in water quality data, and the simulation was compared with the water quality data changes in the carbon source dosing scheme. The main evaluation objectives were whether the dosing scheme could reliably achieve the preset water quality target under the actual system dynamics and the smoothness and stability of the scheme's execution process. When the results showed that the predetermined target was not achieved, the unreasonable water quality data was input into the carbon source dosing analysis model to analyze the unreasonable water quality data for carbon source dosing. The data was then replaced in the prediction and the simulation continued to optimize the treatment scheme until the water quality data in the simulation met the requirements, thus forming a reliable carbon source dosing scheme.
[0059] Step S4: Based on the optimized carbon source addition scheme, the carbon source addition amount is precisely adjusted through the automatic control system to achieve precise addition;
[0060] Specifically, deploying an automatic carbon source dosing control system in a wastewater treatment plant requires adding a complete set of control equipment to the existing carbon source dosing equipment. This includes sensors for real-time monitoring of key water quality parameters (such as COD, DO, ammonia nitrogen, pH, etc.), flow meters for precise dosing, and regulating valves or metering pumps as actuators. Based on this, appropriate PLC control algorithms are configured for the actuators according to actual process requirements, and a stable connection is established with the central processing unit through an industrial network to form a control system capable of receiving central commands in real time and dynamically adjusting the carbon source dosing. The central processing unit sends corresponding control commands to the control unit based on the established scheme results, achieving precise and reliable automated dosing.
[0061] Step S5: Monitor and collect actual water quality change data in real time, compare it with the data generated by the prediction model, analyze the deviation, continuously optimize the machine learning algorithm and prediction model, and optimize the model analysis effect;
[0062] Specifically, the system continuously collects actual water quality changes using data acquisition sensors and records the actual carbon source dosage to assess whether the actual water quality changes meet the water treatment requirements. Then, it calculates the deviation between the actual values and the predicted values for the same period, using the root mean square error (RMSE) as a key performance indicator. Concentration is used as the primary evaluation criterion. When the root mean square error (RMSE) is less than 0.5 mg / L, the model performance is excellent, and no intervention is needed at this time. When the RMSE is higher than 0.5 mg / L but lower than 1.0 mg / L, the model automatically optimizes, records actual water quality data, and uses it for incremental training. Simultaneously, the parameters of the carbon source dosage analysis model are optimized based on the water quality response results, and the training weight of recent data is increased in the denitrification demand prediction model. When the RMSE is higher than 1.5 mg / L, there is a significant difference between the model training environment and actual operating conditions. Maintenance personnel are notified to optimize the training set, reduce the weight of training data, and significantly increase the weight of actual data. Under the premise of stable model operation, the model analysis effect is continuously optimized based on actual data, and a reasonable and long-term carbon source dosage plan is formulated.
[0063] like Figure 2 The effect comparison diagram of the carbon source addition control method for sewage treatment in this invention compared with the traditional method is shown in the figure. The black bars in the figure represent the effect of the present invention, and the gray bars represent the effect of the traditional invention. The present invention is superior to the traditional solution in terms of effluent quality compliance rate and carbon saving rate in sewage treatment, and has high practicality.
[0064] Example 2: In some wastewater treatment plants, the sources of wastewater are complex, and there may be drastic changes in water quality data. Therefore, in terms of data acquisition, the frequency of data collection is significantly increased to once per minute, and the prediction frequency for carbon source dosage in the model is also modified to once per minute. Specifically, to achieve a denitrification demand prediction model under complex environments, a temporal neural network is used as the basic model, shifting the focus to the relationship between water quality data changes and time changes. A training sample set is constructed, including minute-level water quality parameter sequences, carbon source dosage sequences, and corresponding water quality change results. Then, an input-output sequence is constructed using a sliding time window, with multidimensional water quality data from the previous period as input and key denitrification indicators from subsequent periods as prediction targets. The network learns water quality parameters through backpropagation and gradient descent algorithms. The dynamic patterns of parameter changes over time and their complex mapping relationship with denitrification requirements allow for the extraction of patterns in water quality changes over time from complex water quality variations (e.g., receiving wastewater from a factory every evening at 6 PM causes drastic changes in water quality). Based on this, a carbon source dosage analysis model is used for prediction. Furthermore, in the initial deployment phase, the model struggles to adapt to drastically changing environments. To address this, a simplified solution is implemented, with dosage dynamically adjusted every minute through rapid analysis to ensure stable effluent quality. As training data increases, the denitrification demand prediction model continuously learns the patterns of actual water quality changes. Once its prediction accuracy gradually improves and stabilizes, the system automatically reduces the frequency of calling the carbon source dosage analysis model, gradually transitioning to a collaborative control mode where the prediction model is dominant and the analysis model is auxiliary, achieving a smooth evolution from forced intervention to intelligent optimization.
[0065] Example 3: In low-temperature environments (typically below 15℃, especially below 5-10℃), the metabolic activity of the microbial community responsible for denitrification is significantly reduced, and its enzymatic reaction rate decreases accordingly, leading to a slower denitrification rate and consequently, inaccurate model predictions. To adapt to low-temperature scenarios and possible seasonal temperature changes, in terms of hardware, temperature sensors and controllable heating devices are installed in key units such as the denitrification zone of the wastewater treatment plant to achieve real-time monitoring and appropriate control of the ambient temperature, creating suitable reaction conditions for the denitrifying bacteria. In terms of models, for both models, a temperature-denitrification relationship learning objective is introduced during training. The actual denitrification efficiency in different temperature ranges in historical data is analyzed, and an empirical correction curve or lookup table is fitted to extract the temperature-activity compensation function. In the calculation of carbon source dosage and water quality changes, the calculation logic of carbon source dosage and the prediction results of water quality changes are corrected according to the temperature conditions to compensate for the inhibitory effect of low temperature on the denitrification rate.
[0066] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for controlling the addition of carbon sources in wastewater treatment, characterized in that: Step S1: Deploy various types of data sensors at multiple key nodes in the wastewater treatment plant to collect water quality data in real time, and transmit the collected data to the central processing unit for centralized processing; Step S2: The central processing unit processes the real-time multimodal data collected from the wastewater treatment plant and uses machine learning algorithms to analyze the required amount of carbon source to be added. Step S3: Train the denitrification demand prediction model to predict water quality change trends, optimize carbon source dosage, formulate a carbon source dosage scheme, simulate the carbon source dosage scheme, and optimize and adjust the scheme based on the simulation results. Specifically, this includes: To train the denitrification demand prediction model, a large number of known water quality data changes and carbon source addition amounts in different time windows were selected as samples, standardized, and grouped according to continuous time to form a training set. Random forest is used as the base model, and the model is trained using a training set. During the training process, the relationship between time series, changes in water quality parameters, changes in carbon source dosage and water quality response is learned. During validation, the model is based on the previous day's water quality data to predict subsequent water quality data, carbon source dosage and water quality change results. A denitrification demand prediction model is used to predict water quality data and carbon source dosage in the future to form a preliminary prediction sequence. Each set of predicted future water quality data and the set water quality target are input into the carbon source dosage analysis model to calculate the theoretical carbon source dosage required to achieve the target under the water quality conditions. A consistency check is performed by comparing the theoretical dosage derived from the analysis model with the original predicted dosage output by the prediction model. If the difference exceeds the set tolerance range, the prediction result is determined to have a significant deviation. The prediction model is then corrected using the analysis model data. The corresponding values in the prediction sequence are replaced and corrected using the theoretical values derived from the analysis model. All data points after the above checks and corrections are integrated and smoothed to generate a coherent, reliable, and long-term carbon source dosing plan. Next, the scheme was verified. The water quality data of the sewage treatment system at the current moment was used as the starting point of the simulation. The obtained long-term addition scheme was converted into a periodic addition amount. The denitrification demand prediction model was used to simulate the changes in water quality data and compared with the changes in water quality data in the carbon source addition scheme. The main evaluation objectives were whether the addition scheme could reliably achieve the preset water quality target under the actual system dynamics and the smoothness and stability of the scheme execution process. When the results show that the predetermined target was not achieved, the carbon source dosage analysis model is used to analyze the unreasonable part of the water quality data for carbon source dosage, and replacement is carried out in the prediction and simulation is continued to optimize the treatment plan until the water quality data in the simulation meets the requirements, thus forming a reliable carbon source dosage plan. Step S4: Based on the optimized carbon source addition scheme, the carbon source addition amount is precisely adjusted through the automatic control system to achieve precise addition; Step S5: Monitor and collect actual water quality change data in real time, compare it with the data generated by the prediction model, analyze the deviation, continuously optimize the machine learning algorithm and prediction model, and optimize the model analysis effect.
2. The method for controlling carbon source addition in wastewater treatment according to claim 1, characterized in that: The deployment of various types of data sensors at multiple key nodes in the wastewater treatment plant to collect water quality data in real time specifically includes: Based on the layout of the wastewater treatment plant, at key nodes, ensure that the deployment of sensors can reflect the real-time water quality changes at each stage of the wastewater treatment process; set up various types of data sensors at corresponding key nodes, including direct parameters of denitrification and environmental parameters affecting the denitrification process; after collecting water quality data at the corresponding nodes, upload the data to the central processing unit.
3. The method for controlling carbon source addition in wastewater treatment according to claim 1, characterized in that: The central processing unit processes the real-time collected multimodal data from the wastewater treatment plant, specifically including: Data is cleaned to remove missing values, outliers, and duplicate data to ensure data integrity and accuracy. For missing values, linear interpolation is used to fill in the missing data by inferring the missing data based on the linear relationship between the data points before and after the missing point, thus ensuring data continuity. For outliers, the standard deviation method is used to identify and correct them. Data exceeding the set threshold is identified as outliers and replaced or corrected to values within a reasonable range. Subsequently, the data collected by each sensor are aligned according to the timestamp to ensure that all data points have the same timestamp; when the sampling frequency of the data is inconsistent, linear interpolation is used to supplement the sampling data of different time periods to ensure the temporal consistency and smoothness of the data. To standardize the data scale, Z-score standardization is applied to different types of water quality data to eliminate dimensional differences between parameters. Moving average method is used to smooth noise in the data, and the mean of the data within a certain time window is calculated to reduce the interference of short-term fluctuations on data analysis. Feature engineering extracts meaningful features from the raw data, calculates other features, and converts all data into a unified structured JSON format to ensure that the input data format is consistent for subsequent analysis and machine learning models.
4. The method for controlling carbon source addition in wastewater treatment according to claim 1, characterized in that: The specific details of using machine learning algorithms to analyze the required carbon source dosage include: To train the carbon source dosage analysis model, a large number of known water quality data changes and carbon source dosages were selected as samples, including water quality data consistent with the types of sensors deployed, carbon source dosages under the water quality conditions, and changes in water quality data after the deployment. The collected data were converted into a standard format through a consistent preprocessing step to form a training set. Random forest model was chosen as the base model to learn nonlinear relationships. Water quality parameters, carbon source dosage, and water quality changes after dosage were input into the random forest model for multiple rounds of iterative training. This allowed the model to gradually learn the regular relationship between carbon source dosage and water quality response under different water quality conditions and operating conditions. During training, the sample space was repeatedly divided using multiple decision trees to solidify the mapping relationship between water quality parameter combination, carbon source dosage, and water quality response effect in the model structure. The splitting was performed by minimizing the mean square error, and the complexity and generalization ability of the trees were controlled by hyperparameter optimization until the model's fitting error for various typical operating conditions in the training set converged to a reasonable range. After training is completed, the current water quality data and water quality target are obtained every half hour. The data is then input into the model, and the model calculates the ideal carbon source addition amount based on the learned mapping relationship, according to the water quality target and the current water quality data.
5. The method for controlling carbon source addition in wastewater treatment according to claim 1, characterized in that: The precise addition of carbon source, achieved by accurately adjusting the amount added through an automatic control system based on the optimized carbon source addition scheme, specifically includes: Deploying an automatic carbon source dosing control system in a wastewater treatment plant requires adding a complete set of control equipment to the existing carbon source dosing equipment, including sensors, flow meters, and regulating valves or metering pumps as actuators. Based on this, appropriate PLC control algorithms are configured for the actuators according to actual process requirements, and a stable connection is established with the central processing unit via an industrial network, forming a control system capable of receiving central commands in real time and dynamically adjusting the carbon source dosing. The central processing unit, based on the established scheme, sends corresponding control commands to the control unit to regulate the control equipment and achieve dosing control.
6. The method for controlling carbon source addition in wastewater treatment according to claim 1, characterized in that: The process of real-time monitoring and collection of actual water quality change data, comparing it with data generated by the prediction model, analyzing deviations, and continuously optimizing the machine learning algorithm and prediction model, specifically includes: Continuously collect actual water quality change results through data acquisition sensors and record the actual carbon source dosage to evaluate the actual water quality change results; Calculate the deviation between the actual value and the predicted value for the same period, using the root mean square error as the key performance indicator, and incorporate the water quality data... Concentration is used as the primary evaluation criterion; When the root mean square error does not exceed 0.5 mg / L, it indicates that the model performance is excellent and no intervention is needed at this time. When the root mean square error is higher than 0.5 mg / L but lower than 1.0 mg / L, the model is automatically optimized. The actual water quality data is recorded and used for incremental training of the model. At the same time, the parameters of the carbon source dosage analysis model are optimized based on the water quality response results, and the training weight of recent data is increased in the denitrification demand prediction model. When the root mean square error is higher than 1.5 mg / L, there is a significant difference between the model training environment and the actual operating conditions. The operation and maintenance personnel should be notified to optimize the training set, while reducing the weight of the training data and significantly increasing the weight of the actual data. Under the premise of stable model operation, continuously optimize the model analysis effect based on actual data, and formulate a reasonable and long-term carbon source addition plan.
7. The method for controlling carbon source addition in wastewater treatment according to claim 1, characterized in that: In response to low-temperature environments, temperature sensors and controllable heating devices are installed in key units of wastewater treatment plants to automatically regulate the temperature. Regarding the models, for both models, a learning objective on the relationship between temperature and denitrification is introduced during their training. The actual denitrification efficiency under different temperature ranges in historical data is analyzed, and an empirical correction curve or lookup table is fitted to extract the temperature-activity compensation function. In the calculation of carbon source dosage and water quality changes, the calculation logic of carbon source dosage and the prediction results of water quality changes are corrected according to the temperature conditions to compensate for the inhibitory effect of low temperature on the denitrification rate.