Carbon emission accounting method, system and device based on block chain and medium
Patent Information
- Application Number
- CN202510761785.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-10-17
AI Technical Summary
Existing blockchain-based carbon emission accounting solutions are inefficient when processing large numbers of concurrent transactions, pose risks of data privacy leakage, have insufficient consensus mechanism performance, are difficult to meet diverse needs, and have complex operational processes, hindering users from adopting new technologies.
The RSA asymmetric encryption algorithm is used to ensure the uniqueness and unforgeability of electronic signatures, and independent verification is achieved through an asynchronous consensus mechanism. Combined with the global electric-carbon aggregation chain for evidence storage, a trusted accounting system for multi-subject collaboration is constructed to simplify the operational process.
It improves the reliability and security of carbon emission data, reduces audit costs, is suitable for complex accounting scenarios involving large-scale multi-party participation, and improves the transparent management efficiency of the carbon market.
Smart Images

Figure CN120806330A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of carbon emissions, and in particular to a carbon emission accounting method, system, device and medium based on a blockchain. BACKGROUND
[0002] Carbon emissions, as one of the main sources of greenhouse gases, accurate measurement and management are essential to achieve emission reduction targets. The traditional carbon accounting method mainly relies on manual recording and paper reports, which has the problems of low data transparency, easy tampering, high auditing cost and difficult traceability. Especially in the case of multi-party participation, how to ensure the authenticity and consistency of the data becomes a big challenge. In recent years, with the development of information technology, especially the rise of blockchain technology, it provides a new possibility to solve the above problems. Blockchain is a distributed ledger technology, which has the characteristics of decentralization, tamper-proof, transparency, etc., which can effectively enhance the security and credibility of data. In the field of carbon emission accounting, through the blockchain technology, a more reliable and efficient accounting system can be established, so as to improve the operation efficiency of the carbon market and promote the fairness of carbon trading.
[0003] However, the existing carbon accounting scheme based on blockchain still faces some challenges: many existing blockchain platforms perform poorly when handling a large number of concurrent transactions, limiting their application in large-scale carbon accounting; while blockchain improves data transparency, it also brings the risk of privacy leakage, especially when sensitive business information is involved; consensus mechanism is the core component of blockchain, but most traditional consensus algorithms (such as PoW, PoS) sacrifice performance while ensuring security, resulting in longer transaction confirmation time; different countries and regions have different standards and regulations for carbon emissions, how to design a system architecture that can meet the diverse needs and maintain consistency is a big problem; complex operation process and technical threshold may hinder users from adopting new technology. SUMMARY
[0004] In view of the above existing problems, the present application is proposed.
[0005] Therefore, the present application provides a carbon emission accounting method based on a blockchain to solve the problems that the existing power line image analysis technology is susceptible to background interference, difficult to cope with environmental factors and unable to effectively distinguish different abnormalities.
[0006] To solve the above technical problems, the present application provides the following technical solutions: a carbon emission accounting method based on a blockchain, comprising the following steps:
[0007] Obtaining carbon emission data of each subject;
[0008] According to the carbon emission data, obtaining carbon emission accounting results and Hash values;
[0009] The carbon emission accounting result and the Hash value are sent to a related subject, the related subject uses an encryption algorithm to perform signature confirmation, and a to-be-chained block is obtained;
[0010] The to-be-chained block is stored through an asynchronous consensus mechanism, and the consistency of the signature and the Hash value is verified through an encryption algorithm, and the to-be-chained block that passes the verification is added to a global electric carbon aggregation chain.
[0011] As a preferred scheme of the carbon emission accounting method based on the block chain, wherein: according to the carbon emission data, the carbon emission accounting result and the Hash value are obtained, including:
[0012] Based on the carbon emission accounting method, the carbon emission data generated by each subject is calculated to generate an accounting report including direct carbon emission and indirect carbon emission;
[0013] The characteristic value of the accounting report is calculated through the Hash algorithm to generate a Hash value with a fixed length.
[0014] As a preferred scheme of the carbon emission accounting method based on the block chain, wherein: the carbon emission accounting result and the Hash value are sent to a related subject, and the related subject uses an encryption algorithm to perform signature confirmation, including:
[0015] The accounting report and the Hash value are sent to a related subject, and the related subject uses an RSA asymmetric encryption algorithm to encrypt the Hash value using a private key to generate an electronic signature;
[0016] If one subject does not perform signature, it is considered that there is a problem with the accounting report, and each subject needs to renegotiate again; if each related subject performs signature, it is considered that there is no problem with the accounting report, and the signature is completed.
[0017] The beneficial effects of the preferred technical scheme are: the RSA asymmetric encryption algorithm ensures the uniqueness and unforgeability of the electronic signature, and the multi-subject consensus signature is forced, which eliminates the unapproved accounting result from the source, improves the authority and credibility of the accounting result, and the clear signature completion determination rule avoids the problem of unclear responsibility in the traditional audit process, ensures that the carbon emission data is generated under the supervision of multiple parties, and reduces the risk of human intervention and data falsification.
[0018] As a preferred scheme of the carbon emission accounting method based on the block chain, wherein: the to-be-chained block is obtained, including:
[0019] When the signature of each related subject is completed, a to-be-chained block including block information and block content is generated;
[0020] The to-be-uplinked block is broadcasted, and the signature of the to-be-uplinked block is verified again, if the signature is correct, the to-be-uplinked block is stored through an asynchronous consensus mechanism, and if the signature is incorrect, the to-be-uplinked block is ignored.
[0021] The beneficial effects of the preferred technical scheme are that the signature integrity of the to-be-uplinked block is ensured through the block generation and secondary signature verification mechanism after signature completion, and the processing rule of ignoring invalid blocks can improve the resistance of the block chain network to malicious attacks.
[0022] As a preferred scheme of the carbon emission accounting method based on the block chain, the method further comprises the following steps:
[0023] The block information comprises a parent Hash, a timestamp and a block height of the to-be-uplinked block on the chain.
[0024] The block content comprises a citation, a main text and an appendix, wherein the citation is a Hash value of the main text, the main text is an accounting report, and the appendix is a signature of each subject.
[0025] As a preferred scheme of the carbon emission accounting method based on the block chain, the method further comprises the following steps:
[0026] After receiving the to-be-uplinked block, the block chain node independently verifies the electronic signature in the appendix, decrypts the signature using the public key of the corresponding subject, obtains a Hash value and compares the Hash value with the Hash value in the citation;
[0027] If the Hash value is consistent with the Hash value in the citation, it is confirmed that the accounting report is reliable and has not been tampered with, otherwise, the to-be-uplinked block is ignored.
[0028] If part of the block chain nodes cannot participate due to network interruption, the remaining nodes reach a consensus through independent verification, and the to-be-uplinked block that passes the verification is broadcasted to the global electric carbon aggregation chain to complete uplink.
[0029] The beneficial effects of the preferred technical scheme are that the asynchronous consensus mechanism allows nodes to independently verify the signature, even if part of the nodes are disconnected from the network, the consensus can be completed, the consensus time complexity is optimized to O(n), and in combination with the tamper-proof feature of the global electric carbon aggregation chain, the carbon accounting provides traceable and anti-fraud reliable evidence, reduces the audit cost and data dispute risk.
[0030] As a preferred scheme of the carbon emission accounting method based on the block chain, the method further comprises the following steps:
[0031] The signature in the appendix is reversely decrypted using the RSA public key to obtain a restored value.
[0032] Verify the consistency between the restored value and the cited hash value. After confirmation, permanently store the block in the global electric-carbon aggregation chain to generate an unalterable carbon accounting evidence record. During the audit, the validity of the signature can be repeatedly verified by retrieving the block.
[0033] Another object of the present invention is to provide a blockchain-based carbon emission accounting system.
[0034] To solve the above technical problems, the present invention provides the following technical solutions: a blockchain-based carbon emission accounting system, comprising: a data acquisition module for acquiring carbon emission data of each entity;
[0035] A data calculation module is used to obtain carbon emission accounting results and hash values based on the carbon emission data;
[0036] The signature confirmation module is used to send the carbon emission accounting results and hash values to relevant entities. The relevant entities use encryption algorithms to perform signature confirmation and obtain the block to be put on the chain;
[0037] The verification storage module is used to store the blocks to be chained on the chain through an asynchronous consensus mechanism, and verify the consistency of the signature and the hash value through an encryption algorithm, and add the blocks to be chained that have passed the verification to the global electric carbon polymerization chain.
[0038] The present invention provides a computer device comprising a memory and a processor, wherein the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of a blockchain-based carbon emission accounting method are implemented.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the blockchain-based carbon emission accounting method.
[0040] Compared with the prior art, the beneficial effects of the present application: the present application constructs a multi-subject collaborative trusted accounting system through blockchain technology, uses RSA asymmetric encryption electronic signature to ensure that the accounting result is approved by multiple parties and then chained, combines Hash value anchoring to prevent data tampering, and realizes independent verification when the network is not completely connected through an asynchronous consensus mechanism, optimizes the consensus time complexity to O(n), and can improve the processing efficiency. At the same time, the global electric carbon aggregation chain realizes cross-chain data storage and interaction, and the whole process of data generation, signature confirmation, block storage and asynchronous consensus trusted closed loop, not only enhances the reliability and security of carbon emission data, but also simplifies the operation process, reduces the audit cost, especially suitable for large-scale, multi-subject involved complex accounting scenarios, and provides efficient technical support for transparent management and green low-carbon development of carbon market. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0042] Figure 1 The whole process schematic diagram of a kind of carbon emission accounting method based on blockchain described in one embodiment of the present application.
[0043] Figure 2 The carbon emission accounting system schematic diagram of the multi-subject structure of a kind of carbon emission accounting method based on blockchain described in one embodiment of the present application.
[0044] Figure 3 The implementation process and process quantity schematic diagram of carbon accounting result storage of a kind of carbon emission accounting method based on blockchain described in one embodiment of the present application.
[0045] Figure 4 The time required for consensus accounting result using different consensus mechanisms of a kind of carbon emission accounting method based on blockchain described in one embodiment of the present application is compared with the schematic diagram. DETAILED DESCRIPTION
[0046] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.
[0047] Embodiment 1, refer to Figure 1For an embodiment of the present application, a blockchain-based carbon emission accounting method is provided, comprising:
[0048] S100: obtaining carbon emission data of each subject;
[0049] S102: obtaining carbon emission accounting results and Hash values according to the carbon emission data;
[0050] S104: sending the carbon emission accounting results and Hash values to relevant subjects, and using an encryption algorithm for signature confirmation by the relevant subjects to obtain a to-be-chained block;
[0051] S106: storing the to-be-chained block through an asynchronous consensus mechanism, and verifying the consistency of the signature and Hash values through an encryption algorithm, and adding the to-be-chained block that passes the verification to a global electric carbon aggregation chain.
[0052] It should be noted that by obtaining carbon emission data of each subject and generating accounting reports and Hash values, the data can be quantified and the characteristics can be anchored; then through a multi-subject encryption signature mechanism, the accounting results are required to be approved by multiple parties, data falsification is prevented from the source, and the authority of the results is ensured; a block structure including the main text of the report and the signed appendix is constructed, the main text is prevented from being tampered with by using the Hash value, the appendix is verified by multiple parties, and a tamper-proof evidence unit is formed; finally, through an asynchronous consensus mechanism, the nodes are allowed to verify the signature independently, and even if the network is partially interrupted, consensus can still be reached, the consensus time complexity is optimized to O(n), and the efficiency can be improved. The present application solves the problems of low data transparency, easy tampering, high auditing cost and strong network dependence of traditional carbon accounting, realizes the trusted generation, efficient evidence and full-process traceability of carbon emission data, and provides safe and reliable technical support for carbon management.
[0053] Embodiment 2, refer to Figures 1-2 For an embodiment of the present application, based on the above embodiment, a blockchain-based carbon emission accounting method is provided.
[0054] In the embodiment of the present application, the step S100 of obtaining carbon emission data of each subject includes obtaining raw data such as the amount of fossil fuel burned by enterprises, the amount of desulfurizing agent consumed, the data of purchased and sold electricity and heat; the subjects include carbon emission enterprises, accounting agencies, accounting management departments, emission right management departments, and individuals whose data are verified by the accounting management agencies.
[0055] In the embodiment of the present application, the step S102 of obtaining carbon emission accounting results and Hash values includes:
[0056] Based on the carbon emission accounting method, the carbon emission data generated by each subject is calculated to generate an accounting report including direct carbon emission and indirect carbon emission; the characteristic value of the accounting report is calculated by Hash algorithm to generate a fixed length Hash value.
[0057] For example, based on the "China Power Generation Enterprise Greenhouse Gas Emission Accounting Method and Reporting Guide (Trial)", etc. standards, the fossil fuel combustion quantity, desulfurizing agent consumption quantity, purchased and sold power and heat data and other raw data are calculated to generate an accounting report containing direct carbon emission quantity, such as fossil fuel combustion, desulfurization process emission; indirect carbon emission quantity, such as purchased power emission; transfer emission quantity, such as sold power and heat transfer emission; the characteristic value of the accounting report is calculated by Hash algorithm to generate a fixed length Hash value to anchor the uniqueness of the report content and prevent data tampering.
[0058] Carbon accounting is a measure to measure the direct and indirect emissions of carbon dioxide and its equivalent gases to the earth's biosphere by industrial activities. It is a series of activities aimed at emission enterprises, which requires them to collect, count and record data related to carbon emissions according to the monitoring plan, and calculate and summarize all information related to emissions. As mentioned above, carbon accounting covers a variety of different functional subjects, including power grids, power exchanges, ring exchanges, demonstration parks and other parts. The core point of the carbon accounting system based on blockchain technology is to make the local chain, off-chain and data center in the field of electric carbon connected, and to realize the security and easy connection of the whole process of carbon emission accounting by means of interconnection protocol and smart contract.
[0059] As shown in Figure 2 The structure diagram of the carbon emission accounting system with multi-subject structure, which is divided into three parts, including multi-subject structure, interconnection protocol and global electric carbon aggregation chain. The multi-subject structure disassembles each subject participating in carbon emission accounting; the interconnection protocol clearly defines the responsibilities of each subject in the carbon accounting process, and builds a way for each local chain to connect the global aggregation chain; the global electric carbon aggregation chain realizes the interconnection of each local chain, ensures the credibility and efficiency of the carbon accounting process, and plays the functions of evidence storage and data interaction.
[0060] In an optional implementation, the Hash value of the accounting report can be calculated by SHA-256 algorithm, the report content is converted into 256-bit binary feature code, and then converted into hexadecimal string to generate a unique Hash value, and the original text of the report cannot be reversed by the Hash value.
[0061] In an optional implementation, a 128-bit Hash value can also be generated by MD5 algorithm to anchor the report content with a shorter character sequence, and to ensure that the report has not been tampered with by checksum comparison.
[0062] In the embodiment of the present application, the carbon emission accounting result and the Hash value are sent to the relevant subject in step S104, the relevant subject uses the encryption algorithm for signature confirmation to obtain the block to be chained, and further comprising sub-steps A1-A4:
[0063] A1: The accounting report and the Hash value are sent to the relevant subject, and the relevant subject uses the RSA asymmetric encryption algorithm to encrypt the Hash value using the private key to generate an electronic signature;
[0064] A2: If one party subject does not sign, it is considered that the accounting report has problems, and each subject needs to renegotiate again; if each relevant subject signs, it is considered that the accounting report has no problems, and the signature is completed;
[0065] A3: After the signature of each relevant subject is completed, a block to be chained including block information and block content is generated;
[0066] A4: The block to be chained is broadcasted, and the signature of the block to be chained is verified again, if correct, the block to be chained is stored through the asynchronous consensus mechanism, if incorrect, the block to be chained is ignored.
[0067] Suppose that a subject approves the accounting result, and designs a general electronic signature method to ensure that such approval can be verified, and the signature method has the following characteristics:
[0068] (i) Different fields are signed, different signatures or not easy to be the same, to ensure that the signature corresponds to the signed field content;
[0069] (ii) Different subjects sign, different signatures, and signatures are difficult to be imitated to prevent false approval of the accounting result;
[0070] (iii) The signature can be verified, that is, a specific signature can be proved to be the signature of a specific subject for a specific field.
[0071] To meet the above conditions, a non-symmetric encryption algorithm is considered to convert the field to be signed into a text to be encrypted, the signature subject uses the private key to encrypt the field into ciphertext, and the ciphertext is used as the signature, and the public key is used to decrypt the signature and compare it with the original field to verify the signature. The private key held by each user is unique and corresponds to the public key held by the carbon emission accounting manager subject. Therefore, the present application uses the RSA asymmetric encryption algorithm to provide an implementation method of an electronic signature service.
[0072] For example, the RSA asymmetric encryption method provides a method for constructing a public-private key pair to serve the implementation of electronic signature, and the method comprises the following steps:
[0073] Randomly generate two large prime numbers p and q;
[0074] Calculate N = p x q, and calculate r = (p - 1) x (q - 1);
[0075] Find an integer e coprime to r, i.e. gcd(e, r) = 1, where gcd(a, b) represents the greatest common divisor of a and b;
[0076] Find the modular inverse element d of e with respect to r, i.e. ed≡1(mod r), where a≡b(mod c) represents that a and b have the same remainder after being divided by c. Since e and r are coprime, it can be proved that d exists;
[0077] (N, e) is the private key given by the accounting manager to the accounting subject, and (N, d) is the public key retained by the accounting manager.
[0078] Assuming that the accounting result field is converted into a signature pre-value l, the signer can sign and send to the manager using the formula L≡le(mod N), and the uniqueness of L is limited by 0<L<N. The validity of the signature can be verified using the following method: first, convert the accounting result field into a signature pre-value l according to the accounting result field, and then the manager uses the public key (N, d) to verify whether the formula l≡Ld(mod N) is true, and if it is true, the signature is considered valid.
[0079] In addition, in order to realize electronic signature technology, a technology for converting the to-be-signed field into a to-be-encrypted text is also designed, which is to prevent the original information from being too large to cause the signature method to be difficult to implement. In order to avoid the influence of the uncertainty of the length of the to-be-signed field, the Hash value of the to-be-signed field is calculated. Under normal circumstances, it is difficult for Hash values of different fields to be the same, i.e. it can be approximately considered that the Hash value corresponds to the original field uniquely, which can be obtained from the original field, but cannot be restored to the original field.
[0080] In an optional embodiment, elliptic curve encryption algorithm can also be used for signature confirmation, by generating an elliptic curve parameter group to construct a public-private key pair; when signing, the private key is used to perform elliptic curve digital signature on the Hash value to generate a signature result containing r and s values; when verifying, the consistency of the signature and the Hash value is verified by the public key and the elliptic curve parameters.
[0081] In another optional embodiment, SM2 national encryption algorithm can also be used for signature confirmation, based on the elliptic curve cryptography algorithm published by the National Cryptography Administration, and using the SM2 standard to generate a public-private key pair; the signature process encrypts the Hash value through the SM2 algorithm to generate standard signature data; when verifying, the public key and the SM2 decryption algorithm are used to verify the validity of the signature.
[0082] In the embodiment of the present application, the block information includes the parent Hash, timestamp and block height of the block to be chained on the chain; the block content includes the citation, main text and appendix, wherein the citation is the Hash value of the main text, the main text is the accounting report, and the appendix is the signature of each subject.
[0083] Specifically, the present application designs a storage contract to store the carbon emission accounting results by a signature method, and the storage contract is divided into two parts of report signature and signature verification.
[0084] The report signature realizes that the server responsible for signing generates a signature according to the signature private key and the Hash value of the report, while the signature verification realizes that the server responsible for accounting restores the report Hash value according to the signature and the signature public key, and compares it with the Hash value of the report itself to confirm the credibility of the signature. In addition, in order to realize the electronic signature technology, the present application also relates to a technology for converting the field to be signed into a text to be encrypted, which is to prevent the original information from being too large to cause the signature method to be difficult to implement. In order to avoid the influence of the uncertainty of the length of the field to be signed, the Hash value of the field to be signed is calculated. Under normal circumstances, the Hash values of different fields are difficult to be the same, that is, it can be approximately considered that the Hash value corresponds to the original field uniquely, which can be obtained from the original field, but cannot be restored to the original field. Based on the demand for protecting the recognition of the carbon emission accounting results, the above method is used to construct an asynchronous consensus mechanism applied to the carbon emission accounting block chain. In essence, the main role of the consensus mechanism is to solve the trust problem between the participants of the block chain, to ensure the consistency of multiple accounts recorded on the block chain, and to prevent unauthorized data tampering attempts.
[0085] After obtaining the accounting report, the accounting institution submits the result report and the accounting data proof to a server controlled by the carbon accounting management party, and the server copies the report and the accounting data and their proof materials to each subject. For the carbon accounting of enterprise emission subjects, it will be sent to the carbon emission subject, the accounting institution, the carbon emission accounting management party and the carbon emission right management party, and after the four subjects verify that the accounting is correct, they will use the private key to electronically sign the accounting report, which is regarded as acknowledging the correctness of the report, and the signature will be attached as an appendix to the original report text and returned to the server. When the server receives the report with the signature appendix, it uses the public key stored in the database to verify the appendix to ensure the validity of the signature.
[0086] When one party doubts the result, that is, the server does not receive all the reports with valid signed appendices from the subjects, it is considered that there is a problem with the report, which should be re-negotiated by the parties involved in the accounting. Specifically, this "negotiation" process refers to the process of determining the true value of the accounting data by the doubting party. For individual accounting subjects, the server directly copies the accounting data and the report to the subject receiving carbon accounting, and verifies the validity of the signature after the subject signs the report and returns it.
[0087] If the server receives the same number of reports with valid signed appendices as the number of copies after signing, it is considered that the signing is complete. At this time, the server generates a block, including block information and block content. Finally, the server broadcasts the block, and the servers in the blockchain verify the correctness of the signature of the block again. If it is correct, the block is added to the chain. If it is not correct, it is considered that someone has forged and broadcasted, and the block is ignored.
[0088] It should be noted that the signature in the generated block content should be verified by the server that has been broadcasted, which indicates that the private key used by each subject for encryption is correct, thereby avoiding data loss caused by attacks on the database storing the private key, which does not violate the principle of distributed structure of the blockchain. The public key used for decryption is public and difficult to tamper with.
[0089] In the embodiment of the present application, the block to be chained in step S106 is stored by an asynchronous consensus mechanism, and the consistency of the signature and the Hash value is verified by an encryption algorithm. The verified block to be chained is added to the global electric carbon aggregation chain, which further includes sub-steps B1-B4:
[0090] B1: After receiving the block to be chained, the blockchain node independently verifies the electronic signature in the appendix, decrypts the signature using the public key of the corresponding subject, obtains the Hash value and compares it with the Hash value in the citation;
[0091] B2: If the Hash value is consistent with the Hash value in the citation, it is confirmed that the accounting report is reliable and has not been tampered with; otherwise, the block to be chained is ignored. If some blockchain nodes cannot participate due to network interruption, the remaining nodes reach a consensus through independent verification, and the verified block to be chained is broadcast to the global electric carbon aggregation chain to complete the chaining;
[0092] B3: The signature in the appendix is decrypted in reverse using the RSA public key to obtain the restored value;
[0093] B4: Verify the consistency of the restored value and the citation Hash value, and permanently store the block to the global electric carbon aggregation chain after confirming that there is no error, generate an unalterable carbon accounting evidence record, and verify the validity of the signature repeatedly by calling the block during auditing.
[0094] In the embodiments of the present application, in order to solve the problem of trust between blockchain participants, ensure the consistency of multiple account records on the blockchain, and prevent unauthorized data tampering attempts, the present application builds an asynchronous consensus mechanism for the blockchain applied to carbon emission accounting on the basis of the evidence storage contract.
[0095] When the blockchain records a certain content, a server that attempts to tamper with the recorded content (an attack server) may cause other servers that do not want to tamper with the content (honest servers) to record by sending false information. The role of the consensus mechanism in the blockchain is to make all honest servers record the correct content. In the present application, after receiving the report with the signature, the honest server can verify whether the signature is correct through the public key of the signer. If the signature is correct, it is a correct accounting report, not a misleading accounting report sent by the attack server. Therefore, all honest servers record the correct content.
[0096] The consensus mechanism is asynchronous and not sensitive to the network. Even if part of the server cannot participate in the consensus due to network problems, the remaining servers can still complete the consensus.
[0097] For example, when a server is disconnected, each server only needs to independently verify the authenticity of the accounting report according to the accounting report and the signature, and use the public key to verify the signature to see if it is correct. Unlike the synchronous consensus mechanism, these servers do not need to communicate with the disconnected server. When applying the consensus mechanism of the present application to carbon accounting, the time complexity of the consensus is O(n), where n represents the number of emission subjects to be accounted for. This is because the consensus mechanism of the present application is that the server receiving the information verifies the authenticity of the accounting report. In this process, each server independently completes the verification, which can be done simultaneously. When calculating, only the completion time of one server needs to be considered, and the complexity is O(1). Since there are n accounting reports of emission subjects that need to be chained in the re-accounting, the total time complexity of the consensus mechanism is O(n).
[0098] Embodiment 3, refer to Figures 3-4 and Tables 1-2, based on the above-mentioned embodiments, provides a carbon emission accounting method based on a blockchain. In order to verify the beneficial effects of the present application, scientific demonstration is carried out through experiments.
[0099] In order to show the blockchain suitable for carbon emission accounting, this section will use a set of carbon emission related data of power generation enterprises to process the blockchain, and explain the process of carbon accounting based on the research blockchain. In the calculation example, the accounting period for the carbon emission accounting of the enterprise is 1 year, and the present application counts the original emission data in the year, part of which is counted in months and aggregated in years.
[0100] Table 1 Original data related to carbon emission accounting of enterprises
[0101]
[0102]
[0103] The carbon emission accounting contract of the blockchain provides the accounting results as shown in Table 2.
[0104] Table 2 Enterprise Emission Accounting Report
[0105]
[0106]
[0107] Thereafter, the Hash value of the calculation report is calculated to show the data encryption process. The PHP method is used to calculate the Hash value of the accounting report: $2y$10$5cFM939IwRiVvdchSknMseNyV2Dgpo17MKOCP.WhGEtSuxKGyQEnq, and the Hash value is converted into hexadecimal ASCII code as follows: 00243279243130243563464d393339497752695676646368536b6e4d73654e7956324467706f31374D4B4F43502E57684745745375784K477951456e71.
[0108] After the contract output calculates the accounting report, the report will be copied to the emission enterprise, the accounting agency, and the accounting management agency. In the evidence storage contract, the RSA-encrypted public and private key pairs of the emission enterprise, the accounting agency, and the accounting management agency are as shown in the appendix. After the three parties have no objection to the accounting results, they will sign respectively. The signature private keys of the three parties and the signature results are recorded as follows (the public key is too long to be omitted):
[0109] ① Emission Enterprise
[0110] Signature Private Key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKSrG oPd+GtHz6Wn / VF93fibxKQagc2pNBicf2cXG1zOD2EaPipbohQEYXcYJ8do / xL47PLqUvcaGWM2aJULxE+4uP5WMOzo / jy3henrXiy502WBzTkeocCcDdlcvK+LCnCS Pz4xI5zazjaG1EawFzVEeR+e073OS+298z / XdDvwIDAQAB
[0111] Signature result: Bdh4 / VuSBn43oXK+Bl+ / zEufhIzPOh8naQbF910OnYQyhCISGs72T2EfqRSvmfUyItbH8AsVhb+ySx2LbSGgcHTWQPfgxn2inG26d7D8A+XtKVSjRxDl6+GoCrIY0+g46CBbECJNOHU5De / uedpsymskjopZjjuV3092kJuRwAM=
[0112] 2. Accounting agency
[0113] Signature private key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCzjWr5Umjq8Vu9BRR4aa2fN+py / O9kto8dAK4UhQS9X3jDiIpLMv2c63Qqx6p1cDKypgIadPv38HorGagpiSh6s4xlmnMGViZy6GXtsjDhDWVUe0Kj6BH7 / wzjBBL7l6BUtJdTxfu0SGc4yAo8wjR2Thilu6RCr8Pz0eZd+ / 0kuQIDAQAB
[0114] Signature result: In03hAJudsRiM+iE9+393qv1bJoO7eOYgG17j7ASqUTpUbHelmPIPWCwIvyB7t / ZXOFbSe74J5eOfOcUpXjSXFz9T28OWY52eV48Er50pBKgtbdT60zRd4EeuPzW9lfSlyy0CcVy7Ud8J8xDGlRSDhuk9mE9PbCOKrzCudRflzM
[0115] 3. Accounting management agency
[0116] Signature private key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHpiacgypSodcE54KyA / XEee5nJde2LL8f+njR0p4vgtA9ahsgAR+hEzkVH8NQh6c+EvRUIUFGXYRR+ET0SA8XMIZP7lnxXedtP1sYHp0NPvrYDFNfx+fB823oRohT+uw7dcWmvu8JdLybECRO6i4xn3tIGStWyq4a5e3Yjnsu6QIDAQAB
[0117] Signature result: WXA7y5M8oUO+vTy+i3H6LC+qlKpwJylaUtvLehwRxSMkq0dEw E08VOh / pOXw7gSb43kmvLDEPyo4e1y / tGw+9O2vg03uQKwWk19LVz3rKwvj0D8eXqvwj6ROOzBnobmbrxIleAhUQSkpIMlF0NokWz+gzIBKxpiocuNxvzqipBQ=
[0118] The server receives the above signatures, decrypts each signature, and the result is recorded as follows:
[0119] Decryption result of the discharging enterprise: $2y$10$5cFM939IwRiVvdchSknMseNyV2Dgpo17MKOCP.WhGEtSuxKGyQEnq; decryption result of the accounting agency: $2y$10$5cFM939IwRiVvdchSknMseNyV2Dgpo17MKOCP.WhGEtSuxKGyQEnq; decryption result of the accounting management agency: $2y$10$5cFM939IwRiVvdchSknMseNyV2Dgpo17MKOCP.WhGEtSuxKGyQEnq
[0120] It is not difficult to verify that the result is the same as the original Hash value, as shown in Figure 3 The implementation process of the above signature contract is shown, where some contents such as signatures, key pairs, etc. are omitted.
[0121] Subsequently, the server enters the next process and starts packaging the content, i.e. generates a block. The block content part of the block includes the report, the report Hash value and the above three signatures. After packaging, the server broadcasts the block to each subject participating in the blockchain.
[0122] The server participating in the consensus receives the block, uses the public key of each subject corresponding to the signature of each subject to respectively decrypt the attached document, finds that the citation is the same as that of the block, and thus adds the block to the chain, thereby completing the consensus. When the report needs to be queried, the block corresponding to the report is called again to verify the above signature. If the signature is correct, it is considered that the content of the block is reliable, wherein the information has not been tampered with and the result has been jointly confirmed by the participating accounting subjects; otherwise, the information of the block is not believed. Considering the characteristics of a large number of carbon accounting subjects and large data volume, the present application simulates 1000 sets of emission data of emission enterprises, chains the accounting results, and measures 100, 500, and 1000 sets of accounting results. In order to reflect the high efficiency of the carbon accounting block chain constructed by the present application, the present application also writes algorithms for consensus accounting results by applying some common and time-consuming consensus mechanisms, including Raft, PBFT, and RBFT consensus mechanisms, and measures the average consensus time of consensus of an accounting report by applying these algorithms, and obtains the comparison chart of the average consensus time of accounting as shown in Figure 4 In the chart, it is assumed that each subject to be accounted has a server joined in the block chain, and Raft is not easy to measure due to its strong random characteristics, so the average value given in the literature is directly taken, that is, 225ms for each block. It is not difficult to see that in the carbon accounting scenario, the consensus mechanism designed by the present application has less consensus time than other consensus mechanisms, which can improve the accounting efficiency. The above embodiment verifies the advantages of the block chain structure constructed by the present application and the conventional system in accounting efficiency by simulating accounting of a large number of subjects.
[0123] Embodiment 4, the above is a schematic scheme of a carbon emission accounting method based on a block chain. It should be noted that the technical scheme of the carbon emission accounting system based on the block chain belongs to the same concept as the technical scheme of the carbon emission accounting method based on the block chain described above, and the technical scheme of the carbon emission accounting system based on the block chain in the present embodiment is not described in detail. The contents can be seen from the description of the technical scheme of the carbon emission accounting method based on the block chain described above.
[0124] The present embodiment also provides a carbon emission accounting system based on a block chain, comprising:
[0125] A data acquisition module for acquiring carbon emission data of each subject;
[0126] A data calculation module for acquiring carbon emission accounting results and Hash values according to the carbon emission data;
[0127] A signature confirmation module for sending the carbon emission accounting results and Hash values to the related subjects, and the related subjects use the encryption algorithm for signature confirmation to obtain a block to be chained;
[0128] The verification storage module is configured to store the to-be-chained block by using an asynchronous consensus mechanism, verify consistency of a signature and a Hash value by using an encryption algorithm, and add the to-be-chained block that passes the verification to the global carbon aggregation chain.
[0129] The embodiment also provides an electronic device suitable for the case of carbon emission accounting based on a blockchain, including a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions to implement the method for carbon emission accounting based on a blockchain proposed in the above embodiment.
[0130] The embodiment also provides a storage medium having a computer program stored thereon, and the program is executed by a processor to implement the method for carbon emission accounting based on a blockchain proposed in the above embodiment.
[0131] The storage medium proposed in the embodiment and the method for carbon emission accounting based on a blockchain proposed in the above embodiment belong to the same inventive concept, and the technical details not described in the embodiment can be referred to the above embodiment, and the embodiment has the same beneficial effects as the above embodiment.
[0132] From the above description about the embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and necessary universal hardware, and of course can also be realized by hardware. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, and the computer software product can be stored in a computer readable storage medium, such as a floppy disk, a ROM, a RAM, a FLASH, a hard disk, or an optical disc, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present application.
[0133] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application but not limit the present application, and although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the present application, and all of them should be covered in the scope of the claims of the present application.
Claims
1. A carbon emission accounting method based on blockchain, characterized in that: include: Obtain carbon emission data of each entity; Obtain carbon emission accounting results and hash values based on the carbon emission data; The carbon emission accounting results and hash values are sent to relevant entities, who then use encryption algorithms to sign and confirm the results, obtaining the blocks to be uploaded to the blockchain. The blocks to be put on the chain are stored on the chain through the asynchronous consensus mechanism, and the consistency of the signature and the hash value is verified through the encryption algorithm, and the blocks to be put on the chain that pass the verification are added to the global electric carbon polymerization chain.
2. A blockchain-based carbon emissions accounting method as claimed in claim 1, characterized in that: Based on the carbon emission data, obtain the carbon emission accounting results and hash value, including: Based on the carbon emission accounting method, the carbon emission data generated by each entity is calculated to generate an accounting report including direct and indirect carbon emissions; The characteristic value of the accounting report is calculated through the Hash algorithm to generate a Hash value of fixed length.
3. A blockchain-based carbon emissions accounting method as claimed in claim 2, characterized in that: The carbon emission accounting results and hash values are sent to relevant entities, who then use encryption algorithms to sign and confirm, including: The accounting report and Hash value are sent to the relevant parties, who then use the RSA asymmetric encryption algorithm to encrypt the Hash value with their private key to generate an electronic signature; If one party fails to sign, it is deemed that there is a problem with the accounting report and the parties need to renegotiate again; if all relevant parties sign, it is deemed that there is no problem with the accounting report and the signature is completed.
4. A blockchain-based carbon emissions accounting method as claimed in claim 3, characterized in that: Get the block to be chained, including: When all relevant parties have signed, a block to be uploaded to the chain is generated, including block information and block content; The block to be chained is broadcasted, and the signature of the block to be chained is checked again to see if it is correct. If it is correct, the block to be chained will be stored on the chain through the asynchronous consensus mechanism. If it is incorrect, the block to be chained will be ignored.
5. A blockchain-based carbon emissions accounting method as claimed in claim 4, characterized in that: Also includes: Block information includes the parent hash, timestamp, and block height of the block to be on-chain. The block content includes citation, main text, and appendix. The citation is the hash value of the main text, the main text is the accounting report, and the appendix is the signature of each entity.
6. A blockchain-based carbon emissions accounting method as claimed in claim 2, characterized in that: The blocks to be put on the chain are stored on the chain through an asynchronous consensus mechanism, including: After receiving the block to be uploaded, the blockchain node independently verifies the electronic signature in the attachment, decrypts the signature using the public key of the corresponding subject, obtains the hash value, and compares it with the hash value in the reference; If the hash value is consistent with the hash value in the quotation, the accounting report is confirmed to be credible and has not been tampered with; otherwise, the block to be uploaded to the chain is ignored; If some blockchain nodes are unable to participate due to network interruption, the remaining nodes will reach a consensus through independent verification, and the verified blocks to be put on the chain will be broadcast to the global electric carbon polymerization chain to complete the chain.
7. A blockchain-based carbon emissions accounting method as claimed in claim 5, characterized in that: The consistency of the signature and the hash value is verified through an encryption algorithm, and the blocks to be added to the global electric carbon polymerization chain are added after verification, including: Use the RSA public key to reverse decrypt the signature in the attachment to obtain the restored value; Verify the consistency between the restored value and the cited hash value. After confirmation, permanently store the block in the global electric-carbon aggregation chain to generate an unalterable carbon accounting evidence record. During the audit, the validity of the signature can be repeatedly verified by retrieving the block.
8. A blockchain-based carbon emission accounting system, applying a blockchain-based carbon emission accounting method according to any one of claims 1 to 7, characterized in that: include: Data acquisition module, used to obtain carbon emission data of each entity; A data calculation module is used to obtain carbon emission accounting results and hash values based on the carbon emission data; The signature confirmation module is used to send the carbon emission accounting results and hash values to relevant entities. The relevant entities use encryption algorithms to perform signature confirmation and obtain the block to be put on the chain; The verification storage module is used to store the blocks to be chained on the chain through an asynchronous consensus mechanism, and verify the consistency of the signature and the hash value through an encryption algorithm, and add the blocks to be chained that have passed the verification to the global electric carbon polymerization chain.
9. A computer device comprising a memory and a processor, wherein the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of a blockchain-based carbon emission accounting method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of a blockchain-based carbon emission accounting method as described in any one of claims 1 to 7.