A Transformer-based method and system for carbon accounting in zero-carbon industrial parks

By using a Transformer-based multi-scale temporal fusion coding model and a category-constrained multi-head attention module, the problems of temporal feature capture and auditability of carbon accounting results in zero-carbon parks are solved, achieving efficient and reliable carbon accounting and points management.

CN121903181BActive Publication Date: 2026-07-17XIANGJIANG LAB

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIANGJIANG LAB
Filing Date
2026-03-25
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately capture the temporal characteristics of multi-source heterogeneous data in carbon accounting for zero-carbon parks. The accounting results lack auditable traceability and are subject to uncertainty and low credibility, failing to meet the requirements for third-party verification and compliance management.

Method used

A Transformer-based multi-scale temporal fusion coding model is adopted. The fusion input tensor is generated through the preprocessing of multi-source heterogeneous carbon data, and carbon flow tracking is performed using a class-constrained multi-head attention module. Combined with uncertainty analysis and carbon integral generation optimization modules, auditable carbon accounting results and evidence packages are output.

Benefits of technology

It achieves accurate alignment and robust governance of multi-source heterogeneous carbon data, improves the accuracy of time-series feature modeling, provides verifiable decomposition and credibility assessment of carbon emission source contributions, and meets the construction and management requirements of zero-carbon parks that are measurable, accountable, and auditable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121903181B_ABST
    Figure CN121903181B_ABST
Patent Text Reader

Abstract

This invention discloses a carbon accounting method and system for zero-carbon industrial parks based on Transformer. The method includes: collecting multi-source heterogeneous carbon data from zero-carbon industrial parks and performing preprocessing to generate a fusion input tensor and corresponding data quality identifiers; inputting the fusion input tensor into a multi-scale time-series fusion coding model, and generating an intermediate representation of time-series features through multi-branch coding processing adapted to different data sources and sampling granularities; obtaining emission source contribution decomposition information through a category-constrained carbon flow tracking attention module, completing uncertainty analysis to obtain the target carbon accounting result and confidence interval data; and generating a compliant carbon integral scheme and auditable evidence package through a carbon integral generation optimization module. This effectively solves the problems of difficulty in aligning multi-source heterogeneous data in zero-carbon industrial parks, insufficient consideration of both periodic and abrupt features, and poor traceability of accounting results, significantly improving the accuracy and compliance of carbon accounting, and realizing a complete closed loop from carbon accounting to incentive management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of energy metering and carbon emission accounting, and in particular to a carbon accounting method and system for zero-carbon industrial parks based on Transformer. Background Technology

[0002] Currently, technologies related to carbon emission accounting and management in industrial parks mainly fall into two mainstream paths. One is the static inventory method, which relies on fixed emission factors to conduct periodic carbon emission accounting. This method is a commonly used compliant accounting method in the industry, but it suffers from problems such as coarse time granularity, weak dynamic response capability, and inability to achieve time-based refined accounting. The other is the dynamic accounting method, which uses traditional time-series deep learning models such as Long Short-Term Memory Networks and Gated Recurrent Units, or the general Transformer architecture to conduct time-series prediction and accounting of carbon emissions. Some solutions have also carried out rule-based optimization designs around carbon credit allocation; however, these solutions are mostly scenario-based applications of general models, without structural adaptation to the characteristics of multi-scale heterogeneous carbon data in zero-carbon parks, and without deeply integrating the auditability requirements of carbon accounting and the compliance constraints of carbon credits with model design.

[0003] There are four major shortcomings in the application of existing technologies for carbon accounting and carbon credit management in zero-carbon industrial parks. First, aligning and fusing multi-source heterogeneous data is challenging. Data with different sampling frequencies and modalities, after simple resampling and interpolation, are prone to losing key information and introducing interpolation noise, directly leading to increased errors in the calculation results. Second, the ability to capture time-series features is insufficient, making it difficult to simultaneously consider the inherent seasonal and shift-based multi-periodic patterns of carbon emissions, as well as the short-term abrupt changes caused by equipment start-up and shutdown and operating condition switching. This can easily lead to periodic fitting deviations or the smoothing of abrupt events. Third, the calculation results lack auditable traceability. Existing neural network models are mostly "black box" structures, only able to output carbon emission calculation values, unable to provide verifiable emission source contribution decomposition results and complete evidence chains, making it difficult to meet the requirements of third-party verification, auditing, and responsibility allocation. Fourth, carbon accounting and carbon asset management are disconnected, lacking the quantification of uncertainty and credibility assessment of the calculation results, failing to provide a safety margin for auditing, and making it difficult to achieve closed-loop management from accurate accounting to compliant carbon credit generation under the hard constraints of carbon quotas and policy rules. Summary of the Invention

[0004] The main objective of this invention is to provide a carbon accounting method and system for zero-carbon industrial parks based on Transformer, aiming to solve the technical problems of existing technologies, such as difficulty in accurately capturing time-series characteristics from multi-source heterogeneous data, lack of auditable and traceable accounting results, and uncertainty and low credibility of accounting results.

[0005] To achieve the above objectives, this invention provides a carbon accounting method for zero-carbon industrial parks based on Transformer, the method comprising the following steps:

[0006] Collect multi-source heterogeneous carbon data from the target park, and preprocess the multi-source heterogeneous carbon data to generate a fusion input tensor and a data quality identifier.

[0007] The fusion input tensor is input into the pre-trained multi-scale temporal fusion coding model, and the output temporal feature intermediate representation vector is generated. The multi-scale temporal fusion coding model is a multi-scale Transformer architecture. The multi-scale temporal fusion coding model includes feature extraction modules of multiple branches. Each branch's feature extraction module corresponds to processing a data source or a sampling granularity. The feature extraction module is used to encode the input data of each branch.

[0008] The intermediate representation vector of the time-series features and the data quality identifier are input into the carbon flow tracing attention module to obtain contribution decomposition information. The carbon flow tracing attention module is a category-constrained multi-head attention structure, where each attention head corresponds to a carbon emission category and the contribution decomposition is constrained by a mask matrix.

[0009] Based on the contribution decomposition information, uncertainty analysis is performed on the intermediate representation vector of the time series features to obtain the target carbon accounting results and confidence interval data.

[0010] The contribution decomposition information, target carbon accounting results, and confidence interval data are input into the carbon integral generation and optimization module to generate a carbon integral scheme and an auditable evidence package.

[0011] Optionally, the multi-scale temporal fusion coding model further includes a cross-modal attention fusion module, frequency domain adaptive position coding, and a mutation-aware attention head;

[0012] The cross-modal attention fusion module is used to learn trainable initial attention weights for the branch feature vectors output by the feature extraction modules of each branch; dynamically correct the initial attention weights based on the quality identification features of each branch to determine the target attention weights of each branch; and perform cross-modal attention fusion on the feature extraction modules of each branch based on the target attention weights to output global temporal fusion features.

[0013] The frequency domain adaptive position coding module is used to perform frequency domain analysis on the global time-series fusion features, extract the dominant frequency term features, generate frequency domain adaptive position codes based on the dominant frequency term features, and inject the frequency domain adaptive position codes into each time step of the global time-series fusion features to perform periodic enhancement processing on the global time-series fusion features.

[0014] The mutation-aware attention head is used to perform mutation enhancement processing on the global temporal fusion features after periodic enhancement processing, and output the intermediate representation vector of the temporal features.

[0015] Optionally, the mutation-aware attention head is further used to construct first-order and second-order temporal difference features step-by-step on the global temporal fusion features after periodic enhancement processing. The first-order temporal difference features are used to characterize the feature change amplitude of adjacent time steps, and the second-order temporal difference features are used to characterize the fluctuation of the feature change rate. The first-order and second-order temporal difference features and the data quality features of the corresponding time steps are concatenated to obtain concatenated features. The concatenated features are then mapped using a multilayer perceptron, and the mapped concatenated features are input into a Sigmoid activation function for normalization processing to calculate the mutation intensity score for each time step. In the scaling dot product attention calculation process of the degree-temporal fusion coding model, a mutation bias term constructed based on the mutation intensity score is introduced. The mutation bias term increases the attention allocation weight corresponding to the time step where the mutation occurs, and the attention calculation process is constrained by a causal mask matrix. Based on the mutation intensity score, the value vector channel in the attention calculation process is gated and enhanced to obtain a gated and enhanced attention value vector, thereby increasing the influence of the features at the mutation time on the attention output result. Based on the adjusted attention weights and the gated and enhanced attention value vector, mutation enhancement processing is performed on the global temporal fusion features after periodic enhancement processing to output the intermediate representation vector of temporal features.

[0016] Optionally, the multi-scale temporal fusion coding model further includes a data splitting module;

[0017] The data splitting module is used to split the fused input tensor into multiple branches of input data based on the sampling scale and data source type;

[0018] The feature extraction module is further configured to map the data source fields corresponding to the input data into fixed-dimensional feature vectors to obtain a field-mapped feature sequence; using a globally unified time grid as a reference, perform sliding window aggregation on high-frequency sequences in the field-mapped feature sequence, and perform event unrolling or forward padding operations on low-frequency sequences to generate a windowed feature sequence; perform robust preprocessing on the windowed feature sequence to obtain a robustly preprocessed feature sequence, the robust preprocessing including missing data imputation and abnormal data repair; map the robustly preprocessed feature sequence to the latent space dimension through a linear projection layer or a one-dimensional convolutional layer, perform layer normalization on the mapped feature sequence, and perform noise suppression on the layer-normalized feature sequence through a gating unit to output a branch embedding feature sequence; perform position encoding on the branch embedding feature sequence to output a branch feature vector.

[0019] Optionally, the step of collecting multi-source heterogeneous carbon data from the target park and preprocessing the multi-source heterogeneous carbon data to generate a fused input tensor and data quality identifier includes:

[0020] Collect multi-source heterogeneous carbon data of the target park, including electricity load sequence, gas consumption sequence, heat consumption sequence, production log data, transportation and logistics energy consumption data and meteorological data;

[0021] The multi-source heterogeneous carbon data is subjected to time granularity alignment and time series correction to generate aligned initial time series data;

[0022] The initial time series data is subjected to data quality preprocessing, and tensor transformation is performed on the processed initial time series data to generate a fused input tensor. A corresponding data quality identifier is generated based on the data quality preprocessing process. The data quality preprocessing includes downsampling and aggregating high-frequency data in the initial time series data, and upsampling and interpolating or event unfolding low-frequency data.

[0023] Optionally, the carbon flow tracking attention module is used to obtain emission category embedding vectors and emission source embedding vectors, and use the emission category embedding vectors and emission source embedding vectors as attention query vectors; use the intermediate representation vectors of time-series features as attention key vectors and attention value vectors respectively, and construct a category-constrained multi-head attention structure based on the attention query vectors, attention key vectors, and attention value vectors; set a mask matrix corresponding to the emission category for each attention head of the category-constrained multi-head attention structure, perform constrained attention calculation, and generate an emission source-time dimension contribution weight matrix; generate contribution decomposition information based on the contribution weight matrix, the contribution decomposition information including a contribution decomposition report field and a contribution heatmap, the contribution decomposition report field including emission category, emission device, emission time period, contribution ratio, and number of restrictive candidate words.

[0024] Optionally, the step of performing uncertainty analysis on the intermediate representation vector of the time-series features based on the contribution decomposition information to obtain the target carbon accounting results and confidence interval data includes:

[0025] Carbon emission time series prediction is performed based on the intermediate representation vector of the time series features to generate initial carbon accounting results;

[0026] The Dropout layer of the multi-scale temporal fusion coding model is subjected to multiple forward inferences using a Monte Carlo random deactivation method.

[0027] Calculate the confidence interval data corresponding to the initial carbon accounting result and the contribution decomposition information based on the results of multiple forward inferences;

[0028] Based on the data quality identifier, the initial carbon accounting results, the contribution decomposition information, and the confidence interval data are verified to generate the target carbon accounting results and confidence interval data.

[0029] Optionally, the carbon integral generation optimization module is configured to generate an initial carbon integral generation and allocation scheme through a multi-objective optimization layer, wherein the total loss function of the multi-objective optimization layer refers to the following formula:

[0030]

[0031]

[0032]

[0033]

[0034]

[0035]

[0036]

[0037] in, Represents the total loss item. This represents the amount of carbon integral allocated to object i in period t. This represents the total amount of carbon integrals generated in period t. , , , , and These represent the weight coefficients of each item. This indicates a quota constraint. This represents the upper bound of the confidence interval for calculating emissions over period t. This indicates the upper limit of the carbon emission quota for the park in period t. Indicates the total number of settlement cycles. Indicates policy and rule constraints. A function representing the degree of violation of a single rule r. Represents a set of policies and rules. This indicates a risk uncertainty term. This represents the width of the confidence interval for calculating emissions over period t. This represents the lower bound of the confidence interval for calculating emissions over period t. Represents a non-decreasing penalty function. Indicates a fair allocation item. This represents the percentage of carbon emission contribution of object i in period t. Represents a constant. Represents the smoothing term of the scheme. Indicates the revenue item. This represents the carbon integral price over period t. Indicates the traversal index of an allocatable object;

[0038] The carbon credit generation optimization module is configured to generate a carbon credit scheme and an auditable evidence package based on the initial carbon credit generation and allocation scheme, the target carbon accounting result, the contribution decomposition information, the confidence interval data, and the data quality identifier.

[0039] Furthermore, to achieve the above objectives, this invention also proposes a Transformer-based zero-carbon park carbon accounting system that applies the Transformer-based zero-carbon park carbon accounting method described above. The Transformer-based zero-carbon park carbon accounting system includes:

[0040] The data processing module is used to collect multi-source heterogeneous carbon data of the target park, and preprocess the multi-source heterogeneous carbon data to generate a fusion input tensor and a data quality identifier.

[0041] A multi-scale encoding module is used to input the fused input tensor into a pre-trained multi-scale temporal fusion encoding model and output a temporal feature intermediate representation vector. The multi-scale temporal fusion encoding model is a multi-scale Transformer architecture. The multi-scale temporal fusion encoding model includes feature extraction modules with multiple branches. Each branch's feature extraction module corresponds to processing a data source or a sampling granularity. The feature extraction module is used to encode the input data of each branch.

[0042] The contribution decomposition module is used to input the intermediate representation vector of the time-series features and the data quality identifier into the carbon flow tracing attention module to obtain contribution decomposition information. The carbon flow tracing attention module is a category-constrained multi-head attention structure, where each attention head corresponds to a carbon emission category and the contribution decomposition is constrained by a mask matrix.

[0043] The uncertainty analysis module is used to perform uncertainty analysis on the intermediate representation vector of the time series features based on the contribution decomposition information, and to obtain the target carbon accounting results and confidence interval data.

[0044] The carbon accounting module is used to input the contribution decomposition information, target carbon accounting results and confidence interval data into the carbon integral generation and optimization module to generate a carbon integral scheme and an auditable evidence package.

[0045] Optionally, the multi-scale temporal fusion coding model further includes a cross-modal attention fusion module, frequency domain adaptive position coding, and a mutation-aware attention head;

[0046] The cross-modal attention fusion module is used to learn trainable initial attention weights for the branch feature vectors output by the feature extraction modules of each branch; dynamically correct the initial attention weights based on the quality identification features of each branch to determine the target attention weights of each branch; and perform cross-modal attention fusion on the feature extraction modules of each branch based on the target attention weights to output global temporal fusion features.

[0047] The frequency domain adaptive position coding module is used to perform frequency domain analysis on the global time-series fusion features, extract the dominant frequency term features, generate frequency domain adaptive position codes based on the dominant frequency term features, and inject the frequency domain adaptive position codes into each time step of the global time-series fusion features to perform periodic enhancement processing on the global time-series fusion features.

[0048] The mutation-aware attention head is used to perform mutation enhancement processing on the global temporal fusion features after periodic enhancement processing, and output the intermediate representation vector of the temporal features.

[0049] This invention achieves accurate alignment and robust governance of carbon data across granularities and modalities through standardized preprocessing and quality label generation of multi-source heterogeneous carbon data, reducing accounting errors caused by data noise and information loss at the source. Relying on a multi-branch, multi-scale Transformer architecture adaptable to different data sources and sampling granularities, it achieves adaptive fusion of multi-source time-series features while accurately capturing multi-periodic patterns and short-term abrupt events in carbon emissions, significantly improving the accuracy of time-series feature modeling. Through a category-constrained carbon flow tracking attention module, it achieves verifiable decomposition of carbon emission source contributions, effectively solving the problem of untraceable black boxes in traditional neural network models. Combined with the carbon accounting results and confidence intervals output by uncertainty analysis, it provides quantitative credibility assessment and safety margins for audit verification. Finally, through a carbon integral generation optimization module and the output of auditable evidence packages, it significantly improves the efficiency and refinement of carbon accounting in industrial parks, reduces manual accounting and auditing costs, and provides reliable support for emission reduction optimization and carbon asset operation in industrial parks, fully adapting to the construction and management requirements of zero-carbon parks that are measurable, accountable, verifiable, and auditable. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1This is a schematic diagram of the structure of a Transformer-based zero-carbon park carbon accounting device in the hardware operating environment of the embodiment of the present invention.

[0052] Figure 2 This is a flowchart illustrating the first embodiment of the zero-carbon park carbon accounting method based on Transformer of the present invention.

[0053] Figure 3 This is a schematic diagram of the structure of a multi-scale temporal fusion coding model in one embodiment of the zero-carbon park carbon accounting method based on Transformer of the present invention;

[0054] Figure 4 This is a flowchart illustrating the second embodiment of the zero-carbon park carbon accounting method based on Transformer of the present invention.

[0055] Figure 5 This is a flowchart illustrating the third embodiment of the zero-carbon park carbon accounting method based on Transformer of the present invention.

[0056] Figure 6 This is a flowchart illustrating the fourth embodiment of the zero-carbon park carbon accounting method based on Transformer of the present invention.

[0057] Figure 7 This is a structural block diagram of the first embodiment of the zero-carbon park carbon accounting system based on Transformer of the present invention.

[0058] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0059] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0060] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a Transformer-based zero-carbon park carbon accounting device, which is part of the hardware operating environment involved in the embodiments of the present invention.

[0061] like Figure 1As shown, the Transformer-based zero-carbon park carbon accounting device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; the user interface 1003 may also include standard wired and wireless interfaces. The network interface 1004 may optionally include standard wired and wireless interfaces (such as Wireless-Fidelity (Wi-Fi) interfaces). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage system independent of the aforementioned processor 1001.

[0062] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the carbon accounting equipment for zero-carbon parks based on Transformer, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0063] like Figure 1 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a carbon accounting program for zero-carbon parks.

[0064] exist Figure 1 In the Transformer-based zero-carbon park carbon accounting device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and memory 1005 in the Transformer-based zero-carbon park carbon accounting device of the present invention can be set in the Transformer-based zero-carbon park carbon accounting device. The Transformer-based zero-carbon park carbon accounting device calls the zero-carbon park carbon accounting program stored in the memory 1005 through the processor 1001 and executes the Transformer-based zero-carbon park carbon accounting method provided in the embodiment of the present invention.

[0065] This invention provides a method for carbon accounting in zero-carbon industrial parks based on Transformer, referring to... Figure 2 , Figure 2This is a flowchart illustrating the first embodiment of the zero-carbon park carbon accounting method based on Transformer of the present invention.

[0066] In this embodiment, the zero-carbon park carbon accounting method based on Transformer includes the following steps:

[0067] Step S10: Collect multi-source heterogeneous carbon data of the target park, and preprocess the multi-source heterogeneous carbon data to generate a fusion input tensor and a data quality identifier.

[0068] It should be understood that the executing entity of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or a terminal electronic device capable of performing the above functions. The following description uses a Transformer-based zero-carbon park carbon accounting device (hereinafter referred to as the accounting device) as an example to illustrate this embodiment and the following embodiments.

[0069] It should be noted that multi-source heterogeneous carbon data refers to various types of raw carbon emission and carbon reduction data within the zero-carbon park, which have different sources, data structures, collection granularities, and format standards. Multi-source heterogeneous carbon data includes at least electricity load sequences, gas / heat consumption sequences, production plans or production logs, transportation / logistics energy consumption, and meteorological data.

[0070] It should be noted that the data quality identifier can be a quantitative representation vector generated based on the quality verification results in the preprocessing stage. This vector is used to mark the missing rate, anomaly rate, completeness, and timeliness level of the corresponding carbon data, providing a quality weighting basis for subsequent model calculations and avoiding interference from low-quality data on the calculation results.

[0071] In the specific implementation, the accounting equipment acquires multi-source heterogeneous carbon data of the zero-carbon park, and obtains the mapping relationship and accounting boundary information of metering points, equipment, energy users, and the main body of energy consumption. It performs unified time granularity alignment and time correction on the multi-source data, uses an adaptive interpolation network to fill in missing values, and detects and repairs outliers to generate a fused input tensor. At the same time, it outputs data quality labels and completion / repair confidence scores.

[0072] Furthermore, in order to improve data quality and accurately address the issues of disorganized dimensions, misaligned timelines, format mismatches, and ambiguous entity relationships in multi-source carbon data, the aforementioned deficiencies in S10 may include:

[0073] Step S101: Collect multi-source heterogeneous carbon data of the target park.

[0074] It should be noted that multi-source heterogeneous carbon data includes electricity load series, gas consumption series, heat consumption series, production log data, transportation and logistics energy consumption data, and meteorological data.

[0075] Among them, the power load sequence refers to the time-series data of power load fluctuations in the park recorded at fixed time intervals, reflecting the changes in power load in different time periods and different areas.

[0076] Gas / heat consumption sequence refers to the time-series data of gas and heat consumption values ​​in the park, which are recorded continuously over time and belong to the direct consumption data of fossil energy.

[0077] Transportation and logistics energy consumption data refers to various energy consumption data generated within the park and for logistics transportation entering the park, covering motor vehicle fuel, electricity consumption of new energy vehicles, etc., and belongs to auxiliary carbon emission data within the park's carbon accounting boundary.

[0078] Step S102: Perform time granularity alignment and time series correction processing on the multi-source heterogeneous carbon data to generate aligned initial time series data.

[0079] In some embodiments, the optimization device can address the issue of inconsistent time granularity of carbon data (e.g., power load at the minute level, production logs at the shift level, and meteorological data at the hour level). First, it can uniformly set a reference time granularity (usually at the hour or day level). Then, it can perform timestamp standardization processing on various types of raw data, aligning the collection timestamps of all data to the reference time node. Subsequently, it can perform time series correction to address the time series disorder caused by data collection delays, interruptions, and time offsets. Through linear correction and time window padding, it can correct the data time series order, ensuring that all carbon data are arranged in an orderly manner along the time axis, generating initial time series data with a completely unified time dimension, and eliminating carbon flow accounting deviations caused by time misalignment.

[0080] Step S103: Perform data quality preprocessing on the initial time series data, and perform tensor transformation operation on the processed initial time series data to generate a fused input tensor, and generate a corresponding data quality identifier based on the data quality preprocessing process. The data quality preprocessing includes downsampling and aggregating high-frequency data in the initial time series data, and upsampling and interpolating or event unfolding low-frequency data.

[0081] In its implementation, the optimization equipment collects data such as power load sequences, gas / heat consumption sequences, production plans or logs, and meteorological data, aligning data from different sampling frequencies to a unified time granularity g. High-frequency data undergoes downsampling aggregation (mean, peak, integral, etc.), while low-frequency data undergoes upsampling interpolation or event expansion. Missing values ​​are filled using an adaptive interpolation network, and the completion confidence score is output. Outliers are detected using a combination of robust statistics and consistency checks, outputting the outlier type and repair method, forming a fused input tensor and metadata (equipment ID, emission category, data source type, boundary label, etc.).

[0082] In some embodiments, hierarchical data quality preprocessing is performed on the aligned initial time-series data: For high-frequency time-series data such as power load and meteorology, downsampling aggregation is performed using mean aggregation and peak aggregation to compress the data volume while retaining core fluctuation characteristics, avoiding high-frequency data redundancy that could overload the model; For low-frequency discrete data such as production logs and transportation logistics, upsampling interpolation is performed using linear interpolation and neighbor-value filling, or event expansion is performed in conjunction with production events and logistics events to fill in the time gaps in low-frequency data and ensure data continuity; After preprocessing, the structured time-series data is transformed into a high-dimensional tensor according to the time dimension, data type dimension, and feature dimension, and integrated into a fusion input tensor adapted to the Transformer model input format. Simultaneously, based on the data missing rate, outlier ratio, and interpolation ratio during the preprocessing process, corresponding data quality labels are generated.

[0083] Understandably, this embodiment introduces a time alignment and quality governance mechanism for multi-source heterogeneous data on the data side, including missing data completion, anomaly repair, and quality label output. This aligns data from different systems and frequencies before it enters the model, significantly improving the consistency of accounting inputs and the stability of results, and reducing error propagation caused by disconnections, drift, and meter reading delays. This is because pre-processing data cleaning and quality labeling reduces distribution drift caused by noise and missing data, and provides traceable data credibility evidence for subsequent model inference and audit reports.

[0084] Step S20: Input the fusion input tensor into the pre-trained multi-scale temporal fusion coding model and output the intermediate representation vector of temporal features.

[0085] It should be noted that the multi-scale temporal fusion coding model described in this embodiment is a multi-scale Transformer architecture. The multi-scale temporal fusion coding model includes feature extraction modules with multiple branches. Each branch's feature extraction module corresponds to processing a data source or a sampling granularity. The feature extraction module is used to encode the input data of each branch.

[0086] It should be noted that the intermediate representation vector of time-series features refers to the high-dimensional feature vector output after multi-branch extraction and cross-scale fusion, which includes the time-series fluctuation trend of multi-source carbon data, the carbon source correlation relationship, and the emission reduction change pattern, while removing redundant information from the original data.

[0087] In its implementation, the multi-scale temporal fusion coding model is a multi-branch independent coding structure, including encoders and decoders with multiple branches, as shown in the reference. Figure 3 , Figure 3As shown in one embodiment, the multi-scale temporal fusion coding model is first divided into K parallel input branches according to the data source type or time sampling granularity. The K parallel input branches include the first branch to the Kth branch. Each branch corresponds to carbon data of a certain scale. The carbon data includes high-frequency sensor data, medium-frequency metrological data or low-frequency event data, so as to realize the isolated coding of data of different scales.

[0088] Secondly, a dedicated encoder is configured for each input branch. The encoder is used to perform independent feature encoding on the input data of the corresponding branch and output the branch-level feature representation. The encoder output of the first branch is connected to a 1×1 convolutional layer to complete feature dimension adaptation and preliminary compression processing.

[0089] Next, except for the first branch, the encoder outputs of the other branches are connected to the corresponding decoders. The decoders are used to map the branch encoded features into feature maps of the same dimension. The feature maps output by all decoders are concatenated with the feature map of the first branch after 1×1 convolution by channel dimension to achieve global aggregation of multi-scale features.

[0090] Finally, the spliced ​​multi-scale fused features are input into a 1×1 convolutional layer to complete cross-channel information integration and dimension regularization, and output a unified intermediate representation of temporal features. The intermediate representation of temporal features is used for subsequent carbon flow tracing, uncertainty analysis and carbon integral generation.

[0091] Through the above-mentioned structure of multi-branch independent coding and global fusion, the multi-scale temporal fusion coding model not only preserves the unique regularities of carbon data at different scales, but also achieves efficient alignment and fusion of multi-source information, effectively solving the problems of large scale differences and difficulty in feature alignment of heterogeneous carbon data in zero-carbon parks.

[0092] Step S30: Input the intermediate representation vector of the time series features and the data quality identifier into the carbon flow tracking attention module to obtain contribution decomposition information.

[0093] It should be noted that the carbon flow tracking attention module is a category-constrained multi-head attention structure. Each attention head corresponds to a carbon emission category, and the contribution is decomposed by constraining the mask matrix. Category-constrained multi-head attention structure: Each head focuses on extracting carbon flow features of a single category. Category constraints avoid cross-category feature confusion and improve the targeting and specificity of carbon flow decomposition.

[0094] The mask matrix can be a binary constraint matrix used to constrain the feature focus range of each attention head, marking the feature dimensions and carbon source categories that each attention head can focus on, masking irrelevant feature weights, forcing the model to focus on the carbon flow information of the corresponding category, and avoiding decomposition bias caused by feature interference.

[0095] It should be noted that the contribution decomposition information can be the contribution ratio of each category of carbon emissions, carbon sinks, and green electricity offsets to the total carbon revenue and expenditure of the park, obtained after attention weighting calculation, as well as the carbon flow correlation of each carbon source node, so as to realize the traceability and decomposition of carbon accounting results.

[0096] In practical implementation, the accounting device can input the intermediate representation into the auditable carbon flow tracing attention module (CAT-Module), generate an emission source contribution matrix and a carbon footprint contribution heatmap based on category-constrained multi-head attention, and output the contribution decomposition report field.

[0097] Step S40: Based on the contribution decomposition information, perform uncertainty analysis on the intermediate representation vector of the time series features to obtain the target carbon accounting results and confidence interval data.

[0098] It should be noted that the target carbon accounting results can be the core accounting values ​​such as net carbon emissions, carbon emissions by category, and carbon emission reductions of the zero-carbon park obtained after uncertainty analysis and calibration, eliminating random fluctuations and error interference, and conforming to the actual carbon income and expenditure of the park.

[0099] Confidence interval data refers to the reasonable fluctuation range of the accounting results generated based on the uncertainty analysis results. It intuitively reflects the credibility range of carbon accounting results, reflects the degree of influence of data quality and model accuracy on the accounting results, and provides a reliable reference for the application of accounting results.

[0100] In some embodiments, the accounting device uses contribution decomposition information as weights to perform weighted mapping on the intermediate representation vector of time-series features. It also builds an uncertainty analysis model by combining uncertainties such as data quality differences, model prediction biases, and inherent fluctuations in carbon data. Using a combination of probability statistics and inference analysis, it first calculates the core values ​​of total carbon emissions and carbon emissions by category in the park, then quantifies the error range and fluctuation amplitude in the accounting process to generate corresponding confidence intervals. At the same time, it marks high-uncertainty accounting nodes, locates the source of error, and finally outputs the target carbon accounting result calibrated for uncertainty, as well as confidence interval data characterizing the reliability of the result.

[0101] Step S50: Input the contribution decomposition information, target carbon accounting results and confidence interval data into the carbon integral generation and optimization module to generate a carbon integral scheme and an auditable evidence package.

[0102] It should be noted that the carbon credit scheme can be a credit allocation, deduction, and incentive scheme based on the park's carbon accounting and emission reduction contributions. It can be used for internal carbon management assessment and emission reduction incentives in the park, and can also be connected to external carbon trading systems. It is the core implementation document for carbon management in zero-carbon parks.

[0103] An auditable evidence package can be a standardized data package that integrates the original data, processing records, and supporting materials for the results of each stage of the carbon accounting process, completely preserving the entire accounting chain trace and meeting the compliance requirements of third-party audits, policy verification, and carbon trading evidence storage.

[0104] This embodiment achieves accurate alignment and robust governance of carbon data across granularities and modalities through standardized preprocessing and quality label generation of multi-source heterogeneous carbon data, reducing accounting errors caused by data noise and information loss at the source. Relying on a multi-branch, multi-scale Transformer architecture adaptable to different data sources and sampling granularities, it achieves adaptive fusion of multi-source time-series features while accurately capturing multi-periodic patterns and short-term abrupt events in carbon emissions, significantly improving the accuracy of time-series feature modeling. Through a category-constrained carbon flow tracking attention module, it achieves verifiable decomposition of carbon emission source contributions, effectively solving the problem of untraceable black boxes in traditional neural network models. Combined with the carbon accounting results and confidence intervals output by uncertainty analysis, it provides quantitative credibility assessment and safety margins for audit verification. Finally, through the carbon integral generation optimization module and the output of auditable evidence packages, it significantly improves the efficiency and refinement of carbon accounting in the park, reduces manual accounting and auditing costs, and provides reliable support for emission reduction optimization and carbon asset operation in the park, fully adapting to the construction and management requirements of zero-carbon parks that are measurable, accountable, verifiable, and auditable.

[0105] refer to Figure 4 , Figure 4 This is a flowchart illustrating the second embodiment of the zero-carbon park carbon accounting method based on Transformer of the present invention.

[0106] Based on the first embodiment described above, in order to accurately capture periodic pattern features and reduce systematic biases caused by periodic factors, in this embodiment, the multi-scale temporal fusion coding model further includes a cross-modal attention fusion module, a frequency domain adaptive position coding, and a mutation-aware attention head;

[0107] The cross-modal attention fusion module is configured to perform the following steps:

[0108] Step S201: Learn trainable initial attention weights for the branch feature vectors output by the feature extraction module of each branch;

[0109] Step S202: Dynamically correct the initial attention weights based on the quality identification features of each branch to determine the target attention weights for each branch;

[0110] Step S203: Perform cross-modal attention fusion on the feature extraction modules of each branch based on the target attention weight, and output global temporal fusion features;

[0111] The frequency domain adaptive position coding module is configured to perform the following steps:

[0112] Step S204: Perform frequency domain analysis on the global time-series fusion features and extract the dominant frequency term features;

[0113] Step S205: Generate frequency domain adaptive position coding based on the dominant frequency term feature, and inject the frequency domain adaptive position coding into each time step of the global temporal fusion feature to perform periodic enhancement processing on the global temporal fusion feature;

[0114] The mutation-aware attention head is configured to perform the following steps:

[0115] Step S206: Perform mutation enhancement processing on the global temporal fusion features after periodic enhancement processing, and output the intermediate representation vector of temporal features.

[0116] It should be noted that this embodiment introduces Frequency-domain Adaptive Positional Encoding (FAPE) into the MST-Transformer. FAPE is used to explicitly inject dominant frequency features in the frequency domain into the positional encoding, enhancing the ability to express multi-period patterns such as seasons, shifts, and production cycles. Traditional sinusoidal positional encoding is combined with the dominant frequency term to enhance the perception of multi-period patterns; and a mutation-aware attention head is designed, introducing a temporal difference term in the attention calculation to improve sensitivity to abrupt events such as equipment start-up and shutdown.

[0117] It is understandable that this embodiment, by introducing frequency-domain adaptive position coding (FAPE), can more effectively identify multi-periodic patterns such as seasons, shifts, and production rhythms, and reduce systematic deviations caused by periodic factors. This is because incorporating the dominant frequency component into the position representation in a learnable manner transforms periodic information from "implicit learning" to "explicit injection," thereby improving the stability and generalization ability of the periodic pattern expression.

[0118] Furthermore, in order to improve the ability to detect mutation events and reduce the accounting bias during mutation periods, in one embodiment, the mutation-sensing attention head is also configured to perform the following steps:

[0119] Step S2061: Construct first-order and second-order temporal difference features for the global temporal fusion features after periodic enhancement processing step by step. The first-order temporal difference features are used to characterize the feature change amplitude of adjacent time steps, and the second-order temporal difference features are used to characterize the fluctuation of the feature change rate.

[0120] Step S2062: The first-order time-series difference feature, the second-order time-series difference feature, and the data quality feature of the corresponding time step are concatenated to obtain the concatenated feature;

[0121] Step S2063: The spliced ​​features are mapped using a multilayer perceptron, and the mapped spliced ​​features are then input into a sigmoid activation function for normalization to calculate the mutation intensity score for each time step.

[0122] Step S2064: In the scaling dot product attention calculation process of the multi-scale temporal fusion coding model, a mutation bias term constructed based on the mutation intensity score is introduced. The attention allocation weight corresponding to the time step in which the mutation occurs is increased by the mutation bias term, and the attention calculation process is constrained by the causal mask matrix.

[0123] Step S2065: Based on the mutation intensity score, perform gated enhancement processing on the value vector channel in the attention calculation process to obtain the gated enhanced attention value vector, so as to enhance the influence of the features at the mutation moment on the attention output result;

[0124] Step S2066: Based on the adjusted attention weights and the gated attention value vector, perform abrupt enhancement processing on the global temporal fusion features after periodic enhancement processing, and output the intermediate representation vector of the temporal features.

[0125] It should be noted that the mutation-aware attention head is used to integrate temporal difference terms in attention calculation, improving sensitivity to sudden events such as equipment start-up and shutdown, operating condition switching, and abnormal emissions; its specific processing can be implemented as follows:

[0126] (1) Construction of difference features:

[0127] For the fused temporal input features (or output to branches) Construct first-order difference features:

[0128]

[0129] And it can construct second-order difference features:

[0130]

[0131] in It can be a vector, and the difference is calculated element-wise along each dimension. For missing or anomalous locations, the difference features can be masked or weighted in combination with quality indicators (missing markers, repair markers, confidence scores).

[0132] (2) Mutation intensity score:

[0133] Calculate the mutation intensity score at each time step. This is used to depict the range of change. Preferably:

[0134]

[0135] in, Indicates splicing, For data quality features (such as completion confidence, anomaly marking). For the Sigmoid function, make When it is not necessary to introduce a second-order difference, only one can be used. .

[0136] (3) Mutation bias injection into attention weights:

[0137] Attention to standard scaled dot product:

[0138]

[0139] in, Represents the attention weight matrix. Represents the normalized exponential function, Represents the attention query vector. Represents the attention key vector. This represents the dimension of the attention feature vector. A mutation bias term is introduced when calculating the attention weights, making the model more likely to be focused on at time steps where mutations occur.

[0140] It can also be injected on the Value (value vector) side:

[0141]

[0142] in , It is a vector of all 1s. These are the learnable or adjustable coefficients of the mutation bias term. This is an optional causal mask matrix (used to ensure that only historical information is considered). The above form is equivalent to adding a learnable preference to the temporal location of the mutation, thereby increasing the weight of attention allocation.

[0143] (4) Value weighting for mutation gating:

[0144] In addition to attention bias, gating enhancement can also be applied to the Value channel:

[0145]

[0146] Where represents the original attention value vector at time step t, and represents the gated and enhanced attention value vector at time step t. These are the learnable coefficients for value vector gating, thus amplifying their impact on the output at abrupt changes.

[0147] (5) Output and anomaly annotation:

[0148] The output of the mutation-aware attention head is:

[0149]

[0150] Wherein, represents the intermediate representation vector of temporal features in the final output of the mutation-aware attention head, and simultaneously... As an auxiliary output for anomaly annotation and audit reports: when Exceeding the threshold When the value is 0.8, time step t is marked as a candidate point for mutation, and suggestions for locating the cause of mutation can be given by combining the Top-K contribution sources output by CAT-Module (such as equipment start-up and shutdown, production line switching, or sudden change in external temperature).

[0151] It is understandable that this embodiment, by setting a mutation-aware attention head, enables short-term sudden changes such as equipment start-up and shutdown, and operating condition switching to be captured in a timely manner, thereby improving the ability to detect mutation events and reducing the calculation bias during mutation periods. The reason is that the difference / rate of change feature is naturally sensitive to mutations, and introducing it into attention calculation can enhance the model's response to local structural mutations, thereby preventing sudden events from being "smoothly masked" by the overall trend.

[0152] Furthermore, in order to improve data quality and reduce distribution drift caused by noise and missing data, in one embodiment, the multi-scale temporal fusion coding model further includes a data splitting module;

[0153] The data splitting module is used to split the fused input tensor into multiple branches of input data based on the sampling scale and data source type; map the data source fields corresponding to the input data to fixed-dimensional feature vectors to obtain field-mapped feature sequences; perform sliding window aggregation on high-frequency sequences in the field-mapped feature sequences based on a globally unified time grid, and perform event unrolling or forward padding operations on low-frequency sequences to generate windowed feature sequences; perform robust preprocessing on the windowed feature sequences to obtain robustly preprocessed feature sequences, the robust preprocessing including missing data imputation and abnormal data repair; map the robustly preprocessed feature sequences to the latent space dimension through a linear projection layer or a one-dimensional convolutional layer, perform layer normalization on the mapped feature sequences, and perform noise suppression on the layer-normalized feature sequences through a gating unit to output branch embedding feature sequences; perform position encoding on the branch embedding feature sequences to output branch feature vectors.

[0154] It is understood that this embodiment will use the multi-scale temporal fusion coding model (MST-Transformer) to fuse input tensor input. The multi-scale temporal fusion Transformer structure (MST-Transformer) processes second / minute level sensor data, hourly level metering data and daily level production log data through multi-branch encoders, and combines cross-modal attention weights to achieve adaptive fusion, thus solving the problem of alignment and fusion of multi-source heterogeneous data.

[0155] The multi-scale temporal fusion coding model sets up a multi-branch feature extraction module at the front end of the encoder. The module consists of at least two or more branches, each branch corresponding to a data source or a sampling granularity. Its structure preferably includes the following sub-units (each sub-unit can be merged or split):

[0156] (1) Input adaptation and field mapping unit: Map the data source field corresponding to the branch to a fixed-dimensional feature vector, including the unification of units and the expansion of dimensions (e.g., expanding power data to statistical features such as mean, peak, gradient, integral, etc., and expanding production logs to event encoding and category embedding).

[0157] (2) Sampling alignment and windowing unit: Based on a unified time grid, perform window aggregation (mean / peak / integral, etc.) on high-frequency sequences, perform event expansion or forward filling on low-frequency sequences, and generate the time index mask of the branch.

[0158] (3) Quality governance and robust preprocessing unit: including missing value completion (adaptive interpolation network or multiple interpolation), anomaly detection and repair (truncation / replacement / revaluation), and output quality labels (missing label, repair label, confidence score) as additional channels.

[0159] (4) Branch-specific embedding and normalization unit: The input is mapped to a unified latent space dimension by a linear projection layer or a one-dimensional convolutional layer and normalized by LayerNorm; a gating unit can be added to suppress noise channels.

[0160] (5) Branch Position Encoding Injection Unit: This unit independently injects position encoding for each branch, preferably using Frequency Domain Adaptive Position Encoding (FAPE), and can adaptively adjust the position encoding terms based on the dominant frequency parameter of the branch. Each branch outputs a branch representation after the above processing. Then the cross-modal attention fusion module performs... Weighted fusion is performed to form a unified representation;

[0161] The proportion of data processed by different branches does not need to be the same; it can be adaptively configured based on the sampling frequency, missing rate, noise level, and business importance of the data source.

[0162] In practical implementation, the accounting device can use one or a combination of the following two mechanisms to achieve adaptive processing / contribution ratios for each branch:

[0163] (1) Time-granularity driven sample proportion mechanism. Based on a unified time grid, each branch outputs a fixed-length representation within each time window. Therefore, high-frequency data branches can participate in fusion through statistical features after window aggregation, while low-frequency data branches can participate in fusion through event expansion / forward filling. Under this mechanism, the effective information of each branch is determined by the number of available observations and statistical features within the time window, rather than simply inputting proportionally according to the number of original sampling points.

[0164] (2) Contribution ratio mechanism driven by fusion weights: In the cross-modal attention fusion module, trainable fusion weights are learned for each branch, and the branch weights are dynamically corrected in combination with quality indicators (missing data indicators, confidence scores), so that the branch is automatically deweighted when the data quality is poor or the noise is high, and automatically weighted when the data quality is good and more relevant to the target. Finally, the contribution ratio of each branch to the accounting result is obtained by the model learning, which can change dynamically with the season, shift, and working conditions.

[0165] In some embodiments, the accounting device may set prior constraints or upper and lower limits for branch weights (e.g., setting initial weights based on the importance of emission categories) to prevent the weights of a certain branch from collapsing in extreme cases, thereby ensuring the stability and interpretability of the fusion.

[0166] Understandably, this embodiment employs a multi-branch encoder combined with cross-modal attention for fusion, enabling second / minute-level energy consumption fluctuations, hourly-level metering changes, and daily-level production plan trends to be simultaneously characterized within the same framework. This improves the efficiency of utilizing multi-source information and enhances adaptability to different operating conditions. The reason for this is that constructing dedicated representations for different time scales before adaptive weighted fusion avoids information loss and semantic confusion caused by simple resampling or direct splicing.

[0167] refer to Figure 5 , Figure 5 This is a flowchart illustrating the third embodiment of the zero-carbon park carbon accounting method based on Transformer of the present invention.

[0168] Based on the above embodiments, in this embodiment, the carbon flow tracking attention module is configured to perform the following steps:

[0169] Step S301: Obtain the emission category embedding vector and the emission source embedding vector, and use the emission category embedding vector and the emission source embedding vector as attention query vectors.

[0170] It should be noted that the emission category embedding vector can be obtained by using the embedding layer of a deep learning network to transform textual and label-based carbon emission categories (such as indirect emissions from electricity, direct emissions from gas, green electricity offsets, etc.) into numerical vectors that the model can recognize, thereby realizing the digital representation of emission categories and enabling category constraints.

[0171] Emission source embedding vectors can transform various physical emission sources (equipment, pipelines, main bodies, etc.) within the park into fixed-dimensional numerical vectors, realizing the vectorized labeling of emission sources for precise location of the physical source of carbon emissions.

[0172] It should be noted that the attention query vector can be generated by fusing two-dimensional embedding vectors of emission category and emission source. As a "query instruction" of the multi-head attention mechanism, it is used to accurately match the temporal features of the corresponding category and emission source in the subsequent feature pool and extract the associated carbon flow information in a targeted manner.

[0173] It is understandable that this embodiment realizes the vectorized and standardized representation of emission categories and emission sources, transforming fuzzy carbon classification and carbon source information into numerical vectors that the model can compute, locking in the core target of attention calculation in advance, laying a directional foundation for subsequent category-constrained attention calculation, avoiding the drawbacks of the attention mechanism indiscriminately extracting features from the source, and improving the targeting of carbon flow tracking.

[0174] Step S302: Use the intermediate representation vector of the temporal feature as the attention key vector and the attention value vector respectively, and construct a category-constrained multi-head attention structure based on the attention query vector, attention key vector and attention value vector.

[0175] It should be noted that the attention key vector can be transformed from the intermediate representation vector of the temporal features and used to perform similarity matching with the attention query vector to filter out temporal features that are highly related to the target emission category and emission source, thereby achieving accurate feature matching.

[0176] Attention value vectors can be synchronously transformed from intermediate representation vectors of temporal features. They store the original condensed carbon data temporal features and are the core carrier for finally extracting effective carbon flow information. After matching is completed, the corresponding feature values ​​are output.

[0177] In some embodiments, the carbon flow tracking attention module can call the intermediate representation vector of temporal features and synchronously split it into two parallel inputs. One input is processed by linear transformation and feature mapping to become an attention key vector, which is used to match the feature dimension of the attention query vector. The other input is processed by synchronous linear transformation to become an attention value vector, which is used to store the core carbon flow features to be extracted. Then, with the query vector, key vector, and value vector as the three core elements, a corresponding number of independent attention heads are configured according to the preset number of emission categories to build a basic category-constrained multi-head attention structure, ensuring that each attention head corresponds to a single emission category, realizing parallel classification operation, and preventing cross-category feature interference.

[0178] It is understandable that this embodiment builds a dedicated multi-head attention framework adapted to carbon accounting scenarios to achieve a precise matching mechanism for query-key-value three-vectors. It adapts to the accounting needs of multiple emission categories through the parallel design of multiple attention heads, preserves the integrity of time-series features, and realizes the categorical decomposition of attention structure.

[0179] Step S303: Set a mask matrix corresponding to the emission category for each attention head of the category-constrained multi-head attention structure, perform constrained attention calculation, and generate the emission source-time dimension contribution weight matrix.

[0180] It should be noted that the emission source-time dimension contribution weight matrix is ​​a two-dimensional structured weight matrix, which horizontally covers all emission sources in the park and vertically covers the entire time period. The values ​​in the matrix correspond to the carbon emission contribution weight of each emission source in the corresponding time period.

[0181] It is understandable that this embodiment achieves rigid category constraints through a mask matrix, completely solving the problems of cross-category feature confusion and weight shift in multi-head attention, accurately filtering out invalid feature interference, making attention calculation fully conform to the category classification rules of carbon accounting, realizing the quantitative visualization of carbon emission contribution, and significantly improving the accuracy of carbon flow tracking.

[0182] Step S304: Generate contribution decomposition information based on the contribution weight matrix. The contribution decomposition information includes a contribution decomposition report field and a contribution heatmap. The contribution decomposition report field includes emission category, emission equipment, emission time period, contribution ratio, and number of restricted candidate words.

[0183] It should be noted that the contribution decomposition report fields are structured text-based decomposition results, including core fields such as emission category, emission equipment, emission time period, and contribution ratio. In addition, the number of candidate words is limited according to the standard to meet the standardized requirements of carbon accounting reports and audit verification, and to facilitate manual review and archiving.

[0184] A contribution heatmap is a visual chart generated based on a contribution weight matrix. It uses color gradients to intuitively display the spatial (emission source) and temporal distribution patterns of carbon emission contributions, quickly identify high-carbon emission nodes, and assist in carbon management decisions in industrial parks.

[0185] In its implementation, the Carbon Flow Tracking Attention Module (CAT-Module) uses the emission category / emission source embedding vector as the query Q, the intermediate representation Z as the key K and the value V, and calculates the category-constrained multi-head attention weights. A category mask matrix is ​​applied to each attention head to focus on the corresponding emission category; optionally, a causal mask is applied to ensure temporal consistency of interpretation. The module outputs an emission source contribution matrix, a carbon footprint contribution heatmap, and generates contribution decomposition report fields (including category, device, time period, contribution ratio, Top-K drivers, etc.).

[0186] This embodiment thoroughly addresses the pain points of traditional carbon accounting, such as ambiguous carbon sources, unclear contribution attribution, and inability to perform refined source tracing, through dual-embedded vector-oriented query, category-constrained attention calculation, rigid mask matrix filtering, and standardized output. This further improves the accuracy and standardization of contribution decomposition. The carbon flow tracking attention module enables carbon flow contribution tracing and introduces category constraints at the attention layer, so that the output not only provides the accounting results but also forms a verifiable contribution decomposition and heatmap evidence chain, meeting the needs of audit traceability and responsibility allocation. By binding attention weights to metadata such as emission categories / equipment and focusing the interpretation on the business-accepted accounting caliber through mask constraints, the contribution interpretation becomes more stable and verifiable.

[0187] refer to Figure 6 , Figure 6 This is a flowchart illustrating the fourth embodiment of the zero-carbon park carbon accounting method based on Transformer of the present invention.

[0188] Based on the above embodiments, in this embodiment, step S40 further includes:

[0189] Step S401: Based on the intermediate representation vector of the time series features, perform time series prediction of carbon emissions to generate initial carbon accounting results.

[0190] It should be noted that the initial carbon accounting results can be basic carbon emission accounting values ​​directly derived from the intermediate representation vector of time series features. They have not undergone model uncertainty correction or data quality deviation calibration, and only reflect the basic carbon emission level after model feature extraction. They are the original benchmark data for uncertainty analysis.

[0191] In the specific implementation, the intermediate representation vector of the device call time-series features is optimized and imported into the prediction branch of the multi-scale time-series fusion coding model that has been pre-trained and fine-tuned for the park scenario. Based on the long-term carbon emission trend, short-term energy consumption fluctuation, and implicit features related to carbon sources extracted by the model, and combined with the park's production and operation and energy consumption patterns, a full-dimensional time-series extrapolation and prediction is carried out. The prediction scope comprehensively covers core accounting categories such as Scope1 direct carbon emissions, Scope2 indirect carbon emissions, and carbon sink offsetting emission reduction. Simultaneously, the emission source and accounting time period dimensions corresponding to the contribution decomposition information output in step three are matched to generate basic carbon accounting values ​​that have not undergone error calibration and data quality weighting, which is the initial carbon accounting result. This includes core indicators such as the park's net total carbon emissions, carbon emissions by category, and carbon emission contribution of a single emission source, serving as fixed benchmark data for subsequent uncertainty analysis.

[0192] Step S402: Perform multiple forward inferences on the Dropout layer of the multi-scale temporal fusion coding model using the Monte Carlo random deactivation method.

[0193] It should be noted that Monte Carlo random deactivation is a model uncertainty assessment method based on probability and statistics principles. It keeps the Dropout layer on during the inference phase and generates multiple sets of results through multiple rounds of randomly masked neurons, quantifying the inherent inference bias of the model itself. It is the core technical means of uncertainty analysis in carbon accounting.

[0194] The Dropout layer is a regularization layer built into deep learning models. Its core function is to prevent the model from overfitting. In this solution, this layer is enabled during the inference phase to simulate potential errors in the model's feature extraction and carbon emission prediction processes.

[0195] It should be noted that multiple forward inferences simply involve keeping the input data unchanged, adjusting the inactivation state of neurons within the model, performing multiple rounds of independent inference operations, and obtaining multiple sets of parallel results.

[0196] In the implementation, Monte Carlo Dropout is used to perform T forward inferences (preferably T is 20-200) to calculate the mean and variance and generate confidence intervals. Periods of high uncertainty are marked in the audit report, along with a data quality summary and an index of key driving evidence.

[0197] It is understandable that this embodiment simulates the potential inference error of the model itself by random deactivation, abandons the one-sidedness of single inference results, comprehensively captures the inherent uncertainty of the model prediction process, generates sufficient statistical samples, lays a solid data foundation for subsequent confidence interval calculation, and greatly improves the comprehensiveness and credibility of uncertainty quantification results.

[0198] Step S403: Calculate the confidence interval data corresponding to the initial carbon accounting result and the contribution decomposition information based on the results of multiple forward inferences.

[0199] It should be noted that the confidence interval data can be a reasonable fluctuation range of carbon accounting values ​​generated statistically based on multiple sets of inference results. It is divided into the overall accounting confidence interval and the confidence interval of subdivided categories / emission sources. It intuitively represents the fluctuation range of the accounting results under a given confidence level and directly reflects the stability and reliability of the results.

[0200] It is understandable that this embodiment transforms the abstract model uncertainty into a concrete and interpretable numerical fluctuation range, thereby realizing the quantitative characterization of carbon emission accounting errors. This completely solves the shortcomings of traditional carbon accounting, which only outputs fixed values ​​and has no error reference, providing a reliable basis for the accounting results and improving the rigor of carbon accounting conclusions.

[0201] Step S404: Verify the initial carbon accounting result, the contribution decomposition information, and the confidence interval data based on the data quality identifier, and generate the target carbon accounting result and confidence interval data.

[0202] In the specific implementation, the optimized equipment can retrieve the data quality identifiers generated in the preprocessing stage. Based on data integrity, anomaly rate, and interpolation ratio, dual weighted verification and deviation correction are carried out on the initial carbon accounting results, multi-round inference data, and original confidence intervals. For accounting dimensions with high data quality, few missing values, and complete original vouchers, the confidence interval is appropriately narrowed and the weight of the initial results is strengthened to match the actual carbon emission situation. For accounting dimensions with low data quality, many outliers, and a high proportion of interpolation completion, the confidence interval is appropriately widened and the initial accounting values ​​are fine-tuned to eliminate accounting deviations caused by data quality defects. After completing the full-dimensional calibration, the final target carbon accounting result and the optimized version of the confidence interval data adapted to the data quality are generated, and high-error and low-quality accounting nodes are marked simultaneously.

[0203] This embodiment provides confidence intervals for the calculated values ​​and contribution outputs through uncertainty quantification, thereby supporting alerts and review decisions for high-risk periods; it extends traditional point estimation to interval estimation, enabling audits to obtain credible quantification results that match data quality and model uncertainty, rather than just seeing "a single number"; it achieves accurate calibration of carbon accounting results, quantifies the fluctuation range of accounting across all dimensions, takes into account both inherent model biases and defects in the quality of the original data, significantly improves the rigor and credibility of carbon accounting results, and provides a clear direction for the optimization and iteration of carbon data in the park.

[0204] Furthermore, based on the above embodiments, in the fifth embodiment of the present invention, the carbon integral generation optimization module is configured to perform the following steps:

[0205] Step S501: Generate an initial carbon integral generation and allocation scheme through a multi-objective optimization layer.

[0206] In its implementation, the optimization device inputs the carbon accounting results, contribution decomposition, and confidence interval into the carbon credit generation optimization module. The multi-objective optimization layer maximizes credit gains and overall economic benefits under carbon quota constraints while suppressing strategy volatility. The rule-constraint subnetwork maps local policies, accounting boundaries, and trading rules into constraints or loss regularization to ensure the compliance of the output scheme. A reinforcement learning adapter is introduced, using credit gains as the reward function and incorporating over-limit penalties and volatility penalties to fine-tune the strategy to adapt to different operating conditions and price changes.

[0207] The multi-objective optimization layer transforms the carbon accounting results, contribution decomposition, and uncertainty information output by the model into executable carbon integral generation and allocation decision variables, and solves for the optimal solution while satisfying carbon quota and policy rule constraints. Let the settlement period be... The set of allocatable objects is (The object can be a department, enterprise entity, production line, equipment group, or emission reduction project). The decision variables for this optimization layer can be defined as: The amount of carbon integrals (or integral share) allocated to object i in period t. The total number of carbon credits (or tradable credits) generated / confirmed in period t. : The emission reduction contribution coefficient / reward coefficient of object i in period t (optional variable, or can be directly given by the contribution level). In a preferred embodiment, the optimization layer adopts a multi-objective form of maximizing benefits, controlling risks, and constraining fairness / stability, which can be equivalently written as minimizing the loss function:

[0208]

[0209] The constraints include:

[0210] (1) Quota constraint :

[0211] Let the calculated emissions of the park in period t be... (Unit: tCO2e), corresponding to the upper bound of the confidence interval is: (Originated from MC-Dropout), the quota limit is... To reflect the safety margin of auditing, an upper bound constraint can be used to construct penalties for exceeding the limit:

[0212]

[0213] That is, when the "conservatively estimated upper limit of emissions" exceeds the quota, the penalty increases quadratically with the degree of exceedance.

[0214] (2) Policy and rule constraints :

[0215] Let the set of policies and rules be... This includes: eligibility criteria, upper and lower limits on points, restrictions on certain categories from receiving rewards, and limits on allocation ratios. For each rule... Constructing a violation degree function ,but:

[0216]

[0217] Assumption: If an object i is not eligible (indicator variable) If the integral obtained is 0, then it can be defined as follows:

[0218]

[0219] in, This is a qualification indicator variable for object i. Function to represent the penalty for qualification violation;

[0220] (3) Risk / Uncertainty Item :

[0221] To avoid aggressive allocations during periods of high uncertainty, a risk penalty based on the interval width is introduced. Let the interval width be... , can be defined as:

[0222]

[0223] in, The fact that it is a non-decreasing function indicates that the higher the uncertainty, the greater the penalty for generating / confirming integrals, thus forming a conservative strategy.

[0224] (4) Fair / contribution-based allocation :

[0225] Let CAT-Module give the contribution percentage of object i in period t as ,and To ensure that the distribution of points aligns with the contribution level, we can define:

[0226]

[0227] This guarantee allocation is based on evidence and facilitates auditing and responsibility apportionment.

[0228] (5) Scheme smoothing / stability term :

[0229] To avoid drastic fluctuations in the allocation scheme between adjacent periods, the following can be defined:

[0230]

[0231] It can be used to control strategy fluctuations and improve executability.

[0232] (6) Revenue Items :

[0233] Let the integral price over period t be... The total revenue can then be expressed as:

[0234]

[0235] The total loss appears with a negative sign, maximizing the profit.

[0236] in, Represents the total loss item. This represents the amount of carbon integral allocated to object i in period t. This represents the total amount of carbon integrals generated in period t. , , , , and These represent the weight coefficients of each item. This indicates a quota constraint. This represents the upper bound of the confidence interval for calculating emissions over period t. This indicates the upper limit of the carbon emission quota for the park in period t. Indicates the total number of settlement cycles. Indicates policy and rule constraints. A function representing the degree of violation of a single rule r. Represents a set of policies and rules. This indicates a risk uncertainty term. This represents the width of the confidence interval for calculating emissions over period t. This represents the lower bound of the confidence interval for calculating emissions over period t. Represents a non-decreasing penalty function. Indicates a fair allocation item. This represents the percentage of carbon emission contribution of object i in period t. Represents a constant. Represents the smoothing term of the scheme. Indicates the revenue item. This represents the carbon integral price over period t. Represents the traversal index of an allocatable object.

[0237] Step S502: Based on the initial carbon credit generation and allocation scheme, the target carbon accounting result, the contribution decomposition information, the confidence interval data and the data quality identifier, generate a carbon credit scheme and an auditable evidence package.

[0238] It should be noted that the carbon credit generation and allocation scheme output in this embodiment is used to transform the calculated carbon emission results and their source contribution relationships into an executable basis for carbon credit (or carbon asset) settlement, incentive and trading management within the park.

[0239] Its core functions include:

[0240] (1) Settlement: Determine the total amount (or tradable amount) of carbon credits that can be confirmed / generated in the park within a certain period, and the corresponding compliance verification results;

[0241] (2) Incentives and responsibility sharing: Based on the contribution level, the points (or corresponding rewards and penalties) are allocated to specific objects (departments, enterprises, production lines, equipment groups or emission reduction projects) to achieve "whoever contributes, benefits; whoever causes the exceedance, bears the responsibility";

[0242] (3) Execution and Audit: Provide an executable list and supporting fields to facilitate review by finance, operations, audit or third-party verification agencies.

[0243] It is understood that, to ensure reproducibility and verifiability, this embodiment generates an auditable evidence package, which includes at least: accounting period, data index and hash, boundary parameters, emission factor version information (such as purchased electricity emission factor), model version, data quality identifiers (missing data completion, anomaly repair, confidence level), contribution heatmap index, rule verification results and logs, etc. The evidence package can be encapsulated in a structured format (such as JSON) and stored in a versioned manner.

[0244] This embodiment combines a rule-constrained subnetwork, a multi-objective optimization layer, and a reinforcement learning adapter to generate an executable points generation and allocation scheme under carbon quota and policy constraints, thereby improving overall returns and policy stability. This is because compliance conditions are internalized as constraints or regularization terms to ensure feasibility; multi-objective optimization achieves a trade-off between returns, risks, and stability; and reinforcement learning fine-tuning iterates the strategy according to changing operating conditions, ultimately forming a closed-loop optimization of "calculation-interpretation-decision".

[0245] Furthermore, this invention also proposes a computer-readable storage medium storing a zero-carbon park carbon accounting program, which, when executed by a processor, implements the steps of the Transformer-based zero-carbon park carbon accounting method described above.

[0246] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0247] The aforementioned computer-readable storage medium may be included in a Transformer-based zero-carbon park carbon accounting device; or it may exist independently and not be assembled into a Transformer-based zero-carbon park carbon accounting device.

[0248] Furthermore, this invention also proposes a computer program product, including a zero-carbon park carbon accounting program, which, when executed by a processor, implements the steps of the Transformer-based zero-carbon park carbon accounting method as described above.

[0249] The specific implementation of the computer program product of this invention is basically the same as the embodiments of the above-mentioned zero-carbon park carbon accounting method based on Transformer, and will not be repeated here.

[0250] Reference Figure 7 , Figure 7 This is a structural block diagram of the first embodiment of the zero-carbon park carbon accounting system based on Transformer of the present invention.

[0251] like Figure 7 As shown, the zero-carbon park carbon accounting system based on Transformer proposed in this embodiment of the invention includes:

[0252] The data processing module 10 is used to collect multi-source heterogeneous carbon data of the target park and preprocess the multi-source heterogeneous carbon data to generate a fusion input tensor and a data quality identifier.

[0253] The multi-scale encoding module 20 is used to input the fused input tensor into the pre-trained multi-scale temporal fusion encoding model and output the intermediate representation vector of temporal features. The multi-scale temporal fusion encoding model is a multi-scale Transformer architecture. The multi-scale temporal fusion encoding model includes feature extraction modules of multiple branches. Each branch's feature extraction module corresponds to processing a data source or a sampling granularity. The feature extraction module is used to encode the input data of each branch.

[0254] The contribution decomposition module 30 is used to input the intermediate representation vector of the time series features and the data quality identifier into the carbon flow tracing attention module to obtain contribution decomposition information. The carbon flow tracing attention module is a category-constrained multi-head attention structure, where each attention head corresponds to a carbon emission category and the contribution decomposition is constrained by a mask matrix.

[0255] Uncertainty analysis module 40 is used to perform uncertainty analysis on the intermediate representation vector of the time series features based on the contribution decomposition information to obtain the target carbon accounting results and confidence interval data;

[0256] The carbon accounting module 50 is used to input the contribution decomposition information, target carbon accounting results and confidence interval data into the carbon integral generation and optimization module to generate a carbon integral scheme and an auditable evidence package.

[0257] This embodiment achieves accurate alignment and robust governance of carbon data across granularities and modalities through standardized preprocessing and quality label generation of multi-source heterogeneous carbon data, reducing accounting errors caused by data noise and information loss at the source. Relying on a multi-branch, multi-scale Transformer architecture adaptable to different data sources and sampling granularities, it achieves adaptive fusion of multi-source time-series features while accurately capturing multi-periodic patterns and short-term abrupt events in carbon emissions, significantly improving the accuracy of time-series feature modeling. Through a category-constrained carbon flow tracking attention module, it achieves verifiable decomposition of carbon emission source contributions, effectively solving the problem of untraceable black boxes in traditional neural network models. Combined with the carbon accounting results and confidence intervals output by uncertainty analysis, it provides quantitative credibility assessment and safety margins for audit verification. Finally, through the carbon integral generation optimization module and the output of auditable evidence packages, it significantly improves the efficiency and refinement of carbon accounting in the park, reduces manual accounting and auditing costs, and provides reliable support for emission reduction optimization and carbon asset operation in the park, fully adapting to the construction and management requirements of zero-carbon parks that are measurable, accountable, verifiable, and auditable.

[0258] The Transformer-based zero-carbon park carbon accounting system provided in this application employs the Transformer-based zero-carbon park carbon accounting method described in the above embodiments, and can solve the technical problems of Transformer-based zero-carbon park carbon accounting. Compared with the prior art, the beneficial effects of the Transformer-based zero-carbon park carbon accounting system provided in this application are the same as those of the Transformer-based zero-carbon park carbon accounting method provided in the above embodiments, and other technical features of the Transformer-based zero-carbon park carbon accounting system are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0259] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.

[0260] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.

[0261] In addition, for technical details not described in detail in this embodiment, please refer to the Transformer-based carbon accounting method for zero-carbon parks provided in any embodiment of the present invention, which will not be repeated here.

[0262] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0263] It should be noted that the user information (including but not limited to user device information, user personal information, user location information, user behavior information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0264] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0265] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0266] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A carbon accounting method for zero-carbon industrial parks based on Transformer, characterized in that, The method includes: Collect multi-source heterogeneous carbon data from the target park, and preprocess the multi-source heterogeneous carbon data to generate a fusion input tensor and a data quality identifier. The fusion input tensor is input into the pre-trained multi-scale temporal fusion coding model, and the output temporal feature intermediate representation vector is generated. The multi-scale temporal fusion coding model is a multi-scale Transformer architecture. The multi-scale temporal fusion coding model includes feature extraction modules of multiple branches. Each branch's feature extraction module corresponds to processing a data source or a sampling granularity. The feature extraction module is used to encode the input data of each branch. The multi-scale temporal fusion coding model further includes a cross-modal attention fusion module, a frequency-domain adaptive positional encoding, and a mutation-aware attention head. The cross-modal attention fusion module learns trainable initial attention weights for the branch feature vectors output by the feature extraction modules of each branch; dynamically corrects the initial attention weights based on the quality identification features of each branch to determine the target attention weights for each branch; performs cross-modal attention fusion on the feature extraction modules of each branch based on the target attention weights, and outputs global temporal fusion features. The frequency-domain adaptive positional encoding module performs frequency domain analysis on the global temporal fusion features to extract dominant frequency term features; generates frequency-domain adaptive positional encoding based on the dominant frequency term features, and injects the frequency-domain adaptive positional encoding into each time step of the global temporal fusion features to perform periodic enhancement processing on the global temporal fusion features; the mutation-aware attention head performs mutation enhancement processing on the periodically enhanced global temporal fusion features and outputs a temporal feature intermediate representation vector. The intermediate representation vector of the time-series features and the data quality identifier are input into the carbon flow tracing attention module to obtain contribution decomposition information. The carbon flow tracing attention module is a category-constrained multi-head attention structure, where each attention head corresponds to a carbon emission category and the contribution decomposition is constrained by a mask matrix. The carbon flow tracking attention module is used to obtain emission category embedding vectors and emission source embedding vectors, and use these vectors as attention query vectors; it uses the intermediate representation vectors of time-series features as attention key vectors and attention value vectors, respectively, and constructs a category-constrained multi-head attention structure based on the attention query vectors, attention key vectors, and attention value vectors; it sets a mask matrix corresponding to the emission category for each attention head of the category-constrained multi-head attention structure, performs constrained attention calculation, and generates an emission source-time dimension contribution weight matrix; it generates contribution decomposition information based on the contribution weight matrix, which includes a contribution decomposition report field and a contribution heatmap. The contribution decomposition report field includes emission category, emission device, emission time period, contribution ratio, and number of restrictive candidate words. Based on the contribution decomposition information, uncertainty analysis is performed on the intermediate representation vector of the time series features to obtain the target carbon accounting results and confidence interval data. The contribution decomposition information, target carbon accounting results, and confidence interval data are input into the carbon integral generation and optimization module to generate a carbon integral scheme and an auditable evidence package.

2. The zero-carbon park carbon accounting method based on Transformer as described in claim 1, characterized in that, The mutation-aware attention head is also used to construct first-order and second-order temporal difference features step-by-step on the global temporal fusion features after periodic enhancement processing. The first-order temporal difference features are used to characterize the feature change amplitude of adjacent time steps, and the second-order temporal difference features are used to characterize the fluctuation of the feature change rate. The first-order and second-order temporal difference features and the data quality features of the corresponding time steps are concatenated to obtain concatenated features. The concatenated features are then mapped using a multilayer perceptron, and the mapped concatenated features are input into a sigmoid activation function for normalization processing to calculate the mutation intensity score for each time step. In the scaling dot product attention calculation process of the multi-scale temporal fusion coding model, a mutation bias term constructed based on the mutation intensity score is introduced. The mutation bias term increases the attention allocation weight corresponding to the time step where the mutation occurs, and the attention calculation process is constrained by a causal mask matrix. Based on the mutation intensity score, the value vector channel in the attention calculation process is gated and enhanced to obtain the gated and enhanced attention value vector, so as to enhance the influence of the features at the mutation moment on the attention output result. Based on the adjusted attention weights and the gated attention value vector, the global temporal fusion features after periodic enhancement are subjected to mutation enhancement processing, and the intermediate representation vector of the temporal features is output.

3. The zero-carbon park carbon accounting method based on Transformer as described in claim 1, characterized in that, The multi-scale temporal fusion coding model also includes a data splitting module; The data splitting module is used to split the fused input tensor into multiple branches of input data based on the sampling scale and data source type; The feature extraction module is also used to map the data source fields corresponding to the input data into fixed-dimensional feature vectors to obtain field mapping feature sequences; based on a globally unified time grid, it performs sliding window aggregation on high-frequency sequences in the field mapping feature sequences and performs event expansion or forward filling operations on low-frequency sequences to generate windowed feature sequences. Robust preprocessing is performed on the windowed feature sequence to obtain a robust preprocessed feature sequence. The robust preprocessing includes missing data imputation and abnormal data repair. The robust preprocessed feature sequence is mapped to the latent space dimension through a linear projection layer or a one-dimensional convolutional layer. The mapped feature sequence is then subjected to layer normalization, and noise suppression is performed on the layer normalized feature sequence through a gating unit to output a branch embedding feature sequence. The branch embedding feature sequence is then positionally encoded to output a branch feature vector.

4. The zero-carbon park carbon accounting method based on Transformer as described in claim 1, characterized in that, The process involves collecting multi-source heterogeneous carbon data from the target industrial park, preprocessing the multi-source heterogeneous carbon data to generate a fused input tensor and data quality identifiers, including: Collect multi-source heterogeneous carbon data of the target park, including electricity load sequence, gas consumption sequence, heat consumption sequence, production log data, transportation and logistics energy consumption data and meteorological data; The multi-source heterogeneous carbon data is subjected to time granularity alignment and time series correction to generate aligned initial time series data; The initial time series data is subjected to data quality preprocessing, and tensor transformation is performed on the processed initial time series data to generate a fused input tensor. A corresponding data quality identifier is generated based on the data quality preprocessing process. The data quality preprocessing includes downsampling and aggregating high-frequency data in the initial time series data, and upsampling and interpolating or event unfolding low-frequency data.

5. The zero-carbon park carbon accounting method based on Transformer as described in claim 1, characterized in that, The uncertainty analysis of the intermediate representation vector of the time series features based on the contribution decomposition information to obtain the target carbon accounting results and confidence interval data includes: Carbon emission time series prediction is performed based on the intermediate representation vector of the time series features to generate initial carbon accounting results; The Dropout layer of the multi-scale temporal fusion coding model is subjected to multiple forward inferences using a Monte Carlo random deactivation method. Calculate the confidence interval data corresponding to the initial carbon accounting result and the contribution decomposition information based on the results of multiple forward inferences; Based on the data quality identifier, the initial carbon accounting results, the contribution decomposition information, and the confidence interval data are verified to generate the target carbon accounting results and confidence interval data.

6. The carbon accounting method for zero-carbon industrial parks based on Transformer as described in claim 1, characterized in that, The carbon integral generation and optimization module is configured to generate an initial carbon integral generation and allocation scheme through a multi-objective optimization layer. The total loss function of the multi-objective optimization layer refers to the following formula: in, Represents the total loss item. This represents the amount of carbon integral allocated to object i in period t. This represents the total amount of carbon integrals generated in period t. , , , , and These represent the weight coefficients of each item. This indicates a quota constraint. This represents the upper bound of the confidence interval for calculating emissions over period t. This indicates the upper limit of the carbon emission quota for the park in period t. Indicates the total number of settlement cycles. Indicates policy and rule constraints. A function representing the degree of violation of a single rule r. Represents a set of policies and rules. This indicates a risk uncertainty term. This represents the width of the confidence interval for calculating emissions over period t. This represents the lower bound of the confidence interval for calculating emissions over period t. Represents a non-decreasing penalty function. Indicates a fair allocation item. This represents the percentage of carbon emission contribution of object i in period t. Represents a constant. Represents the smoothing term of the scheme. Indicates the revenue item. This represents the carbon integral price over period t. Indicates the traversal index of an allocatable object; The carbon credit generation optimization module is configured to generate a carbon credit scheme and an auditable evidence package based on the initial carbon credit generation and allocation scheme, the target carbon accounting result, the contribution decomposition information, the confidence interval data, and the data quality identifier.

7. A Transformer-based zero-carbon park carbon accounting system applying the Transformer-based zero-carbon park carbon accounting method according to any one of claims 1 to 6, characterized in that, The system includes: The data processing module is used to collect multi-source heterogeneous carbon data of the target park, and preprocess the multi-source heterogeneous carbon data to generate a fusion input tensor and a data quality identifier. A multi-scale encoding module is used to input the fused input tensor into a pre-trained multi-scale temporal fusion encoding model and output a temporal feature intermediate representation vector. The multi-scale temporal fusion encoding model is a multi-scale Transformer architecture. The multi-scale temporal fusion encoding model includes feature extraction modules with multiple branches. Each branch's feature extraction module corresponds to processing a data source or a sampling granularity. The feature extraction module is used to encode the input data of each branch. The multi-scale temporal fusion coding model further includes a cross-modal attention fusion module, a frequency-domain adaptive positional encoding, and a mutation-aware attention head. The cross-modal attention fusion module learns trainable initial attention weights for the branch feature vectors output by the feature extraction modules of each branch; dynamically corrects the initial attention weights based on the quality identification features of each branch to determine the target attention weights for each branch; performs cross-modal attention fusion on the feature extraction modules of each branch based on the target attention weights, and outputs global temporal fusion features. The frequency-domain adaptive positional encoding module performs frequency domain analysis on the global temporal fusion features to extract dominant frequency term features; generates frequency-domain adaptive positional encoding based on the dominant frequency term features, and injects the frequency-domain adaptive positional encoding into each time step of the global temporal fusion features to perform periodic enhancement processing on the global temporal fusion features; the mutation-aware attention head performs mutation enhancement processing on the periodically enhanced global temporal fusion features and outputs a temporal feature intermediate representation vector. The contribution decomposition module is used to input the intermediate representation vector of the time-series features and the data quality identifier into the carbon flow tracing attention module to obtain contribution decomposition information. The carbon flow tracing attention module is a category-constrained multi-head attention structure, where each attention head corresponds to a carbon emission category and the contribution decomposition is constrained by a mask matrix. The uncertainty analysis module is used to perform uncertainty analysis on the intermediate representation vector of the time series features based on the contribution decomposition information, and to obtain the target carbon accounting results and confidence interval data. The carbon accounting module is used to input the contribution decomposition information, target carbon accounting results and confidence interval data into the carbon integral generation and optimization module to generate a carbon integral scheme and an auditable evidence package.