Carbon emission monitoring and verification method, device, equipment and medium based on blockchain

Using blockchain technology and the ACGMM model to identify anomalies in carbon emission data, combined with the calculation of emission allowances, it solves the problems of low regulatory efficiency and single data anomaly identification in the existing technology, and achieves multi-dimensional anomaly identification and data transparency. , improving supervision efficiency and data reliability.

CN118171090BActive Publication Date: 2024-09-03BEIJING HUIDI INTELLIGENT TECH RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410609840.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-16
Publication Date
2024-09-03
Estimated Expiration
2044-05-16

AI Technical Summary

Technical Problem

The existing carbon emission data monitoring system has the problems of single dimension of data anomaly identification and lagging supervision efficiency. It fails to effectively utilize the transparency and decentralization characteristics brought by blockchain technology, and the automated monitoring solution fails to meet the needs of data verification.

Method used

Adopt a blockchain-based carbon emission monitoring and verification method, identify data outliers through the ACGMM model, and combine it with the emission amount calculation smart contract to achieve abnormal identification and monitoring of carbon emission data, using the decentralization of the blockchain to Trustless, traceable, transparent, and secure features ensure reliable storage of data and no tampering.

Benefits of technology

It achieves multi-dimensional anomaly identification of carbon emission data, improves supervision efficiency, ensures data transparency and security, turns post-event supervision into in-process supervision, adapts to the carbon emission characteristics of different enterprises, and improves data quality and storage. reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118171090B
    Figure CN118171090B
Patent Text Reader

Abstract

The present invention discloses a carbon emission monitoring and verification method, device, equipment and medium based on blockchain, wherein the carbon emission monitoring and verification method comprises obtaining a current carbon emission data sample of a monitoring enterprise; calling an abnormal data identification smart contract to identify abnormal data of the current carbon emission data sample; calling an emission amount calculation smart contract to calculate the emission balance of the monitoring enterprise according to the current carbon emission data sample; uploading the abnormal data identification result and the emission balance to the blockchain. The carbon emission monitoring and verification method of the present invention can perform real-time abnormal verification and evidence storage on carbon emission data, effectively ensuring the data quality of carbon emission data in the system and improving regulatory efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of carbon emission data processing, and in particular to a blockchain-based carbon emission monitoring and verification method, device, equipment and medium. Background Art

[0002] The existing carbon emission reporting and verification system relies on the self-statistical data of emission units during the monitoring stage. The periodicity of the reporting stage leads to regulatory lags. The reliance on professional talents during the verification stage increases labor costs, resulting in prominent problems with data quality and execution efficiency. Most of the existing blockchain-based carbon emission monitoring and control methods are mainly aimed at enterprises rather than regulatory authorities, and do not consider the commercial privacy issues brought about by the transparency of blockchain data. At the same time, most of the current automated monitoring solutions do not consider the needs of data verification and accounting, and only register and save the data. A small number of monitoring solutions that implement data verification also face the dilemma of a single verification method and poor adaptability. The anomaly detection framework designed based on the characteristics of carbon emission data of different enterprises has not yet been realized. Summary of the invention

[0003] The present invention provides a blockchain-based carbon emission monitoring and verification method, device, equipment and medium, which solves the problems in the prior art of single dimension of carbon emission data anomaly identification and lagging carbon emission supervision efficiency.

[0004] To achieve the above objectives, based on one aspect of the present invention, a blockchain-based carbon emission monitoring and verification method is provided, comprising:

[0005] Obtain current carbon emission data samples of monitored enterprises;

[0006] Calling the abnormal data identification smart contract to identify abnormal data for the current carbon emission data sample, including applying the ACGMM model carried by the abnormal data identification smart contract to check whether the current carbon emission data sample has data outliers, and if so, adding a data outlier abnormal label to the current carbon emission data sample, the ACGMM model includes a contrast representation module, an attention module, and an estimation network module;

[0007] The application of the ACGMM model carried by the abnormal data identification smart contract to check whether the current carbon emission data sample has data outliers includes:

[0008] Obtain the preconfigured model parameters of the monitoring enterprise corresponding to the current carbon emission data sample and the historical carbon emission data within a preset time period, wherein the historical carbon emission data includes multiple carbon emission data samples and the enterprise carbon emission characteristics corresponding to each of the carbon emission data samples, and the probability that the sample belongs to each distribution; load the preconfigured model parameters into the ACGMM model, extract the numerical index of each carbon emission data sample in the historical carbon emission data and the numerical index of the current carbon emission data sample to form a carbon emission data set, wherein the carbon emission data set is a matrix, and each row of the matrix is ​​a sample representation vector, and any of the sample representation vectors is composed of the numerical index of one of the carbon emission data samples; take the sample representation vector corresponding to the current carbon emission data sample and input it into the comparison representation module to obtain the comparison representation vector; input the carbon emission data set into the attention module of the L layer to obtain the current carbon emission data sample corresponding attention distribution vector; concatenate the comparison representation vector and the attention distribution vector to obtain the corporate carbon emission characteristics of the current carbon emission data sample; apply the estimation network module to process the corporate carbon emission characteristics to obtain the probability that the current carbon emission data sample belongs to each distribution; calculate the mean and covariance matrix according to the corporate carbon emission characteristics corresponding to each of the carbon emission data samples in the historical carbon emission data and the probability that the sample belongs to each distribution, the comparison representation module, the attention module and the output value of the estimation network module; calculate the energy value of the corporate carbon emission characteristics of the current carbon emission data sample according to the corporate carbon emission characteristics of the current carbon emission data sample, the mean and the covariance matrix; determine whether the energy value of the current carbon emission data sample is greater than a preset reference threshold, and if so, return the recognition result that there is a data outlier in the current carbon emission data;

[0009] Calling the emission amount calculation smart contract according to the current carbon emission data sample to calculate the emission balance of the monitored enterprise;

[0010] The abnormal data identification result and the dischargeable balance are uploaded to the blockchain.

[0011] In one embodiment, the calling of the abnormal data identification smart contract to identify abnormal data of the current carbon emission data sample further includes:

[0012] Check whether the upload time interval of the current carbon emission data sample is less than the maximum upload time interval threshold; if not, determine that the current carbon emission data sample has data missing, and add a data missing anomaly label to the current carbon emission data sample;

[0013] According to the quantitative relationship between the numerical indicators of the current carbon emission data sample, it is determined whether there is a data error in the quantitative relationship between the numerical indicators. If yes, a data error anomaly label is added to the current carbon emission data sample.

[0014] In one embodiment, before calling the abnormal data identification smart contract to identify abnormal data of the current carbon emission data sample, the method further includes configuring the model parameters of the ACGMM model corresponding to the monitored enterprise, including:

[0015] Upload the historical emission data of the monitored enterprise within the preset time range;

[0016] Extract the numerical indicators of each sample in the historical emission data of the enterprise to form the historical emission data set of the enterprise , where N is the number of time series samples, M is the maximum number of numerical indicators in the sample, , A sample representation vector composed of numerical indicators corresponding to the sample;

[0017] Input model parameters , , is the neighborhood distance, is the core object identification threshold, and constructs positive and negative sample data based on the enterprise historical emission data set X through the preset DBSCAN clustering model idea;

[0018] Construct a contrastive representation module under the contrastive learning framework, and obtain any sample representation vector through the contrastive representation module The contrast representation vector , ;

[0019] Update the model parameters of the comparison representation module through the positive and negative sample data ;

[0020] Construct L attention modules, select any sample representation vector from the enterprise historical emission data set X according to the preset sampling range b The corresponding sample subset , , , , , sample subset is the sample representation vector and The previous (b-1) consecutive sample representation vectors together constitute dimensional matrix, any sample subset Input L attention modules to get any sample representation vector The corresponding L attention distribution vectors , , ,in, , is the model parameter of the l-th layer attention module;

[0021] Construct a modified transformer structure, for any sample representation vector , according to the currently selected sample representation vector The corresponding sample subset Calculate the parameters in each attention module , , The value of ,in, , , is the model parameter of the l-th layer attention module, according to the parameter , Calculate sample subsets Attention distribution in each attention module , according to the attention distribution ,parameter Calculate sample subsets At the initial reconstruction output of each attention module , based on the initial reconstruction output of each attention module Calculate sample subsets The secondary reconstruction output of each attention module ;

[0022] Through the modified transformer structure, any sample subset is calculated Secondary reconstruction output of the Lth attention module , construct the loss function and apply each sample subset Optimize the loss function and continuously reduce any sample subset Instead of reconstructing the output The difference between them updates the model parameters in the L attention modules , ;

[0023] Construct an estimation network module under the GMM framework, and for any sample representation vector , the contrast representation vector obtained by the contrast representation module And the L attention distribution vectors obtained by L attention modules Splice and get Carbon emission characteristics of enterprises , , , based on the carbon emission characteristics of enterprises The estimation network module is simulated through a multi-layer neural network to obtain the joint density estimation of the estimation network module , estimate the joint density estimate of the network module output go through The layer obtains the sample representation vector The probability of belonging to each distribution , and then according to The probability of belonging to each distribution Calculate the energy value of each sample ;

[0024] Construct a loss function for updating the model parameters of the estimated network module and apply each sample subset Optimize the loss function and update the model parameters in the estimation network module;

[0025] The model parameters of the comparison representation module, the attention module, and the estimation network module carrying the enterprise identifier are written into the model parameter ledger of the blockchain.

[0026] In one embodiment, the positive and negative sample data are constructed based on the enterprise historical emission data set X by using a preset DBSCAN clustering model concept, including:

[0027] S501: Initialize the list of samples not accessed in the enterprise historical emission data set X , a list of samples visited , Cluster partition ;

[0028] S502: Randomly select a sample in the unvisited set , remove it from the unvisited list: , add to the visited list: ;

[0029] S503: Calculate other samples in the enterprise historical emission data set X The distance dist is obtained of The object set A in the neighborhood, if , then the corresponding sample is located at of In the neighborhood, the distance calculation formula between samples is , where M is the number of numerical indicators in the sample, Representation sample The mth numerical index of Representation sample The mth numerical index of is the neighborhood distance;

[0030] S504: If of Number of objects in the neighborhood , go to step S505, otherwise Partition into outlier set : , proceed to step S511;

[0031] S505: Initialize the current category set , k=k+1, where k is used to count the number of categories of enterprise production modes, and the initial k=0;

[0032] S506: Select any sample from set A that has not been traversed ,like In the unvisited set, go to step S507, otherwise go to step S510;

[0033] S507: Remove from the unvisited list: , add to the visited list: , calculate the other samples in the enterprise historical emission data set X and The distance of The set of objects in the neighborhood is H,

[0034] S508: If of Number of objects in the neighborhood , add the sample point set HA to the set A;

[0035] S509: If does not belong to any cluster. Add to current category ;

[0036] S510: Check whether each object in A has been traversed, if so, proceed to step S511, otherwise proceed to step S506;

[0037] S511: Check if there are any unvisited points in the unvisited list If yes, proceed to step S502, if no, end the positive and negative sample data construction process.

[0038] In one embodiment, the invoking the emission amount calculation smart contract to calculate the emission amount balance of the monitored enterprise according to the current carbon emission data sample includes:

[0039] The current dischargeable balance of the monitored enterprise is calculated by the following formula:

[0040]

[0041] in, Indicates the upload timestamp of the i-th carbon emission data, represents the emission balance of the carbon account after the i-th upload, Indicates the amount of CO2 emitted per unit time.

[0042] In one embodiment, after uploading the abnormal data identification result and the dischargeable balance to the blockchain, the method further includes changing the error record value in the blockchain according to the abnormal data identification result returned by the abnormal data identification smart contract, including:

[0043] Calling the data writing smart contract to write a carbon emission data with a negative value of the erroneous record into the blockchain, and remarking "offsetting the carbon emission record at a certain moment";

[0044] Calculate the latest dischargeable balance, call data to write into the smart contract to update the dischargeable balance of the monitored enterprise in the blockchain;

[0045] Call the data writing smart contract to write the corrected data into the blockchain, and note "correct the carbon emission record at a certain moment";

[0046] Calculate the latest dischargeable balance, call data to write into the smart contract to update the dischargeable balance of the monitored enterprise in the blockchain.

[0047] Based on the same inventive concept, the present invention also provides a blockchain-based carbon emission monitoring and verification device, comprising:

[0048] The emission data upload module is used to obtain the current carbon emission data samples of the monitored enterprises;

[0049] An abnormal data identification module, used to call the abnormal data identification smart contract to identify abnormal data of the current carbon emission data sample, including applying the ACGMM model carried by the abnormal data identification smart contract to check whether the current carbon emission data sample has data outliers, and if so, adding a data outlier abnormal label to the current carbon emission data sample, the ACGMM model includes a contrast representation module, an attention module, and an estimation network module;

[0050] The application of the ACGMM model carried by the abnormal data identification smart contract to check whether the current carbon emission data sample has data outliers includes:

[0051] Obtain the preconfigured model parameters of the monitoring enterprise corresponding to the current carbon emission data sample and the historical carbon emission data within a preset time period, wherein the historical carbon emission data includes multiple carbon emission data samples and the enterprise carbon emission characteristics corresponding to each of the carbon emission data samples, and the probability that the sample belongs to each distribution; load the preconfigured model parameters into the ACGMM model, extract the numerical index of each carbon emission data sample in the historical carbon emission data and the numerical index of the current carbon emission data sample to form a carbon emission data set, wherein the carbon emission data set is a matrix, and each row of the matrix is ​​a sample representation vector, and any of the sample representation vectors is composed of the numerical index of one of the carbon emission data samples; take the sample representation vector corresponding to the current carbon emission data sample and input it into the comparison representation module to obtain the comparison representation vector; input the carbon emission data set into the attention module of the L layer to obtain the current carbon emission data sample corresponding attention distribution vector; concatenate the comparison representation vector and the attention distribution vector to obtain the corporate carbon emission characteristics of the current carbon emission data sample; apply the estimation network module to process the corporate carbon emission characteristics to obtain the probability that the current carbon emission data sample belongs to each distribution; calculate the mean and covariance matrix according to the corporate carbon emission characteristics corresponding to each of the carbon emission data samples in the historical carbon emission data and the probability that the sample belongs to each distribution, the comparison representation module, the attention module and the output value of the estimation network module; calculate the energy value of the corporate carbon emission characteristics of the current carbon emission data sample according to the corporate carbon emission characteristics of the current carbon emission data sample, the mean and the covariance matrix; determine whether the energy value of the current carbon emission data sample is greater than a preset reference threshold, and if so, return the recognition result that there is a data outlier in the current carbon emission data;

[0052] An emission amount calculation module is used to call an emission amount calculation smart contract to calculate the emission balance of the monitored enterprise according to the current carbon emission data sample;

[0053] The data writing module is used to upload the abnormal data identification result and the dischargeable balance to the blockchain.

[0054] Based on the same inventive concept, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the blockchain-based carbon emission monitoring and verification method described in any one of the above items is implemented.

[0055] Based on the same inventive concept, the present invention also provides a computer-readable storage medium on which computer instructions are stored, and the computer instructions are used to enable a computer to execute a blockchain-based carbon emission monitoring and verification method as described in any of the above items.

[0056] Compared with the prior art, the beneficial effects of the present invention are: an ACGMM model is designed according to the characteristics of carbon emission data to identify data anomalies, and the outliers of carbon emission data can be analyzed from the dimensions of horizontal data and vertical data at the same time to more accurately identify abnormal data. A personalized ACGMM model is configured for each enterprise. Combined with the decentralized, trustless, traceable, transparent and secure technical features of blockchain, while ensuring the transparency and security of the preliminary verification process, the reliable storage and non-tampering of the carbon emission data of the enterprise can be guaranteed. The carbon emission data of the enterprise is personalized for data anomaly identification while being uploaded to the blockchain, which transforms the post-supervision of the existing carbon emission monitoring system into in-process supervision that can promptly rectify problems, solving the problems of the single dimension of data anomaly identification and the lagging efficiency of carbon emission supervision in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0058] Figure 1 This is a flow chart of an embodiment of a carbon emission monitoring and verification method based on blockchain of the present invention;

[0059] Figure 2 This is a schematic diagram of the architecture of a blockchain-based carbon emission monitoring and verification system;

[0060] Figure 3 A comparison chart of calculated data and monitoring data for a power generation company;

[0061] Figure 4 This is a scatter plot of carbon emissions and heat supply for a power generation company;

[0062] Figure 5 for Figure 2 The ACGMM model structure diagram of the blockchain-based carbon emission monitoring and verification system shown;

[0063] Figure 6 for Figure 5 The schematic diagram of contrast representation module training in the ACGMM model shown;

[0064] Figure 7 for Figure 5 Schematic diagram of the modified transformer structure in the ACGMM model shown;

[0065] Figure 8This is a schematic diagram of the industrial chain structure of emission enterprises in the glass manufacturing industry;

[0066] Fig. 9 for Figure 8 The schematic diagram of the node channel division of emission enterprises in the glass manufacturing industry is shown;

[0067] Fig.10 This is a structural schematic diagram of an embodiment of a carbon emission monitoring and verification device based on blockchain of the present invention;

[0068] Fig.11 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0069] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0070] like Figure 1 As shown, an embodiment of the present invention provides a carbon emission monitoring and verification method based on blockchain, comprising:

[0071] S1: Obtain the current carbon emission data samples of the monitored enterprises;

[0072] S2: Call the abnormal data identification smart contract to identify abnormal data of the current carbon emission data sample;

[0073] S3: Call the emission amount calculation smart contract based on the current carbon emission data sample to calculate the emission balance of the monitored enterprise;

[0074] S4: Upload the abnormal data identification results and the dischargeable balance to the blockchain.

[0075] The blockchain-based carbon emission monitoring and verification method of this embodiment is applied to Figure 2 The blockchain-based carbon emission monitoring and verification system shown in Figure 2 As shown, the blockchain-based carbon emission monitoring and verification system includes a user response layer, a service and model layer, and a distributed data layer, wherein the smart contracts in the service and model layer and the blockchain in the distributed data layer together constitute a blockchain network.

[0076] The distributed data layer is used to store the data of the entire system, including the blockchain for storing the core data that cannot be tampered with and the MySql database for storing auxiliary extended data. Specifically, the blockchain is divided into an emission data ledger and a model parameter ledger. The emission data ledger is used to store data that requires high security, such as carbon emission data submitted by the enterprise, abnormal data identification results, and the current emission amount of the enterprise. It is the core of the data layer. The MySql database deployed locally on each node is used to store auxiliary information such as enterprise information, system environment parameters, and data correction records. It is mainly used for extensibility purposes that do not involve the core needs of the system, such as data anomaly alarms and front-end display processing. Its storage content only affects the user experience of the current node and will not affect the overall security and stability of the system.

[0077] The service and model layer is used to implement basic business and data processing logic. The service and model layer includes a microservice subsystem for processing request connection logic and a smart contract for implementing distributed data processing logic. Specifically, the microservice subsystem is used to connect the scheduling blockchain network, MySql database and external mail system, as well as to implement the business processing logic of functional modules such as on-chain enterprise management, emission quota setting, emission data upload, data abnormality alarm, data statistical analysis, error data correction, and model parameter configuration. Smart contracts are used to perform distributed processing on carbon emission data uploaded by emission enterprises. They are equipped with the ACGMM (Attention Contrastive Gaussian Mixture Model) model designed for the characteristics of carbon emission data. The processing content of smart contracts includes emission quota calculation, data writing, data reading, abnormal data identification, label addition, timestamp addition, etc.

[0078] The user response layer is the view layer, which is used to provide users with data display and operation interface, and respond to user needs through the operation interface, including the regulatory department interface and the emission enterprise interface. The regulatory department interface includes user management, current emission viewing, historical record query, data visualization, error data correction, model parameter configuration and other functions, and the emission enterprise interface includes historical record query, data visualization, enterprise information modification and other functions. The regulatory department interface provides visualization and display of global data, and the emission enterprise interface provides visualization and display of the currently logged-in enterprise data.

[0079] In this embodiment, the smart contracts in the service and model layer and the blockchain in the distributed data layer together constitute a blockchain network. As a virtual structure for realizing data security processing and storage, the blockchain network is a decentralized network, and network services are jointly provided by peer nodes deployed in regulatory departments and emission enterprises. Among them, smart contracts are used to calculate and process carbon emission data in a distributed manner, and blockchain is used to store processed carbon emission data in a distributed manner.

[0080] In this embodiment, the microservice subsystem communicates with the blockchain network through gRPC (Google Remote Procedure Calls). The user response layer as the view layer communicates with the microservice subsystem of the business logic layer through the RESTful interface (REST, Representational State Transfer). The relevant interface has a data verification mechanism for checking operation permissions and call parameters.

[0081] In addition to the core fields that record greenhouse gas emissions, the carbon emission data submitted by the enterprise should also include auxiliary fields such as gas flow, flow rate, emissions of each component, blade speed, kiln temperature, etc. The auxiliary fields vary depending on the industry and monitoring equipment to which the enterprise belongs, and can be used to assist in the identification of abnormal data. The current carbon emission data containing auxiliary fields is called horizontal data. The carbon emission data submitted by the enterprise is not an isolated sample, but a continuous sampling data with a time series relationship. The sequence of carbon emission data from the historical moment to the current latest moment is called longitudinal data.

[0082] Through the investigation and analysis of historical carbon emission data, it is found that corporate carbon emissions have the following characteristics: (1) Time series correlation: that is, corporate production is not an isolated process, and there is a time series correlation between the company's current carbon emissions and historical carbon emissions. For example, one of the main sources of carbon emissions from power generation companies is the fuel combustion process, and the combustion emissions after the fuel is put into use are not instantaneous processes; (2) Abnormal persistence, that is, carbon emission data anomalies usually persist in multiple continuous sampling data. Data anomalies are generally caused by external factors such as monitoring equipment and meteorology. The continuous effect of external factors will lead to the persistence of data anomalies. Figure 3 The figure shows the comparison between the carbon emission monitoring data and the calculated data of a power generation company. The circled carbon emission monitoring data is abnormal, which shows that the abnormal data is persistent in time. (3) Production step-by-step. The production efficiency of the company does not change smoothly, which leads to step-by-step changes in carbon emission data. Taking power generation companies as an example, there is a significant difference in electricity demand at noon and late at night. Therefore, power generation companies implement different production modes at noon and late at night, and the carbon emission patterns under different production modes are different. Figure 4 A scatter plot of carbon emissions and heating supply of a power generation company is shown. It can be seen that the company's carbon emissions and other production-related indicators have obvious step characteristics, reflecting the different production modes of the company. Different production modes correspond to different carbon emission modes.

[0083] Taking into account the temporal correlation, abnormal persistence and production step nature of corporate carbon emissions, the abnormal data identification smart contract in this embodiment identifies abnormal situations of missing and incorrect data in carbon emission data through conditional checks (predefined conditions). At the same time, the ACGMM model is called to identify abnormal situations of data outliers in carbon emission data.

[0084] Data missing means that the time interval for uploading carbon emission data exceeds the specified threshold, data error means that the quantitative relationship between numerical indicators in carbon emission data violates normal logic, and data outliers mean that carbon emission data does not conform to the normal distribution law in the horizontal and vertical dimensions. Data missing identification is mainly used to verify whether the time interval for uploading carbon emission data meets the requirements, data error identification is mainly used to verify the quantitative relationship between the numerical indicators of carbon emission records, and data outlier identification is mainly used to verify whether carbon emission data conforms to the normal distribution law in the horizontal and vertical data dimensions. When carbon emission data does not conform to the normal distribution law, it reveals that there may be unconventional situations such as abnormal enterprise-side detection, abnormal supervision equipment, or human tampering with data. The abnormal data identification smart contract is equipped with the ACGMM model designed for the characteristics of carbon emission data, and calls the ACGMM model to identify data outliers for carbon emission data. Through the predefined data missing identification conditions and data error identification conditions, the carbon emission data is identified by conditional checking.

[0085] In view of the time series correlation and abnormal persistence of carbon emission data, the ACGMM model introduces an attention mechanism to process the longitudinal data of carbon emission data to capture the continuous distribution anomalies related to time series. The attention mechanism can obtain the attention distribution of time series data for the purpose of discovering anomalies. In view of the production step nature of carbon emission data, the ACGMM model introduces the idea of ​​comparative learning to extract features from the horizontal data of carbon emission data to amplify the difference between abnormal data and normal data. The ACGMM model is designed based on the characteristics of carbon emission data. Its basic structure is as follows: Figure 5 As shown, it includes three parts: comparison representation module, attention module, and estimation network module. Specifically, for the carbon emission data uploaded by the enterprise at any time, the comparison representation module extracts the representation features of the carbon emission data, and the attention module extracts the attention distribution features on the current carbon emission data and its historical data during reconstruction. The vectors obtained by the attention module and the comparison representation module are concatenated and then input into the estimation network module. The estimation network module simulates the Gaussian mixture model through a multi-layer neural network, and finally obtains the Gaussian distribution probability, which is used to calculate the energy value of the current carbon emission data. The energy value can be used to identify whether the current carbon emission data is outlier compared with the historical data distribution.

[0086] In this embodiment, calling the abnormal data identification smart contract to identify abnormal data of carbon emission data includes:

[0087] S11: Check whether the upload time of the current carbon emission data sample meets the first condition. The first condition is that the upload time interval of the current carbon emission data sample is less than the maximum upload interval threshold, that is, ,in, is the predefined maximum acceptable upload interval threshold, Indicates the timestamp of the t-th data upload. If the first condition is not met, it is judged that the current carbon emission data sample has data missing, and the label adding smart contract is called to add a data missing exception label to the current carbon emission data sample;

[0088] S12: Check whether the quantitative relationship between the numerical indicators of the current carbon emission data sample meets the second condition. The second condition is ,in, is the gas emission, is the gas conversion rate, For heat emission, Indicates taking the absolute value. If the second condition is not met, it is judged that the current carbon emission data sample has data errors, and the label adding smart contract is called to add a data error exception label to the current carbon emission data sample;

[0089] S13: Call the ACGMM model carried by the abnormal data identification smart contract to check whether there is data outlier in the current carbon emission data sample;

[0090] In this embodiment, the ACGMM model includes a contrast representation module, an L-layer attention module, and an estimation network module. Step S13 specifically includes:

[0091] S131: Call the data reading smart contract to obtain the pre-configured model parameters of the enterprise corresponding to the current carbon emission data sample and the historical carbon emission data of the enterprise within a preset period from the model parameter ledger and emission data ledger of the blockchain respectively. The historical carbon emission data obtained includes multiple carbon emission data samples and the carbon emission characteristics of the enterprise corresponding to each carbon emission data sample, and the probability that the sample belongs to each distribution.

[0092] S132: Load the obtained pre-configured model parameters into the ACGMM model, extract the numerical indicators of each carbon emission data sample in the historical carbon emission data and the numerical indicators in the current carbon emission data sample (i.e., the sample to be identified), and form a carbon emission data set , , , is a sample representation vector (i.e., row vector) composed of numerical indicators corresponding to carbon emission data samples, and the matrix contains B sample representation vectors representing B carbon emission data samples, each sample representation vector contains M dimensions representing M numerical indicators, and the carbon emission dataset Input to the ACGMM model for execution, the sample representation vector of the current carbon emission data sample is express.

[0093] S133: Get the sample representation vector of the current carbon emission data sample Input the contrast representation module to obtain the contrast representation vector : ,in, The model parameters of the representation module are shown for comparison.

[0094] S134: Get carbon emission data set Input L layers of attention modules respectively and calculate the process variables of each attention module , : ,in, , is the model parameter of the attention module at layer l, according to the process variables , Calculating Carbon Emissions Dataset Attention distribution in each attention module , ,in, Represents the process variable calculated by the attention module at layer l is the transpose of , d represents the hidden layer dimension of the attention module. L attention distribution vectors can be obtained , the attention distribution vector corresponding to the current carbon emission data sample is .

[0095] matrix The B sample representation vectors contained serve to discover the correlation of carbon emission data from the time series dimension. Therefore, the sample representation vectors of B carbon emission data samples are used in the calculation and obtained in each attention module dimensional attention distribution matrix .

[0096] S135: The sample representation vector of the current carbon emission data sample The contrast representation vector output by the contrast representation module and the attention distribution vector output by the attention module Carbon emission characteristics of enterprises spliced ​​into current carbon emission data samples : .

[0097] S136: The carbon emission characteristics of enterprises in the current carbon emission data sample Input the estimation network module and get The probability of belonging to each distribution .

[0098] S137: Calculate the mean, covariance matrix and other parameters based on the enterprise carbon emission characteristics of each carbon emission data sample in the historical carbon emission data and the probability that the sample belongs to each distribution, the output values ​​of the comparison representation module, the attention module and the estimation network module:

[0099] ,

[0100] ,

[0101] ,

[0102] Among them, B is the carbon emission dataset The sample representation vector number contained, K is the number of sub-distributions of the estimated network classification, is the probability of the kth sub-distribution, is the mean of the kth sub-distribution, is the covariance of the kth sub-distribution, Represents the sample representation vector Carbon emission characteristics of enterprises and the mean of the kth subdistribution The transpose of the difference.

[0103] S138: Calculate the sample representation vector of the current carbon emission data sample Carbon emission characteristics of enterprises Energy value , energy value Characterizes the degree of outlier anomaly of the current carbon emission data sample:

[0104] .

[0105] S139: Determine the energy value of the current carbon emission data sample Is it greater than the preset reference threshold? If so, the identification result of the data outlier in the current carbon emission data sample is returned, and the label adding smart contract is called to add the data outlier anomaly label to the carbon emission data to be identified.

[0106] In this embodiment, the model parameter configuration module of the microservice subsystem performs initial model parameter configuration for each newly joined enterprise. Specifically, the regulatory department creates accounts for newly joined enterprises in the emission data ledger and model parameter ledger in the blockchain network, uploads the existing enterprise historical emission data to the microservice subsystem deployed locally by the regulatory department through the API (Application Programming Interface). The model parameter configuration function can generate and train customized pre-configured model parameters that meet the actual production characteristics of the enterprise for the current enterprise. The regulatory department can also manually adjust the parameters to control the strictness of the ACGMM model. After confirming that the configured model parameters are correct, the microservice subsystem calls the data to write the smart contract to update the model parameters to the corresponding enterprise account of the blockchain model parameter ledger. The model parameters will be distributed and stored in each node and can be traced. The model parameter configuration module updates the model parameters pre-configured by the regulatory department for different enterprises in real time to the model parameter ledger of the blockchain, which is used to realize customized identification models by industry and enterprise to adapt to the greenhouse gas emission characteristics of different production processes. The blockchain adopts a "dual ledger" model to build a model parameter ledger that is independent of the emission data ledger that stores carbon emission records. This ledger can only be written by regulatory authorities and is readable by all nodes. When an enterprise writes carbon emission data, each node reads the pre-configured model parameters of the enterprise in the model parameter ledger to configure the ACGMM model.

[0107] The model parameter configuration function module is used to set customized anomaly identification model parameters according to the production conditions of each enterprise. The ACGMM model for preliminary verification of carbon emission data adopts the basic idea of ​​customized centralized training and distributed transparent execution. The regulatory authorities can set and train customized model parameters for each enterprise based on its historical emission data, and inject customized model parameters of each enterprise into the blockchain model parameter ledger through the model parameter configuration function module, so as to set a customized ACGMM model for distributed carbon emission data processing. When processing carbon emission data, each node reads the model parameter data of the corresponding enterprise account under the model parameter ledger, thereby ensuring the adaptability of abnormal data identification to the differentiated production conditions of each enterprise.

[0108] In this embodiment, the process of the regulatory department generating and training pre-configured model parameters corresponding to the enterprise includes:

[0109] S401: Upload the historical emission data of the enterprise within a preset time range for which model parameters need to be configured, where the historical emission data of the enterprise includes multiple carbon emission data samples;

[0110] S402: Extract the numerical indicators of each sample in the enterprise's historical emission data to obtain the enterprise's historical emission data set , where N is the number of time series samples, M is the maximum number of numerical indicators in the sample, and the numerical indicators include greenhouse gas emissions, gas flow, gas flow rate, emissions of each component, blade speed, kiln temperature, etc. , is a sample representation vector composed of numerical indicators corresponding to the i-th sample in the historical emission data of the enterprise;

[0111] S403: Input model parameters , , is the neighborhood distance, is the core object identification threshold, and the sample representation vectors of the enterprise historical emission data set X are divided into K category sets through the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering model idea and the set of outliers , to construct positive and negative sample data, each category set Represents an enterprise production model, where the sample representation vectors of the same category set are defined as positive samples, and the sample representation vectors of different category sets are defined as negative samples;

[0112] S404: Construct a contrastive representation module under the contrastive learning framework, and obtain any sample representation vector through the contrastive representation module The contrast representation vector , , The model parameters of the representation module are shown for comparison;

[0113] S405: Update the parameters of the comparison representation module using the positive and negative sample data representing the enterprise production mode ; Including: using the inner product method to calculate the similarity of the comparison representation vectors between samples: , for any sample representation vector ,Will The distance between it and the random positive sample is recorded as ,Will The distance between the negative sample and , The negative sample set is recorded as In order to increase the similarity of the representation vectors between samples under the same enterprise production model, a loss function is constructed : , so that the distribution of normal data under the contrast representation vector is more concentrated, and the loss function is adjusted by using positive and negative sample data For optimization, let each sample represent a vector The sum of the loss functions after one round of training is , Indicates the minimum value of the sum of the loss functions before the current round. If the sum of the loss functions of each round in three consecutive rounds of training satisfies , that is, it is impossible to reach a value smaller than the minimum value of the loss function before the current round, then the optimization ends, and the model parameters in the comparison representation module are updated at the same time ; The comparison shows that the module training is as follows Figure 6 As shown, it aims to increase the difference between abnormal data and normal data.

[0114] S406: construct L attention modules, select any sample representation vector from the enterprise historical emission data set X according to the preset sampling range b The corresponding sample subset , used to calculate any sample representation vector The L attention distribution vectors of , , , sample subset is the sample representation vector and Previous Continuous The sample representation vectors together constitute dimensional matrix, b represents the sample subset The number of sample representation vectors included, the sample subset selected from the enterprise historical emission data set X The number of , , , select a sample subset This is equivalent to sampling the enterprise's historical emission data set X through a sliding window. The length of a sliding window is b. When the enterprise's historical emission data set X contains a large amount of sample data, Approaching N. Input L attention modules to get any sample representation vector L attention distribution vectors , , ;

[0115] S407: Construct a modified transformer structure. The modified transformer structure is as follows: Figure 7 As shown in Figure 2, its basic structure is similar to that of the transformer. The Multi-Head Attention in the transformer is replaced by the Attention Model constructed by S406. For any sample representation vector , according to the currently selected sample representation vector The corresponding sample subset Calculate the parameters in each attention module , , The value of ,in, , , is the model parameter of the l-th layer attention module; according to the parameter , Calculate sample subsets Attention distribution in each attention module , ,in, Represents the process variable calculated by the attention module at layer l The transpose of , d represents the hidden layer dimension of the attention module; according to the attention distribution ,parameter Compute the initial reconstruction output of each attention module ( is a matrix variable, l represents the number of layers of the attention module, Indicates that the current corresponding sample subset is ), ; Based on the initial reconstruction output of each attention module Calculate sample subsets The secondary reconstruction output of each attention module , , ,

[0116] ,

[0117] in, , , d represents the hidden layer dimension of the attention module, which is the same as the sample representation vector The vector dimensions M of are equal;

[0118] S408: Calculate the representation vector of each sample through the modified transformer structure The corresponding sample subset Secondary reconstruction output of the Lth attention module , construct the loss function : , apply each sample to represent the vector The corresponding sample subset For the loss function Optimize and continuously reduce any sample subset Instead of reconstructing the output The difference between them, assuming that each sample subset The sum of the loss functions after one round of training is , Indicates the minimum value of the sum of the loss functions before the current round. If the sum of the loss functions of each round in three consecutive rounds of training satisfies , the optimization ends and the model parameters in the attention module are updated , ;

[0119] S409: Construct an estimation network module under the GMM (Gaussian Mixture Model) framework to perform joint density estimation. The model structure is as follows: Figure 5 As shown, including: for each sample representation vector , the contrast representation vector obtained by the contrast representation module And the L attention distribution vectors obtained by L attention modules Splice and get Carbon emission characteristics of enterprises : , ,based on Carbon emission characteristics of enterprises The estimation network module is simulated through a multi-layer neural network to obtain the joint density estimation of the estimation network module : , estimate the joint density estimate of the network module output go through The sample representation vector corresponding to the sample available at the layer The probability of belonging to each distribution : , and then according to The probability of belonging to each distribution Calculate the energy value of the sample :

[0120] ,

[0121] Among them, MLN is a multi-layer neural network. , , , express The probability of belonging to the kth subdistribution, To estimate the model parameters of the network module; set the threshold based on experience ,like , then the sample represents the vector The corresponding samples are identified as abnormal data, and the threshold is adjusted Adjustable strictness of the estimation network module (GMM);

[0122] S410: Constructing model parameters for estimating network modules Update the loss function : , using each sample subset of the enterprise historical emission dataset X For the loss function To optimize, set each sample subset The sum of the loss functions after one round of training is , Indicates the minimum value of the sum of the loss functions before the current round. If the sum of the loss functions of each round in three consecutive rounds of training satisfies , then the optimization ends, where , is a hyperparameter used to control the weight, d is the hidden layer dimension of the attention module, are variables representing the row and column numbers of the matrix, For the matrix No. Line Column value, first item To maximize the likelihood function, the second term The regularization term introduced to solve the problem of zero items in the covariance matrix is ​​adjusted by the hyperparameter , Adjust the weights of each item and update the model parameters in the estimation network module ;

[0123] S411: The enterprise identifier , , , , , , , , Model parameter ledger written to the blockchain.

[0124] In this embodiment, in the model parameter configuration part, due to the huge amount of carbon emission data and the single structure, it is not suitable for data annotation or data enhancement. The comparison representation module needs to rely on positive and negative samples for parameter update. Therefore, the positive and negative sample data are constructed through the DBSCAN clustering model idea, including:

[0125] The enterprise production mode corresponding to the sample is identified through the largest density connected sample set W. Each enterprise production mode represents a carbon emission mode. The samples under the same enterprise production mode are defined as positive samples, and the samples at a certain moment are The samples of different enterprise production modes and the samples that do not correspond to any enterprise production mode are defined as negative samples. The model parameters of the DBSCAN clustering model include , , is the neighborhood distance, The core object identification threshold is based on experience Generally, it refers to the actual production mode number of the enterprise, such as full load, overload, shutdown, etc. Generally , based on the following DBSCAN clustering model conditions, define the largest density-connected sample set W derived from the density-reachable relationship:

[0126] Neighborhood: Corresponding to the radius in space, for ,That The neighborhood contains the sample set D and The distance is no greater than The subsample set of , the number of this sub-sample set is recorded as ,

[0127] Core object: For any sample , For Neighborhood corresponding At least the number of samples included, that is, if ,but is the core object,

[0128] Density Direct: If lie in of In the neighborhood, and is a core object, then it is called Depend on Density direct,

[0129] Density reachable: For core objects and , if there is a sample sequence ,satisfy ,and Depend on The density is directly Depend on The density can reach

[0130] Density connected: for and , if there is a core object sample ,make and All by The density can reach and Density connected.

[0131] In this embodiment, the samples of the enterprise historical emission data set X are divided into K category sets by using the preset DBSCAN clustering model. and the set of outliers , to construct positive and negative sample data, including:

[0132] S501: Initialize the list of samples that have not been visited , a list of samples visited , Cluster partition ,

[0133] S502: Randomly select a sample in the unvisited set , remove it from the unvisited list: , add to the visited list: ,

[0134] S503: Calculate other samples in the enterprise historical emission data set X The distance dist is obtained of The object set A in the neighborhood, if , then the corresponding sample is located at of In the neighborhood, the distance calculation formula between samples is , where M is the number of numerical indicators in the sample, Representation sample The mth numerical index of Representation sample The mth numerical index of is the neighborhood distance,

[0135] S504: If of Number of objects in the neighborhood , MinPts is the core object recognition threshold, go to step S505, otherwise Partition into outlier set : , proceed to step S511,

[0136] S505: Initialize the current category set , k=k+1, where k is used to count the number of categories of enterprise production modes (i.e., carbon emission modes). In this embodiment, the initial k=0,

[0137] S506: Select any sample from set A that has not been traversed ,like In the unvisited set, go to step S507, otherwise go to step S510,

[0138] S507: Remove from the unvisited list: , add to the visited list: , calculate the other samples in the enterprise historical emission data set X and The distance of The set of objects in the neighborhood is H,

[0139] S508: If of Number of objects in the neighborhood , add the sample point set HA to the set A,

[0140] S509: If does not belong to any cluster. Add to current category ,

[0141] S510: Check whether each object in A has been traversed. If so, proceed to step S511; otherwise, proceed to step S506.

[0142] S511: Check if there are any unvisited points in the unvisited list If yes, proceed to step S502, if no, end the positive and negative sample data construction process.

[0143] In this embodiment, the emission amount calculation smart contract calculates the real-time emission amount balance of the enterprise carbon account, which can be further used for extended applications such as balance alarm and carbon trading. The remaining emission amount is taken as the current balance of the enterprise carbon account, and the current carbon emission data sample is regarded as the transaction item that triggers the change of the account balance. The carbon account balance decreases with the occurrence of such transactions, and the emission amount balance of the carbon account is calculated based on the following formula.

[0144]

[0145] in, Indicates the upload timestamp of the i-th carbon emission data, represents the emission balance of the carbon account after the i-th upload, Indicates the amount of CO2 emitted per unit time.

[0146] Transaction items that cause changes in account balances, such as carbon emission data and correction data, as well as the real-time emittable balance of corporate carbon accounts are directly set by writing data into smart contracts.

[0147] In this embodiment, the abnormal data identification results uploaded in step S4 include: the current carbon emission data sample that has completed abnormal data identification (normal or with data anomaly labels added), the enterprise carbon emission characteristics of the current carbon emission data sample , the probability that the current carbon emission data sample belongs to each distribution .

[0148] In this embodiment, the error data correction module of the microservice subsystem is used to correct the erroneous record values ​​that have been written into the blockchain. The error data correction adopts the basic idea of ​​the red-letter correction method in accounting, and writes auxiliary data to the MySQL database for the view layer display to optimize the view layer data display effect. It can offset and correct the original data when it cannot be tampered with, while ensuring the traceability of the correction operation. The processing flow of error data correction includes:

[0149] S701: Write a carbon emission data with a negative value of the wrong record, and note "offset the carbon emission record at a certain moment";

[0150] S702: Calculate the remaining emission balance and update the emission balance of the corresponding enterprise carbon account;

[0151] S703: Write the corrected data and note "correct the carbon emission record at a certain moment";

[0152] S704: Calculate the remaining emission amount and update the emission balance of the corresponding enterprise carbon account;

[0153] S705: Write the offset carbon emission record number and the corresponding enterprise key into the database;

[0154] S706: Auxiliary data is written into the MySQL database, data is refreshed on the view layer error data correction page, and carbon emission data that has been offset in the MySQL database is filtered.

[0155] In this embodiment, the blockchain network is used to execute smart contracts and save carbon emission data in a distributed manner under the constraint that the carbon emission data of enterprises is not leaked to their upstream and downstream. Data isolation between enterprises is achieved through the blockchain channel mechanism. As a node in the distributed blockchain network, enterprises can join the corresponding channel according to their position in the supply chain, and regulatory authorities can join all channels to monitor global data.

[0156] The blockchain network uses the channel mechanism to design the internal organizational structure, separate different supply chain levels, and thus achieve ledger isolation. Taking the glass manufacturing industry as an example, its industrial chain is as follows: Figure 8As shown in the figure, the key raw material in the upstream of the industrial chain is synthetic ammonia, the key raw material in the midstream of the industrial chain is soda ash, and the downstream of the industrial chain is glass manufacturing. When monitoring and verifying the carbon emissions of various enterprises in the glass manufacturing industry, such as Fig. 9 As shown in the figure, channels are established in the blockchain network according to the supply chain level, and enterprises are assigned to the channels corresponding to their level. The regulatory authorities join all channels at the same time. When an enterprise uploads carbon emission data, only the nodes in the channel participate in the distributed execution of the smart contract and the distributed storage of data. This solution can achieve physical isolation of carbon emission data for upstream and downstream enterprises while ensuring supervision.

[0157] In other embodiments, when it is difficult to define the level of an enterprise in the industrial chain, or when there is a more stringent commercial privacy protection requirement for carbon emission data related to the production situation of an enterprise, in order to better protect the commercial privacy of the enterprise, the blockchain network structure can also be designed as follows: a channel is established for each enterprise in the blockchain network, and the regulatory department is added to all channels at the same time. When an enterprise uploads carbon emission data, only the enterprise node and the regulatory department node participate in the distributed execution of the smart contract and the distributed storage of data. The carbon emission data of the enterprise is transparent to the regulatory department, but at the same time isolated from other nodes in the blockchain network.

[0158] This embodiment is based on blockchain and combines a continuous emission monitoring system (CEMS) that can automatically collect carbon emission data to provide regulatory authorities and enterprises with a highly reliable, real-time, and low-cost carbon emission monitoring and verification service. After the CEMS deployed in the enterprise's production environment collects carbon emission data, the system implemented in this embodiment will automatically obtain relevant data and execute business processes such as data identification, accounting, evidence storage, and correction. Figure 2 The business process of the carbon emission monitoring and verification system shown is as follows:

[0159] S901: Initial parameter configuration. The regulatory department creates accounts for newly joined enterprises in the emission data ledger and model parameter ledger in the blockchain network, uploads the existing historical emission data of enterprises to the microservice subsystem deployed locally by the regulatory department through the API, and generates customized model parameters that meet the production characteristics of the enterprise for the current enterprise through the model parameter configuration function of the microservice subsystem. The regulatory department can also manually adjust the model parameters to control the strictness of the ACGMM model. After confirming that the model parameters are correct, the microservice subsystem calls the data to write the smart contract to update the parameters to the corresponding enterprise account in the model parameter ledger of the blockchain. The model parameters will be distributed and stored in each node and can be traced.

[0160] S902: Carbon emission data collection and upload. The CEMS deployed in the enterprise production environment collects and analyzes the velocity, flow, pressure, composition, and concentration of the exhaust gas, and uploads the current carbon emission data collected and analyzed in the previous period to the microservice subsystem deployed locally in the enterprise through the API every hour (preset time interval). The microservice subsystem writes the data into the smart contract through gRPC calls to upload the current carbon emission data to be processed to the enterprise local node of the blockchain network. After the enterprise local node signs, it sends the current carbon emission data to other nodes in the same channel through broadcasting.

[0161] S903: Identification of abnormal carbon emission data. After receiving the current carbon emission data to be processed sent by broadcast, each node in the blockchain network processes the current carbon emission data in a distributed manner. For each node that receives the current carbon emission data to be processed, the data reading smart contract is called to obtain the latest 1,000 carbon emission historical data of the current enterprise (i.e., the historical carbon emission data of the enterprise) from the emission data ledger of the blockchain, and the data reading smart contract is called to obtain the pre-configured model parameters of the current enterprise from the model parameter ledger of the blockchain. The model parameters, 1,000 carbon emission historical data and the current carbon emission data to be identified are used as input parameters, and the abnormal data identification smart contract is called to identify three types of abnormal situations: data missing, data error, and data outlier. After the abnormal data identification smart contract returns the identification result, an abnormal type label is added to the current carbon emission data. For example, if the current carbon emission data is identified as a data error exception, an "Error" label is added to the "alarmInfo" field of the data.

[0162] S904: Calculation of emission amount. For each node that receives the current carbon emission data to be processed, the data reading smart contract is called to obtain the emission balance in the current enterprise carbon account from the emission data ledger of the blockchain, and the emission balance and the current carbon emission data to be processed are used as input parameters to call the emission amount calculation smart contract. The emission amount calculation smart contract returns the remaining emission amount after the current carbon emission data is written into the blockchain, and adds the current hourly timestamp and the current remaining emission amount to the current carbon emission data.

[0163] S905: Data storage. For each node that receives the current carbon emission data to be processed, the current carbon emission data after data anomaly identification and emission amount accounting processing is signed and sent back to the emission enterprise node. At this time, the current carbon emission data includes the current carbon emission data sample that has completed abnormal data identification (the corresponding abnormal label is added if the identification result is abnormal), the enterprise carbon emission characteristics of the current carbon emission data sample, the probability that the current carbon emission data sample belongs to each distribution, and the remaining emission balance. The enterprise node determines whether all processed data are consistent, including the judgment of the distributed processing result fields such as abnormal labels, remaining emission amount, and hourly timestamps. If the data processed by more than 51% of the nodes in the current channel is consistent, the enterprise node packages the data and endorses the signature and sends it to the regulatory department node after signing. The regulatory department node sorts the received data, packages a batch of data that has not yet been written into the blockchain to generate a new block, and sends it to all nodes in the current channel of the blockchain network through broadcasting. For each node that receives a new block, each piece of data in the block will be verified to check the authenticity of the signature, data consistency, and whether the endorsement policy is met. After completion, the new block will be appended to the local blockchain, and the world state will be modified to update the emittable balance of each corporate account.

[0164] S906: Data query access. The regulatory department selects the emission enterprise to be queried through the historical record query interface on the regulatory department page. The microservice subsystem queries the blockchain network channel and enterprise key corresponding to the enterprise in the MySql database. The microservice subsystem uses the enterprise key as a parameter to call the data reading smart contract in the corresponding channel of the enterprise, returns the historical emission data of the enterprise and displays it in the view layer. The emission enterprise enters the historical record query page of the local view layer. The microservice subsystem queries the blockchain network channel and enterprise key corresponding to the current enterprise in the MySql database. The microservice subsystem uses the enterprise key as a parameter to call the data reading smart contract in the corresponding channel of the enterprise, returns the historical emission data of the enterprise and displays it in the view layer. The channel that the microservice subsystem calls the smart contract must be a channel that the node has joined, otherwise the system prompts an error.

[0165] S907: Correction of incorrect data. The regulatory department selects the incorrect data and enters the corrected data before submitting it. The microservice subsystem calls the data writing smart contract, uploads a piece of carbon emission data that negates all values ​​of the incorrect data and adds the label "offset the Xth carbon emission record", and the data is written to the blockchain network after steps S904 and S905. Then, the microservice subsystem calls the data writing smart contract, uploads a piece of carbon emission data containing the corrected data and adding the label "correct the Xth carbon emission record", and the data is written to the blockchain network after steps S904 and S905. The microservice subsystem writes a record containing the enterprise key and the incorrect data number to the MySql database, and the view layer incorrect data correction page refreshes the data and filters the corrected data in the MySql database.

[0166] S908: Adjustment of emission amount. The microservice subsystem queries the blockchain network channels and enterprise keys corresponding to all enterprises in the MySql database. The microservice subsystem uses the enterprise key as a parameter to call the data reading smart contract in the corresponding channel of the enterprise, obtains the remaining emission amount of the enterprise account from the world state, and the view layer displays the remaining emission amount information of all enterprise accounts in the form of a list. The regulatory department refers to the current emission amount of the enterprise and inputs the emission amount of the enterprise in the next cycle and submits it. The microservice subsystem generates an update record of the current remaining emission amount of the enterprise, and uploads the generated emission amount update record to the blockchain network through the gRPC call data upload smart contract. After the consensus of each node is reached through the signature, proposal initiation, endorsement, packaging, sorting, generation of new blocks, and verification, the emission amount update record is written into the blockchain, and the emission amount of the corresponding enterprise account in the world state is updated at the same time.

[0167] This embodiment builds a system model that can conduct preliminary verification and evidence storage of corporate carbon emission data and can serve the business needs of regulatory authorities. It uses a distributed blockchain framework as the underlying support of the system and integrates the ACGMM model designed for the characteristics of carbon emission data into the system. The decentralized, trustless, traceable, transparent, and secure technical features of blockchain ensure the reliable storage and tamper-proof of corporate carbon emission data. The monitoring architecture collects data in real time through IoT devices and calls interfaces to upload and conduct preliminary verification and evidence storage, turning the existing post-event supervision scheme into an in-event supervision scheme that can promptly rectify problems. Compared with the prior art, the carbon emission monitoring and verification system of this embodiment takes regulatory authorities rather than emission enterprises as the main service objects, which is more in line with the actual business needs of MRV digitization. Specifically, it can be manifested as follows: the distributed abnormal data identification model built through smart contracts can realize the preliminary judgment and labeling of erroneous data on the basis of fairness and transparency, which can assist regulatory authorities and emission enterprises in making decisions; the ACGMM model built by combining the characteristics of carbon emission data can analyze horizontal and vertical data to accurately identify abnormal outlier samples; through the blockchain model parameter ledger, personalized abnormal data identification model parameters are configured for each enterprise, which ensures the transparency and security of the preliminary verification process, while helping regulatory authorities to carry out differentiated customization according to the actual production emissions of various industries and enterprises; the ledger isolation based on supply chain stratification achieved through the channel mechanism effectively avoids the problem of corporate commercial privacy leakage caused by blockchain data transparency; a carbon account mechanism is built to realize the real-time accounting of the income and expenditure of corporate carbon emission quotas by blockchain applications; the error data correction process is implemented according to the accounting red-ink correction method, which can offset and correct the original data when it cannot be tampered with, meeting the business needs of erroneous data processing in actual scenarios. The system is designed and optimized from the perspective of actual business needs and actual data characteristics, and a complete system solution is proposed for the identification, accounting, storage and correction of raw carbon emission data. It also provides regulatory authorities with customized capabilities for identifying data anomalies accurate to the enterprise level. This is different from the existing simple solutions that simply register and save data, and is also different from the rigid solutions that only target a single data processing scenario. It can meet the regulatory authorities' cross-enterprise and cross-industry regulatory needs, effectively ensure the data quality of carbon emission data within the system and improve regulatory efficiency.

[0168] like Fig.10 As shown, based on the same inventive concept, corresponding to the above-mentioned embodiment method, an embodiment of the present invention further provides a carbon emission monitoring and verification device based on blockchain, which is used to implement the corresponding method in the above-mentioned embodiment, including:

[0169] The emission data uploading module 10 is used to obtain the current carbon emission data sample of the monitored enterprise;

[0170] The abnormal data identification module 20 is used to call the abnormal data identification smart contract to identify abnormal data of the current carbon emission data sample;

[0171] The emission amount calculation module 30 is used to call the emission amount calculation smart contract to calculate the emission balance of the monitored enterprise according to the current carbon emission data sample;

[0172] The data writing module 40 is used to upload the abnormal data identification results and the dischargeable balance to the blockchain.

[0173] Fig.10 The device shown is arranged at Figure 2 In the service and model layer of the system shown, the emission data uploading module 10, the abnormal data identification module 20, the emission amount calculation module 30, and the data writing module 40 correspond to Figure 2 The emission data upload module, abnormal data identification smart contract, emission amount calculation smart contract, and data writing smart contract.

[0174] The apparatus of the above-mentioned embodiment is used to implement the corresponding method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0175] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, an embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the carbon emission monitoring and verification method described in the above-mentioned embodiment is implemented.

[0176] Fig.11 A more specific hardware schematic diagram of an electronic device provided by this embodiment is shown, and the device may include: a processor 100, a memory 200, an input / output interface 300, a communication interface 400, and a bus 500. The processor 100, the memory 200, the input / output interface 300, the communication interface 400, and the bus 500 realize communication connection with each other inside the device.

[0177] The processor 100 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present invention.

[0178] The memory 200 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 200 may store an operating system and other application programs. When the technical solution provided by the embodiment of the present invention is implemented by software or firmware, the relevant program code is stored in the memory 200 and is called and executed by the processor 100.

[0179] The input / output interface 300 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0180] The communication interface 400 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0181] The bus 500 includes a path that transmits information between various components of the device (eg, the processor 100 , the memory 200 , the input / output interface 300 , and the communication interface 400 ).

[0182] It should be noted that, although the above device only shows the processor 100, the memory 200, the input / output interface 300, the communication interface 400 and the bus 500, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0183] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, an embodiment of the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the carbon emission monitoring and verification method as described in the above-mentioned embodiment.

[0184] The computer-readable storage medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology; the information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computer device.

[0185] The computer instructions stored in the computer storage medium of the above embodiment are used to enable the computer to execute the carbon emission monitoring and verification method described in the above embodiment, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0186] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present invention is limited to these examples. Under the concept of the present invention, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations in different aspects of the embodiments of the present invention as described above, which are not provided in detail for the sake of simplicity.

[0187] The embodiments of the present invention are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present invention. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the present invention.

Claims

1. A blockchain-based carbon emission monitoring and verification method. It is characterized in that include: Obtain current carbon emission data samples of monitored enterprises; Calling the abnormal data identification smart contract to identify abnormal data for the current carbon emission data sample, including applying the ACGMM model carried by the abnormal data identification smart contract to check whether the current carbon emission data sample has data outliers, and if so, adding a data outlier abnormal label to the current carbon emission data sample, the ACGMM model includes a contrast representation module, an attention module, and an estimation network module; The ACGMM model used in the abnormal data identification smart contract is applied to check whether the current carbon emission data sample has data outliers, including: Obtain the preconfigured model parameters of the monitored enterprise corresponding to the current carbon emission data sample and the historical carbon emission data within a preset time period, wherein the historical carbon emission data includes multiple carbon emission data samples and the enterprise carbon emission characteristics corresponding to each of the carbon emission data samples, and the probability that the sample belongs to each distribution; load the preconfigured model parameters into the ACGMM model, extract the numerical index of each carbon emission data sample in the historical carbon emission data and the numerical index of the current carbon emission data sample to form a carbon emission data set, wherein the carbon emission data set is a matrix, and each row of the matrix is ​​a sample representation vector, and any of the sample representation vectors is composed of the numerical index of one of the carbon emission data samples; take the sample corresponding to the current carbon emission data sample This representation vector is input into the comparison representation module to obtain a comparison representation vector; the carbon emission data set is input into the attention module of the L layer to obtain the attention distribution vector corresponding to the current carbon emission data sample; the comparison representation vector and the attention distribution vector are spliced ​​to obtain the corporate carbon emission characteristics of the current carbon emission data sample; the estimation network module is used to process the corporate carbon emission characteristics to obtain the probability that the current carbon emission data sample belongs to each distribution; the mean and covariance matrix are calculated based on the corporate carbon emission characteristics corresponding to each carbon emission data sample in the historical carbon emission data and the probability that the sample belongs to each distribution, the comparison representation module, the attention module and the output value of the estimation network module: , , , Among them, B is the carbon emission dataset The sample representation vector number contained, K is the number of sub-distributions of the estimated network classification, is the probability of the kth sub-distribution, is the mean of the kth sub-distribution, is the covariance of the kth sub-distribution, Represents the sample representation vector Carbon emission characteristics of enterprises and the mean of the kth subdistribution The transpose of the difference between the two; calculating the energy value of the enterprise carbon emission feature of the current carbon emission data sample according to the enterprise carbon emission feature of the current carbon emission data sample, the mean value and the covariance matrix; judging whether the energy value of the current carbon emission data sample is greater than a preset reference threshold value, and if so, returning the recognition result of the existence of data outliers in the current carbon emission data; Calling the emission amount calculation smart contract according to the current carbon emission data sample to calculate the emission balance of the monitored enterprise; The abnormal data identification result and the dischargeable balance are uploaded to the blockchain.

2. The carbon emission monitoring and verification method according to claim 1, It is characterized in that The calling of the abnormal data identification smart contract to identify abnormal data of the current carbon emission data sample also includes: Check whether the upload time interval of the current carbon emission data sample is less than the maximum upload time interval threshold; if not, determine that the current carbon emission data sample has data missing, and add a data missing anomaly label to the current carbon emission data sample; According to the quantitative relationship between the numerical indicators of the current carbon emission data sample, it is determined whether there is a data error in the quantitative relationship between the numerical indicators. If yes, a data error anomaly label is added to the current carbon emission data sample.

3. The carbon emission monitoring and verification method according to claim 1, It is characterized in that Before calling the abnormal data identification smart contract to identify abnormal data of the current carbon emission data sample, the method further includes configuring the model parameters of the ACGMM model corresponding to the monitored enterprise, including: Upload the historical emission data of the monitored enterprise within the preset time range; Extract the numerical indicators of each sample in the historical emission data of the enterprise to form the historical emission data set of the enterprise , where N is the number of time series samples, M is the maximum number of numerical indicators in the sample, , A sample representation vector composed of numerical indicators corresponding to the sample; Input model parameters , , is the neighborhood distance, is the core object identification threshold, and constructs positive and negative sample data based on the enterprise historical emission data set X through the preset DBSCAN clustering model idea; Construct a contrastive representation module under the contrastive learning framework, and obtain any sample representation vector through the contrastive representation module The contrast representation vector , ; Update the model parameters of the comparison representation module through the positive and negative sample data ; Construct L attention modules, select any sample representation vector from the enterprise historical emission data set X according to the preset sampling range b The corresponding sample subset , , , , , sample subset is the sample representation vector and Previous Continuous The sample representation vectors together constitute dimensional matrix, any sample subset Input L attention modules to get any sample representation vector The corresponding L attention distribution vectors , , ,in, , For the Model parameters of the layer attention module; Construct a modified transformer structure, for any sample representation vector , according to the currently selected sample representation vector The corresponding sample subset Calculate the parameters in each attention module , , The value of ,in, , , For the The model parameters of the layer attention module are based on the parameters , Calculate sample subsets Attention distribution in each attention module , according to the attention distribution ,parameter Calculate sample subsets At the initial reconstruction output of each attention module , based on the initial reconstruction output of each attention module Calculate sample subsets The secondary reconstruction output of each attention module ; Through the modified transformer structure, any sample subset is calculated Secondary reconstruction output of the Lth attention module , construct the loss function and apply each sample subset Optimize the loss function and continuously reduce any sample subset Instead of reconstructing the output The difference between them updates the model parameters in the L attention modules , ; Construct an estimation network module under the GMM framework, and for any sample representation vector , the contrast representation vector obtained by the contrast representation module And the L attention distribution vectors obtained by L attention modules Splice and get Carbon emission characteristics of enterprises , , , based on the carbon emission characteristics of enterprises The estimation network module is simulated through a multi-layer neural network to obtain the joint density estimation of the estimation network module , estimate the joint density estimate of the network module output After the SoftMax layer, we get the sample representation vector The probability of belonging to each distribution , and then according to The probability of belonging to each distribution Calculate the energy value of each sample ; Construct a loss function for updating the model parameters of the estimated network module and apply each sample subset Optimize the loss function and update the model parameters in the estimation network module; The model parameters of the comparison representation module, the attention module, and the estimation network module carrying the enterprise identifier are written into the model parameter ledger of the blockchain.

4. The carbon emission monitoring and verification method according to claim 3, It is characterized in that The positive and negative sample data are constructed based on the enterprise historical emission data set X through a preset DBSCAN clustering model concept, including: S501: Initialize the unvisited sample list in the enterprise historical emission data set X, which is unvisited=D, and the visited sample list , Cluster partition ; S502: Randomly select a sample in the unvisited set , remove it from the unvisited list: , add to the visited list: ; S503: Calculate other samples in the enterprise historical emission data set X The distance dist is obtained of The object set A in the neighborhood, if , then the corresponding sample is located at of In the neighborhood, the distance calculation formula between samples is , where M is the number of numerical indicators in the sample, Representation sample The mth numerical index of Representation sample The mth numerical index of is the neighborhood distance; S504: If of Number of objects in the neighborhood , go to step S505, otherwise Partition into outlier set : , proceed to step S511; S505: Initialize the current category set , k=k+1, where k is used to count the number of categories of enterprise production modes, and the initial k=0; S506: Select any sample from set A that has not been traversed ,like In the unvisited set, go to step S507, otherwise go to step S510; S507: Remove from the unvisited list: , add to the visited list: , calculate the other samples in the enterprise historical emission data set X and The distance of The set of objects in the neighborhood is H; S508: If of Number of objects in the neighborhood , add the sample point set HA to the set A; S509: If does not belong to any cluster. Add to current category ; S510: Check whether each object in A has been traversed, if so, proceed to step S511, otherwise proceed to step S506; S511: Check if there are any unvisited points in the unvisited list If yes, proceed to step S502, if no, end the positive and negative sample data construction process.

5. The carbon emission monitoring and verification method according to any one of claims 1 to 4, It is characterized in that The calling of the emission amount calculation smart contract according to the current carbon emission data sample to calculate the emission balance of the monitored enterprise includes: The current dischargeable balance of the monitored enterprise is calculated by the following formula: in, Indicates the upload timestamp of the i-th carbon emission data, represents the emission balance of the carbon account after the i-th upload, Indicates CO per unit time 2 Emissions.

6. The carbon emission monitoring and verification method according to any one of claims 1 to 4, It is characterized in that After uploading the abnormal data identification result and the dischargeable balance to the blockchain, the method further includes changing the error record value in the blockchain according to the abnormal data identification result returned by the abnormal data identification smart contract, including: Calling the data writing smart contract to write a carbon emission data with a negative value of the erroneous record into the blockchain, and remarking "offsetting the carbon emission record at a certain moment"; Calculate the latest dischargeable balance, call data to write into the smart contract to update the dischargeable balance of the monitored enterprise in the blockchain; Call the data writing smart contract to write the corrected data into the blockchain, and note "correct the carbon emission record at a certain time"; Calculate the latest dischargeable balance, call data to write into the smart contract to update the dischargeable balance of the monitored enterprise in the blockchain.

7. A blockchain-based carbon emission monitoring and verification device, It is characterized in that include: The emission data upload module is used to obtain the current carbon emission data samples of the monitored enterprises; An abnormal data identification module, used to call the abnormal data identification smart contract to identify abnormal data of the current carbon emission data sample, including applying the ACGMM model carried by the abnormal data identification smart contract to check whether the current carbon emission data sample has data outliers, and if so, adding a data outlier abnormal label to the current carbon emission data sample, the ACGMM model includes a contrast representation module, an attention module, and an estimation network module; The ACGMM model used in the abnormal data identification smart contract is applied to check whether the current carbon emission data sample has data outliers, including: Obtain the preconfigured model parameters of the monitored enterprise corresponding to the current carbon emission data sample and the historical carbon emission data within a preset time period, wherein the historical carbon emission data includes multiple carbon emission data samples and the enterprise carbon emission characteristics corresponding to each of the carbon emission data samples, and the probability that the sample belongs to each distribution; load the preconfigured model parameters into the ACGMM model, extract the numerical index of each carbon emission data sample in the historical carbon emission data and the numerical index of the current carbon emission data sample to form a carbon emission data set, wherein the carbon emission data set is a matrix, and each row of the matrix is ​​a sample representation vector, and any of the sample representation vectors is composed of the numerical index of one of the carbon emission data samples; take the sample corresponding to the current carbon emission data sample This representation vector is input into the comparison representation module to obtain a comparison representation vector; the carbon emission data set is input into the attention module of the L layer to obtain the attention distribution vector corresponding to the current carbon emission data sample; the comparison representation vector and the attention distribution vector are spliced ​​to obtain the corporate carbon emission characteristics of the current carbon emission data sample; the estimation network module is used to process the corporate carbon emission characteristics to obtain the probability that the current carbon emission data sample belongs to each distribution; the mean and covariance matrix are calculated based on the corporate carbon emission characteristics corresponding to each carbon emission data sample in the historical carbon emission data and the probability that the sample belongs to each distribution, the comparison representation module, the attention module and the output value of the estimation network module: , , , Among them, B is the carbon emission dataset The sample representation vector number contained, K is the number of sub-distributions of the estimated network classification, is the probability of the kth sub-distribution, is the mean of the kth sub-distribution, is the covariance of the kth sub-distribution, Represents the sample representation vector Carbon emission characteristics of enterprises and the mean of the kth subdistribution The transpose of the difference between the two; calculating the energy value of the enterprise carbon emission feature of the current carbon emission data sample according to the enterprise carbon emission feature of the current carbon emission data sample, the mean value and the covariance matrix; judging whether the energy value of the current carbon emission data sample is greater than a preset reference threshold value, and if so, returning the recognition result of the existence of data outliers in the current carbon emission data; An emission amount calculation module is used to call an emission amount calculation smart contract to calculate the emission balance of the monitored enterprise according to the current carbon emission data sample; The data writing module is used to upload the abnormal data identification result and the dischargeable balance to the blockchain.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the blockchain-based carbon emission monitoring and verification method as described in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium storing computer instructions. It is characterized in that The computer instructions are used to enable a computer to execute the blockchain-based carbon emission monitoring and verification method as described in any one of claims 1-6.