Electricity utilization carbon emission data storage system, method and equipment and storage medium

Through the hierarchical blockchain platform, single point failure and high concurrency complexity of traditional power-using carbon emission data storage systems are solved, and efficient and secure data storage and synchronization are achieved to ensure data security and flexibility.

CN119323055AActive Publication Date: 2025-01-17GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD

Patent Information

Application Number
CN202411462189.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-01-17
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

The traditional power carbon emission data storage method has a single point of failure, which is easily compromised and leads to data tampering. The high concurrency and real-time requirements increase storage costs, and data synchronization is complex.

Method used

Using a layered blockchain platform, including Ye Blockchain, Intermediate-layer Blockchain and Root Blockchain, certificates are issued through the identity registration interface, and data is requested through Ye Blockchain, Intermediate-layer Blockchain and Root Zone Blockchain processes and caches requests through message queue interfaces to ensure safe and efficient synchronization of data.

Benefits of technology

Improve data security, realize efficient and secure data storage and synchronization, and easily find the blocks to which data belongs through a hierarchical blockchain platform, support cross-chain data access and download, and effectively respond to large-scale and high-concurrent data flow requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323055A_ABST
    Figure CN119323055A_ABST
Patent Text Reader

Abstract

The invention discloses an electricity utilization carbon emission data storage system, method and device and a storage medium. The system comprises the steps that a power supply bureau registers identities for an environmental protection monitoring department and a carbon emission user and issues certificates; the data uplink interface receives a data uplink request; the leaf block chain stores the power utilization carbon emission data, synchronizes a block head of the leaf block chain to the middle-layer block chain and downloads other block heads from the middle-layer block chain; the middle-layer block chain collects and processes block head information of all subordinate leaf block chains, synchronizes a block head of the middle-layer block chain to a root block chain, and downloads the block head from the root block chain; the root block chain collects and processes block header information from the middle-layer block chain, and broadcasts the block header of the root block chain to the middle-layer block chain and the leaf block chain recursively; and the data downloading interface receives a data downloading request initiated by an environmental protection monitoring department and returns corresponding power utilization carbon emission data. The technical problems that in the prior art, a single-point fault exists, and data are prone to being tampered are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage technology, and in particular to a data storage system, method, device and storage medium for carbon emissions from electricity consumption. Background Technology

[0002] Electricity consumption carbon emission data involves a wide variety of users and a large number of users, who generate a large number of data upload and access requests. Moreover, this data often involves users' important business privacy. Due to the above characteristics of electricity consumption carbon emission data, the industry has put forward a series of requirements for data storage, including large-scale storage capacity, high concurrency processing capabilities, high real-time performance, and data security.

[0003] Traditional methods for storing carbon emissions data involve centrally uploading the data to dedicated storage servers. However, the size of these storage server clusters increases with the volume of stored data, posing a challenge to data synchronization between different servers. The large volume of data storage and access requests demands higher server performance. Furthermore, to meet the high concurrency and real-time requirements, mechanisms such as load balancing, rate limiting, and circuit breaking are needed, making data request management more complex and significantly increasing data storage costs. Traditional centralized server storage methods also suffer from a single point of failure: if a server is compromised, all data is at risk of being tampered with, and this tampering is difficult for users to detect. Summary of the Invention

[0004] This application provides a data storage system, method, device, and storage medium for electricity carbon emissions, which addresses the technical problem of single point of failure in existing centralized server data storage systems, where all data can be easily tampered with once the server is compromised.

[0005] In view of this, the first aspect of this application provides a data storage system for carbon emissions from electricity consumption, comprising: a hierarchical blockchain platform and a power supply bureau, wherein the hierarchical blockchain platform includes a leaf blockchain, a middle layer blockchain, a root blockchain, an identity registration interface, a data uplink interface, and a data download interface;

[0006] The power supply bureau is used to register the identities of environmental monitoring departments and carbon emission users through the identity registration interface and issue certificates for accessing the blockchain.

[0007] The data upload port is used to receive data upload requests initiated by carbon emission users;

[0008] The leaf blockchain is used to store electricity carbon emission data after the carbon emission user's certificate verification is passed, and to periodically synchronize the block header of the leaf blockchain to the intermediate layer blockchain, and download the block header of the intermediate layer blockchain and the block header of the root blockchain from the intermediate layer blockchain.

[0009] The intermediate layer blockchain is used to collect and process the block header information of all subordinate leaf blockchains, and periodically synchronize the block headers of the intermediate layer blockchain to the root blockchain, and download the block headers of the root blockchain from the root blockchain.

[0010] The root blockchain is used to collect and process block header information from the intermediate layer blockchain, and recursively broadcast the block headers of the root blockchain to the intermediate layer blockchain and the leaf blockchain.

[0011] The data download interface is used to receive data download requests initiated by environmental monitoring departments, and to return the electricity carbon emission data of the corresponding target user after the certificate verification of the environmental monitoring departments is successful.

[0012] Optionally, the layered blockchain platform also includes message queues set at the data link interface and the data download interface, the message queues being used to cache interface requests.

[0013] Optionally, the power supply bureau specifically includes:

[0014] A login unit is used to log in to the electricity carbon emission data storage system as a system administrator.

[0015] The registration unit is used to call the identity registration interface to initiate a registration request to the electricity carbon emission data storage system and register an account based on the identity information of the registered user, wherein the registered user is an environmental monitoring department or a carbon emission user.

[0016] The certificate generation and sending unit is used to generate a blockchain platform access certificate based on the registered user's account and issue it to the registered user.

[0017] Optionally, the certificate generation and sending unit is specifically used for:

[0018] Receive the certificate signing request generated by the registered user based on the account and public key, and verify the registered user's account;

[0019] Certificate information is generated by combining the certificate's validity period, serial number, the registered user's account, and public key, and a hash operation is performed on the certificate information to generate a digest;

[0020] The digest is signed to obtain the signature content;

[0021] The certificate information and signature content are combined to generate a certificate for accessing the blockchain, and the certificate is sent to the registered user.

[0022] Optionally, the data upload port is specifically used to receive data upload requests initiated by carbon emission users. The data upload request includes electricity consumption carbon emission data, timestamps, and accounts.

[0023] The leaf blockchain is specifically used to connect the carbon emission user to the hierarchical blockchain platform after the carbon emission user's certificate verification is successful.

[0024] Calculate the hash value of the electricity carbon emission data uploaded by the carbon emission user, and create a transaction based on the hash value, the timestamp and the account. Sign the transaction with the carbon emission user's private key, broadcast the transaction and the corresponding signature to the blockchain network, verify the signature by other nodes in the blockchain network, and package the transaction into a new block.

[0025] Calculate the hash value of the new block and the previous block, generate a block header, upload the block header to the intermediate blockchain, and simultaneously download the block header of the intermediate blockchain and the block header of the root blockchain from the intermediate blockchain.

[0026] Optionally, the data download interface is used to receive data download requests initiated by the environmental monitoring department, wherein the data download request carries the account of the target user to which the data to be downloaded belongs and the range of the upload time of the data to be downloaded;

[0027] The hierarchical blockchain platform is used to verify the certificates of the environmental monitoring department and, after successful verification, connect the environmental monitoring department to the hierarchical blockchain platform.

[0028] According to the data download request, query all transactions that meet the conditions in the current blockchain. If a transaction that meets the conditions is found in the current blockchain, obtain the hash values ​​of all nodes on the path from the block to Merklegen where the transaction is located, and calculate the hash value along the path to obtain the path hash value.

[0029] The path hash value is compared with the Merkle root of the current blockchain block header. If they match, the target user's electricity carbon emission data is returned to the environmental monitoring department after determining the block containing the target user's electricity carbon emission data and its integrity.

[0030] If there is a discrepancy, the system iterates through the transactions in the headers of other blocks downloaded from the current blockchain, locates the blockchain where the queried transaction is located, determines the block where the target user's electricity carbon emission data is located and its completeness, and then returns the target user's electricity carbon emission data to the environmental monitoring department.

[0031] A second aspect of this application provides a method for storing carbon emissions from electricity consumption, applied to any of the carbon emissions data storage systems described in the first aspect, the method comprising:

[0032] The power supply bureau registers the identities of environmental monitoring departments and carbon emission users through an identity registration interface and issues certificates that connect to the blockchain.

[0033] Carbon emission users initiate data upload requests through the data upload interface;

[0034] After the certificate verification of carbon emission users is passed, Ye Blockchain stores electricity carbon emission data, and periodically synchronizes the block header of Ye Blockchain to the intermediate layer blockchain, and downloads the block header of the intermediate layer blockchain and the block header of the root blockchain from the intermediate layer blockchain.

[0035] The intermediate layer blockchain collects and processes the block header information of all subordinate leaf blockchains, and periodically synchronizes the block headers of the intermediate layer blockchain to the root blockchain, and downloads the block headers of the root blockchain from the root blockchain.

[0036] The root blockchain collects and processes block header information from the intermediate layer blockchain, and recursively broadcasts the block headers of the root blockchain to the intermediate layer blockchain and the leaf blockchain.

[0037] Environmental monitoring departments initiate data download requests through data download interfaces to download the target user's electricity consumption carbon emission data.

[0038] Optionally, the power supply bureau can register the identities of environmental monitoring departments and carbon emission users through an identity registration interface and issue certificates for blockchain access, including:

[0039] The power supply bureau logs into the electricity consumption carbon emission data storage system as a system administrator;

[0040] The system calls the identity registration interface to initiate a registration request to the electricity carbon emission data storage system, and registers an account based on the identity information of the registered user, who is either an environmental monitoring department or a carbon emission user.

[0041] A blockchain platform access certificate is generated based on the registered user's account and issued to the registered user.

[0042] A third aspect of this application provides an electronic device, the device including a processor and a memory;

[0043] The memory is used to store program code and transmit the program code to the processor;

[0044] The processor is used to execute any one of the electricity carbon emission data storage methods described in the second aspect according to the instructions in the program code.

[0045] The fourth aspect of this application provides a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store program code, which, when executed by a processor, implements the electricity carbon emission data storage method described in any of the second aspects.

[0046] As can be seen from the above technical solutions, this application has the following advantages:

[0047] The electricity carbon emission data storage system provided in this application uses blockchain for electricity carbon emission data storage. The inherent characteristics of blockchain ensure that the data cannot be tampered with even if it is leaked, thus improving data security. The system uses a layered blockchain platform for data storage and processing, achieving efficient and secure data storage and synchronization. By collecting and processing the block headers of the leaf blockchains through the root blockchain and broadcasting them to each leaf blockchain, the system makes it easy to find the block to which the data belongs, enabling cross-chain data access and download, and improving the flexibility of data retrieval.

[0048] Furthermore, multiple blockchains receive carbon emission data from the connected nodes, and combined with message queues, they can effectively handle large-scale, high-concurrency data transfer requests; the Merkel path for finding blocks can quickly determine the validity of on-chain data and the order in which it is uploaded to the chain, preventing data asynchrony. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0050] Figure 1 A schematic diagram of a data storage system for carbon emissions from electricity consumption provided in this application embodiment;

[0051] Figure 2 A schematic diagram of the structure of the layered blockchain platform provided in this application embodiment;

[0052] Figure 3 This is a schematic flowchart of a method for storing carbon emissions from electricity consumption, provided in an embodiment of this application. DETAILED DESCRIPTION

[0053] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0054] For easier understanding, please refer to Figure 1 The first aspect of this application provides a data storage system for carbon emissions from electricity consumption, comprising: a hierarchical blockchain platform and a power supply bureau. The hierarchical blockchain platform includes a leaf blockchain, a middle layer blockchain, a root blockchain, an identity registration interface, a data uplink interface, and a data download interface.

[0055] The power supply bureau uses the identity registration interface to register the identities of environmental monitoring departments and carbon emission users, and issues certificates for accessing the blockchain.

[0056] The data upload interface is used to receive data upload requests initiated by carbon emission users.

[0057] Leaf Blockchain is used to store electricity carbon emission data after the carbon emission user's certificate verification is passed, and to periodically synchronize the block header of Leaf Blockchain to the intermediate layer blockchain, and download the block header of the intermediate layer blockchain and the block header of the root blockchain from the intermediate layer blockchain.

[0058] The intermediate layer blockchain is used to collect and process the block header information of all subordinate leaf blockchains, and periodically synchronize the block headers of the intermediate layer blockchain to the root blockchain, and download the block headers of the root blockchain from the root blockchain.

[0059] The root blockchain is used to collect and process block header information from the intermediate blockchains, and recursively broadcasts the block headers of the root blockchain to the intermediate blockchains and leaf blockchains.

[0060] The data download interface is used to receive data download requests initiated by environmental monitoring departments and return the corresponding target user's electricity carbon emission data after the environmental monitoring department's certificate verification is successful.

[0061] In this embodiment, the core of the electricity consumption carbon emission data storage system is a layered blockchain platform, which provides services to power supply bureaus, carbon emission users, and environmental monitoring departments, enabling large-scale storage and synchronization of electricity consumption carbon emission data. The layered blockchain platform provides an identity registration interface, a data upload interface, and a data download interface. Power supply bureaus register environmental monitoring departments and carbon emission users through the identity registration interface and issue certificates for blockchain access; carbon emission users upload their electricity consumption carbon emission data to the blockchain through the data upload interface; and environmental monitoring departments download the on-chain electricity consumption carbon emission data of target users (such as emission-controlled enterprises, power generation facilities, metering facilities, energy storage facilities, etc.) through the data download interface.

[0062] The layered blockchain data storage structure adopted by the electricity carbon emission data storage system is as follows: Figure 2 As shown, the layered blockchain platform consists of three layers, from bottom to top: leaf blockchain, middle layer blockchain, and root blockchain.

[0063] Ye Blockchain is used to store carbon emission data related to electricity consumption within a district or county. Nodes in Ye Blockchain include district / county environmental monitoring departments, emission-controlled enterprises, power generation facilities, metering facilities, energy storage facilities, and other carbon emission users. After registering their identities, carbon emission users upload their carbon emission data to their respective Ye Blockchain. The platform automatically and periodically synchronizes the block headers of Ye Blockchain to the intermediate blockchain and downloads the block headers of the intermediate blockchain and the root blockchain from it. District / county environmental monitoring departments do not participate in uploading data to the blockchain.

[0064] The intermediate layer blockchain collects and processes block header information from all its subordinate leaf blockchains. Nodes in the intermediate layer blockchain include environmental monitoring departments at the district and county levels and the municipal environmental protection bureau. The platform automatically and periodically synchronizes the block headers of the intermediate layer blockchain to the root blockchain and downloads block headers from the root blockchain.

[0065] There is only one root blockchain, which is responsible for collecting and processing block header information from the intermediate layer blockchains, and recursively broadcasting the block headers of the root blockchain to the intermediate layer blockchains and leaf blockchains. Nodes in the root blockchain include the ecological environment department, the power supply bureau, and the municipal environmental protection bureau.

[0066] Furthermore, to meet the large-scale, high-concurrency storage needs of electricity consumption carbon emission data, the layered blockchain platform introduces message queues as data caches at the data link interface and data download interface. When data is generated in a concentrated manner during the peak carbon emission period, interface requests can be temporarily stored in the message queue to prevent data loss and maintain the efficient operation of the system.

[0067] Furthermore, the power supply bureau specifically includes:

[0068] The login unit is used to log in to the electricity carbon emission data storage system as a system administrator;

[0069] The registration unit is used to call the identity registration interface to initiate a registration request to the electricity consumption carbon emission data storage system. It registers an account based on the user's identity information, such as the environmental monitoring department or the carbon emission user. Administrators can register accounts based on the user's company name and type, generating a user ID as the login account.

[0070] The certificate generation and issuance unit is used to generate access certificates for the blockchain platform based on the registered user's account and issue them to the registered user.

[0071] Furthermore, the certificate generation and sending unit is specifically used for:

[0072] Receive certificate signing requests generated by registered users based on their account and public key, and verify the registered users' accounts;

[0073] The certificate information is generated by combining the certificate's validity period, serial number, registered user's account, and public key, and a hash operation is performed on the certificate information to generate a digest.

[0074] Sign the abstract to obtain the signature content;

[0075] The certificate information and signature content are combined to generate a certificate for accessing the blockchain, and the certificate is sent to the registered user.

[0076] It should be noted that registered users can independently generate key pairs (PK) on the system's client. C SK C ), can be PK'd using userID and public key. C Generate Certificate Signing Request (PK) C The system sends a certificate signing request to the corresponding server of the power supply bureau, along with the userID of the registered user. The server verifies the user's account (userID) and combines it with the certificate validity period (T). C Serial Number (SN) Cert Certificate information is generated using the following information: Cert=(userID,T) C ,SN Cert PK C The hash operation is performed on the hash to generate a digest H(Cert), and then the digest is signed to obtain the signature content Sign. S (H(Cert)), and finally, the certificate information and signature content are combined to obtain the certificate Cert for accessing the blockchain. C ={Cert,Sign S (H(Cert))}, and send it to the registered user.

[0077] Furthermore, the data upload interface is specifically used to receive data upload requests initiated by carbon emission users. The data upload requests include electricity consumption carbon emission data, timestamps, and accounts.

[0078] Ye Blockchain is specifically used to connect carbon emission users to a layered blockchain platform after their certificates have been verified.

[0079] Calculate the hash value of the electricity carbon emission data uploaded by the carbon emission user, and create a transaction based on the hash value, timestamp and account. Sign the transaction with the carbon emission user's private key, broadcast the transaction and the corresponding signature to the blockchain network, verify the signature by other nodes in the blockchain network, and package the transaction into a new block.

[0080] Calculate the hash value of the new block and the previous block, generate the block header, upload the block header to the intermediate blockchain, and download the block headers of the intermediate blockchain and the root blockchain from the intermediate blockchain.

[0081] The specific process of data upload includes:

[0082] a) Carbon emission users log in to the electricity carbon emission data storage system using their userID, initiate a data upload request through the data upload interface, and upload the electricity carbon emission data (D), the timestamp (TimeStamp), and the userID. The system verifies the user's certificate, connects the user to the blockchain platform, and the data upload request is queued in the message queue.

[0083] b. The blockchain platform processes data upload requests, calculates the hash value H(D) of the electricity consumption carbon emission data D, creates a transaction T={H(D),TimeStamp,userID}, and uses the user's private key SK. C Sign transaction T to obtain ,Will Broadcast to the blockchain network.

[0084] c. Other nodes in the blockchain network verify the signature. The transaction is packaged into a new block B. Calculate the current block B and the previous block B. prev The hash value is used to generate the block header Header={H(B),H(B)}. prev The `TimeStamp` method uploads the block header to the intermediate blockchain and downloads other block headers.

[0085] d. Repeat steps b and c until the data is uploaded to the root blockchain.

[0086] Furthermore, the data download interface is used to receive data download requests initiated by environmental monitoring departments. The data download request carries the account of the target user to which the data to be downloaded belongs and the range of the upload time of the data to be downloaded.

[0087] A layered blockchain platform is used to verify the certificates of environmental monitoring departments and connect the environmental monitoring departments to the layered blockchain platform after verification.

[0088] Based on the data download request, query all transactions that meet the conditions in the current blockchain. If a transaction that meets the conditions is found in the current blockchain, obtain the hash values ​​of all nodes on the path from the block to Merklegen where the transaction is located, and calculate the hash value along the path to obtain the path hash value.

[0089] Compare the path hash value with the Merkle root of the current blockchain block header. If they match, after determining the block where the target user's electricity carbon emission data is located and its integrity, return the target user's electricity carbon emission data to the environmental monitoring department.

[0090] If there is a discrepancy, the system iterates through the transactions in the headers of other blocks downloaded from the current blockchain, locates the blockchain where the queried transaction is located, determines the block where the target user's electricity carbon emission data is located and its completeness, and then returns the target user's electricity carbon emission data to the environmental monitoring department.

[0091] The specific process of data download includes:

[0092] A. The environmental monitoring department logs into the system using the userID account and initiates a data download request through the data download interface. It uploads the userID account of the target user to which the data to be downloaded belongs and the range of the data upload time (BeginTime, EndTime), where BeginTime is the start time and EndTime is the end time.

[0093] B. The system verifies the certificate of the environmental monitoring department. After successful verification, the environmental monitoring department is connected to the blockchain platform, and data download requests are queued in the message queue.

[0094] C. The blockchain platform processes data download requests by querying all matching transactions T within the current blockchain based on the target user's account (userID) and the upload time range (BeginTime, EndTime) of the data to be downloaded. i If T i In the current blockchain, obtaining T i The Merkel proof is the hash value of all nodes on the path from the block to the Merkel root. Calculate the hash value along the path. The final calculated H currentWith the block header of Merkelgen H root If the comparisons match, the location and integrity of the data are determined, and the data is downloaded.

[0095] D. If transaction T i If the transaction is not in the current blockchain, iterate through the downloaded block headers to locate transaction T. i The blockchain in which the data is located determines the block where the data is located and its integrity, and then the data is downloaded.

[0096] The electricity carbon emission data storage system provided in this application uses blockchain for electricity carbon emission data storage. The inherent characteristics of blockchain ensure that the data cannot be tampered with even if it is leaked, thus improving data security. The system uses a layered blockchain platform for data storage and processing, achieving efficient and secure data storage and synchronization. By collecting and processing the block headers of the leaf blockchains through the root blockchain and broadcasting them to each leaf blockchain, the system makes it easy to find the block to which the data belongs, enabling cross-chain data access and download, and improving the flexibility of data retrieval.

[0097] Furthermore, multiple blockchains receive carbon emission data from the connected nodes, and combined with message queues, they can effectively handle large-scale, high-concurrency data transfer requests; the Merkel path for finding blocks can quickly determine the validity of on-chain data and the order in which it is uploaded to the chain, preventing data asynchrony.

[0098] Please refer to Figure 3 The second aspect of this application provides a method for storing electricity carbon emissions data, applied to the electricity carbon emissions data storage system of the first aspect, the method comprising:

[0099] Step 110: The power supply bureau registers the identities of environmental monitoring departments and carbon emission users through the identity registration interface and issues certificates for accessing the blockchain.

[0100] The power supply bureau logs into the electricity consumption carbon emission data storage system as a system administrator; it calls the identity registration interface to initiate a registration request to the electricity consumption carbon emission data storage system, registers an account based on the registered user's identity information (the registered user is either an environmental monitoring department or a carbon emission user); it generates a certificate for accessing the blockchain platform based on the registered user's account and issues it to the registered user. Specifically, it obtains the certificate signature request generated by the registered user based on their account and public key, and verifies the registered user's account; it generates certificate information by combining the certificate's validity period, serial number, registered user's account, and public key, and performs a hash operation on the certificate information to generate a digest; it signs the digest to obtain the signature content; it combines the certificate information and the signature content to generate a certificate for accessing the blockchain, and sends the certificate to the registered user.

[0101] It should be noted that registered users can independently generate key pairs (PK) on the system's client. C SKC ), can be PK'd using userID and public key. C Generate Certificate Signing Request (PK) C The system sends a certificate signing request to the corresponding server of the power supply bureau, along with the userID of the registered user. The server verifies the user's account (userID) and combines it with the certificate validity period (T). C Serial Number (SN) Cert Certificate information is generated using the following information: Cert=(userID,T) C ,SN Cert PK C The hash operation is performed on the hash to generate a digest H(Cert), and then the digest is signed to obtain the signature content Sign. S (H(Cert)), and finally, the certificate information and signature content are combined to obtain the certificate Cert for accessing the blockchain. C ={Cert,Sign S (H(Cert))}, and send it to the registered user.

[0102] Step 120: Carbon emission users initiate a data upload request through the data upload interface.

[0103] Step 130: After the certificate verification of the carbon emission user is passed, Ye Blockchain stores the electricity carbon emission data, and periodically synchronizes the block header of Ye Blockchain to the intermediate layer blockchain, and downloads the block header of the intermediate layer blockchain and the block header of the root blockchain from the intermediate layer blockchain.

[0104] The data upload interface is used to receive data upload requests initiated by carbon emission users. These requests include electricity consumption carbon emission data, timestamps, and account information. After the carbon emission user's certificate verification is successful, Ye Blockchain connects the carbon emission user to the layered blockchain platform. It calculates the hash value of the electricity consumption carbon emission data uploaded by the user, creates a transaction based on the hash value, timestamp, and account information, signs the transaction using the user's private key, and broadcasts the transaction and corresponding signature to the blockchain network. Other nodes in the blockchain network verify the signature and package the transaction into a new block. It calculates the hash value between the new block and the previous block, generates a block header, uploads the block header to the intermediate blockchain, and simultaneously downloads the block headers of the intermediate blockchain and the root blockchain from the intermediate layer blockchain.

[0105] Step 140: The intermediate layer blockchain collects and processes the block header information of all subordinate leaf blockchains, and periodically synchronizes the block headers of the intermediate layer blockchain to the root blockchain, and downloads the block headers of the root blockchain from the root blockchain.

[0106] Step 150: The root blockchain collects and processes block header information from the intermediate blockchains, and recursively broadcasts the block headers of the root blockchain to the intermediate blockchains and leaf blockchains.

[0107] The specific process of data uploading includes:

[0108] a) Carbon emission users log in to the electricity carbon emission data storage system using their userID, initiate a data upload request through the data upload interface, and upload the electricity carbon emission data (D), the timestamp (TimeStamp), and the userID. The system verifies the user's certificate, connects the user to the blockchain platform, and the data upload request is queued in the message queue.

[0109] b. The blockchain platform processes data upload requests, calculates the hash value H(D) of the electricity consumption carbon emission data D, creates a transaction T={H(D),TimeStamp,userID}, and uses the user's private key SK. C Sign transaction T to obtain ,Will Broadcast to the blockchain network.

[0110] c. Other nodes in the blockchain network verify the signature. The transaction is packaged into a new block B. Calculate the current block B and the previous block B. prev The hash value is used to generate the block header Header={H(B),H(B)}. prev The `TimeStamp` method uploads the block header to the intermediate blockchain and downloads other block headers.

[0111] d. Repeat steps b and c until the data is uploaded to the root blockchain.

[0112] Step 160: The environmental monitoring department initiates a data download request through the data download interface to download the target user's electricity consumption carbon emission data.

[0113] The data download interface receives data download requests initiated by environmental monitoring departments. The data download request carries the account of the target user to whom the data to be downloaded belongs and the range of the data upload time.

[0114] The layered blockchain platform verifies the certificates of environmental monitoring departments and connects them to the platform after successful verification. Based on the data download request, it queries all eligible transactions within the current blockchain. If a matching transaction is found, it obtains the hash values ​​of all nodes along the path from the block to the Merkle root for that transaction, calculates the path hash value, and compares it with the Merkle root in the current blockchain's block header. If they match, it returns the target user's electricity carbon emission data to the environmental monitoring department after determining the block containing the data and its integrity. If they don't match, it iterates through the transactions in other block headers downloaded from the current blockchain, locates the blockchain containing the found transaction, determines the block containing the target user's electricity carbon emission data and its integrity, and then returns the target user's electricity carbon emission data to the environmental monitoring department.

[0115] Specifically, the data download process includes:

[0116] A. The environmental monitoring department logs into the system using the userID account and initiates a data download request through the data download interface. It uploads the userID account of the target user to which the data to be downloaded belongs and the range of the data upload time (BeginTime, EndTime), where BeginTime is the start time and EndTime is the end time.

[0117] B. The system verifies the certificate of the environmental monitoring department. After successful verification, the environmental monitoring department is connected to the blockchain platform, and data download requests are queued in the message queue.

[0118] C. The blockchain platform processes data download requests by querying all matching transactions T within the current blockchain based on the target user's account (userID) and the upload time range (BeginTime, EndTime) of the data to be downloaded. i If T i In the current blockchain, obtaining T i The Merkel proof is the hash value of all nodes on the path from the block to the Merkel root. Calculate the hash value along the path. The final calculated H current With the block header of Merkelgen H root If the comparisons match, the location and integrity of the data are determined, and the data is downloaded.

[0119] D. If transaction T i If the transaction is not in the current blockchain, iterate through the downloaded block headers to locate transaction T. i The blockchain in which the data is located determines the block where the data is located and its integrity, and then the data is downloaded.

[0120] The electricity consumption carbon emission data storage method provided in this application uses blockchain for electricity consumption carbon emission data storage. The inherent characteristics of blockchain ensure that the data cannot be tampered with even if it is leaked, thus improving data security. The layered blockchain platform is used for data storage and processing, which realizes efficient and secure data storage and synchronization. By collecting and processing the block headers of leaf blockchains through the root blockchain and broadcasting them to each leaf blockchain, the block to which the data belongs can be easily found, realizing cross-chain data access and download, and improving the flexibility of data retrieval.

[0121] Furthermore, multiple blockchains receive carbon emission data from the connected nodes, and combined with message queues, they can effectively handle large-scale, high-concurrency data transfer requests; the Merkel path for finding blocks can quickly determine the validity of on-chain data and the order in which it is uploaded to the chain, preventing data asynchrony.

[0122] A third aspect of this application provides an electronic device, which includes a processor and a memory;

[0123] The memory is used to store program code and transfer the program code to the processor;

[0124] The processor is used to execute the second aspect of the electricity carbon emission data storage method according to the instructions in the program code.

[0125] The fourth aspect of this application provides a computer-readable storage medium for storing program code, which, when executed by a processor, implements the electricity carbon emission data storage method of the second aspect.

[0126] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific process of the method described above can be referred to the corresponding process in the aforementioned system embodiments, and will not be repeated here.

[0127] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or apparatus.

[0128] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0129] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0130] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0131] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0132] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for executing all or part of the steps of the methods described in the various embodiments of this application through a computer device (which may be a personal computer, server, or network device, etc.). The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0133] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A system for storing electricity carbon emission data, characterized in that: include: A layered blockchain platform and a power supply bureau, wherein the layered blockchain platform includes a leaf blockchain, a middle-layer blockchain, a root blockchain, an identity registration interface, a data upload interface, and a data download interface; The power supply bureau is used to register the identities of environmental monitoring departments and carbon emission users through the identity registration interface and issue certificates for accessing the blockchain; The data uplink interface is used to receive a data uplink request initiated by a carbon emission user; The leaf blockchain is used to store electricity carbon emission data after the certificate of the carbon emission user is verified, and to regularly synchronize the block header of the leaf blockchain to the middle-layer blockchain, and download the block header of the middle-layer blockchain and the block header of the root blockchain from the middle-layer blockchain; The middle-layer blockchain is used to collect and process the block header information of all subordinate leaf blockchains, and to regularly synchronize the block headers of the middle-layer blockchain to the root blockchain, and download the block headers of the root blockchain from the root blockchain; The root blockchain is used to collect and process block header information from the middle-layer blockchain, and recursively broadcast the block header of the root blockchain to the middle-layer blockchain and the leaf blockchain; The data download interface is used to receive a data download request initiated by an environmental monitoring department, and return the electricity carbon emission data of the corresponding target user after the certificate of the environmental monitoring department is verified.

2. The electricity carbon emission data storage system according to claim 1, characterized in that: The layered blockchain platform also includes a message queue arranged at the data upload interface and the data download interface, and the message queue is used to cache interface requests.

3. The electricity carbon emission data storage system according to claim 1, characterized in that: The power supply bureau specifically includes: A login unit, used to log in to the electricity carbon emission data storage system as a system administrator; A registration unit, configured to call the identity registration interface to initiate a registration request to the electricity carbon emission data storage system, and register an account according to the identity information of a registered user, wherein the registered user is an environmental monitoring department or a carbon emission user; The certificate generation and sending unit is used to generate a blockchain platform access certificate according to the account of the registered user and issue it to the registered user.

4. The electricity carbon emission data storage system according to claim 3 is characterized in that: The certificate generating and sending unit is specifically used for: Receive a certificate signing request generated by the registered user based on the account and public key, and verify the account of the registered user; Generate certificate information by combining the validity period, serial number, account number and public key of the certificate, and perform hash operation on the certificate information to generate a summary; Signing the summary to obtain signature content; The certificate information and signature content are combined to generate a certificate for accessing the blockchain, and the certificate is sent to the registered user.

5. The electricity carbon emission data storage system according to claim 1, characterized in that: The data uplink interface is specifically used to receive a data uplink request initiated by a carbon emission user, wherein the data uplink request includes electricity carbon emission data, a timestamp and an account number; The leaf blockchain is specifically used to connect the carbon emission user to the layered blockchain platform after the certificate of the carbon emission user is verified; Calculate the hash value of the electricity carbon emission data uploaded by the carbon emission user, and create a transaction based on the hash value, the timestamp and the account number, sign the transaction with the private key of the carbon emission user, broadcast the transaction and the corresponding signature to the blockchain network, and have other nodes in the blockchain network verify the signature and package the transaction into a new block; Calculate the hash value of the new block and the previous block, generate a block header, upload the block header to the intermediate blockchain, and download the block header of the intermediate blockchain and the block header of the root blockchain from the intermediate blockchain.

6. The electricity carbon emission data storage system according to claim 4, characterized in that: The data download interface is used to receive a data download request initiated by the environmental monitoring department, wherein the data download request carries an account number of a target user to which the data to be downloaded belongs and a range of time for uploading the data to be downloaded; The layered blockchain platform is used to verify the certificate of the environmental monitoring department and connect the environmental monitoring department to the layered blockchain platform after the verification; According to the data download request, all eligible transactions in the current blockchain are queried. If an eligible transaction is found in the current blockchain, all node hash values ​​of the transaction on the path from the block to the Merkle root are obtained, and the hash values ​​are calculated along the path to obtain the path hash value; Compare the path hash value with the Merkle root of the block header of the current blockchain to see if they are consistent. If they are consistent, after determining the block where the target user's electricity carbon emission data is located and its integrity, return the target user's electricity carbon emission data to the environmental monitoring department; If there is any inconsistency, the transactions in other block headers downloaded from the current blockchain will be traversed and queried to locate the blockchain where the queried transaction is located. After determining the block where the target user's electricity carbon emission data is located and its integrity, the target user's electricity carbon emission data will be returned to the environmental monitoring department.

7. A method for storing electricity carbon emission data, characterized in that: Applied to the electricity consumption carbon emission data storage system according to any one of claims 1 to 6, the method comprises: The power supply bureau registers the identities of environmental monitoring departments and carbon emission users through the identity registration interface and issues certificates for access to the blockchain; Carbon emission users initiate data upload requests through the data upload interface; The leaf blockchain stores the electricity carbon emission data after the certificate of the carbon emission user is verified, and regularly synchronizes the block header of the leaf blockchain to the middle-layer blockchain, and downloads the block header of the middle-layer blockchain and the block header of the root blockchain from the middle-layer blockchain; The middle-layer blockchain collects and processes the block header information of all subordinate leaf blockchains, and regularly synchronizes the block headers of the middle-layer blockchain to the root blockchain, and downloads the block headers of the root blockchain from the root blockchain; The root blockchain collects and processes block header information from the middle-layer blockchain, and recursively broadcasts the block header of the root blockchain to the middle-layer blockchain and the leaf blockchain; The environmental monitoring department initiates a data download request through the data download interface to download the electricity carbon emission data of the target user.

8. The method for storing electricity carbon emission data according to claim 7, characterized in that: The power supply bureau registers the identities of environmental monitoring departments and carbon emission users through the identity registration interface and issues certificates for access to the blockchain, including: The power supply bureau logs into the electricity carbon emission data storage system as a system administrator; Calling the identity registration interface to initiate a registration request to the electricity carbon emission data storage system, registering an account according to the identity information of the registered user, wherein the registered user is an environmental monitoring department or a carbon emission user; A blockchain platform access certificate is generated based on the registered user's account and issued to the registered user.

9. An electronic device, characterized in that: The device comprises a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the electricity consumption carbon emission data storage method according to any one of claims 7-8 according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and when the program codes are executed by a processor, the method for storing electricity carbon emission data according to any one of claims 7 to 8 is implemented.

Citation Information

Patent Citations

  • In-system data summarization method and device

    CN109600433A

  • Intelligent medical data storage method based on multi-level blockchain system architecture

    CN110727737A

  • Carbon emission data processing method and device

    CN115250176A

  • Carbon emission data chaining method based on block chain technology

    CN115941206A

Cited By

  • Electric carbon measurement real-time monitoring method based on block chain

    CN121212585A