A self-learning method for predicting influent quantity of sewage plant based on fourier transform
By employing the Fourier transform self-learning method, the problems of data dependence and insufficient signal analysis in the influent prediction model of wastewater treatment plants are solved. This enables efficient and accurate influent prediction even with insufficient data, supporting the stable operation and efficiency improvement of wastewater treatment plants.
Patent Information
- Application Number
- CN202210841381.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-18
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2042-07-18
AI Technical Summary
Existing wastewater treatment plant influent prediction models require a large amount of data and are complex to construct. Furthermore, traditional Fourier prediction models are insufficient for analyzing specific signals at specific time periods, and cannot guarantee the accuracy and stability of the prediction results. They are particularly ineffective when data is insufficient or variables are difficult to obtain.
A Fourier transform-based self-learning method is adopted. Through historical data collection, cleaning, and self-learning correction, a Fourier transform self-learning prediction model is established. Timestamp data is used for self-learning correction to determine the correction coefficient, thereby achieving accurate prediction of water inflow.
It enables automatic model correction to improve prediction accuracy without requiring large amounts of data and multiple variables. It is suitable for wastewater treatment plants that do not have flow meters installed or have insufficient data, ensuring the stability and accuracy of influent flow prediction. It supports balanced pumping control and advance regulation strategies, thereby improving the stable operation and treatment efficiency of wastewater treatment plants.
Smart Images

Figure CN115330023B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of sewage treatment plant water inflow prediction, and more specifically, relates to a Fourier transform-based self-learning sewage treatment plant water inflow prediction method. Background Art
[0002] With my country's continuously growing population and rapid economic and social development, per capita water resources are becoming scarce, and urban water shortages are a prominent problem. In recent years, sewage treatment effluent standards have become increasingly stringent, requiring real-time compliance. Sewage treatment systems exhibit strong nonlinearity, time-varying parameters, and high dynamics, which severely impact the stable operation of sewage treatment plants and the efficiency of sewage treatment systems.
[0003] The above problems can be solved through effective prediction of the water inflow of sewage treatment plants, which is mainly reflected in the following two points: First, based on the predicted water volume, the sewage treatment plant can be balanced and pumped up to stabilize the water volume pumped up by the sewage treatment plant, ensuring the stable operation of the sewage treatment plant; second, the sewage treatment plant can be controlled in advance according to the predicted water volume, the operation control parameters can be optimized, and the response can be made in advance to improve the treatment efficiency of the sewage treatment system.
[0004] Currently, commonly used models for inflow prediction include LSTM, ARIMA, and exponential smoothing. However, predicting sewage inflow based on these models presents the following difficulties: First, the models require a vast amount of data, making them unsuitable for sewage treatment plants that lack inflow flow meters, have low-quality raw data, or have relatively small amounts of raw data. Second, model construction is complex, as inflow is affected by numerous factors, such as time, population, rainfall, and holidays. This requires considering multiple high-dimensional, non-independent variables and identifying correlations between them, making it unsuitable for sewage treatment plants where variable acquisition, model construction, and training are challenging.
[0005] In addition, the traditional Fourier prediction model analyzes the entire time domain. It does not adequately analyze the special signal frequencies, mutation signals, and variable frequency signals that appear in specific time periods. It cannot guarantee the accuracy and stability of the prediction results, and the prediction effect is relatively insufficient.
[0006] In this situation, there is an urgent need to provide a sewage volume prediction method that has effective prediction capabilities, does not require a large amount of data and multiple variables, and can be automatically corrected. Summary of the Invention
[0007] This invention addresses the shortcomings of existing technologies by proposing a self-learning Fourier transform-based method for predicting sewage treatment plant inflow. The prediction results can be used to control water volume balance and set early control strategies, thereby achieving stable operation and improving treatment efficiency in sewage treatment plants.
[0008] In order to achieve the above object, the present invention provides a self-learning sewage treatment plant inflow prediction method based on Fourier transform, which comprises the following steps:
[0009] S1: Collect historical data of inlet flow, convert timestamp data, clean and store the remaining data to obtain the original data set;
[0010] S2: Using the original data set to build a preliminary Fourier transform prediction model; using the original data set and a computer programming language to build a preliminary Fourier transform prediction model program, input the prediction time period parameters, and obtain the original predicted water inflow data for each time node within the prediction time;
[0011] S3: Determine the length of the correction cycle within the prediction time; use the original predicted water inflow data of each time node in the previous correction cycle and the corresponding measured water inflow data to perform self-learning correction on the original predicted water inflow data in the next correction cycle, determine the correction coefficient of the next correction cycle and establish a Fourier transform self-learning prediction model; build a Fourier transform self-learning prediction model program using a computer programming language, input correction parameters, obtain the corrected predicted water inflow data for the next correction cycle, and store it;
[0012] S4: Determine the prediction accuracy of the Fourier transform self-learning prediction model based on the measured water inflow data within the prediction time, the corresponding revised predicted water inflow data and the model accuracy formula; if the prediction accuracy is lower than a predetermined level, replace and / or expand the original data set and repeat steps S2-S3.
[0013] According to the present invention, preferably, the water inlet flow historical data includes hourly data and / or daily data.
[0014] According to the present invention, preferably, the hourly data is hourly data greater than or equal to 168 hours.
[0015] According to the present invention, preferably, the daily data is daily data greater than or equal to 28 days.
[0016] In the present invention, the data collection includes collection via online flow meters and / or manual data entry. The cleaning includes identifying and removing default inflow flow historical data, outlier inflow flow historical data, and homofrequency inflow flow historical data. In the present invention, default inflow flow historical data is identified and removed by marking it "NaN"; outlier inflow flow historical data is identified and removed based on the "3σ principle"; and homofrequency inflow flow historical data is identified and removed based on "10 consecutive data values displaying the same data."
[0017] According to the present invention, preferably, the timestamp data conversion includes converting the UTC+8:00 timestamp data corresponding to the water inflow historical data into a numerical form for storage, wherein the numerical form is a Unix or NTP timestamp value.
[0018] According to the present invention, preferably, the preliminary Fourier transform prediction model is formula (1):
[0019]
[0020] In formula (1):
[0021] f(t) is the original predicted water volume of the preliminary Fourier transform prediction model;
[0022] A0、a n 、b n is the model parameter, expressed as the change amplitude of the inlet flow rate, obtained by using the original data set as the training data set and using the multiple linear regression model;
[0023] The value of n is 1, 2, or 3;
[0024] ω is 2π;
[0025] t is the timestamp data corresponding to the predicted water inflow data;
[0026] The value of T is: 365 days for daily forecast and / or 1 hour for hourly forecast.
[0027] According to the present invention, preferably, in step S2,
[0028] The computer programming language is at least one of Python, Excel, Java, C++ and Matlab;
[0029] The parameters within the prediction time period include: timestamp data corresponding to each time node within the prediction time period.
[0030] In the present invention, as a preferred solution, in step S2, Python is used to build a "preliminary Fourier transform prediction model program", which includes model input, built-in formulas, and model output items, and realizes input, program operation, and prediction result storage through code. The program input items are the timestamp data corresponding to each time node in the prediction time period and the trained model parameters A0, a n 、b n The output result is the original predicted water inflow data at each time node within the predicted time period.
[0031] According to the present invention, preferably, the correction coefficient of the latter correction period is: Where: r is the correction coefficient, is the average value of the measured water inflow data at each time node in the previous correction period, It is the average value of the original predicted water inflow data at each time node in the previous correction period.
[0032] According to the present invention, preferably, the Fourier transform self-learning prediction model is: f(t)′=rf(t), wherein: f(t)′ is the corrected predicted water volume of the Fourier transform self-learning prediction model, and f(t) is the original predicted water volume of the preliminary Fourier transform prediction model.
[0033] According to the present invention, preferably, in step S3,
[0034] The computer programming language is at least one of Python, Excel, Java, C++ and Matlab;
[0035] The correction parameters include: the correction period duration within the prediction time.
[0036] In the present invention, as a preferred solution, in step S3, Python is used to build a "Fourier transform self-learning prediction model program", which includes input, self-learning related formula (correction coefficient is: The Fourier transform self-learning prediction model is: f(t)′=rf(t), output item, input includes: correction period length within the prediction time, original predicted water inflow data of each time node in the previous correction period and corresponding measured water inflow data; the output item of the program is the corrected predicted water inflow data of the next correction period.
[0037] According to the present invention, preferably, the model accuracy formula is formula (2):
[0038]
[0039] Where: acc is the model accuracy, m is the amount of predicted data within the prediction time, y i is the corresponding corrected predicted water inflow data, is the measured water inflow data within the prediction time.
[0040] The beneficial effects of the technical solution of the present invention are as follows:
[0041] This invention provides a Fourier transform self-learning sewage volume prediction method that is effective, does not require extensive data or multiple variables, and can automatically correct itself. The prediction results can be used to control water volume balance and pumping, as well as to set early control strategies, thereby achieving stable operation and improving treatment efficiency in sewage treatment plants. It offers the following advantages:
[0042] (1) Solve the problem of difficulty in building commonly used LSTM, ARIMA, exponential smoothing models, which are specifically manifested in the inability to predict long-term data, the need for continuous model training, the need for a large amount of basic data, and the need for multiple high-dimensional non-independent variables as model input. The present invention only uses timestamp data and measured data, and can accurately predict short-term and long-term water inflow through a preliminary Fourier prediction model and a self-learning correction model. The model is simple to build and convenient for subsequent use.
[0043] (2) Solve the problems that conventional Fourier transform methods rely on cycles, lack analysis of special signal frequencies, sudden signal changes, and variable frequency signals that appear in specific time periods, cannot guarantee accurate and stable prediction results, and have insufficient prediction effects. The present invention is a Fourier transform self-learning model that can calculate correction coefficients based on a self-set self-learning cycle to ensure the prediction effect of the model within the learning cycle.
[0044] Other features and advantages of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above and other objects, features and advantages of the present invention will become more apparent through a more detailed description of exemplary embodiments of the present invention with reference to the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present invention.
[0046] Figure 1 A flow chart of a Fourier transform-based self-learning sewage treatment plant inflow prediction method provided by the present invention is shown.
[0047] Figure 2 A schematic diagram is shown of the self-learning sewage treatment plant inflow prediction method based on Fourier transform provided in Example 1 of the present invention for obtaining the original predicted inflow data at each time node on a daily basis within the prediction time period.
[0048] Figure 3 A schematic diagram is shown of the self-learning sewage treatment plant inflow prediction method based on Fourier transform provided in Example 1 of the present invention for obtaining the original predicted inflow data at each time node at the hourly level within the prediction time period.
[0049] Figures 4(a)-(c) show schematic diagrams of obtaining corrected predicted water inflow data with correction period lengths of 10d, 5d, and 1d by the Fourier transform-based self-learning sewage plant water inflow prediction method provided in Example 1 of the present invention.
[0050] Figures 5(a)-(c) show schematic diagrams of obtaining corrected predicted water inflow data with correction period lengths of 24h, 12h, and 1h by the Fourier transform-based self-learning sewage plant water inflow prediction method provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0051] The preferred embodiments of the present invention will be described in more detail below. Although the preferred embodiments of the present invention are described below, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. Instead, these embodiments are provided to make the present invention more thorough and complete and to fully convey the scope of the present invention to those skilled in the art.
[0052] Example 1
[0053] This embodiment provides a self-learning method for predicting the inflow of sewage treatment plants based on Fourier transform. Figure 1 As shown, the method includes the following steps:
[0054] S1: Collect historical data of water inflow, convert data, clean and store the remaining data to obtain the original data set;
[0055] Data collection: From a recycled water plant in Beijing, 731 sets of daily data were manually entered over two years, and 960 sets of online monitoring instrument data were collected over 40 days.
[0056] Data conversion: converting the UTC+8:00 timestamp data corresponding to the historical data of water inflow into Unix timestamp value for storage;
[0057] Cleaning: Default inlet flow historical data is identified and eliminated based on the "NaN" mark; outlier inlet flow historical data is identified and eliminated based on the "3σ principle"; and same-frequency inlet flow historical data is identified and eliminated based on "10 consecutive data values displayed as the same data."
[0058] S2: Using the original data set to build a preliminary Fourier transform prediction model and determine the model parameters;
[0059] The preliminary Fourier transform prediction model is formula (1):
[0060]
[0061] In formula (1):
[0062] A0、a n 、b n is the model parameter, expressed as the change amplitude of the inlet flow rate, obtained by using the original data set as the training data set and T taking the values of 365d and 1h using a multiple linear regression model;
[0063] n is 1, 2, or 3; ω is 2π; t is the timestamp corresponding to the predicted water inflow data;
[0064] The original data set was used as the training data set, T was set to 365d and 1h respectively, and the model parameters A0, a n 、b n The expression is:
[0065]
[0066]
[0067] Table 1. Daily and hourly model parameters A0, a n 、b n
[0068]
[0069] Therefore, the daily preliminary Fourier transform prediction model and the hourly preliminary Fourier transform prediction model are formulas (3) and (4), respectively: (3):
[0071] (4):
[0073]
[0074] A preliminary Fourier transform prediction model program was built using Python. The prediction period was set to the subsequent 2 years (daily level) and 5 days (hourly level) (the 3rd and 4th years). The prediction was performed for the prediction period. The timestamp data within the prediction period was input to obtain the original predicted water inflow data for each time node within the prediction period, as shown in the following example: Figure 2 (Day level), 3 (Hour level) are shown.
[0075] S3: Determine the correction period length within the prediction time, which is 10 days at the daily level and 24 hours at the hourly level; determine the correction coefficient; and obtain the corrected predicted water inflow data;
[0076] The correction factor is: Where: r is the correction coefficient, is the average value of the measured water inflow data at each time node in the previous correction period, It is the average value of the original predicted water inflow data at each time node in the previous correction period;
[0077] The Fourier transform self-learning prediction model is: f(t)′=rf(t), where: f(t)′ is the corrected prediction result of the Fourier transform self-learning prediction model, and f(t) is the original prediction result of the preliminary Fourier transform prediction model.
[0078] Daily level: A Fourier transform self-learning prediction model program was constructed using a computer programming language, with a correction period of 10 days entered. Within the program, a self-learning correction was performed based on the original predicted water inflow data for each time point from the previous 1-10 days and its corresponding measured water inflow data. The correction coefficient for the 11-20 days was determined, and the corrected predicted water inflow data for the 11-20 days was obtained and stored using the Fourier transform self-learning prediction model. A self-learning correction was performed based on the original predicted water inflow data for each time point from the previous 11-20 days and its corresponding measured water inflow data, determining the correction coefficient for the 21-30 days. The corrected predicted water inflow data for the 21-30 days was obtained and stored using the Fourier transform self-learning prediction model. The same process was repeated. The results are shown in Figure 4(a). The correction period can be shortened as needed, with daily prediction correction periods set to 5 days or 1 day. The results are shown in Figures 4(b)-(c).
[0079] Hourly level: Similar to the daily level, the original predicted water inflow data for each time point within the previous 1-24 hours and the corresponding measured data are used to obtain the 25-48 hour revised predicted water inflow data; the results are shown in Figure 5(a). The correction cycle can be shortened as needed, with hourly prediction correction cycle lengths of 12 hours and 1 hour. The results are shown in Figures 5(b)-(c).
[0080] S4: Determine the prediction accuracy of the Fourier transform self-learning prediction model according to the measured water inflow data within the prediction time period, the corresponding corrected predicted water inflow data and the model accuracy formula.
[0081] The model accuracy formula is formula (2):
[0082]
[0083] Where: acc is the model accuracy, m is the amount of predicted data within the prediction time period, y i Correct the predicted water inflow data for the predicted time period, is the measured water inflow data within the forecast period.
[0084] The accuracy formulas of the daily Fourier transform self-learning prediction model and the hourly Fourier transform self-learning prediction model are respectively formulas (5) and (6), where m is 730 for the daily level and 121 for the hourly level:
[0085]
[0086]
[0087] Table 2 Model accuracy calculation results
[0088]
[0089]
[0090] As shown in Table 2, the Fourier transform self-learning prediction model of the present invention has good prediction results. It can effectively correct the original model at both the daily and hourly levels, improving the accuracy of the model. The correction effect of the daily prediction is better than that of the hourly correction, and the smaller the correction period, the better the correction effect.
[0091] While various embodiments of the present invention have been described above, the above description is intended to be illustrative, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.
Claims
1. A self-learning sewage treatment plant inflow prediction method based on Fourier transform, characterized in that: The method comprises the following steps: S1: Collect historical data of inlet flow, convert timestamp data, clean and store the remaining data to obtain the original data set; S2: Using the original data set to build a preliminary Fourier transform prediction model; using the original data set and a computer programming language to build a preliminary Fourier transform prediction model program, input the prediction time period parameters, and obtain the original predicted water inflow data for each time node within the prediction time; The preliminary Fourier transform prediction model is formula (1): In formula (1): f(t) is the original predicted water volume of the preliminary Fourier transform prediction model; A0、a n 、b n is the model parameter, expressed as the change amplitude of the inlet flow rate, obtained by using the original data set as the training data set and using the multiple linear regression model; The value of n is 1, 2, or 3; ω is 2π; t is the timestamp data corresponding to the original predicted water inflow data at each time node; The value of T is: 365 days for daily forecast and / or 1 hour for hourly forecast; S3: Determine the length of the correction cycle within the prediction time; use the original predicted water inflow data of each time node in the previous correction cycle and the corresponding measured water inflow data to perform self-learning correction on the original predicted water inflow data in the next correction cycle, determine the correction coefficient of the next correction cycle and establish a Fourier transform self-learning prediction model; build a Fourier transform self-learning prediction model program using a computer programming language, input correction parameters, obtain the corrected predicted water inflow data for the next correction cycle, and store it; S4: Determine the prediction accuracy of the Fourier transform self-learning prediction model based on the measured water inflow data within the prediction time, the corresponding revised predicted water inflow data and the model accuracy formula; if the prediction accuracy is lower than a predetermined level, replace and / or expand the original data set and repeat steps S2-S3.
2. The Fourier transform-based self-learning sewage treatment plant inflow prediction method according to claim 1, wherein: The water inflow historical data includes hourly data and / or daily data.
3. The Fourier transform-based self-learning sewage treatment plant inflow prediction method according to claim 2, wherein: The hourly data is hourly data greater than or equal to 168 hours.
4. The Fourier transform-based self-learning sewage treatment plant inflow prediction method according to claim 2, wherein: The daily data is daily data greater than or equal to 28 days.
5. The Fourier transform-based self-learning sewage treatment plant inflow prediction method according to claim 1, wherein: The timestamp data conversion includes converting the UTC+8:00 timestamp data corresponding to the water inflow historical data into a numerical form for storage, and the numerical form is a Unix or NTP timestamp value.
6. The Fourier transform-based self-learning sewage treatment plant inflow prediction method according to claim 1, wherein: In step S2, The computer programming language is at least one of Python, Excel, Java, C++ and Matlab; The parameters within the prediction time period include: timestamp data corresponding to each time node within the prediction time period.
7. The Fourier transform-based self-learning sewage treatment plant inflow prediction method according to claim 1, wherein: The correction coefficient of the latter correction cycle is: Where: r is the correction coefficient, is the average value of the measured water inflow data at each time node in the previous correction period, It is the average value of the original predicted water inflow data at each time node in the previous correction period; The Fourier transform self-learning prediction model is: f(t)′=rf(t), where: f(t)′ is the corrected predicted water volume of the Fourier transform self-learning prediction model, and f(t) is the original predicted water volume of the preliminary Fourier transform prediction model.
8. The Fourier transform-based self-learning sewage treatment plant inflow prediction method according to claim 1, wherein: In step S3, The computer programming language is at least one of Python, Excel, Java, C++ and Matlab; The correction parameters include: the correction period duration within the prediction time.
9. The Fourier transform-based self-learning sewage treatment plant inflow prediction method according to claim 1, wherein: The model accuracy formula is formula (2): Where: acc is the model accuracy, m is the amount of predicted data within the prediction time, y i is the corresponding corrected predicted water inflow data, is the measured water inflow data within the prediction time.
Citation Information
Patent Citations
Sewage treatment plant inflow prediction method based on deep learning and system thereof
CN113159395A
Passenger flow prediction method and device, equipment and storage medium
CN113283508A