Method and system for calculating oxygen demand of aeration tank of sewage plant
By identifying and correcting abnormalities in sewage treatment data, performing polynomial fitting and calculating oxygen demand based on the actual flow value, the problem of low accuracy in the calculation of oxygen demand in the prior art is solved, and more efficient aeration system control and energy consumption optimization are achieved.
Patent Information
- Application Number
- CN202510154473.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-06-24
AI Technical Summary
The prior art has problems of data instability and low calculation accuracy in the calculation of oxygen demand in the aeration tank of sewage plants, and it is difficult to adapt to real-time changes in sewage water quality.
By obtaining the initial timing data of each indicator of the aeration tank sewage treatment, identifying and correcting the abnormal data, performing polynomial fitting to obtain the predicted value, and calculating the oxygen demand based on the actual flow value.
The accuracy of the calculation of oxygen demand in the aeration tank of the sewage plant has been improved, the ability to capture dynamic changes in the sewage treatment process has been enhanced, and the precise control and energy consumption optimization of the aeration system has been ensured.
Smart Images

Figure CN120199357A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sewage treatment, and particularly to a method and system for calculating the oxygen demand of an aeration tank in a sewage treatment plant. Background Art
[0002] In the current sewage treatment process, the calculation of the oxygen demand of the aeration tank is an important link to ensure the treatment effect and optimize energy consumption. However, due to the dynamic changes in sewage quality indicators and process operation parameters, and the measurement data is often affected by environmental interference, sensor errors, and abnormal fluctuations, resulting in high data instability during the calculation process, thus affecting the accuracy of the oxygen demand estimation and making it impossible to achieve efficient aeration control. Existing technologies usually use fixed formulas or empirical models to calculate the oxygen demand. Some of these methods set fixed parameters based on static working conditions and are difficult to adapt to the real-time changes in sewage quality. Another type of method directly inputs real-time measurement data into the calculation model, but does not fully consider data anomalies, making the calculation results vulnerable to noise and short-term fluctuations, resulting in a large deviation in the calculated oxygen demand.
[0003] Therefore, how to improve the accuracy of calculating the oxygen demand of the aeration tank in a sewage treatment plant has become a technical problem that urgently needs to be solved. Summary of the Invention
[0004] The present invention provides a method, system, electronic device, and storage medium for calculating the oxygen demand of an aeration tank in a sewage treatment plant to solve the defects in the prior art and effectively improve the accuracy of calculating the oxygen demand of the aeration tank in a sewage treatment plant.
[0005] The present invention provides a method for calculating the oxygen demand of an aeration tank in a sewage treatment plant, including the following steps: Obtain the initial time series data of each index for the sewage treatment in the aeration tank; For any one of the indexes, identify and correct the abnormal data in the corresponding initial time series data to obtain corrected time series data; For any one of the indexes, perform polynomial fitting on the corresponding corrected time series data to obtain a predicted value; Obtain the actual value of the flow rate for the sewage treatment in the aeration tank; Calculate the oxygen demand for the sewage treatment in the aeration tank according to the predicted values of all the indexes and the actual value of the flow rate.
[0006] According to the method for calculating the oxygen demand of an aeration tank in a sewage treatment plant provided by the present invention, the performing polynomial fitting on the corresponding corrected time series data to obtain a predicted value specifically includes: Select a local sampling window from the corrected time series data, and respectively form an observation value vector and a design matrix according to the observed values and the corresponding sampling times within the local sampling window; Perform least squares solution on the observed value vector and the design matrix to obtain the polynomial coefficient vector; Multiply the polynomial coefficient vector by the design matrix to obtain the fitted value vector; Take the fitted value corresponding to the next time period or the target time in the fitted value vector as the predicted value.
[0007] According to a method for calculating the oxygen demand of an aeration tank in a sewage treatment plant provided by the present invention, selecting a local sampling window from the corrected time series data, and respectively forming an observed value vector and a design matrix according to the observed values and the corresponding sampling times within the local sampling window specifically includes: Select n sampling points before and after the central time point t, and intercept a local sampling window with a length of 2n + 1 from the corrected time series data; Arrange the observed values within the local sampling window in the sampling order to form the observed value vector X; Record the sampling time of each sampling point within the time series window as τi, and construct a design matrix B, where the number of rows of the design matrix is the same as the length of the observed value vector, and each row corresponds to a sampling time τi; the number of columns of the design matrix is a positive integer k, and all elements in the first column are constants 1, which are used for fitting the constant term of the polynomial; the element in the m-th column of the i-th row of the design matrix is equal to the (m - 1)-th power of τi, and m is a positive integer between 2 and k.
[0008] According to a method for calculating the oxygen demand of an aeration tank in a sewage treatment plant provided by the present invention, performing least squares solution on the observed value vector and the design matrix to obtain the polynomial coefficient vector specifically includes: Construct an initial coefficient vector A, where the initial coefficient vector successively includes the coefficients from the constant term coefficient to the (k - 1)-th power term coefficient; According to the initial coefficient vector A, the observed value vector X, and the design matrix B, solve by the least squares method to satisfy The smallest polynomial coefficient vector.
[0009] According to a method for calculating the oxygen demand of an aeration tank in a sewage treatment plant provided by the present invention, the indicators include the BOD5 concentration of the influent of the aeration tank, the BOD5 concentration of the effluent of the aeration tank, the total Kjeldahl nitrogen concentration of the influent of the aeration tank, the total Kjeldahl nitrogen concentration of the effluent of the aeration tank, the sludge concentration of the aeration tank, the flow rate of the excess sludge discharge, the concentration of the excess sludge discharge, the total nitrogen concentration of the influent of the aeration tank, the nitrate concentration of the effluent of the aeration tank, the sludge return ratio, the dissolved oxygen concentration of the sludge return, the mixed liquor return ratio, and the dissolved oxygen concentration of the mixed liquor return.
[0010] A method for calculating the oxygen demand of an aeration tank in a sewage treatment plant provided by the present invention calculates the oxygen demand for sewage treatment in the aeration tank according to the predicted values of all the above indicators and the actual value of the flow rate, specifically including: Calculate the oxygen demand for sewage treatment in the aeration tank through the following formula: O d =a×[Q×(F Si -F Se )]+b×[Q×(F Nki -F Nke )]+c×[Q×F X -F Qv ×F Xv -d×[Q×(F Nti -F NKe -F Noe )-e×F Qv ×F Xv -f×[Q×F R ×F DR -g×[Q×F r ×F Di ; In the formula, O d is the oxygen demand for sewage treatment in the aeration tank, Q is the actual value of the flow rate, F Si is the predicted value of the BOD5 concentration of the influent water of the aeration tank, F Se is the predicted value of the BOD5 concentration of the effluent water of the aeration tank, F Nki is the predicted value of the total Kjeldahl nitrogen concentration of the influent water of the aeration tank, F NKe is the predicted value of the total Kjeldahl nitrogen concentration of the effluent water of the aeration tank, F X is the predicted value of the sludge concentration of the aeration tank, F Qv is the predicted value of the flow rate of the excess sludge discharge, F Xv is the predicted value of the excess sludge discharge concentration, F Nti is the predicted value of the total nitrogen concentration of the influent water of the aeration tank, F Noe is the predicted value of the nitrate concentration of the effluent water of the aeration tank, F R is the predicted value of the sludge return ratio, F DR is the predicted value of the dissolved oxygen concentration of the sludge return, F r is the predicted value of the mixed liquor return ratio, F Di is the predicted value of the dissolved oxygen concentration of the mixed liquor return, a is the oxygen demand coefficient for oxidizing each kilogram of BOD5, b is the oxygen demand coefficient for oxidizing each kilogram of ammonia nitrogen, c is the endogenous respiration equivalent coefficient of cells, d is the ammonia nitrogen oxidation conversion coefficient, e is the nitrogen content conversion coefficient of excess sludge, f is the dissolved oxygen conversion coefficient of sludge return cells, and g is the dissolved oxygen conversion coefficient of mixed liquor return sludge.
[0011] A method for calculating the oxygen demand of an aeration tank in a sewage treatment plant provided by the present invention, wherein identifying and correcting abnormal data in the corresponding initial time series data to obtain corrected time series data specifically includes: Determine the potential influencing factors corresponding to each data point in the initial time series data; Calculate the first average value of all the data points and the second average value of all the potential influencing factors; For any one of the data points, calculate the Pearson correlation coefficient according to the corresponding potential influencing factor, the first average value, and the second average value; Eliminate the data points whose Pearson correlation coefficients are not within the preset range to obtain the corrected time series data.
[0012] The present invention also provides a system for calculating the oxygen demand of an aeration tank in a sewage treatment plant, including the following modules: An acquisition module, configured to acquire the initial time series data of each index for sewage treatment in the aeration tank; A first processing module, configured to identify and correct abnormal data in the corresponding initial time series data for any one of the indexes to obtain corrected time series data; The first processing module is further configured to perform polynomial fitting on the corresponding corrected time series data for any one of the indexes to obtain a predicted value; The acquisition module is further configured to acquire the actual value of the flow rate of sewage treatment in the aeration tank; A second processing module, configured to calculate the oxygen demand for sewage treatment in the aeration tank according to the predicted values of all the indexes and the actual value of the flow rate.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, it implements the method for calculating the oxygen demand of an aeration tank in a sewage treatment plant as described in any one of the above.
[0014] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the method for calculating the oxygen demand of an aeration tank in a sewage treatment plant as described in any one of the above.
[0015] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the method for calculating the oxygen demand of an aeration tank in a sewage treatment plant as described in any one of the above.
[0016] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: By obtaining the initial time-series data of various indicators for the sewage treatment in the aeration tank, the changes of key process parameters in the sewage treatment process can be comprehensively grasped, providing a complete data basis for subsequent calculations and ensuring the accuracy and real-time nature of the oxygen demand calculation. For any indicator, by identifying and correcting the abnormal data in the corresponding initial time-series data, the corrected time-series data can be obtained, effectively eliminating data anomalies caused by sensor errors, environmental interference, or sudden working conditions, reducing the influence of noise, making the input data more stable, and providing high-quality data input for the oxygen demand calculation. For any indicator, by performing polynomial fitting on the corresponding corrected time-series data, the predicted value can be obtained, thereby smoothing the short-term fluctuations of the data, improving the ability to capture the trend of the indicator, making the predicted value more in line with the actual dynamic changes in the sewage treatment process, and enhancing the accuracy of the oxygen demand calculation. By obtaining the actual value of the flow rate for the sewage treatment in the aeration tank, it is ensured that the oxygen demand calculation can fully consider the changes in the sewage treatment load, making the calculation result more adaptable, avoiding errors caused by the fixed flow rate assumption, and improving the flexibility of the aeration system regulation. By calculating the oxygen demand for the sewage treatment in the aeration tank based on the predicted values of all indicators and the actual value of the flow rate, the accuracy of the oxygen demand calculation for the aeration tank in the sewage treatment plant can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 FIG. is one of the schematic flowcharts of the method for calculating the oxygen demand of the aeration tank in the sewage treatment plant provided by the present invention.
[0019] Figure 2 FIG. is another schematic flowchart of the method for calculating the oxygen demand of the aeration tank in the sewage treatment plant provided by the present invention.
[0020] Figure 3 FIG. is yet another schematic flowchart of the method for calculating the oxygen demand of the aeration tank in the sewage treatment plant provided by the present invention.
[0021] Figure 4 FIG. is still another schematic flowchart of the method for calculating the oxygen demand of the aeration tank in the sewage treatment plant provided by the present invention.
[0022] Figure 5 FIG. is yet another schematic flowchart of the method for calculating the oxygen demand of the aeration tank in the sewage treatment plant provided by the present invention.
[0023] Figure 6It is a schematic structural diagram of an oxygen demand calculation system for an aeration tank in a sewage treatment plant provided by the present invention.
[0024] Figure 7 It is a schematic structural diagram of an electronic device provided by the present invention. Detailed implementation manners
[0025] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the protection scope of the present invention.
[0026] It should be noted that in the description of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitations, an element defined by the phrase "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element. The orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the system or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus cannot be construed as a limitation of the present invention. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0027] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and do not limit the number of objects. For example, the first object can be one or multiple. In addition, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates an "or" relationship between the associated objects before and after.
[0028] The following will be combined with Figures 1 - 7 Describe the oxygen demand calculation method, system, electronic device and storage medium for an aeration tank in a sewage treatment plant provided by the present invention.
[0029] Figure 1It is one of the flow schematic diagrams of the method for calculating the oxygen demand of the aeration tank provided by the present invention. As Figure 1 shown, it includes but is not limited to the following steps: Step 101: Obtain the initial time-series data of each index for the sewage treatment in the aeration tank.
[0030] In the treatment of the aeration tank in the sewage treatment plant, the prerequisite for accurately calculating the oxygen demand is to accurately master the time-series data of each key index in the sewage treatment process of the aeration tank. Therefore, in Step 101, it is first necessary to obtain the initial time-series data of each index for the sewage treatment in the aeration tank to ensure the integrity and reliability of the basic data for subsequent data processing, prediction, and calculation. Since the influent, effluent, and process operation status in the sewage treatment process are highly dynamic, these indexes not only change with time but are also affected by various external factors. Therefore, directly using the original data for oxygen demand calculation may lead to calculation errors and even deviation accumulation, thus affecting the accuracy of aeration control and energy consumption optimization. Therefore, reasonably obtaining and organizing these initial time-series data is the first step of the entire technical solution and the key to ensuring data quality and calculation accuracy.
[0031] In a possible implementation manner, the indexes include the BOD5 concentration of the influent of the aeration tank, the BOD5 concentration of the effluent of the aeration tank, the total Kjeldahl nitrogen concentration of the influent of the aeration tank, the total Kjeldahl nitrogen concentration of the effluent of the aeration tank, the sludge concentration of the aeration tank, the flow rate of the excess sludge discharge, the concentration of the excess sludge discharge, the total nitrogen concentration of the influent of the aeration tank, the nitrate concentration of the effluent of the aeration tank, the sludge return ratio, the dissolved oxygen concentration of the sludge return, the mixed liquor return ratio, and the dissolved oxygen concentration of the mixed liquor return.
[0032] To ensure the availability and timeliness of the data, all these indexes need to be continuously collected at a set time interval to form a complete time series and stored in a database or a data cache module for subsequent data cleaning, outlier processing, and prediction calculation.
[0033] In actual operation, the collection of the initial time-series data usually depends on the existing sensor network in the sewage treatment plant, including equipment such as water quality monitors, flow meters, and dissolved oxygen sensors. These devices regularly collect the values of each index through online monitoring and transmit the data to the data storage end through an industrial control system (such as a SCADA system or a PLC control unit). To improve the stability and consistency of the data, the time interval for data recording can be set during the collection process, for example, sampling is carried out in units of 5 minutes or 10 minutes to ensure that the data can reflect the dynamic changes in the sewage treatment process. In addition, some monitoring indexes such as the sludge return ratio or the mixed liquor return ratio are calculated from the process parameters of the aeration tank, so the relevant calculated values need to be synchronously obtained through the process control system to ensure the consistency of all index data.
[0034] Step 102: For any one index, identify and correct the abnormal data in the corresponding initial time-series data to obtain corrected time-series data.
[0035] In the treatment of the aeration tank in a sewage treatment plant, the initial time-series data of each index obtained are often affected by sensor errors, environmental disturbances, and process fluctuations, and may contain abnormal data, such as mutations, losses, or values that do not conform to the actual situation. If the unprocessed data are directly used for the calculation of oxygen demand, it will not only reduce the calculation accuracy but also may lead to misregulation of the aeration system and increase energy consumption. Therefore, in Step 102, it is necessary to identify and correct the abnormal data in the initial time-series data of any one index to obtain more stable and accurate corrected time-series data, so as to provide high-quality input data for subsequent prediction models and oxygen demand calculations.
[0036] In a possible implementation manner, referring to Figure 2 , Figure 2 is the second flow schematic diagram of the method for calculating the oxygen demand of the aeration tank in a sewage treatment plant provided by the present invention. As Figure 2 shown, Step 102 specifically includes Steps 201-204: Step 201: Determine the potential influencing factors corresponding to each data point in the initial time-series data.
[0037] Step 202: Calculate the first average value of all data points and the second average value of all potential influencing factors.
[0038] Step 203: For any one data point, calculate the Pearson correlation coefficient according to the corresponding potential influencing factor, the first average value, and the second average value.
[0039] Step 204: Eliminate the data points whose Pearson correlation coefficients are not within the preset range to obtain corrected time-series data.
[0040] Specifically, in Step 201, in order to accurately judge whether a data point is abnormal, it is first necessary to determine the potential influencing factors of this data point. For each index, it will be affected by other relevant process parameters during the sewage treatment process. For example, the influent BOD5 concentration in the aeration tank may be affected by factors such as the effluent BOD5 concentration, the sludge return ratio, and the sludge concentration. Therefore, by analyzing the sewage treatment process flow, multiple relevant potential influencing factors can be determined for each data point, so that the identification of abnormal values not only depends on the fluctuation of the data point itself but also can be judged in combination with the change trends of other indexes. After determining the potential influencing factors, in Step 202, it is necessary to calculate the first average value of all data points and the second average value of all potential influencing factors, where the first average value is used to measure the overall level of the target data, and the second average value is used to measure the overall level of the potential influencing factors to provide a reference benchmark for anomaly detection.
[0041] In step 203, based on the calculated first average value and second average value, the Pearson correlation coefficient is used to measure the correlation between the data points and their potential influencing factors. The Pearson correlation coefficient can reflect the linear relationship between two variables, and its value range is between -1 and 1. A value close to 1 indicates a positive correlation, a value close to -1 indicates a negative correlation, and a value close to 0 indicates almost no correlation. For any data point, the Pearson correlation coefficient between it and the corresponding potential influencing factor can be calculated, and based on this correlation, it can be determined whether the data point conforms to the overall data trend. If the correlation between the data point and its potential influencing factor is low, it may indicate that the data point is an outlier and further screening is required. In step 204, the data points whose Pearson correlation coefficients are not within the preset range are removed to form corrected time-series data. Usually, this preset range can be obtained based on historical data statistics. For example, the threshold range is set as [-1, 1]. When the Pearson correlation coefficient of a certain data point exceeds this range, it is determined as abnormal data and removed. For the removed data points, methods such as linear interpolation or historical trend fitting can be used to complete them to ensure the continuity and integrity of the data.
[0042] Through the above method, abnormal data caused by measurement errors, sensor failures, or short-term fluctuations can be effectively identified and removed, thereby improving the quality of the sewage treatment time-series data. Compared with the traditional simple threshold judgment method, this method not only considers the change trend of the data itself but also combines the multi-factor correlation in the sewage treatment process, making the detection of abnormal data more accurate and avoiding the occurrence of mis-removal and mis-judgment. Finally, by obtaining high-quality corrected time-series data, the accuracy of subsequent polynomial fitting prediction can be improved, ensuring that the oxygen demand calculation is more in line with the actual working conditions, providing more reliable data support for the precise control of the aeration tank system, making the aeration adjustment more scientific and reasonable, reducing energy consumption, and improving the sewage treatment efficiency.
[0043] Step 103: For any index, perform polynomial fitting on the corresponding corrected time-series data to obtain a predicted value.
[0044] During the calculation of the oxygen demand in the aeration tank of a sewage treatment plant, there are still short-term fluctuations in the time-series data of each index after abnormal identification and correction. This kind of fluctuation may come from environmental changes, measurement noise, or instantaneous disturbances in the sewage treatment process. If the corrected time-series data is directly used for oxygen demand calculation, the short-term fluctuations may cause the calculation results to be unstable and affect the precise control of the aeration system. Therefore, in step 103, it is necessary to perform polynomial fitting on the corrected time-series data to obtain a smoothed predicted value to reduce data noise and improve the stability and accuracy of the calculation.
[0045] In a possible implementation, referring to Figure 3 ,Figure 3 This is the third schematic flow chart of the calculation method for the oxygen demand of the aeration tank in a sewage treatment plant provided by the present invention. As Figure 3 shown, step 103 specifically includes steps 301-304: Step 301: Select a local sampling window from the corrected time series data, and respectively form an observation value vector and a design matrix according to the observed values and corresponding sampling times within the local sampling window.
[0046] During the calculation of the oxygen demand of the aeration tank in a sewage treatment plant, although the abnormal values have been removed from the corrected time series data, there may still be certain short-term fluctuations and non-linear trends. In order to accurately obtain the predicted values of each index and provide more stable input data in the calculation of the oxygen demand, it is necessary to select a local sampling window from the corrected time series data in step 301, and respectively form an observation value vector and a design matrix according to the observed values and corresponding sampling times within this window. This can ensure that the fitting process not only takes into account the change trend of historical data, but also can establish a trend prediction model that better conforms to the actual working conditions through polynomial fitting, improving the accuracy and stability of the predicted values.
[0047] In a possible implementation manner, referring to Figure 4 , Figure 4 This is the fourth schematic flow chart of the calculation method for the oxygen demand of the aeration tank in a sewage treatment plant provided by the present invention. As Figure 4 shown, step 301 specifically includes steps 401-403: Step 401: Select n sampling points before and after the central time point t, and intercept a local sampling window with a length of 2n + 1 from the corrected time series data.
[0048] Step 402: Arrange the observed values within the local sampling window in the sampling order to form an observation value vector X.
[0049] Step 403: Denote the sampling times of each sampling point within the time series window as τ i , and construct a design matrix B, where the number of rows of the design matrix is the same as the length of the observation value vector, and each row corresponds to a sampling time τ i ; the number of columns of the design matrix is a positive integer k, and the first column is all constants 1, which is used for the constant term of the fitting polynomial; the element in the m-th column of the i-th row of the design matrix is equal to τ i to the (m - 1) power, where m is a positive integer between 2 and k.
[0050] During the calculation of the oxygen demand in the aeration tank of the sewage treatment plant, although the corrected time-series data has removed outliers, it is still affected by short-term fluctuations, environmental disturbances, and measurement errors. Directly using these data for prediction may lead to unstable fitting results, thus affecting the accuracy of the oxygen demand calculation. To further optimize the data quality and improve the smoothness and stability of the predicted values, in steps 401 to 403, a local sampling window needs to be extracted from the corrected time-series data and polynomial fitting is performed based on the Savitzky-Golay filter to reduce the impact of noise on the calculation results and more accurately capture the temporal variation trend of the data.
[0051] Specifically, first, in step 401, the current time t is determined as the central time point, and n sampling points are selected before and after it respectively to intercept a local sampling window of length 2n + 1 from the corrected time-series data. Selecting the data before and after the central time point is to ensure that the trend of historical data and current data can be considered simultaneously during the fitting process, thus avoiding biases caused by unilateral data. The setting of the window length 2n + 1 needs to balance the requirements of data smoothness and real-time performance. If the window is too short, the trend may not be effectively captured, while if the window is too long, excessive historical noise may be introduced. Therefore, it is crucial to reasonably set the size of n according to the data characteristics and calculation requirements.
[0052] Using the Savitzky-Golay filter for the filtering process of observations at a given time series point, this filter uses order polynomial for the following fitting: ; where t is the time function and a is the variable coefficient.
[0053] After obtaining the local sampling window, in step 402, all the observations within the window need to be arranged in the sampling order to form an observation vector X, so that this vector can accurately reflect the data situation at each sampling moment in the time series. The observation vector X can be expressed by the following formula: ; The observation vector X, as the target value of the least squares fitting, directly affects the accuracy of the fitting result.
[0054] Subsequently, in step 403, to perform the polynomial fitting calculation, the sampling moments of each sampling point within the local sampling window need to be structured and a design matrix B is constructed, such that the number of rows of B is the same as the length of the observation vector X, and each row corresponds to a sampling moment. The first column of the design matrix B is all set to the constant 1 for the constant term of the fitting polynomial, and the element in the m-th column and the i-th row is set to the corresponding sampling moment τ ito the power of (m - 1), where τ1 = t - n, τ2 = t - n + 1, …… τ 2n+1 = t + n), and m ranges from 2 to k, ensuring that the design matrix can support polynomial fittings of different orders. The construction method of this matrix ensures that the time characteristics of different time series points can be effectively mapped into the polynomial fitting model, enabling subsequent calculations to make full use of the time series information of the data and improving the fitting accuracy.
[0055] The design matrix B can be expressed by the following formula: .
[0056] Step 302: Perform a least squares solution on the observation value vector and the design matrix to obtain the polynomial coefficient vector.
[0057] In the process of calculating the oxygen demand of the aeration tank in the sewage treatment plant, after the correction time series data passes through the selection of the local sampling window and the construction of the design matrix, it is necessary to solve the polynomial coefficient vector by the least squares method to ensure that the fitting result can optimally approximate the data trend and reduce the influence of noise. Therefore, in step 302, based on the constructed observation value vector and design matrix, calculate the optimal polynomial coefficient vector, so that the subsequent fitting process can more accurately reflect the dynamic change trend of each index in the sewage treatment process and improve the stability and accuracy of the predicted value.
[0058] In a possible implementation manner, referring to Figure 5 , Figure 5 is the fifth flow chart of the method for calculating the oxygen demand of the aeration tank in the sewage treatment plant provided by the present invention. As Figure 5 shown, step 302 specifically includes steps 501 - 502: Step 501: Construct the initial coefficient vector A, where the initial coefficient vector sequentially includes the constant term coefficient to the (k - 1) - th power term coefficient.
[0059] Step 502: According to the initial coefficient vector A, the observation value vector X, and the design matrix B, solve by the least squares method to satisfy the smallest polynomial coefficient vector.
[0060] The initial coefficient vector A can be expressed by the following formula: ; Since , where is the error. Therefore, let , that is .
[0061] Subsequently, in step 502, solve based on the least squares method to satisfy The smallest polynomial coefficient vector A. The core of this solution process lies in minimizing the sum of squares of the error matrix , and taking the partial derivative of S to solve for it, minimizing the error, that is: ; ; Thus, the optimal polynomial coefficient vector is obtained. Therefore, the smallest polynomial coefficient vector can be expressed as , where B is the constructed design matrix, X is the vector of observed values, is the transpose of matrix B, represents the inverse matrix of the design matrix.
[0062] This calculation process ensures that the fitting model can make full use of the observed data within the local time window, enabling the obtained coefficients to accurately represent the variation law of the data and having a certain anti-noise ability.
[0063] Through the processing of steps 501 to 502, the finally obtained polynomial coefficient vector can minimize the data fitting error to the greatest extent, enabling the observed values within the local time window to be more accurately described, while avoiding the loss of data information that may be caused by traditional filtering methods. Compared with simple interpolation or moving average methods, this method can not only effectively retain the trend characteristics of time series data, but also provide a smoother and more accurate fitting result while reducing noise interference. Finally, through this optimization solution process, the obtained polynomial coefficient vector will be used to calculate the fitting value vector, and further used to predict the future change trend of the process parameters of the aeration tank, making the calculation of oxygen demand more accurate, ensuring the more stable control of the aeration system, thereby reducing energy consumption and improving the overall operation efficiency of the sewage treatment system.
[0064] Step 303: Multiply the polynomial coefficient vector by the design matrix to obtain the fitting value vector.
[0065] Specifically, based on the optimal polynomial coefficient vector A calculated in step 502, it is necessary to perform matrix multiplication with the design matrix B to obtain the fitting value vector F, that is . In this calculation process, the fitting value of each time series point is calculated by the corresponding polynomial model. This fitting curve can maintain the global trend of the data to the greatest extent, while smoothing the local short-term fluctuations, enabling the fitting result to more accurately describe the dynamic change characteristics of various process parameters in the sewage treatment process.
[0066] Compared with directly using the original time series data for oxygen demand calculation, this method ensures the stability of the calculation input data through polynomial fitting and least squares optimization, reduces the influence of short-term noise in the data, and makes the calculation result more accurate and reliable.
[0067] Step 304: Use the fitted value in the fitted value vector corresponding to the next time period or the target time as the predicted value.
[0068] Specifically, after completing the polynomial fitting and calculating the fitted value vector F, the extraction method of the predicted value needs to be determined. Generally, the predicted value can be selected as the fitted value at the corresponding next time period t+1 in the fitted value vector, or according to the system requirements, the fitted value at a specific target time t+m can be extracted. Among them, if the oxygen demand calculation depends on short-term prediction, then F(t+1) is selected as the predicted value, and if the oxygen demand calculation involves long-term regulation, then based on trend extrapolation, F(t+m) can be selected as the predicted value at the target time. The selection method of this predicted value can be adjusted according to the specific control strategy of the sewage treatment system to ensure that the calculation result matches the actual demand of the aeration system.
[0069] Compared with directly using the observed data at the current time for calculation, this method uses the smoothed data after fitting as the prediction basis, making the oxygen demand calculation more stable and avoiding the influence of short-term fluctuations on aeration control. At the same time, compared with traditional moving average or linear extrapolation methods, the predicted value extracted based on polynomial fitting can capture the data trend more accurately and effectively reduce errors, making the prediction result more in line with the dynamic change characteristics of the sewage treatment system.
[0070] In summary, through the calculations in steps 301 to 304, the predicted values of various indicators can be obtained, that is, the predicted value of the influent BOD5 concentration of the aeration tank, the predicted value of the effluent BOD5 concentration of the aeration tank, the predicted value of the influent total Kjeldahl nitrogen concentration of the aeration tank, the predicted value of the effluent total Kjeldahl nitrogen concentration of the aeration tank, the predicted value of the sludge concentration of the aeration tank, the predicted value of the excess sludge discharge flow rate, the predicted value of the excess sludge discharge concentration, the predicted value of the influent total nitrogen concentration of the aeration tank, the predicted value of the effluent nitrate concentration of the aeration tank, the predicted value of the sludge return ratio, the predicted value of the dissolved oxygen concentration of the sludge return, the predicted value of the mixed liquor return ratio, and the predicted value of the dissolved oxygen concentration of the mixed liquor return.
[0071] Step 104: Obtain the actual value of the sewage treatment flow rate in the aeration tank.
[0072] In the process of calculating the oxygen demand of the aeration tank in a sewage treatment plant, in addition to predicting various pollutant indicators, the actual value of the sewage flow rate in the aeration tank for sewage treatment is also an important input parameter for calculating the oxygen demand. During the sewage treatment process, changes in the flow rate directly affect the oxygen demand. If the calculation is based only on the predicted values of pollutant concentrations while ignoring the influence of the flow rate, it may lead to the calculation result of the oxygen demand deviating from the actual operating conditions, thereby affecting the control accuracy of the aeration system. Therefore, in step 104, it is necessary to obtain the actual value of the sewage flow rate in the aeration tank for sewage treatment to ensure that the oxygen demand calculation can dynamically adapt to the load changes of the sewage treatment system and improve the accuracy and reliability of the calculation results.
[0073] Specifically, the actual value of the sewage flow rate in the aeration tank is usually measured in real time by a flow meter and collected and stored through the automatic control system of the sewage treatment plant. During the data collection process, in order to ensure the stability of the flow rate data, it is necessary to filter the flow rate signal to reduce the error caused by sensor noise. At the same time, in order to match the time series data of other pollutant indicators, the collection interval of the flow rate data needs to be consistent with the sampling interval of the water quality indicators to ensure the time synchronization of the calculation input data.
[0074] Step 105: Calculate the oxygen demand for sewage treatment in the aeration tank based on the predicted values of all indicators and the actual value of the flow rate.
[0075] In the process of calculating the oxygen demand of the aeration tank in a sewage treatment plant, the oxygen supply needs to be accurately calculated according to the pollutant degradation demand and the sewage treatment load to ensure that the aeration system can optimize energy consumption while meeting the treatment requirements. If the calculation method cannot fully consider the removal requirements of each pollutant or only uses a fixed coefficient for estimation, it may lead to insufficient or excessive oxygen supply, affecting the sewage treatment effect and energy utilization efficiency. Therefore, in step 105, it is necessary to calculate the oxygen demand for sewage treatment in the aeration tank based on the predicted values of all pollutant indicators and the actual value of the sewage flow rate, so that the calculation result can dynamically adapt to the operating state of the sewage treatment system and provide accurate oxygen demand for the subsequent control of the aeration system.
[0076] Specifically, the oxygen demand calculation is based on the oxygen demands of organic matter oxidation, nitrogen removal, and sludge metabolism during the sewage treatment process and is calculated using the following formula: O d =a×[Q×(F Si -F Se )]+b×[Q×(F Nki -F Nke )]+c×[Q×F X -F Qv ×F Xv -d×[Q×(F Nti -F NKe -FNoe ) - e × F Qv × F Xv ) - f × [Q × F R × F DR ) - g × [Q × F r × F Di ; Wherein, O d is the oxygen demand for sewage treatment in the aeration tank (unit: kgO2 / d), Q is the actual value of the flow rate (unit: m 3 / h), F Si is the predicted value of the BOD5 concentration of the influent water of the aeration tank (unit: mg / L), F Se is the predicted value of the BOD5 concentration of the effluent water of the aeration tank (unit: mg / L), F Nki is the predicted value of the total Kjeldahl nitrogen concentration of the influent water of the aeration tank (unit: mg / L), F NKe is the predicted value of the total Kjeldahl nitrogen concentration of the effluent water of the aeration tank (unit: mg / L), F X is the predicted value of the sludge concentration of the aeration tank (unit: mg / L), F Qv is the predicted value of the flow rate of the excess sludge discharge (unit: m 3 / h), F Xv is the predicted value of the concentration of the excess sludge discharge (unit: mg / L), F Nti is the predicted value of the total nitrogen concentration of the influent water of the aeration tank (unit: mg / L), F Noe is the predicted value of the nitrate concentration of the effluent water of the aeration tank (unit: mg / L), F R is the predicted value of the sludge return ratio (unit: %), F DR is the predicted value of the dissolved oxygen concentration of the sludge return (unit: mg / L), F r is the predicted value of the mixed liquor return ratio (unit: %), F Di is the predicted value of the dissolved oxygen concentration of the mixed liquor return (unit: mg / L), a is the oxygen demand coefficient for oxidizing per kilogram of BOD5, b is the oxygen demand coefficient for oxidizing per kilogram of ammonia nitrogen, c is the endogenous respiration equivalent coefficient of cells, d is the ammonia nitrogen oxidation conversion coefficient, e is the nitrogen content conversion coefficient of the excess sludge, f is the dissolved oxygen conversion coefficient of the sludge return cells, and g is the dissolved oxygen conversion coefficient of the mixed liquor return sludge.
[0077] The parameters a to g are empirical coefficients, corresponding to the oxygen demand calculation factors for processes such as organic matter degradation, ammonia nitrogen oxidation, and sludge respiration metabolism, respectively, and can be corrected through model learning to adapt to different sewage treatment conditions. In this application, the oxygen demand coefficient a for oxidizing each kilogram of BOD5 is preferably 1.57;. The oxygen demand coefficient b for oxidizing each kilogram of ammonia nitrogen is preferably 4.57; the endogenous respiration equivalent coefficient c of cells is preferably 1.42; the ammonia nitrogen oxidation conversion coefficient d is preferably 2.83; the value range of the nitrogen content conversion coefficient e of the excess sludge is between 0.11 and 0.188, and in this application, it is preferably 0.12; the dissolved oxygen conversion coefficient f of the sludge return cells has a value range between 0.23 and 0.7, and in this application, it is preferably 0.45; the dissolved oxygen conversion coefficient g of the mixed liquor return sludge has a value range between 0.85 and 1.5, and in this application, it is preferably 1.2.
[0078] In the calculation process, first, using the predicted values of the pollutant indicators and the actual flow rate obtained, substituting them into the above oxygen demand calculation formula, and combining with the oxygen demand of each component in the sewage treatment process, calculate the total oxygen demand under the current working conditions. During the calculation process, through the predicted values of the pollutant removal concentrations, dynamically adjust the oxygen demand calculation so that the oxygen supply can match the load changes in the sewage treatment process. In addition, in order to improve the calculation accuracy, the empirical coefficients in the oxygen demand calculation formula can be adjusted using historical operation data and real-time monitoring data to make it more in line with the operating characteristics of the current sewage treatment system.
[0079] Compared with the traditional fixed empirical formula estimation method, this calculation method is based on real-time prediction data and the actual flow rate, making the oxygen demand calculation more accurate and capable of adapting to the dynamic changes of the sewage treatment system. Finally, through the processing in step 105, the calculated oxygen demand will provide key input data for the control of the aeration system, making the aeration adjustment more accurate, effectively reducing energy consumption, improving the operating efficiency of the sewage treatment system, and ensuring that the effluent quality meets the standards.
[0080] Refer to Figure 6 , Figure 6 is the structural schematic diagram of the oxygen demand calculation system for the aeration tank in the sewage treatment plant provided by the present invention. The system includes: An acquisition module for acquiring the initial time-series data of each index for sewage treatment in the aeration tank; A first processing module for identifying and correcting the abnormal data in the corresponding initial time-series data for any index to obtain corrected time-series data; The first processing module is also used for performing polynomial fitting on the corresponding corrected time-series data for any index to obtain predicted values; The acquisition module is also used for acquiring the actual flow rate of sewage treatment in the aeration tank; The second processing module is used to calculate the oxygen demand for sewage treatment in the aeration tank according to the predicted values of all indicators and the actual flow value.
[0081] In a possible implementation manner, the first processing module is further used to: Select a local sampling window from the corrected time series data, and respectively form an observation value vector and a design matrix according to the observation values and the corresponding sampling times within the local sampling window; Perform least squares solution on the observation value vector and the design matrix to obtain a polynomial coefficient vector; Multiply the polynomial coefficient vector by the design matrix to obtain a fitted value vector; Use the fitted value corresponding to the next time period or the target time in the fitted value vector as the predicted value.
[0082] In a possible implementation manner, the first processing module is further used to: Select n sampling points before and after the central time point t, and intercept a local sampling window with a length of 2n + 1 from the corrected time series data; Arrange the observation values within the local sampling window in the sampling order to form an observation value vector X; Denote the sampling times of each sampling point within the time series window as τ i , and construct a design matrix B, where the number of rows of the design matrix is the same as the length of the observation value vector, and each row corresponds to a sampling time τ i ; the number of columns of the design matrix is a positive integer k, and the first column is all constants 1, which is used for the constant term of the fitted polynomial; the element in the m-th column of the i-th row of the design matrix is equal to τ i to the (m - 1) - th power, and m is a positive integer between 2 and k.
[0083] In a possible implementation manner, the first processing module is further used to: Construct an initial coefficient vector A, where the initial coefficient vector sequentially includes the coefficients from the constant term coefficient to the (k - 1) - th power term coefficient; According to the initial coefficient vector A, the observation value vector X, and the design matrix B, solve by the least squares method to satisfy The smallest polynomial coefficient vector.
[0084] In a possible implementation manner, the second processing module is further used to: Calculate the oxygen demand for sewage treatment in the aeration tank through the following formula: O d = a×[Q×(F Si - F Se )] + b×[Q×(F Nki - F Nke )] + c×[Q×F X-F Qv ×F Xv -d×[Q×(F Nti -F NKe -F Noe )-e×F Qv ×F Xv -f×[Q×F R ×F DR -g×[Q×F r ×F Di ; In the formula, O d is the oxygen demand for sewage treatment in the aeration tank, Q is the actual value of the flow rate, F Si is the predicted value of the BOD5 concentration of the influent water of the aeration tank, F Se is the predicted value of the BOD5 concentration of the effluent water of the aeration tank, F Nki is the predicted value of the total Kjeldahl nitrogen concentration of the influent water of the aeration tank, F NKe is the predicted value of the total Kjeldahl nitrogen concentration of the effluent water of the aeration tank, F X is the predicted value of the sludge concentration of the aeration tank, F Qv is the predicted value of the flow rate of the excess sludge discharge, F Xv is the predicted value of the concentration of the excess sludge discharge, F Nti is the predicted value of the total nitrogen concentration of the influent water of the aeration tank, F Noe is the predicted value of the nitrate concentration of the effluent water of the aeration tank, F R is the predicted value of the sludge return ratio, F DR is the predicted value of the dissolved oxygen concentration of the sludge return, F r is the predicted value of the mixed liquor return ratio, F Di is the predicted value of the dissolved oxygen concentration of the mixed liquor return, a is the oxygen demand coefficient for oxidizing per kilogram of BOD5, b is the oxygen demand coefficient for oxidizing per kilogram of ammonia nitrogen, c is the endogenous respiration equivalent coefficient of cells, d is the ammonia nitrogen oxidation conversion coefficient, e is the nitrogen content conversion coefficient of the excess sludge, f is the dissolved oxygen conversion coefficient of the sludge return cells, and g is the dissolved oxygen conversion coefficient of the mixed liquor return sludge.
[0085] In a possible implementation manner, the first processing module is further configured to: Determine the potential influencing factors corresponding to each data point in the initial time series data; Calculate the first average value of all data points and the second average value of all potential influencing factors; For any data point, calculate the Pearson correlation coefficient according to the corresponding potential influencing factor, the first average value, and the second average value; Remove the data points whose Pearson correlation coefficients are not within the preset range to obtain the corrected time series data.
[0086] It should be noted that the oxygen demand calculation system for the aeration tank of the sewage treatment plant provided by the present invention can execute the oxygen demand calculation method for the aeration tank of the sewage treatment plant in any of the above embodiments during specific operation, and this embodiment will not be elaborated herein.
[0087] Figure 7 is a schematic structural diagram of the electronic device provided by the present invention. As Figure 7 shown, the electronic device may include: a processor 710 (processor), a communication interface 720 (Communications Interface), a memory 730 (memory), and a communication bus 740. Among them, the processor 710, the communication interface 720, and the memory 730 complete mutual communication through the communication bus 740. The processor 710 can call the logical instructions in the memory 730 to execute the oxygen demand calculation method for the aeration tank of the sewage treatment plant. The method includes: obtaining the initial time-series data of each index for the sewage treatment in the aeration tank; for any index, identifying and correcting the abnormal data in the corresponding initial time-series data to obtain corrected time-series data; for any index, performing polynomial fitting on the corresponding corrected time-series data to obtain a predicted value; obtaining the actual value of the flow rate of the sewage treatment in the aeration tank; and calculating the oxygen demand for the sewage treatment in the aeration tank according to the predicted values of all indexes and the actual value of the flow rate.
[0088] In addition, when the logical instructions in the above-mentioned memory 730 are implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0089] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer is capable of executing the method for calculating the oxygen demand of the aeration tank in a sewage treatment plant provided in the above-mentioned embodiments. The method includes: obtaining initial time-series data of various indicators for sewage treatment in the aeration tank; for any one indicator, identifying and correcting the abnormal data in the corresponding initial time-series data to obtain corrected time-series data; for any one indicator, performing polynomial fitting on the corresponding corrected time-series data to obtain predicted values; obtaining the actual value of the flow rate of sewage treatment in the aeration tank; and calculating the oxygen demand of sewage treatment in the aeration tank according to the predicted values of all indicators and the actual value of the flow rate.
[0090] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the method for calculating the oxygen demand of the aeration tank in a sewage treatment plant provided in the above-mentioned embodiments. The method includes: obtaining initial time-series data of various indicators for sewage treatment in the aeration tank; for any one indicator, identifying and correcting the abnormal data in the corresponding initial time-series data to obtain corrected time-series data; for any one indicator, performing polynomial fitting on the corresponding corrected time-series data to obtain predicted values; obtaining the actual value of the flow rate of sewage treatment in the aeration tank; and calculating the oxygen demand of sewage treatment in the aeration tank according to the predicted values of all indicators and the actual value of the flow rate.
[0091] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.
[0092] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiments.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for calculating oxygen demand in aeration tanks of sewage treatment plants, characterized in that: include: Obtain initial time series data for various indicators of aeration tank sewage treatment; For any of the indicators, abnormal data in the corresponding initial time series data is identified and corrected to obtain corrected time series data; For any of the indicators, a polynomial fitting is performed on the corresponding corrected time series data to obtain a predicted value; Get the actual flow value of the aeration tank sewage treatment; The oxygen demand for aeration tank sewage treatment is calculated based on the predicted values of all the indicators and the actual flow rate.
2. The method for calculating oxygen demand for aeration tanks in sewage treatment plants according to claim 1, characterized in that: The polynomial fitting of the corresponding corrected time series data to obtain the predicted value specifically includes: Selecting a local sampling window from the modified time series data, and forming an observation value vector and a design matrix according to the observation values in the local sampling window and the corresponding sampling moments; Performing least squares solution on the observation value vector and the design matrix to obtain a polynomial coefficient vector; Multiplying the polynomial coefficient vector by the design matrix to obtain a fitted value vector; The fitting value corresponding to the next time period or target time in the fitting value vector is used as the predicted value.
3. The method for calculating oxygen demand for aeration tanks in sewage treatment plants according to claim 2, characterized in that: The step of selecting a local sampling window from the modified time series data and forming an observation value vector and a design matrix according to the observation values in the local sampling window and the corresponding sampling moments specifically includes: Select n sampling points before and after the central time point t, and intercept a local sampling window with a length of 2n+1 from the corrected time series data; Arrange the observation values in the local sampling window in a sampling order to form the observation value vector X; The sampling time of each sampling point in the timing window is recorded as τ i , and construct a design matrix B, where the number of rows of the design matrix is the same as the length of the observation vector, and each row corresponds to a sampling time τ i ; The number of columns of the design matrix is a positive integer k, and the first column is all constant 1, which is used to fit the constant term of the polynomial; the element of the i-th row and m-th column of the design matrix is equal to τ i to the (m-1)th power, where m is a positive integer between 2 and k.
4. The method for calculating oxygen demand for aeration tanks in sewage treatment plants according to claim 3, characterized in that: The least squares solution of the observation value vector and the design matrix to obtain the polynomial coefficient vector specifically includes: Constructing an initial coefficient vector A, wherein the initial coefficient vector includes coefficients from constant terms to (k−1)-th power terms in sequence; According to the initial coefficient vector A, the observation value vector X and the design matrix B, the least squares method is used to solve the problem of Minimum polynomial coefficient vector.
5. The method for calculating oxygen demand for aeration tanks in sewage treatment plants according to claim 1, characterized in that: The indicators include BOD5 concentration of aeration tank inlet water, BOD5 concentration of aeration tank effluent, total Kjeldahl nitrogen concentration of aeration tank inlet water, total Kjeldahl nitrogen concentration of aeration tank effluent water, aeration tank sludge concentration, residual sludge discharge flow, residual sludge discharge concentration, total nitrogen concentration of aeration tank inlet water, nitrate concentration of aeration tank effluent water, sludge return ratio, dissolved oxygen concentration of sludge return, mixed liquor return ratio and dissolved oxygen concentration of mixed liquor return.
6. The method for calculating oxygen demand for aeration tanks in sewage treatment plants according to claim 5, characterized in that: The calculation of the oxygen demand for aeration tank sewage treatment based on the predicted values of all the indicators and the actual flow rate specifically includes: The oxygen demand for sewage treatment in the aeration tank is calculated by the following formula: O d =a×[Q×(F Si -F Se )]+b×[Q×(F Nki -F Nke )]+c×[Q×F X -F Qv ×F Xv ]-d×[Q×(F Nti -F NKe -F Noe )-e×F Qv ×F Xv ]-f×[Q×F R ×F DR ]-g×[Q×F r ×F Di ]; In the formula, O d is the oxygen demand for sewage treatment in the aeration tank, Q is the actual flow rate, and F Si is the predicted value of the BOD5 concentration of the aeration tank influent, F Se is the predicted value of BOD5 concentration of the aeration tank effluent, F Nki is the predicted value of the total Kjeldahl nitrogen concentration in the aeration tank inlet, F NKe is the predicted value of the total Kjeldahl nitrogen concentration in the aeration tank effluent, F X is the predicted value of the sludge concentration in the aeration tank, F Qv is the predicted value of the excess sludge discharge flow, F Xv is the predicted value of the excess sludge discharge concentration, F Nti is the predicted value of the total nitrogen concentration in the aeration tank inlet, F Noe is the predicted value of nitrate concentration in the aeration tank effluent, F R is the predicted value of the sludge return ratio, F DR is the predicted value of dissolved oxygen concentration of the sludge return, F r is the predicted value of the mixed liquor reflux ratio, F Di is the predicted value of the dissolved oxygen concentration of the mixed liquor reflow, a is the oxygen demand coefficient for oxidizing each kilogram of BOD5, b is the oxygen demand coefficient for oxidizing each kilogram of ammonia nitrogen, c is the cellular endogenous respiration equivalent coefficient, d is the ammonia nitrogen oxidation conversion coefficient, e is the conversion coefficient of the nitrogen content of the residual sludge, f is the dissolved oxygen conversion coefficient of the sludge reflow cells, and g is the dissolved oxygen conversion coefficient of the mixed liquor reflow sludge.
7. The method for calculating oxygen demand for aeration tanks in sewage treatment plants according to claim 1, characterized in that: The identifying and correcting of abnormal data in the corresponding initial time series data to obtain corrected time series data specifically includes: Determine a potential impact factor corresponding to each data point in the initial time series data; Calculating a first average value of all the data points and a second average value of all the potential influencing factors; For any of the data points, calculating the Pearson correlation coefficient according to the corresponding potential influencing factor, the first average value, and the second average value; The data points whose Pearson correlation coefficient is not within the preset range are eliminated to obtain the corrected time series data.
8. A system for calculating oxygen demand in aeration tanks of sewage treatment plants, characterized in that: include: An acquisition module, used to acquire initial time series data of various indicators used for aeration tank sewage treatment; A first processing module is used to identify and correct abnormal data in the corresponding initial time series data for any one of the indicators to obtain corrected time series data; The first processing module is further used to perform polynomial fitting on the corresponding corrected time series data for any one of the indicators to obtain a predicted value; The acquisition module is also used to obtain the actual flow value of the aeration tank sewage treatment; The second processing module is used to calculate the oxygen demand for aeration tank sewage treatment according to the predicted values of all the indicators and the actual value of the flow rate.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method for calculating oxygen demand for aeration tanks in a sewage treatment plant as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for calculating oxygen demand for aeration tanks in a sewage treatment plant as described in any one of claims 1 to 7 is implemented.