Sewage treatment water quality parameter prediction method and fan frequency control method and system

CN120031173APending Publication Date: 2025-05-23HONGTAI HUARUI TECH GRP CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411914558.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

Among the existing sewage treatment equipment, fan control technology has problems such as insufficient flexibility, high energy consumption, inaccurate operation, and poor timeliness, which leads to lag with the actual water quality, affecting the treatment effect and energy consumption.

Method used

The wastewater treatment water quality parameter prediction method is adopted, and the SARIMAX model and the LSTM model are combined to predict future water quality changes, and the fan frequency is adjusted using the prediction data to achieve dynamic adjustment of the aeration volume.

Benefits of technology

By accurately predicting water quality parameters, the error between real-time water quality data and real water quality data is reduced, energy consumption is reduced by about 30%, and the stability and consistency of treatment effects are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031173A_ABST
    Figure CN120031173A_ABST
Patent Text Reader

Abstract

The invention discloses a sewage treatment water quality parameter prediction method and a fan frequency control method and system, and relates to the field of sewage treatment.The key points of the technical scheme are that water quality data are obtained, and the water quality data comprise historical water quality parameter data; constructing an SARIMAX model, and determining (p, d, q) and (P, D, Q, s) initial parameters by using ACF and PACF graphs in combination with actual data; optimizing the parameters through model evaluation (AIC / BIC), combining all the parameters by using a nested loop, evaluating the AIC / BIC value of each group of parameters, selecting the combination with the minimum AIC or BIC value, and determining the combination as an SARIMAX model parameter; fitting the data, and outputting a residual error for LSTM model training; using the residual error to train an LSTM model; taking a plurality of past continuous residual values as the input of the LSTM model to predict the next residual; summing the water quality parameter predicted by the SARIMAX model and the residual error predicted by the LSTM model to obtain a water quality prediction result, and outputting the water quality prediction result. The purpose of predicting water quality parameter data is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a control method for aeration by a fan in the field of sewage treatment, and more specifically, to a sewage treatment water quality parameter prediction method, a fan frequency control method and a system. Background Art

[0002] In the field of fan control of integrated sewage treatment equipment, there are currently several main control technologies and methods: first, manual control, which relies on operators to manually adjust valves or equipment parameters to set a fixed fan output to maintain a constant aeration volume; second, time control, which presets time intervals based on sewage treatment experience and regularly starts and stops the fan for aeration; and finally, PID control, which uses real-time feedback of parameters such as DO and ammonia nitrogen to adjust the fan output through proportional, integral, and differential control strategies to achieve the control target. However, these existing control technologies have significant disadvantages, including lack of flexibility, inability to dynamically adjust the aeration volume according to the actual load changes of sewage treatment, resulting in excessive energy consumption or poor treatment effect; imprecise operation, frequent manual intervention to adjust parameters, which is not only time-consuming and dependent on operating experience, but also easy to cause over-aeration or under-aeration problems, affecting treatment effect and energy consumption; high energy consumption, due to the lack of automatic optimization mechanism, the aeration system is often in high-load operation; and poor timeliness, complex PID controller parameter adjustment, improper parameters are prone to system oscillation or slow response, and it is difficult to cope with many nonlinear factors in sewage treatment and dynamic changes in water quality and environmental factors. The core reason for the above problems is that aeration control can only be regulated through real-time water quality data. However, due to objective reasons of the detection system, real-time water quality data lags behind the actual data by more than two hours. At the same time, the increase or decrease of fan frequency cannot be sudden, and the lag between aeration volume and actual water quality is even more serious. Summary of the invention

[0003] In a first aspect, the purpose of the present invention is to provide a method for predicting water quality parameters of sewage treatment, which reduces the error between real-time water quality data and actual water quality data by making a more accurate prediction of future water quality data.

[0004] The above technical purpose of the present invention is achieved through the following technical solutions: a method for predicting water quality parameters of sewage treatment, obtaining water quality data, wherein the water quality data includes historical water quality parameter data; constructing a SARIMAX model, using ACF and PACF diagrams in combination with actual data to determine the initial parameters (p, d, q) and (P, D, Q, s); optimizing parameters through model evaluation (AIC / BIC), using nested loops to combine all parameters and evaluate the AIC / BIC value of each group of parameters, selecting the combination with the smallest AIC or BIC value, and determining it as the SARIMAX model parameters; fitting data, and outputting residuals for LSTM model training; using residuals to train the LSTM model; using multiple consecutive residual values ​​in the past as inputs of the LSTM model to predict the next residual; summing the water quality parameters predicted by the SARIMAX model and the residuals predicted by the LSTM model to obtain a water quality prediction result, and outputting the water quality prediction result.

[0005] In a preferred embodiment, the water quality parameter data includes one or more of flow rate, chemical oxygen demand, ammonia nitrogen, total nitrogen, and dissolved oxygen; obtaining historical water quality parameter data also includes excluding abnormal data and filling in missing data; the abnormal data exclusion method is as follows: sort the data of each water quality parameter, calculate the first quartile Q1 and the third quartile Q3; calculate the interquartile range IQR=Q3-Q1; set the upper limit to Q3+1.5×IQR and the lower limit to Q1-1.5×IQR; exclude water quality parameters that exceed the upper limit and are lower than the lower limit; and fill in missing data through the linear change trend before and after the missing data.

[0006] In a preferred embodiment, the water quality data also includes holiday data and meteorological data; the meteorological data includes temperature, wind speed and rainfall; in the process of constructing the SARIMAX model to fit the data, the input data is water quality parameter data, and the exogenous variables are whether it is a holiday, temperature, wind speed, and rainfall; when predicting the next residual, the past ten consecutive residual values ​​are used as input to the LSTM model for prediction.

[0007] In a second aspect, the purpose of the present invention is to provide a method for controlling the frequency of a sewage treatment fan, which uses historical water quality data to predict water quality parameter data and uses the predicted data to adjust the fan frequency.

[0008] The above technical objectives of the present invention are achieved through the following technical solutions: a method for controlling the frequency of a sewage treatment fan, S1 obtains water quality data; the water quality data includes holiday data, meteorological data and historical water quality parameter data; the meteorological data includes temperature, wind speed and rainfall; the water quality parameter data includes flow, chemical oxygen demand, ammonia nitrogen content, total nitrogen content and dissolved oxygen content; S2 constructs a SARIMAX model, uses ACF and PACF graphs combined with actual data to determine the initial parameters (p, d, q) and (P, D, Q, s); optimizes parameters through model evaluation (AIC / BIC), uses nested loops to combine all parameters and evaluates the AIC / BIC value of each group of parameters, and selects the one with the smallest AIC or BIC value The combination is determined as the SARIMAX model parameters; S3 fits the data, the input is the water quality parameter data, and the exogenous variables are whether it is a holiday, temperature, wind speed, and rainfall; the output is the residual; the output residual is used for LSTM model training; the LSTM model is trained using the residual data; the past 10 consecutive residual values ​​are used as the input of the LSTM model to predict the next residual; S4 sums the water quality parameter data predicted by the SARIMAX model with the residual predicted by the LSTM model to obtain the water quality parameter data prediction result; S5 repeats steps S2 to S4 to obtain the prediction result of each water quality parameter data; S6 sends the prediction result of the water quality parameter data to the aeration fan, so that the aeration fan can control the fan frequency through the prediction result.

[0009] In a preferred embodiment, historical water quality parameter data is obtained, and the abnormal data are excluded and missing data are filled. The abnormal data exclusion method is as follows: sort the data of each water quality parameter, calculate the first quartile Q1 and the third quartile Q3; calculate the interquartile range IQR = Q3-Q1; set the upper limit to Q3+1.5×IQR and the lower limit to Q1-1.5×IQR; exclude water quality parameters that exceed the upper limit and are lower than the lower limit; and fill in the missing data through the linear change trend before and after the missing data.

[0010] In a preferred embodiment, the aeration fan controls the fan frequency through prediction results, comprising the following steps: obtaining a fuzzy set of each water quality parameter data and fan frequency; the fuzzy set comprises a plurality of fuzzy subsets; obtaining a corresponding rule set of the water quality parameter fuzzy subset and the fan frequency fuzzy subset; obtaining the prediction results of the water quality parameter data; parsing the fan frequency corresponding to the water quality parameter according to the water quality parameter data and the corresponding rule set, and sending a fan frequency signal to the aeration fan.

[0011] In a preferred embodiment, it also includes an adaptive adjustment method for adjusting the corresponding rules of the fuzzy subsets of water quality parameters and the fuzzy subsets of fan frequency by genetic algorithm, and the adaptive adjustment method includes the following steps: defining a gene code for each corresponding rule; initializing and generating a population; defining a fitness function; the greater the fitness, the more ideal the corresponding rule effect; the fitness function formula is:

[0012]

[0013] Among them, Y S Represents the water quality parameter data after treatment, Y M Represents target water quality parameter data; ∑|Y S -Y M | means taking the absolute value of the difference between each type of water quality parameter data after processing and the target water quality parameter data of this type and then summing them. The corresponding rule set is optimized through selection, crossover and mutation operations; the corresponding rules of the water quality parameter fuzzy subset and the fan frequency fuzzy subset are updated.

[0014] On the third aspect, the purpose of the present invention is to provide a sewage treatment fan frequency control system, which uses historical water quality data to predict water quality parameter data and uses the predicted data to adjust the fan frequency.

[0015] The above technical purpose of the present invention is achieved through the following technical solutions: a data acquisition module, the data acquisition module is used to acquire water quality data; the water quality data includes holiday data, meteorological data and historical water quality parameter data; the meteorological data includes temperature, wind speed and rainfall; the water quality parameter data includes flow, chemical oxygen demand, ammonia nitrogen content, total nitrogen content, dissolved oxygen content; a water quality prediction module, the water quality prediction module is used to build a SARIMAX model, use ACF, PACF diagrams combined with actual data to determine the initial parameters (p, d, q) and (P, D, Q, s); optimize parameters through model evaluation (AIC / BIC), use nested loops to combine all parameters and evaluate the AIC / BIC value of each group of parameters, and select Select the combination with the smallest AIC or BIC value and determine it as the SARIMAX model parameter; fit the data, the input is water quality parameter data, and the exogenous variables are whether it is a holiday, temperature, wind speed, and rainfall; the output is the residual; the output residual is used for LSTM model training; use the residual data to train the LSTM model; use the past 10 consecutive residual values ​​as the input of the LSTM model to predict the next residual; sum the water quality parameter data predicted by the SARIMAX model and the residual predicted by the LSTM model to obtain the water quality parameter data prediction result; repeat the above steps to obtain the prediction result of each water quality parameter data; fan control module, the fan control module is used to receive the prediction result of the water quality parameter data and control the frequency of the aeration fan.

[0016] In a preferred embodiment, the fan control module includes a corresponding rule storage module; the corresponding rule storage module is used to store fuzzy sets of each water quality parameter data and fan frequency; and the corresponding rules between the water quality parameter fuzzy subsets and the fan frequency fuzzy subsets; the fan control module is used to obtain the prediction results of the water quality parameter data, determine the fuzzy subset to which the prediction results of the water quality parameter data belong; parse the fan frequency corresponding to the water quality parameter data through the corresponding rule storage module, and send the fan frequency signal to the aeration fan.

[0017] In a preferred embodiment, the fan control module further includes a corresponding rule adaptive adjustment module, which is used to: define a gene code for each corresponding rule; initialize and generate a population; define a fitness function; the greater the fitness, the more ideal the corresponding rule effect; the fitness function formula is:

[0018]

[0019] Among them, Y S Represents the water quality parameter data after treatment, Y M Represents target water quality parameter data; ∑|Y S -Y M | means taking the absolute value of the difference between each type of water quality parameter data after processing and the target water quality parameter data of this type and then summing them. The corresponding rule set is optimized through selection, crossover and mutation operations; the corresponding rules of the water quality parameter fuzzy subset and the fan frequency fuzzy subset are updated in the corresponding rule storage module.

[0020] Compared with traditional sewage treatment methods, the above scheme reduces energy consumption by about 30% by predicting future water quality changes and accurately adjusting the fan frequency. When the water quality fluctuates greatly, the system can make adjustments quickly to maintain the water quality at the sewage outlet within the standard range, achieving stability and consistency in the treatment effect.

[0021] In summary, the present invention has the following beneficial effects: the present invention adopts the SARIMAX model to use water quality data to capture the seasonality and trend of the time series to model the change of water quality, and makes high-precision predictions of future water quality parameters, which can solve the problem that traditional models cannot cope with complex external environmental factors. By calculating the residuals of the predicted data generated by the SARIMAX model, combining historical residual values ​​and exogenous variables to establish an LSTM model, and learning the residuals of the SARIMAX model, the prediction model can be better corrected, and the adaptability of the overall model to complex external environmental factors can be improved, thereby improving the accuracy of the prediction of sewage water quality parameter data. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1Flow chart of the method for predicting water quality parameters of sewage treatment in Example 1

[0023] Figure 2 Embodiment 2 Sewage treatment fan frequency control method

[0024] Figure 3 The adaptive adjustment method of the corresponding rule of embodiment 2

[0025] Figure 4 Schematic diagram of the frequency control system of the sewage treatment fan in Example 3 DETAILED DESCRIPTION

[0026] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0027] Embodiment 1:

[0028] This embodiment provides a method for predicting water quality parameters of sewage treatment, comprising the following steps:

[0029] S1: Data collection,

[0030] The sensors and detectors installed on the sewage treatment equipment collect the sewage inlet water quality parameter data in real time, including inlet flow, chemical oxygen demand (COD), ammonia nitrogen (NH 3 N), total nitrogen (TN), dissolved oxygen (DO); the collection period can be customized and optimized, and multiple sensors are installed at the water inlet and outlet of the sewage treatment equipment to collect water quality parameters in real time, including COD, NH3-N, TN, DO and flow; the data collection frequency is set to once every 10 seconds; real-time acquisition of holidays, temperature, wind speed, and rainfall data.

[0031] S2: Data initialization,

[0032] Acquire water quality data, which includes holiday data and current meteorological data; the current meteorological data includes temperature, wind speed and rainfall; and acquire historical water quality parameter data.

[0033] S3: Data preprocessing,

[0034] Due to sensor failure, blockage or interference from the external environment, the collected data may be missing. The collected water quality data is preliminarily processed and the missing values ​​are reasonably filled. The missing values ​​are filled using the linear change trend of the data before and after the missing values. If the data is normal, no processing is required. Abnormal data is excluded and static anomalies are detected using the interquartile range method.

[0035] S31 Calculate quartiles: Sort the data of each water quality parameter (such as COD) and calculate the first quartile (Q1) and the third quartile (Q3).

[0036] S32 calculates the interquartile range (IQR): interquartile range IQR = Q3 - Q1.

[0037] S33 sets the threshold: the upper limit is set to Q3+1.5×IQR and the lower limit is set to Q1-1.5×IQR. Points outside these ranges are considered abnormal.

[0038] S34 Identify outliers: For each water quality parameter, mark the points that exceed the upper limit or fall below the lower limit as outliers.

[0039] S4: Building a SARIMAX prediction model

[0040] S41 uses ACF and PACF graphs combined with actual data to determine the initial parameters of (p, d, q) and (P, D, Q, s), (p, d, q) = (1, 1, 1); (P, D, Q, s) = (1, 1, 1, 24).

[0041] S42 optimizes parameters through model evaluation (AIC / BIC), uses nested loops to combine all parameters and evaluate the AIC / BIC value of each group of parameters, and selects the combination with the smallest AIC or BIC value.

[0042] S43 uses the rolling window method for cross-validation to evaluate the effects of different parameter combinations on the test set.

[0043] S44 builds a SARIMAX model to fit the data, and the input parameters are water quality parameters COD, NH 3 N, TN, DO, exogenous variables are whether it is a holiday, temperature, wind speed, rainfall, and output residuals for LSTM model training.

[0044]

[0045] is the autoregressive part, which means that the current value depends on the linear combination of the past p lagged values.

[0046] For the moving average part, the current value is also affected by the past q random disturbances (white noise) d.

[0047] It is the seasonal autoregressive part, which means that the current value depends on the linear combination of the lagged values ​​of the past P seasonal cycles (i.e., s is the cycle length).

[0048] It is the seasonal moving average part, which means that the current value is also affected by the past Q seasonal random disturbances (with a period of S).

[0049] y t The water quality parameters collected (COD, NH 3 N, TN, DO).

[0050] c is a constant term that represents the mean trend of the time series (usually close to 0).

[0051] p and q are orders. The lag order at which the partial autocorrelation function PACF graph first drops to 0 is p; the lag order at which the autocorrelation function ACF graph first drops to 0 is q.

[0052] φ i Reflects the degree of influence of each lag value on the current value, which is automatically estimated through model fitting; θ j , Φ k , Θ m The coefficient describes the weight of each disturbance on the current value and is automatically estimated by fitting the data; s is the cycle length.

[0053] X t is an exogenous variable (whether it is a holiday, temperature, wind speed, rainfall), and the coefficient β reflects the effect of the exogenous variable on the current value y t impact.

[0054] ∈ t is the prediction error, which is used by the LSTM model for prediction.

[0055] S5: Establish LSTM model residual prediction,

[0056] S51 uses the residual of the SARIMAX model as the input data of the LSTM model.

[0057] S52 is designed to use the past 10 residual values ​​as the step size to predict the next residual.

[0058] S53 uses residual data to train LSTM until the model can better fit the fluctuation characteristics of the residual and achieve the goal of minimizing the residual prediction error. The following formula is used to evaluate the degree of fit of the model.

[0059]

[0060] ∈ t is the prediction error, which is the actual sequence value (such as the actual COD value) minus the model's predicted value. is the residual predicted by the model, which is the t The predicted value of . Loss is the loss function used to measure and ∈ tThe smaller the Loss, the stronger the model's ability to predict residuals. N is the number of samples in the time series. t is each time point.

[0061] S105: Generate comprehensive prediction results.

[0062] The prediction results of the SARIMAX model and the residuals of the LSTM model are added together to generate the final water quality and flow prediction results. This prediction result can reflect the trend of water quality changes in the future and fully consider short-term fluctuations and long-term trends.

[0063]

[0064] y sarimax is the result predicted by the SARIMAX model, The predicted residual is added together to produce a more accurate result.

[0065] Beneficial effects of this embodiment: By combining the SARIMAX and LSTM models in this embodiment, linear and nonlinear patterns in water quality data can be captured more accurately. SARIMAX is responsible for processing periodic and seasonal trends, and by adding exogenous variables, it can more accurately capture the impact of the external environment (different seasons, holidays, temperature, wind speed, rainfall); LSTM is responsible for capturing nonlinear changes in residuals. The combination of the two makes the prediction of water quality parameters more accurate, especially suitable for complex and changeable sewage treatment scenarios.

[0066] Example 2

[0067] A sewage treatment fan frequency control method comprises the following steps:

[0068] Obtain a fuzzy set of each water quality parameter data and fan frequency; the fuzzy set includes multiple fuzzy subsets. Each water quality parameter and fan frequency fuzzy set includes five fuzzy subsets, namely low, lower, medium, higher, and high.

[0069] Through historical data analysis, the possible value range of each parameter is determined. In this embodiment, the value range is as follows:

[0070] COD range: 0–300 mg / L, the value range is [0,300], and the fuzzy subset is:

[0071] low:[0,50,100];

[0072] lower:[50,100,150];

[0073] medium:[100,150,200];

[0074] higher:[150,200,250];

[0075] high:[200,250,300].

[0076] NH 3 N range: 0–50 mg / L, the value range is [0,50], and the fuzzy subset is:

[0077] low:[0,5,10];

[0078] lower:[5,10,20];

[0079] medium:[10,20,30];

[0080] higher:[20,30,40];

[0081] high:[30,40,50].

[0082] TN range: 0–100 mg / L, the value range is [0,100], and the fuzzy subset is:

[0083] low:[0,10,20];

[0084] lower:[10,20,40];

[0085] medium:[20,40,60];

[0086] higher:[40,60,80];

[0087] high:[60,80,100].

[0088] DO range: 0–10 mg / L, the value range is [0,10], and the fuzzy subset is:

[0089] low:[0,1,2];

[0090] lower:[1,2,3];

[0091] medium:[2,3,4];

[0092] higher:[3,4,5];

[0093] high:[4,6,10].

[0094] For example, in the low subset, COD values ​​in the range of 0–50 completely belong to low; when it is greater than 100, the membership is 0.

[0095] Also define the fuzzy membership function for the fan frequency, ranging from 0-50Hz, and the fuzzy subset is:

[0096] low:[0,0,12];

[0097] lower:[0,12,25];

[0098] medium:[12,25,38];

[0099] higher:[25,38,50];

[0100] high:[38,50,50].

[0101] Obtain the corresponding rules between the fuzzy subsets of water quality parameters and the fuzzy subsets of fan frequency; the corresponding rules of this embodiment are as follows:

[0102] COD=low,NH 3 N=low,TN=low,DO=low→fan frequency=low;

[0103] COD=low,NH 3 N=low,TN=low,DO=lower→fan frequency=lower;

[0104] COD=low,NH 3 N=low,TN=low,DO=medium→fan frequency=medium;

[0105] COD=low,NH 3 N=low,TN=low,DO=higher→fan frequency=higher;

[0106] COD=low,NH 3 N=low,TN=low,DO=high→fan frequency=higher;

[0107] COD=lower,NH 3 N=low,TN=low,DO=low→fan frequency=lower;

[0108] COD=lower,NH 3 N=low,TN=low,DO=medium→fan frequency=medium;

[0109] COD=lower,NH 3 N=low,TN=medium,DO=low→fan frequency=medium;

[0110] COD=lower,NH 3 N=medium,TN=medium,DO=lower→fan frequency

[0111] =medium;

[0112] COD=lower,NH 3 N=medium,TN=medium,DO=medium→fan frequency

[0113] =higher;

[0114] COD=medium,NH 3 N=low,TN=low,DO=low→fan frequency=medium;

[0115] COD=medium,NH 3 N=lower,TN=lower,DO=medium→fan frequency=higher;

[0116] COD=medium,NH 3 N=medium,TN=lower,DO=lower→fan frequency=higher;COD=medium,NH 3 N=medium,TN=medium,DO=medium→fan frequency=medium;

[0117] COD=medium,NH 3 N=higher,TN=higher,DO=low→fan frequency=higher;

[0118] COD=higher,NH 3 N=medium,TN=lower,DO=medium→fan frequency

[0119] =higher;

[0120] COD=higher,NH 3 N=medium,TN=medium,DO=low→fan frequency=higher;COD=higher,NH 3 N=medium,TN=medium,DO=medium→fan frequency

[0121] =higher;

[0122] COD=higher,NH 3N=higher,TN=medium,DO=medium→fan frequency=high;COD=higher,NH 3 N=high,TN=higher,DO=low→fan frequency=high;

[0123] COD=high,NH 3 N=low,TN=medium,DO=low→fan frequency=higher;

[0124] COD=high,NH 3 N=medium,TN=lower,DO=medium→fan frequency=higher;

[0125] COD=high,NH 3 N=medium,TN=medium,DO=medium→fan frequency=high;COD=high,NH 3 N=higher,TN=higher,DO=higher→fan frequency=high;

[0126] COD=high,NH 3 N=high,TN=high,DO=medium→fan frequency=high;

[0127] COD=low,NH 3 N=medium,TN=low,DO=low→fan frequency=lower;

[0128] COD=low,NH 3 N=lower,TN=lower,DO=medium→fan frequency=lower;

[0129] COD=low,NH 3 N=higher,TN=medium,DO=medium→fan frequency

[0130] =medium;

[0131] COD=medium,NH 3 N=low,TN=lower,DO=lower→fan frequency=medium;

[0132] COD=medium,NH 3 N=medium,TN=higher,DO=higher→fan frequency=high;

[0133] COD=lower,NH 3 N = higher, TN = medium, DO = low → fan frequency = medium;

[0134] COD=higher,NH 3 N=higher,TN=low,DO=medium→fan frequency=higher;

[0135] COD=high,NH 3 N=medium,TN=medium,DO=high→fan frequency=higher;

[0136] COD=medium,NH 3 N=high,TN=higher,DO=medium→fan frequency=high;

[0137] COD=higher,NH 3 N=high,TN=higher,DO=higher→fan frequency=high;

[0138] COD=low,NH 3 N=high,TN=high,DO=low→fan frequency=medium;

[0139] COD=lower,NH 3 N=high,TN=high,DO=medium→fan frequency=higher;

[0140] COD=medium,NH 3 N=high,TN=high,DO=medium→fan frequency=higher;

[0141] COD=higher,NH 3 N=high,TN=medium,DO=low→fan frequency=higher;

[0142] COD=high,NH 3 N=higher,TN=medium,DO=medium→fan frequency=high;

[0143] COD=low,NH 3 N=low,TN=medium,DO=high→fan frequency=lower;

[0144] COD=lower,NH 3N=lower,TN=medium,DO=high→fan frequency=lower;

[0145] COD=medium,NH 3 N=low,TN=medium,DO=high→fan frequency=lower;

[0146] COD=higher,NH 3 N=medium,TN=medium,DO=high→fan frequency

[0147] =medium;

[0148] COD=high,NH 3 N=higher,TN=higher,DO=high→fan frequency=medium;

[0149] COD=low,NH 3 N=medium,TN=higher,DO=low→fan frequency=lower;

[0150] COD=medium,NH 3 N=higher,TN=higher,DO=low→fan frequency=higher;

[0151] COD=higher,NH 3 N=higher,TN=higher,DO=low→fan frequency=high;

[0152] COD=medium,NH 3 N=medium,TN=medium,DO=higher→fan frequency

[0153] =medium;

[0154] COD=medium,NH 3 N=medium,TN=medium,DO=medium→fan frequency=medium.

[0155] By using the method described in Example 1, the prediction results of the water quality parameter data are obtained, and the fuzzy subset to which the prediction results of the water quality parameter data belong is determined; the fan frequency corresponding to the water quality parameter is analyzed according to the corresponding rule set of the water quality parameter fuzzy subset and the fan frequency fuzzy subset, and the fan frequency signal is sent to the aeration fan.

[0156] In order to better adapt to the dynamic changes of water quality, it also includes an adaptive adjustment method for adjusting the corresponding rules of the fuzzy subsets of water quality parameters and the fuzzy subsets of fan frequency through a genetic algorithm, and the adaptive adjustment method includes the following steps:

[0157] Define the gene encoding for each corresponding rule;

[0158] Input conditions, that is, each water quality parameter (COD, NH 3 There are 5 levels (N, DO, TN), represented by integers from 0 to 4 (0 means low, 1 means lower, 2 means medium, 3 means higher, and 4 means high).

[0159] The output condition, i.e. the fan frequency, also has 5 levels, also represented by integers from 0 to 4.

[0160] For example, COD = medium, NH3N = medium, TN = medium, DO = medium → fan frequency = medium

[0161] Rule 1: COD = medium(2), NH3N = medium(2), TN = medium(2), DO = medium(2), then fan frequency = medium(2)

[0162] Initialize and generate the population;

[0163] Population size: We initialize the population size to 10, that is, the genetic algorithm will optimize 10 different rule sets. In other possible embodiments, the population size can be selected based on experience.

[0164] Initialize individuals: Each individual represents a rule, where each rule consists of 4 input conditions, i.e., water quality parameter data, and 1 output condition, i.e., fan frequency. Both the input and output can take integer values ​​between 0 and 4. In order to ensure the diversity of the population, these integer values ​​can be randomly selected to initialize the population. In this way, the genome (i.e., rule set) of each individual is randomly generated, covering different possibilities in the input space.

[0165] For example, the individuals generated by rule 1 are [2,2,2,2,2]

[0166] According to this logic, the populations generated are: [3,3,2,1,0], [0,0,2,1,3], [2,2,2,0,1], [1,3,2,1,1], [4,4,1,2,0], etc.

[0167] Define the fitness function; the fitness function is used to evaluate the quality of the current rule set. The fitness function measures the control effect based on the error between the target value and the actual value. The definition of error is the difference between the target value and the actual value. Since the fitness is inversely proportional to the error, the fitness calculation method is defined as minimizing the error. The greater the fitness, the more ideal the corresponding rule effect; the fitness function formula is:

[0168]

[0169] Among them, Y S Represents the water quality parameter data after treatment, Y M Represents target water quality parameter data; ∑|Y S -Y M | means taking the absolute value of the difference between each type of water quality parameter data after processing and the target water quality parameter data of that type and then summing them up.

[0170] Optimize the corresponding rule set through selection, crossover and mutation operations;

[0171] After each control cycle, the control effect is evaluated based on the actual operation results. The error is ∑|Y S -Y M The smaller the error, the greater the fitness, and the better the control effect. If the error is large, it means that the water quality may change greatly. The genetic algorithm evaluates the current error to adjust the corresponding rules. Select the rules with higher fitness and detect the impact of other rules on the control results by exchanging or changing some rules.

[0172] For example, after the control cycle ends, the change in fan frequency may not achieve the expected effect. At this time, the genetic algorithm will adjust the relevant rules by evaluating the current error.

[0173] For example:

[0174] When the water quality parameters are COD=120, NH3N=30, DO=2.1, TN=22, the rule output fan frequency should be adjusted to 25Hz (medium). After evaluation, it is found that the individual fitness of the adjusted frequency (higher) is the highest, so the rule is adjusted dynamically.

[0175] COD=lower,NH3N=medium,TN=medium,DO=lower→fan frequency=higher

[0176] Update the correspondence rules between the fuzzy subsets of water quality parameters and the fuzzy subsets of fan frequencies.

[0177] After each new rule is updated, the system will re-execute the control, collect feedback data, and adjust again based on this data. This is a dynamic optimization process. The genetic algorithm continuously improves the control rules based on the system's operating feedback, allowing the system to adaptively respond to different water quality fluctuations and environmental changes.

[0178] The beneficial effect of this embodiment is that the fuzzy adaptive method can be dynamically updated when real-time data arrives, so that the model can continuously adapt to changes in water quality and achieve real-time monitoring and prediction. This feature is particularly critical in sewage treatment systems because water quality parameters may fluctuate significantly with time, climate, and load changes.

[0179] Example 3

[0180] A sewage treatment fan frequency control system, comprising:

[0181] A data acquisition module is used to acquire water quality data; the water quality data includes holiday data, meteorological data and historical water quality parameter data; meteorological data includes temperature, wind speed and rainfall; water quality parameter data includes flow, chemical oxygen demand, ammonia nitrogen, total nitrogen and dissolved oxygen; preferably, multiple sensors are installed at the water inlet and outlet of the sewage treatment equipment to collect water quality parameters in real time, including COD, NH 3 N, TN, DO and flow; the data collection frequency is set to once every 10 seconds; real-time acquisition of holiday, temperature, wind speed and rainfall data.

[0182] A water quality prediction module is used to construct a SARIMAX model, and the initial parameters (p, d, q) and (P, D, Q, s) are determined by using ACF and PACF diagrams in combination with actual data; the parameters are optimized by model evaluation (AIC / BIC), and all parameters are combined using nested loops and the AIC / BIC values ​​of each group of parameters are evaluated, and the combination with the smallest AIC or BIC value is selected to determine the SARIMAX model parameters; the data is fitted, and the input is water quality parameter data, and the exogenous variables are whether it is a holiday, temperature, wind speed, and rainfall; the output is the residual; the output residual is used for LSTM model training; the LSTM model is trained using the residual data; the past 10 consecutive residual values ​​are used as the input of the LSTM model to predict the next residual; the water quality parameter data predicted by the SARIMAX model and the residual predicted by the LSTM model are summed to obtain the water quality parameter data prediction result; the above steps are repeated to obtain the prediction result of each water quality parameter data. Preferably, the SARIMAX and LSTM models are integrated in the module, and the model is updated every 10 seconds through historical data training to predict the changes of water quality parameters in the next 15 minutes in real time.

[0183] The fan control module includes a corresponding rule storage module; the corresponding rule storage module is used to store each water quality parameter data and fuzzy subset of the fan frequency; the fan module obtains the prediction result of the water quality parameter data, then parses the fan frequency corresponding to the water quality parameter data by calling the corresponding rule storage module, and sends a fan frequency signal to the aeration fan.

[0184] The fan control module also includes a corresponding rule adaptive adjustment module, which is used to: define a gene code for each corresponding rule; initialize and generate a population; define a fitness function; the greater the fitness, the more ideal the corresponding rule effect; the fitness function formula is:

[0185]

[0186] Among them, Y S Represents the water quality parameter data after treatment, Y M Represents target water quality parameter data; ∑|Y S -Y M | means taking the absolute value of the difference between each type of water quality parameter data after processing and the target water quality parameter data of this type and then summing them. The corresponding rule set is optimized through selection, crossover and mutation operations; the corresponding rules of the water quality parameter fuzzy subset and the fan frequency fuzzy subset are updated in the corresponding rule storage module.

[0187] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.

Claims

1. A method for predicting water quality parameters for sewage treatment, characterized in that: Acquire water quality data, including historical water quality parameter data; construct a SARIMAX model, and use ACF and PACF graphs combined with actual data to determine initial parameters (p, d, q) and (P, D, Q, s); Optimize parameters through model evaluation (AIC / BIC), use nested loops to combine all parameters and evaluate the AIC / BIC value of each group of parameters, select the combination with the smallest AIC or BIC value and determine it as the SARIMAX model parameters; fit the data and output the residual for LSTM model training; Use residuals to train the LSTM model; use the past multiple consecutive residual values ​​as input to the LSTM model to predict the next residual; The water quality parameters predicted by the SARIMAX model and the residuals predicted by the LSTM model are summed to obtain the water quality prediction result, and the water quality prediction result is output.

2. A method for predicting sewage quality parameters according to claim 1, characterized in that: The water quality parameter data includes one or more of flow rate, chemical oxygen demand, ammonia nitrogen, total nitrogen, and dissolved oxygen; obtaining historical water quality parameter data also includes excluding abnormal data and filling in missing data; The method to exclude abnormal data is as follows: Sort the data of each water quality parameter, calculate the first quartile Q1 and the third quartile Q3; calculate the interquartile range IQR = Q3-Q1; set the upper limit to Q3+1.5×IQR and the lower limit to Q1-1.5×IQR; exclude water quality parameters that exceed the upper limit and are below the lower limit; Missing data were filled by using the linear trend before and after the missing data.

3. A method for predicting sewage quality parameters according to claim 1, characterized in that: The water quality data also includes holiday data and meteorological data; the meteorological data includes temperature, wind speed and rainfall; in the process of constructing the SARIMAX model to fit the data, the input data is water quality parameter data, and the exogenous variables are whether it is a holiday, temperature, wind speed, and rainfall; when predicting the next residual, the past ten consecutive residual values ​​are used as the input of the LSTM model for prediction.

4. A method for controlling the frequency of a sewage treatment fan, characterized in that: S1 obtains water quality data; the water quality data includes holiday data, meteorological data and historical water quality parameter data; meteorological data includes temperature, wind speed and rainfall; water quality parameter data includes flow, chemical oxygen demand, ammonia nitrogen, total nitrogen and dissolved oxygen; S2 builds the SARIMAX model and uses ACF and PACF plots combined with actual data to determine the initial parameters (p, d, q) and (P, D, Q, s); optimizes the parameters through model evaluation (AIC / BIC), uses nested loops to combine all parameters and evaluates the AIC / BIC value of each group of parameters, and selects the combination with the smallest AIC or BIC value to determine as the SARIMAX model parameters; S3 fits data. The input is water quality parameter data. The exogenous variables are whether it is a holiday, temperature, wind speed, and rainfall. The output is residual. The output residual is used for LSTM model training. The LSTM model is trained using residual data. The past 10 consecutive residual values ​​are used as the input of the LSTM model to predict the next residual. S4 sums the water quality parameter data predicted by the SARIMAX model and the residual predicted by the LSTM model to obtain the prediction result of the water quality parameter data; S5 repeats steps S2 to S4 to obtain prediction results for each water quality parameter data; S6 sends the prediction results of the water quality parameter data to the aeration fan, so that the aeration fan can control the fan frequency according to the prediction results.

5. A sewage treatment fan frequency control method according to claim 4, characterized in that: Obtain historical water quality parameter data, including the elimination of abnormal data and filling in missing data; The method to exclude abnormal data is as follows: Sort the data of each water quality parameter, calculate the first quartile Q1 and the third quartile Q3; calculate the interquartile range IQR = Q3-Q1; set the upper limit to Q3+1.5×IQR and the lower limit to Q1-1.5×IQR; exclude water quality parameters that exceed the upper limit and are below the lower limit; Missing data were filled by using the linear trend before and after the missing data.

6. A sewage treatment fan frequency control method according to claim 4, characterized in that: The aeration fan frequency control by prediction results includes the following steps: Obtaining a fuzzy set of each water quality parameter data and fan frequency; the fuzzy set includes multiple fuzzy subsets; Obtain the corresponding rule set of the fuzzy subsets of water quality parameters and the fuzzy subsets of fan frequency; Obtain the prediction results of water quality parameter data, and determine the fuzzy subset to which the prediction results of water quality parameter data belong; The fan frequency corresponding to the water quality parameter is parsed according to the corresponding rule set of the water quality parameter fuzzy subset and the fan frequency fuzzy subset, and the fan frequency signal is sent to the aeration fan.

7. A sewage treatment fan frequency control method according to claim 6, characterized in that: The invention also includes an adaptive adjustment method for adjusting the correspondence rules between the fuzzy subsets of water quality parameters and the fuzzy subsets of fan frequency by using a genetic algorithm, wherein the adaptive adjustment method includes the following steps: Define the gene code for each corresponding rule; Initialize and generate the population; Define the fitness function; the greater the fitness, the more ideal the corresponding rule effect; the fitness function formula is: Among them, Y S Represents the water quality parameter data after treatment, Y M Represents target water quality parameter data; ∑|Y S -Y M | means taking the absolute value of the difference between each water quality parameter data after treatment and the target water quality parameter data of this type and then summing them up; Optimize the corresponding rule set through selection, crossover and mutation operations; Update the correspondence rules between the fuzzy subsets of water quality parameters and the fuzzy subsets of fan frequencies.

8. A sewage treatment fan frequency control system, characterized in that: include: A data acquisition module, the data acquisition module is used to acquire water quality data; the water quality data includes holiday data, meteorological data and historical water quality parameter data; meteorological data includes temperature, wind speed and rainfall; water quality parameter data includes flow, chemical oxygen demand, ammonia nitrogen, total nitrogen and dissolved oxygen; A water quality prediction module is used to construct a SARIMAX model, and the initial parameters (p, d, q) and (P, D, Q, s) are determined by using ACF and PACF diagrams in combination with actual data; the parameters are optimized by model evaluation (AIC / BIC), and all parameters are combined using nested loops and the AIC / BIC values ​​of each group of parameters are evaluated, and the combination with the smallest AIC or BIC value is selected to determine the SARIMAX model parameters; the data is fitted, and the input is water quality parameter data, and the exogenous variables are whether it is a holiday, temperature, wind speed, and rainfall; the output is the residual; the output residual is used for LSTM model training; the LSTM model is trained using the residual data; the past 10 consecutive residual values ​​are used as the input of the LSTM model to predict the next residual; the water quality parameter data predicted by the SARIMAX model and the residual predicted by the LSTM model are summed to obtain the water quality parameter data prediction result; Repeat the above steps to obtain the prediction results of each water quality parameter data; The fan control module is used to receive the prediction results of the water quality parameter data and send a frequency control signal to the aeration fan.

9. A sewage treatment fan frequency control system according to claim 8, characterized in that: The fan control module includes a corresponding rule storage module; The corresponding rule storage module is used to store fuzzy sets of each water quality parameter data and fan frequency; the fuzzy set includes multiple fuzzy subsets; and the corresponding rules of the water quality parameter fuzzy subsets and the fan frequency fuzzy subsets; A fan control module is used to obtain the prediction results of water quality parameter data; Determine the fuzzy subset to which the prediction results of water quality parameter data belong; The fan frequency corresponding to the water quality parameter data is parsed by calling the corresponding rule storage module, and a fan frequency signal is sent to the aeration fan.

10. A sewage treatment fan frequency control system according to claim 9, characterized in that: The fan control module further includes a corresponding rule adaptive adjustment module, wherein the rule adaptive adjustment module is used to: Define the gene code for each corresponding rule; Initialize and generate the population; Define the fitness function; the greater the fitness, the more ideal the corresponding rule effect; the fitness function formula is: Among them, Y S Represents the water quality parameter data after treatment, Y M Represents target water quality parameter data; ∑|Y S -Y M | means taking the absolute value of the difference between each water quality parameter data after treatment and the target water quality parameter data of this type and then summing them up; Optimize the corresponding rule set through selection, crossover and mutation operations; The corresponding rules between the fuzzy subsets of water quality parameters and the fuzzy subsets of fan frequencies are updated in the corresponding rule storage module.

Citation Information

Patent Citations

  • Method and device for optimizing fuzzy controller of fan on basis of genetic algorithm

    CN110543101A

  • RF-HW water quality index hybrid prediction method based on meteorological factors

    CN112819244A

  • Sewage treatment plant prediction planning operation management method based on peripheral data

    CN113033917A

  • River water quality prediction method based on SARIMA-LSTM

    CN113887119A

  • Intelligent aeration method and system for sewage treatment based on artificial intelligence

    CN116956156A