Intelligent accounting method, system and equipment for greenhouse gas emission in sewage treatment process and storage medium
By constructing a TCNA fusion prediction model based on attention mechanism and temporal convolutional network, the problem of deviation in greenhouse gas emission calculation during wastewater treatment was solved, achieving high-accuracy emission estimation, optimizing treatment process, and reducing greenhouse gas emissions.
Patent Information
- Application Number
- CN202511392623.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-02-17
AI Technical Summary
Existing methods for calculating greenhouse gas emissions from wastewater treatment processes suffer from significant biases, lack dynamism and accuracy, and rely on static assumptions and quantitative analysis, making them unsuitable for adapting to process differences and dynamic changes.
A TCNA fusion prediction model based on attention mechanism and temporal convolutional network is adopted. By collecting time series data of water quality and greenhouse gas emissions in the wastewater treatment process, cleaning and calibrating the data, calculating the emission factors of gas components, and using the trained model to calculate the emissions.
It significantly improves the accuracy of greenhouse gas emission calculation, enables the learning and automatic optimization of complex data patterns, reduces costs, enhances the adaptability and accuracy of the model, and can provide wastewater treatment plants with scientific emission estimates, optimize treatment processes, and reduce greenhouse gas emissions.
Smart Images

Figure CN121543860A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of carbon emission accounting in wastewater treatment, and in particular to an intelligent accounting method, system, equipment and storage medium for greenhouse gas emissions in wastewater treatment processes. Background Technology
[0002] Greenhouse gas emissions are considered one of the main causes of global climate change. Wastewater treatment processes also generate significant amounts of greenhouse gases, such as carbon dioxide (CO2), methane (CH4), and nitrous oxide (N2O), which can have a substantial impact on the ecological environment and climate change. Therefore, accurately calculating greenhouse gas emissions from wastewater treatment processes is of paramount importance.
[0003] Currently, greenhouse gas emissions from wastewater treatment processes are typically estimated using fixed emission factors or laboratory measurements, neglecting differences and dynamic changes in water quality and wastewater treatment processes, leading to significant biases in the calculation results. Furthermore, traditional emission factor models rely heavily on static assumptions and quantitative analysis, lacking dynamism and precision.
[0004] With the development of artificial intelligence technology, machine learning and deep learning models have begun to be applied to the field of environmental monitoring. In particular, the use of deep neural networks to predict pollutant and greenhouse gas emissions can achieve dynamic prediction of greenhouse gas and carbon emissions in the wastewater treatment process, providing more accurate basis and decision support for carbon emission management in the wastewater treatment process. Summary of the Invention
[0005] The purpose of this invention is to provide an intelligent accounting method, system, equipment, and storage medium for greenhouse gas emissions during wastewater treatment processes, in order to solve the problems mentioned in the background art.
[0006] In a first aspect, an embodiment of the present invention provides a method for calculating greenhouse gas emission fluxes during a wastewater treatment process, comprising: Collect time-series data on water quality and greenhouse gas emissions during the wastewater treatment process; Based on the collected water quality and greenhouse gas emission time series data, the data were cleaned and calibrated to calculate the emission factors of the gas components; the gas components include: carbon dioxide, methane and nitrous oxide; A TCNA fusion prediction model for greenhouse gas emission factors in wastewater treatment processes was constructed based on attention mechanisms and temporal convolutional networks. Using the collected, cleaned, and calibrated water quality and greenhouse gas emission time series data, the corresponding gas component emission factors are obtained as output variables to train the greenhouse gas emission factor TCNA fusion prediction model, and the trained TCNA fusion prediction model is obtained. Using the trained TCNA fusion prediction model, greenhouse gas emission factors are output to calculate greenhouse gas emissions during wastewater treatment.
[0007] Optionally, the collected wastewater treatment process water quality time-series data includes influent and effluent chemical oxygen demand (COD), suspended solids (SS), and ammonia nitrogen (NH4). + -N, nitrate nitrogen NO3 - -N and nitrite nitrogen NO2 - -N; The time-series data on greenhouse gas emissions includes total emissions, concentrations and percentages of carbon dioxide, methane, and nitrous oxide.
[0008] Optionally, the cleaning and calibration based on the collected water quality and greenhouse gas emission time-series data includes: Data cleaning steps: Identify and process invalid, abnormal, and noisy data points through algorithms to improve data quality; Data calibration steps: Correct the accuracy of the cleaned data based on standard references or authoritative measurement methods.
[0009] Optionally, the calculation of gas component emission factors and their correlation with water quality data includes: The chemical oxygen demand (CODr) and total nitrogen (TNr) removal rates during the wastewater treatment process were calculated based on the collected water quality time-series data. Based on the chemical oxygen demand (CODr) removed during the wastewater treatment process, carbon dioxide and methane emission factors during the wastewater treatment process are obtained. Based on the total nitrogen removal amount TNr, the nitrous oxide emission factor of the wastewater treatment process is obtained.
[0010] Optionally, the construction of the TCNA fusion prediction model for greenhouse gas emission factors in wastewater treatment processes based on attention mechanisms and temporal convolutional networks includes: Construct a temporal convolutional network model to process multiple input variables and generate feature representations for the sequence at each time step; An attention mechanism is constructed to process the feature representations generated by the temporal convolutional network model and to assign weights to the final prediction to emphasize the most critical time steps; The attention mechanism initializes a trainable weight w and a bias b, and calculates the attention score e of the feature representation at each time step according to the formula e equals x multiplied by w plus b. The attention score e is regularized into a probability distribution a using the Softmax function to ensure that the sum of all attention scores is 1, thereby assigning attention mechanism weights to the feature representation x at each time step. Multiply the feature representation x at each time step by the corresponding attention mechanism weight a, and then sum them to obtain the final feature weight vector s; The feature weight vector s is passed to a fully connected layer to obtain the final output sequence.
[0011] Optionally, the step of using the collected, cleaned, and calibrated water quality and greenhouse gas emission time-series data, and obtaining the corresponding gas component emission factors as output variables, to train the greenhouse gas emission factor TCNA fusion prediction model, to obtain the trained TCNA fusion prediction model, includes: The collected water quality data and the constructed greenhouse gas emission factors are combined to form a water quality-emission factor dataset; The water quality-emission factor dataset is standardized to eliminate dimensional differences between different data items; The standardized water quality-emission factor dataset was randomly divided into training and testing sets in an 8:2 ratio. The training set was input into the constructed TCNA fusion prediction model for multiple training sessions, and the model performance was verified using the test set. The model with the best performance was selected as the TCNA fusion prediction model for greenhouse gas emission factors after training.
[0012] Optionally, the step of using the trained TCNA fusion prediction model to output greenhouse gas emission factors and calculate greenhouse gas emissions during wastewater treatment includes: Obtain the water volume processed by the target wastewater treatment system; Obtain water quality data for the target wastewater treatment process; The water quality data of the target wastewater treatment process is input into the trained greenhouse gas emission factor TCNA fusion prediction model to obtain the dynamic greenhouse gas emission factor of the target wastewater treatment process. Greenhouse gas emissions are calculated based on the dynamic greenhouse gas emission factor and the wastewater treatment volume.
[0013] Optionally, the calculation method is applicable to wastewater treatment systems employing anoxic-aerobic biological nitrogen and phosphorus removal processes.
[0014] Secondly, an embodiment of the present invention provides a greenhouse gas accounting system for wastewater treatment, comprising: The data acquisition module is used to collect time-series data on water quality and greenhouse gas emissions during the wastewater treatment process. The calculation module is used to clean and calibrate the collected water quality and greenhouse gas emission time series data to obtain the emission factors of gas components. The building module is used to construct a fusion prediction model for greenhouse gas emission factors (TCNA) in wastewater treatment processes based on attention mechanisms and temporal convolutional networks. The training module is used to train the TCNA fusion prediction model of greenhouse gas emission factors using the collected, cleaned, and calibrated water quality and greenhouse gas emission time series data and the corresponding gas component emission factors obtained as output variables, so as to obtain the trained TCNA fusion prediction model. The calculation module is used to calculate the greenhouse gas emissions during the wastewater treatment process by using the greenhouse gas emission factor TCNA fusion prediction model to output emission factors.
[0015] Thirdly, the electronic device provided in the embodiments of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the program, it implements the greenhouse gas accounting method in the wastewater treatment process as described in any of the first aspects.
[0016] Fourthly, the computer-readable storage medium provided in the embodiments of the present invention stores a computer program thereon, characterized in that, when the program is executed by a processor, it implements the method for calculating greenhouse gases during wastewater treatment as described in any of the first aspects.
[0017] The present invention has achieved the following beneficial effects: This technical solution significantly improves the accuracy of greenhouse gas emission calculation by introducing a TCNA fusion model and dynamically generating greenhouse gas emission factors from water quality data. This method not only acquires real-time water quality data from the target wastewater treatment system but also provides accurate predictions of greenhouse gas emissions over different time periods by combining emission factors with dynamic water quality information.
[0018] Compared to traditional methods, this technology utilizes deep learning models to learn and automatically optimize complex data patterns, avoiding errors from human experience. It also allows for flexible adjustment of emission factors based on different operating conditions, thereby improving the model's adaptability and accuracy. Furthermore, the establishment of soft-sensor models eliminates the need for complex experiments or on-site monitoring during wastewater treatment, reducing costs and workload.
[0019] Furthermore, by incorporating an attention mechanism, the model can highlight key time steps, enhancing the efficiency and effectiveness of feature selection and further improving the reliability and stability of predictions. Therefore, this method can provide wastewater treatment plants with more scientific emission estimates, optimize treatment processes, reduce greenhouse gas emissions, and contribute to achieving carbon reduction targets.
[0020] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.
[0021] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0022] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram of a method for calculating greenhouse gases during wastewater treatment according to an embodiment of the present invention; Figure 2 This is a structural diagram of the TCNA fusion model, which incorporates a Temporal Convolutional Network (TCN) with an attention mechanism (AM). Figure 3 This is a comparison chart of the soft measurement value and experimental value of CO2 emission factor in the example of this invention; Figure 4 This is a comparison chart of the soft measurement value and experimental value of CH4 emission factor in the example of this invention; Figure 5 This is a comparison chart of the soft measurement value and experimental value of N2O emission factor in an example of the present invention; Figure 6 This is a framework diagram of the soft measurement system for carbon emissions in a wastewater treatment plant in an example of the present invention. Detailed Implementation
[0023] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0024] Figure 1 This application provides a flowchart of a method for calculating greenhouse gases during wastewater treatment, as illustrated in the embodiments of this application. Figure 1 As shown, the method includes: Collect time-series data on water quality and greenhouse gas emissions during the wastewater treatment process; Based on the collected water quality and greenhouse gas emission time series data, the data were cleaned and calibrated to calculate the emission factors of the gas components; the gas components include: carbon dioxide, methane and nitrous oxide; A TCNA fusion prediction model for greenhouse gas emission factors in wastewater treatment processes was constructed based on attention mechanisms and temporal convolutional networks. Using the collected, cleaned, and calibrated water quality and greenhouse gas emission time series data, the corresponding gas component emission factors are obtained as output variables to train the greenhouse gas emission factor TCNA fusion prediction model, and the trained TCNA fusion prediction model is obtained. Using the trained TCNA fusion prediction model, greenhouse gas emission factors are output to calculate greenhouse gas emissions during wastewater treatment.
[0025] The collected wastewater treatment process water quality time-series data includes influent and effluent chemical oxygen demand (COD), suspended solids (SS), and ammonia nitrogen (NH4). + -N, nitrate nitrogen NO3 - -N and nitrite nitrogen NO2 - -N; The time-series data on greenhouse gas emissions includes total emissions, concentrations and percentages of carbon dioxide, methane, and nitrous oxide.
[0026] The cleaning and calibration based on the collected water quality and greenhouse gas emission time-series data includes: Data cleaning steps: Identify and process invalid, abnormal, and noisy data points through algorithms to improve data quality; Data calibration steps: Correct the accuracy of the cleaned data based on standard references or authoritative measurement methods.
[0027] The calculation of gas component emission factors and their correlation with water quality data includes: The chemical oxygen demand (CODr) and total nitrogen (TNr) removal rates during the wastewater treatment process were calculated based on the collected water quality time-series data. Based on the chemical oxygen demand (CODr) removed during the wastewater treatment process, carbon dioxide and methane emission factors during the wastewater treatment process are obtained. Based on the total nitrogen removal amount TNr, the nitrous oxide emission factor of the wastewater treatment process is obtained.
[0028] The construction of the TCNA fusion prediction model for greenhouse gas emission factors in wastewater treatment processes, based on attention mechanisms and temporal convolutional networks, includes: Construct a temporal convolutional network model to process multiple input variables and generate feature representations for the sequence at each time step; An attention mechanism is constructed to process the feature representations generated by the temporal convolutional network model and to assign weights to the final prediction to emphasize the most critical time steps; The attention mechanism initializes a trainable weight w and a bias b, and calculates the attention score e of the feature representation at each time step according to the formula e equals x multiplied by w plus b. The attention score e is regularized into a probability distribution a using the Softmax function to ensure that the sum of all attention scores is 1, thereby assigning attention mechanism weights to the feature representation x at each time step. Multiply the feature representation x at each time step by the corresponding attention mechanism weight a, and then sum them to obtain the final feature weight vector s; The feature weight vector s is passed to a fully connected layer to obtain the final output sequence.
[0029] The process involves using the collected, cleaned, and calibrated water quality and greenhouse gas emission time-series data, along with the corresponding gas component emission factors obtained as output variables, to train the TCNA fusion prediction model for greenhouse gas emission factors. The resulting trained TCNA fusion prediction model includes: The collected water quality data and the constructed greenhouse gas emission factors are combined to form a water quality-emission factor dataset; The water quality-emission factor dataset is standardized to eliminate dimensional differences between different data items; The standardized water quality-emission factor dataset was randomly divided into training and testing sets in an 8:2 ratio. The training set was input into the constructed TCNA fusion prediction model for multiple training sessions, and the model performance was verified using the test set. The model with the best performance was selected as the TCNA fusion prediction model for greenhouse gas emission factors after training.
[0030] The step of using the trained TCNA fusion prediction model to output greenhouse gas emission factors and calculate greenhouse gas emissions during wastewater treatment includes: Obtain the water volume processed by the target wastewater treatment system; Obtain water quality data for the target wastewater treatment process; The water quality data of the target wastewater treatment process is input into the trained greenhouse gas emission factor TCNA fusion prediction model to obtain the dynamic greenhouse gas emission factor of the target wastewater treatment process. Greenhouse gas emissions are calculated based on the dynamic greenhouse gas emission factor and the wastewater treatment volume.
[0031] The calculation method is applicable to wastewater treatment systems employing anoxic-aerobic biological nitrogen and phosphorus removal processes.
[0032] The working principle and beneficial effects of the above technical solution are as follows: S1: Collect water quality data and three greenhouse gas data during the wastewater treatment process, presented in time-series format, to serve as input and output variables for the soft sensor model. The water quality data to be collected includes chemical oxygen demand (COD), suspended solids (SS), and ammonia nitrogen (NH4) in the influent and effluent. + -N, nitrate nitrogen NO3 - -N and nitrite nitrogen NO2 --N. First, a data cleaning algorithm automatically identifies and processes invalid values, abnormal fluctuations, and random noise in the original time-series data to eliminate unreliable data points caused by equipment failures, transmission errors, etc., thereby improving the basic quality of the dataset. Then, based on standard references or authoritative laboratory analysis methods, the cleaned online monitoring data is calibrated and corrected to eliminate systematic errors and ensure the accuracy and traceability of the data, thus providing a high-quality and reliable data foundation for subsequent emission factor calculations and model training.
[0033] S2: Using the acquired, cleaned, and standardized water quality data and data on the three greenhouse gases, emission factors for the three greenhouse gases are constructed respectively: S201: Obtain COD and removal amount (COD) based on the acquired, cleaned, and standardized water quality data. r ) and total removal of nitrogen in three forms (TN) r ); S202: Based on the obtained COD r To establish emission factors for CO2 and CH4, TN r To establish the N2O emission factor.
[0034] S3: Combining the attention mechanism (AM) with the temporal convolutional network (TCN) model yields the TCNA fusion model: S301: Construct a Temporal Convolutional Network (TCN) model that can handle multiple input variables. The TCN generates feature representations for the sequence of each time step of the input variables. In the TCN, if the kernel is k, then the receptive field in the nth layer is k^(n-1). S302: Rebuild an attention mechanism (AM) that can process the features generated in S301, and then pass these feature representations to the AM to assign weights to emphasize the most critical time steps in the final prediction; S303: AM first initializes a trainable weight w and a bias b to calculate the attention score e of the feature representation at each time step, and then calculates the attention score in the manner of e=x·w+b. S304: Normalize the attention score using Softmax. The attention score e calculated in S303 is normalized to a probability distribution a using Softmax to ensure that the sum of the attention scores is 1. This assigns AM weights to the feature representation x at each time step, calculated as a = exp(e) / exp(e1 + e2 + ... + e). n e1, e2, ..., en are all the attention scores of the input, with each ei corresponding to a time step. They represent the level of attention the model pays to the feature at different time steps.
[0035] S305: Feature weight summation: Multiply the feature representation x of each time step by the corresponding AM weight a, and then sum them to obtain the final feature weight vector s. The calculation method is s=a·x. S306: Finally, the weighted features given by AM are passed to a fully connected layer to obtain the final output sequence.
[0036] S4: Using the acquired, cleaned, and standardized data as input variables and the constructed greenhouse gas emission factors as output variables, a soft measurement model from water quality to the three greenhouse gas emission factors is built by training the TCNA model. S401: Combine the constructed emission factors of the three greenhouse gases with the acquired, cleaned, and standardized data to construct a water quality-emission factor dataset; S402: Standardize the water quality-emission factor dataset to eliminate dimensional differences between different data items; S403: Randomly divide the water quality-emission factor dataset into training and test sets in an 8:2 ratio; S404: Input the training set into the constructed TCNA fusion model, and obtain the emission factor soft measurement model that performs best on the test set through multiple training sessions.
[0037] S5: Use these emission factors to calculate the amount of greenhouse gases emitted during wastewater treatment: S501: Obtain water quality data during the target wastewater treatment process; S502: Use the emission factor soft measurement model obtained in S404 to obtain the greenhouse gas emission factor in the target based on the water quality data in S501; S503: Obtain the target wastewater treatment capacity; S504: Calculate the target greenhouse gas (including CO2, CH4 and N2O) emissions based on the results of S502 and S503.
[0038] The research and development approach of this application involves collecting key water quality indicators and greenhouse gas concentration data during wastewater treatment. Based on chemical oxygen demand (COD) removal and total nitrogen (TNO) removal, emission factors for three greenhouse gases (CO2, CH4, and N2O) are constructed. A TCNA fusion model is built by deeply integrating an attention mechanism with a temporal convolutional network. This model is trained using water quality data as input and emission factors as output. Finally, the total greenhouse gas emissions are accurately calculated using dynamic emission factors and wastewater treatment volume. This method is particularly suitable for wastewater treatment systems employing anoxic-aerobic biological nitrogen and phosphorus removal processes, enabling accurate indirect measurement of greenhouse gas emissions that are difficult to monitor directly.
[0039] In the process of collecting water quality and greenhouse gas data during wastewater treatment, the working principle involves deploying online water quality monitoring sensors and greenhouse gas collection devices at key process nodes such as the influent channel, anaerobic tank, anoxic tank, aerobic tank, and effluent channel of the wastewater treatment plant. This continuously acquires core water quality parameters and gas concentration data reflecting wastewater treatment efficiency. The water quality data to be collected includes: Chemical Oxygen Demand (COD, the total amount of reducing substances in water that can be oxidized by strong oxidants, calculated by measuring absorbance using a spectrophotometer after oxidation at 165℃ for 2 hours using the potassium dichromate method, in mg / L); Suspended Solids (SS, the mass of non-dissolved solids per unit volume of water that cannot pass through a specific filter membrane, calculated by filtration of a certain volume of water using a 0.45μm glass fiber membrane in a vacuum filtration device, drying to constant weight in an oven at 105℃, in mg / L); and Ammonia Nitrogen (NH4). + -N refers to the nitrogen content in the form of ammonium ions, determined by measuring the absorbance at 697 nm using the salicylic acid-hypochlorite spectrophotometric method and comparing it with a standard curve, with units of mg / L. Nitrate nitrogen (NO3) - -N refers to the nitrogen content in the form of nitrate, measured using ultraviolet spectrophotometry at dual wavelengths of 220 nm and 275 nm to eliminate interference from organic matter, with units of mg / L. Nitrite nitrogen (NO2) - -N refers to the nitrogen content in the form of nitrite, measured by N-(1-naphthyl)-ethylenediamine spectrophotometry at a wavelength of 540 nm, in mg / L. Greenhouse gas data include carbon dioxide (CO2), quantified by detecting the absorption intensity of infrared light at a specific wavelength using a non-dispersive infrared sensor (NDIR), in μL / L; methane (CH4), quantified by retention time and peak area after separation on a gas chromatograph equipped with a flame ionization detector (FID), in μL / L; and nitrous oxide (N2O), detected by an electron capture detector (ECD) in a gas chromatograph, in μL / L. All sensors acquire data every 15 minutes, transmit it to the data acquisition unit via Modbus protocol, and after data cleaning (removing outliers beyond the physical range and smoothing using a moving average method), store it in the time-series database. This step provides reliable input for the construction of emission factors through multi-dimensional synchronous data acquisition, effectively avoiding calculation bias caused by the absence of a single data point. Then, data cleaning and standardization procedures are performed.
[0040] In the implementation example, let's take a certain method using A. 2Taking a municipal wastewater treatment plant using the / O process as an example, HACH brand online COD analyzers (using ultraviolet absorption method supplemented by periodic potassium dichromate method calibration), SS laser scattering particulate matter monitors, and NH4 monitors are installed at the inlet and outlet. + -N ion-selective electrode analyzer; closed gas chambers are deployed 20cm above the water surface in the anaerobic, anoxic, and aerobic tanks to collect gases, which are then connected to a Picarro G2508 greenhouse gas analyzer via PTFE tubing to monitor CO2, CH4, and N2O concentrations in real time (measurement accuracies of ±0.1ppm, ±0.01ppm, and ±0.001ppm, respectively). Data is transmitted to the Siemens SCADA system via RS485 bus. After outlier removal using the 3σ criterion, hourly averages are calculated and stored in a MySQL database. A total of 8760 sets of valid data were collected continuously for one year, including key parameters such as influent COD concentration range of 185-463mg / L, effluent SS concentration range of 5-15mg / L, and peak N2O concentration in the aerobic tank reaching 0.35μL / L.
[0041] In the steps of constructing emission factors for carbon dioxide, methane, and nitrous oxide based on collected, cleaned, and standardized water quality and greenhouse gas data, the working principle is based on the carbon and nitrogen transformation pathways and greenhouse gas formation mechanisms during wastewater treatment. Key removal indicators are calculated using material balance as the foundation for constructing the emission factors. Chemical oxygen demand removal (CODr, the total mass of COD removed per unit time, in kg / d) is calculated by integrating the daily influent flow rate. The specific calculation formula is: CODr(kg / d) = [(Influent COD concentration (mg / L) - Effluent COD concentration (mg / L)) × Daily treated water volume (m³)] 3 / d)] / 1000; Total nitrogen removal (TNr, referring to the total mass of nitrogen removed per unit time, in kg / d) is calculated using the same method. The calculation formula is: TNr(kg / d) = [(Influent total nitrogen concentration (mg / L) - Effluent total nitrogen concentration (mg / L)) × Daily treated water volume (m³)] / 1000; 3 / d)] / 1000, where the total nitrogen concentration is NH4 + -N, NO3 - -N, NO2 -The sum of -N concentrations. The CO2 emission factor (the mass of CO2 produced per kilogram of COD treated, in kg-CO2 / kg-CODr) is obtained by dividing the CO2 emission flux in the aerobic tank by the daily CODr; the CH4 emission factor (the mass of CH4 produced per kilogram of COD treated, in kg-CH4 / kg-CODr) is obtained by dividing the CH4 emission flux in the anaerobic tank by the daily CODr; the N2O emission factor (the mass of N2O produced per kilogram of total nitrogen treated, in kg-N2O / kg-TNr) is obtained by dividing the N2O emission flux in the aerobic tank by the daily TNr. The formula for calculating the gas emission flux (kg / d) is: Gas emission flux = [(Gas concentration in the gas chamber (μL / L) - Background gas concentration (μL / L)) × Gas flow rate (m³ / d)]. 3 [[(h / d)×24(h / d)×molecular weight(g / mol)] / [molar volume(L / mol)×1000(g / kg)]], where the molecular weight of CO2 is 44 g / mol, CH4 is 16 g / mol, N2O is 44 g / mol, and the molar volume under standard conditions (0℃, 101.325kPa) is 22.4 L / mol. In actual operation, corrections need to be made according to the on-site temperature and pressure. The gas flow rate is measured by a vortex flow meter installed at the gas chamber outlet (calibration accuracy ±1.5%FS). All calculations need to deduct the background concentration (using the monitoring value of the background point upwind of the plant area). This step establishes an emission factor accounting system that conforms to the IPCC guidelines by correlating the gas emission rate with the pollutant removal rate.
[0042] In the implementation example, taking the wastewater treatment plant's data from March 2022 as an example: the average daily treatment capacity was 100,000 tons (i.e., 100,000 m³). 3 The average influent COD was 285 mg / L, and the average effluent COD was 22 mg / L. Therefore, the daily CODr was calculated as [(285-22)×100,000] / 1000 = 26,300 kg / d. The average CH4 concentration in the anaerobic tank was 0.18 μL / L, the background concentration was 0.002 μL / L, and the gas flow rate was 12.5 m³ / d. 3 CH4 emission flux = [(0.18-0.002)×12.5×24×16] / (22.4×1000)≈0.00386kg-CH4 / d, then CH4 emission factor = 0.00386 / 26,300≈1.47×10 -7 kg-CH4 / kg-CODr; daily average TNr in the aerobic tank is 1.2 tons (1,200 kg / d), average N2O concentration is 0.28 μL / L, and gas flow rate is 30.8 m³ / kg. 3 The calculated N2O emission factor is approximately 4.25 × 10⁶ / h. -5kg-N2O / kg-TNr. This resulted in the construction of a dataset of 365 daily dynamic emission factors.
[0043] In the process of constructing the TCNA fusion model by combining the attention mechanism with the temporal convolutional network model, the working principle is to build a hybrid neural network structure that can simultaneously capture long-term dependencies in time series and key feature weights. The temporal convolutional network (TCN) part adopts an dilated causal convolutional architecture, containing 4 residual blocks (each block contains 2 convolutional layers), with a kernel width k=3, and the dilation coefficients increasing exponentially with the number of layers (d=1, 2, 4, 8). The receptive field size is calculated as: receptive field = 1 + 2 × (kernel_size - 1) × (dilation_rate_1 + dilation_rate_2 + ... + dilation_rate_n) = 1 + 2 × (3 - 1) × (1 + 2 + 4 + 8) = 61, ensuring that it can cover a sufficiently long input sequence. Batch normalization and ReLU activation functions are added after each convolutional layer, and the output feature dimension is set to 64. The attention mechanism receives the feature sequence output by the TCN (time step T × feature dimension 64), initializes the trainable weight matrix w (64×1 dimension) and bias vector b (T×1 dimension), and calculates the attention score for each time step (e is a T-dimensional vector) using e = x·w + b. Then, the Softmax function is used to transform e into an attention weight distribution a, specifically calculated as: a_t = exp(e_t) / Σ_{τ=1}^{T}exp(e_τ), ensuring that the sum of all weights is 1. Finally, the feature sequence and weight a are weighted and summed to obtain the context vector s = Σ_{t=1}^{T}(a_t·x_t). The final output layer is a fully connected network, mapping s to a 3-dimensional output (corresponding to three emission factors). The model uses the Adam optimizer (learning rate 0.001) and the mean squared error loss function, implemented in the TensorFlow framework. This structure captures the temporal patterns of water quality data through TCN and strengthens the influence weight of key time points (such as moments of sudden changes in water quality) through an attention mechanism, thereby improving the model's ability to capture dynamic changes in emission factors.
[0044] In the implementation example, a TCNA model was built based on Python 3.8 and TensorFlow 2.9: First, the input shape (None, 24, 5) was defined using the tf.keras.layers.Input layer (corresponding to a 24-hour time series and 5 water quality parameters); then, the TCN module was built using the tcn.TCN layer (nb_filters=64, kernel_size=3, dilations=[1, 2, 4, 8]); the output features were connected to a custom Attention layer (implementing the above weight calculation and Softmax normalization logic); finally, the emission factor was output through Dense(3). The total number of model parameters was 18,563. During training, batch_size=32 was set, and early stopping (patience=15) was used to prevent overfitting.
[0045] In training the TCNA fusion model using collected, cleaned, and standardized water quality data as input variables and constructed emission factors as output variables, the working principle is to divide the standardized water quality-emission factor dataset into training and testing sets in chronological order, and optimize the model parameters through multiple rounds of iteration. First, the water quality data (COD, SS, NH4) are... + -N, NO3 - -N, NO2 - The dataset is composed of 24-hour time-series data of -N and emission factor data (daily emission factors of CO2, CH4, and N2O). Z-score standardization is applied to each water quality parameter and emission factor separately (i.e., the mean μ and standard deviation σ of each parameter are calculated individually across the entire dataset, using the formula x_norm=(x-μ) / σ) to eliminate dimensional differences. The dataset is randomly divided into training and test sets in an 8:2 ratio (to maintain temporal continuity). The training set is input into the TCNA model, and forward propagation is used to calculate predicted values. The mean squared error loss is calculated by comparing these values with the actual emission factors. Parameters are updated through backpropagation and the Adam optimizer (while gradient clipping is used to limit the gradient norm to no more than 5.0 to maintain training stability). Performance is validated on the test set after every 10 epochs of training, and the model parameters with the lowest loss on the test set are retained. Training terminates when there is no improvement in test loss for 20 consecutive epochs or when the maximum of 500 training epochs is reached. The final model must meet R... 2 Performance requirements include a value >0.85 and an RMSE less than 15% of the emission factor range. This step establishes a nonlinear mapping relationship between water quality parameters and emission factors through a data-driven approach, replacing traditional empirical formulas and achieving high-precision soft measurement of emission factors.
[0046] In the implementation example, 365 valid samples were constructed using one year's worth of data from the aforementioned wastewater treatment plant (one sample per day, with an input of a 24×5 water quality time-series matrix and an output of a 3D emission factor vector). After standardization, the data was divided into 292 training samples and 73 test samples. The training process showed that an early shutdown mechanism was triggered in the 217th round, and the model's performance on the test set was as follows: CO2 emission factor prediction R... 2 The predicted CH4 emission factor R is 0.89, with an RMSE of 0.0041 kg-CO2 / kg-CODr. 2 The predicted N2O emission factor R is 0.87, with an RMSE of 0.0013 kg-CH4 / kg-CODr. 2 The concentration was 0.83 and the RMSE was 0.0062 kg-N2O / kg-TNr, all of which met the predetermined requirements.
[0047] In the step of calculating greenhouse gas emissions using emission factors output by a soft-sensor model, the working principle is to input real-time water quality data from the target wastewater treatment plant into a trained TCNA model, obtain dynamic emission factors, and then perform calculations based on the treated water volume. First, recent water quality data (using the same five parameters, the same 24-hour time series, and the same sampling frequency as the training data) is obtained from the target plant's SCADA system. This data is then Z-score standardized using the same mean μ and standard deviation σ calculated during the training phase before being input into the model, outputting the predicted values of the three greenhouse gas emission factors for the day. Simultaneously, the daily treated water volume Q (in tons, i.e., m³) is obtained from the flow meter. 3 CO2 emissions (kg) = predicted CO2 emission factor (kg - CO2 / kg - CODr) × daily CODr (kg); CH4 emissions (kg) = predicted CH4 emission factor (kg - CH4 / kg - CODr) × daily CODr (kg); N2O emissions (kg) = predicted N2O emission factor (kg - N2O / kg - TNr) × daily TNr (kg). To assess the overall greenhouse effect, the final result often needs to be converted to carbon dioxide equivalent (CO2e), using the IPCC-recommended Global Warming Potential (GWP): CO2 = 1, CH4 = 25, N2O = 298, i.e., total CO2e (kg) = CO2 emissions + 25 × CH4 emissions + 298 × N2O emissions. This step enables accurate indirect accounting for gases that are difficult to measure directly, providing reliable data support for wastewater treatment plant carbon footprint accounting and carbon trading.
[0048] In the implementation example, a certain company in Guangdong adopted A. 2 The wastewater treatment plant using the / O process has cumulatively treated 35.92 million cubic meters of wastewater over three years (i.e., 35,920,000 m³). 3The daily emission factors calculated using the soft-sensor model constructed in this method are: CO2 0.82 kg / kg-CODr, CH4 1.47 × 10⁻⁶. -4 The CODr and N2O emissions are calculated to be 0.048 kg / kg-TNr. Combining this with the three-year cumulative CODr of 2,362,000 kg and the cumulative TNr of 133,000 kg, the calculated CO2 emissions are 1,936,840 kg (approximately 1936.8 tons), CH4 emissions are 347 kg (approximately 0.35 tons), and N2O emissions are 6,384 kg (approximately 6.38 tons), equivalent to a total CO2 equivalent of 2,123,107 kg CO2e (approximately 2123 tons). This result demonstrates higher spatiotemporal resolution and accuracy compared to results obtained using traditional emission factor methods or intermittent direct measurement methods.
[0049] This technical solution significantly improves the accuracy of greenhouse gas emission calculation by introducing a TCNA fusion model and dynamically generating greenhouse gas emission factors from water quality data. This method not only acquires real-time water quality data from the target wastewater treatment system but also provides accurate predictions of greenhouse gas emissions over different time periods by combining emission factors with dynamic water quality information. Compared to traditional methods, this technology uses a deep learning model to learn and automatically optimize complex data patterns, avoiding errors from human experience and flexibly adjusting emission factors according to different operating conditions, thereby improving the model's adaptability and accuracy. Simultaneously, the establishment of a soft-sensor model eliminates the need for complex experiments or on-site monitoring during wastewater treatment, reducing costs and workload. Furthermore, by incorporating an attention mechanism, the model can highlight key time steps, enhancing the efficiency and effectiveness of feature selection and further improving the reliability and stability of predictions. Therefore, this method can provide wastewater treatment plants with more scientific emission estimates, optimize treatment processes, reduce greenhouse gas emissions, and contribute to achieving carbon reduction targets.
[0050] Figure 2 This paper presents the detailed internal structure of the TCNA (Temporal Convolutional Network and Attention Mechanism) fusion model employed in this application. Key components of the model are depicted, including Dilated Causal Convolution (DilatedCausalConv), Weight Normalization (WeightNorm), Rectified Linear Unit (ReLU) activation function, Dropout layer to prevent overfitting, and the data flow through a fully connected (Dense) layer for linear transformation and output of the prediction results, demonstrating the sophistication and complexity of the model design.
[0051] Figure 3This paper demonstrates the predictive performance of the soft measurement model constructed in this application for one type of greenhouse gas emission factor (EF). The figure compares the "predicted EF value" output by the model with the "experimental EF value" calculated from actual monitoring data. The trend of the data points distributed along the diagonal line intuitively verifies that the model's prediction results have high accuracy.
[0052] Figure 4 This further illustrates the comparison between the soft-sensor model's predicted and experimental values for another greenhouse gas emission factor. The results are consistent with... Figure 3 Together, these findings demonstrate that the model constructed in this application has good predictive performance for different types of greenhouse gas emission factors, proving the effectiveness and versatility of the model method.
[0053] Figure 5 The model specifically showcases a comparison of its predictive performance for nitrous oxide (N2O) emission factors (unit: g-N2O / kg-TNr). The figure clearly demonstrates that, for N2O, a greenhouse gas with a complex formation mechanism and high volatility, the model's predictions closely track experimental values, accurately reflecting the intrinsic relationship between nitrogen conversion and N2O emissions during wastewater treatment.
[0054] Figure 6 This paper presents the overall framework of the wastewater treatment plant (WWTP) carbon emission accounting system implemented in this application. The system is centered on a "greenhouse gas soft measurement model" and an "emission factor soft measurement model." It receives "water quality parameters" and "greenhouse gas" data from a "wastewater treatment experimental platform" or an actual "wastewater treatment plant" as input, ultimately achieving accurate calculation of "WWTP carbon emissions (CO2, CH4, N2O)." The paper clearly describes the complete technical path from data to model.
[0055] In some embodiments, the present invention provides a greenhouse gas accounting system for wastewater treatment processes, comprising: The data acquisition module is used to collect time-series data on water quality and greenhouse gas emissions during the wastewater treatment process. The calculation module is used to clean and calibrate the collected water quality and greenhouse gas emission time series data to obtain the emission factors of gas components. The building module is used to construct a fusion prediction model for greenhouse gas emission factors (TCNA) in wastewater treatment processes based on attention mechanisms and temporal convolutional networks. The training module is used to train the TCNA fusion prediction model of greenhouse gas emission factors using the collected, cleaned, and calibrated water quality and greenhouse gas emission time series data and the corresponding gas component emission factors obtained as output variables, so as to obtain the trained TCNA fusion prediction model. The calculation module is used to calculate the greenhouse gas emissions during the wastewater treatment process by using the greenhouse gas emission factor TCNA fusion prediction model to output emission factors.
[0056] In some embodiments, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the program to implement the greenhouse gas accounting method in the wastewater treatment process as described in any of the preceding claims.
[0057] In some embodiments, the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when executed by a processor, the program implements the greenhouse gas accounting method in the wastewater treatment process as described in any of the preceding claims.
[0058] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A sewage treatment process greenhouse gas emission intelligent accounting method, characterized in that, The method comprises the following steps: Collecting water quality and greenhouse gas emission time series data of the sewage treatment process; Based on the collected water quality and greenhouse gas emission time series data, cleaning, calibration and calculation are performed to obtain gas component emission factors; the gas components include carbon dioxide, methane and nitrous oxide; A greenhouse gas emission factor TCNA fusion prediction model of the sewage treatment process based on attention mechanism and time convolution network is built; Using the collected, cleaned and calibrated water quality and greenhouse gas emission time series data and the obtained corresponding gas component emission factors as output variables, the greenhouse gas emission factor TCNA fusion prediction model is trained to obtain a trained TCNA fusion prediction model; The trained TCNA fusion prediction model is used to output greenhouse gas emission factors and calculate the greenhouse gas emission of the sewage treatment process.
2. The sewage treatment process greenhouse gas emission intelligent accounting method according to claim 1, characterized in that, The sewage treatment process water quality time series data includes influent and effluent chemical oxygen demand COD, suspended solids SS, ammonia nitrogen NH4 + -N, nitrate nitrogen NO3 - -N and nitrite nitrogen NO2 - -N; the greenhouse gas emission time series data includes total emission, carbon dioxide, methane and nitrous oxide concentration and proportion.
3. The sewage treatment process greenhouse gas emission intelligent accounting method according to claim 1, characterized in that, The cleaning, calibration based on the collected water quality and greenhouse gas emission time series data comprises: Data cleaning step: invalid, abnormal and noise points in the data are identified and processed by algorithm to improve the data quality; Data calibration step: based on standard reference or authoritative measurement method, the accuracy of the cleaned data is corrected.
4. The sewage treatment process greenhouse gas emission intelligent accounting method of claim 1, wherein, The calculation of the gas component emission factors and the correlation between the gas component emission factors and the water quality data comprises: According to the collected water quality time series data, the chemical oxygen demand removal amount CODr and the total nitrogen removal amount TNr of the sewage treatment process are calculated; Based on the chemical oxygen demand removal amount CODr of the sewage treatment process, carbon dioxide and methane emission factors of the sewage treatment process are obtained; Based on the total nitrogen removal amount TNr, the nitrous oxide emission factor of the sewage treatment process is obtained.
5. The sewage treatment process greenhouse gas emission intelligent accounting method according to claim 1, characterized in that, The greenhouse gas emission factor TCNA fusion prediction model of the sewage treatment process based on attention mechanism and time convolution network is built, which comprises: A time convolution network model is built to process multiple input variables and generate feature representations for each time step sequence; An attention mechanism is constructed to process the feature representations generated by the time convolution network model and assign weights to the final prediction to emphasize the most critical time steps; The attention mechanism initializes a trainable weight w and a bias b, and calculates the attention score e of each time step feature representation according to the formula e equals x multiplied by w plus b; The attention score e is regularized to a probability distribution a using the Softmax function to ensure that the sum of all attention scores is 1, so as to assign an attention mechanism weight to each time step feature representation x; Each time step feature representation x is multiplied by the corresponding attention mechanism weight a, and then summed to obtain the final feature weight vector s; The feature weight vector s is transmitted to a fully connected layer to obtain the final output sequence.
6. The sewage treatment process greenhouse gas emission intelligent accounting method according to claim 1, characterized in that, The collected, cleaned and calibrated water quality and greenhouse gas emission time series data and the obtained corresponding gas component emission factors are used as output variables to train the greenhouse gas emission factor TCNA fusion prediction model to obtain a trained TCNA fusion prediction model, which comprises: The collected water quality data and the constructed greenhouse gas emission factors are combined into a water quality-emission factor data set; standardizing the water quality-emission factor dataset to eliminate dimensional differences between different data items; dividing the standardized water quality-emission factor dataset into a training set and a test set in a ratio of 8:2 at random; inputting the training set into the constructed TCNA fusion prediction model for multiple training, verifying the model performance through the test set, and taking the best model performance as the trained greenhouse gas emission factor TCNA fusion prediction model.
7. The sewage treatment process greenhouse gas emission intelligent accounting method according to claim 1, characterized in that, The trained TCNA fusion prediction model is used to output greenhouse gas emission factors and calculate the greenhouse gas emissions of the sewage treatment process, including: acquiring the water quantity of the target sewage treatment system; acquiring the water quality data of the target sewage treatment process; inputting the target sewage treatment process water quality data into the trained greenhouse gas emission factor TCNA fusion prediction model to obtain the target sewage treatment process greenhouse gas dynamic emission factor; calculating the greenhouse gas emissions according to the greenhouse gas dynamic emission factor and the sewage treatment quantity.
8. A sewage treatment process greenhouse gas emission intelligent accounting system, characterized in that, It includes: a collection module for collecting sewage treatment process water quality and greenhouse gas emission time series data; a calculation module for cleaning and calibrating based on the collected water quality and greenhouse gas emission time series data to obtain gas component emission factors; a construction module for building a sewage treatment process greenhouse gas emission factor TCNA fusion prediction model based on an attention mechanism and a time convolution network; a training module for training the greenhouse gas emission factor TCNA fusion prediction model using the collected, cleaned and calibrated water quality and greenhouse gas emission time series data and the corresponding gas component emission factors obtained as output variables to obtain a trained TCNA fusion prediction model; an accounting module for calculating the greenhouse gas emissions of the sewage treatment process using the greenhouse gas emission factor TCNA fusion prediction model to output emission factors.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to realize the sewage treatment process greenhouse gas emission intelligent accounting method of any one of claims 1-7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to realize the sewage treatment process greenhouse gas emission intelligent accounting method of any one of claims 1-7. The program is executed by the processor to realize the sewage treatment process greenhouse gas emission intelligent accounting method of any one of claims 1-7.