Carbon data storage method based on block chain
By using general data blockchain and private data blockchain in the carbon data verification system, combined with the verification mechanism of smart contracts, the problem of insufficient accuracy of carbon data verification is solved, and higher storage security and data integrity are achieved .
Patent Information
- Application Number
- CN202411371751.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-11
AI Technical Summary
In the prior art, the verification accuracy of carbon data is insufficient, resulting in the security and accuracy of carbon data storage in the blockchain.
By introducing a general data blockchain and a private data blockchain into the carbon data verification system, smart contracts are used to verify carbon data. The specific steps include obtaining the data type identification and data fields of the carbon data to be verified, determining the appropriate data node for verification, and conducting specific verification through a private smart contract, and ultimately storing the verified carbon data in the general data blockchain.
Improve the verification accuracy and storage security of carbon data, ensuring the integrity and trustworthiness of carbon data on the blockchain.
Smart Images

Figure CN119415593A_ABST
Abstract
Description
Background Art
[0002] In order to promote the sustainable development of the climate environment, the statistics of carbon data that affects the climate environment are particularly important. After obtaining the carbon data of an enterprise or individual, in order to improve the statistical accuracy of the carbon data, the obtained carbon data needs to be verified. Since the blockchain is tamper-proof and open, storing the verified carbon data in the blockchain can effectively improve the storage security of the carbon data. However, due to the various types of carbon data, such as carbon data generated by transportation, carbon data generated by production, etc., and the data nodes for verifying carbon data are also divided into many types, the accuracy of each data node for verifying different types of carbon data is also different. Therefore, the accuracy of verifying carbon data through all data nodes currently needs to be improved. Summary of the invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is:
[0004] According to one aspect of the present application, a blockchain-based carbon data storage method is provided, which is applied to a carbon data verification system, wherein the carbon data verification system is connected to a general data blockchain, a plurality of data nodes are connected to the general data blockchain, and at least some of the data nodes are each also connected to a private data blockchain, a general smart contract is stored in the general data blockchain, and a private smart contract is stored in each private data blockchain;
[0005] The blockchain-based carbon data storage method described in this application includes the following steps:
[0006] Step S100: in response to receiving the carbon data to be verified, obtaining a data type identifier corresponding to the carbon data to be verified and a number of data fields to be verified included in the carbon data to be verified; each data field to be verified has a corresponding field type;
[0007] Step S200: Determine at least one first data node from a number of data nodes according to the node type identifier corresponding to each data node and the data type identifier corresponding to the carbon data to be verified; the first data node is a data node whose node type corresponding to the node type identifier is the same as the data type corresponding to the data type identifier;
[0008] Step S300: Determine at least one target data node from a number of first data nodes according to the data update time period of each first data node and the acquisition time of the carbon data to be verified; the target data node is a first data node whose difference between the last data update time and the acquisition time of the carbon data to be verified is within a preset time difference threshold;
[0009] Step S400: sending several data fields to be verified included in the carbon data to be verified to each target data node, and obtaining the data verification result of each target data node verifying the carbon data to be verified according to the corresponding private smart contract;
[0010] Step S500: If the data verification result indicates that the carbon data to be verified has passed the verification, the carbon data to be verified is stored in the general data blockchain.
[0011] In an exemplary embodiment of the present application, step S100 includes:
[0012] Step S110: Acquire several data fields to be verified included in the carbon data to be verified, so as to obtain a list of data fields to be verified A=(A1, A2, ..., A i ,...,A n ); wherein i = 1, 2, ..., n; n is the number of data fields to be verified included in the carbon data to be verified; A i is the i-th data field to be verified included in the carbon data to be verified.
[0013] In an exemplary embodiment of the present application, step S200 includes:
[0014] Step S210: Obtain the node type identifier corresponding to each data node to obtain a node type identifier list B = (B1, B2, ..., B j ,...,B m ), where j = 1, 2, ..., m, and m is the number of data nodes; B j is the node type identifier corresponding to the j-th data node;
[0015] Step S220, traverse the node type identification list B, if B j If the corresponding node type is the same as the data type corresponding to the data type identifier of the carbon data to be verified, the jth data node is determined as the first data node.
[0016] In an exemplary embodiment of the present application, step S300 includes:
[0017] Step S310: Obtain the last data update time of each first data node before the current time, and obtain a data update time list C = (C1, C2, ..., C g ,...,C h ), where g = 1, 2, ..., h, h is the number of first data nodes, C g The last data update time of the g-th first data node before the current time;
[0018] Step S320: Obtain the data update time period of each first data node, and obtain a data update period list D=(D1, D2, ..., D g ,...,D h ), where D g is the data update time period of the g-th first data node;
[0019] Step S330: Determine the next data update time of each first data node according to the data update time list C and the data update period list D, and obtain the next data update time list E = (E1, E2, ..., E g ,...,E h ), where E g is the next data update time of the g-th first data node; E g =C g +D g ;
[0020] Step S340, obtaining the acquisition time C0 of the carbon data to be verified;
[0021] Step S350, traverse the next data update time list E, if E g -C0≤E0, the g-th first data node is determined as the target data node, and step S400 is executed; wherein E0 is a preset time difference threshold.
[0022] In an exemplary embodiment of the present application, step S350 further includes:
[0023] If the difference between the next data update time of each first data node and C0 is greater than E0, then traverse the data update time list C. If C0-C g ≤E0, the g-th first data node is determined as the target data node.
[0024] In an exemplary embodiment of the present application, step S400 includes:
[0025] Step S410: According to each data field to be verified and the verifiable field type corresponding to each target data node included in the carbon data to be verified, at least one verification data node corresponding to each data field to be verified is determined from a plurality of target data nodes; the verification data node corresponding to each data field to be verified is a target data node corresponding to a verifiable field type that is the same as the field type corresponding to the data field to be verified;
[0026] Step S420: Send each data field to be verified to the verification data node corresponding to the data field to be verified, and obtain the node verification result of each verification data node verifying the data field to be verified according to the corresponding private smart contract;
[0027] Step S430: Determine the field verification result corresponding to each data field to be verified according to the node verification results corresponding to each data field to be verified;
[0028] Step S440: Determine the data verification result corresponding to the carbon data to be verified according to the verification results of several fields.
[0029] In an exemplary embodiment of the present application, step S410 includes:
[0030] Step S411: Obtain the verifiable field type identifier corresponding to each target data node to obtain a verifiable field type identifier list set F = (F1, F2, ..., F k ,...,F t );F k =(F k1 ,F k2 ,...,F kp ,...,F kq(k) ), where k = 1, 2, ..., t, t is the number of target data nodes, F k is a list of verifiable field type identifiers corresponding to the k-th target data node; p = 1, 2, ..., q(k); q(k) is the number of verifiable field type identifiers corresponding to the k-th target data node; F kp Identifies the p-th verifiable field type corresponding to the k-th target data node;
[0031] Step S412: According to the data type corresponding to the carbon data to be verified and the preset data field mapping table, each data field to be verified is replaced with the corresponding corrected data field to obtain a corrected data field list G = (G1, G2, ..., G i ,...,G n ), where G i A i The corresponding correction data field; the data field mapping table stores a mapping relationship between each data field of carbon data of a plurality of preset data types and the correction data field corresponding to the data field;
[0032] Step S413, traverse the verifiable field type identifier list set F and the corrected data field list G, if F kp The corresponding verifiable field type is the same as G i If the corresponding field types are the same, the kth target data node is determined as G i The corresponding verification data node.
[0033] In an exemplary embodiment of the present application, step S420 includes:
[0034] Step S421: Gi Send to G i In each corresponding verification data node;
[0035] Step S422: Get G i Each corresponding verification data node verifies G according to the corresponding private smart contract i The node verification identification for verification is obtained i Corresponding node verification identification list H i =(H i1 ,H i2 ,...,H ia ,...,H ib(i) ); among them, a=1,2,...,b(i); b(i) is G i The number of corresponding verification data nodes; H ia G i The corresponding a-th verification data node verifies G according to the corresponding private smart contract i The verification identifier of the node performing the verification;
[0036] When H ia When it is 0, it means G i The corresponding a-th verification data node verifies G according to the corresponding private smart contract i The verification result of the node being verified is that it has failed the verification;
[0037] When H ia When it is 1, it means G i The corresponding a-th verification data node verifies G according to the corresponding private smart contract i The verification result of the node being verified is passed.
[0038] In an exemplary embodiment of the present application, step S430 includes:
[0039] Step S431: If H i If the verification flag of each node in G is 1, then i The corresponding field verification result is passed; otherwise, execute step S432;
[0040] Step S432: Get G i The corresponding geographical identifier of each verification data node is obtained by i Corresponding node geographic identification list J i =(J i1 ,J i2 ,...,J ia ,...,J ib(i) ), where J ia G iThe geographical identifier corresponding to the geographical location of the corresponding a-th verification data node;
[0041] Step S433: If J ia The corresponding geographical location is the same as the geographical location where the carbon data to be verified is obtained, and in G i In each corresponding verification data node, G i The difference between the last data update time of the corresponding a-th verification data node and C0 is the smallest, then H ia The node verification result represented by G is determined as i The corresponding field validation result.
[0042] In an exemplary embodiment of the present application, step S440 includes:
[0043] Step S441: Obtain the field verification identifier corresponding to each data field to be verified to obtain a field verification identifier list I = (I1, I2, ..., I i ,...,I n ); where I i The field verification identifier corresponding to the i-th data field to be verified;
[0044] When I i When it is 0, it means that the field verification result corresponding to the i-th data field to be verified is failed;
[0045] When I i When it is 1, it means that the field verification result corresponding to the i-th data field to be verified is passed;
[0046] Step S442, traverse the field verification identifier list I, if I i is 1, the i-th data field to be verified is determined as a field that has passed verification, so as to obtain a number of fields that have passed verification;
[0047] Step S443: If the ratio of the number of fields that pass the verification to n is greater than the preset pass ratio threshold, the data verification result corresponding to the carbon data to be verified is determined to have passed the verification; otherwise, the data verification result corresponding to the carbon data to be verified is determined to have failed the verification.
[0048] According to one aspect of the present application, a non-transitory computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the aforementioned blockchain-based carbon data storage method.
[0049] According to one aspect of the present application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0050] The present invention has at least the following beneficial effects:
[0051] The blockchain-based carbon data storage method of the present invention determines a first data node from a number of data nodes according to a node type identifier corresponding to each data node and a data type identifier corresponding to the carbon data to be verified, determines a target data node from a number of first data nodes according to the data update time period of each first data node and the acquisition time of the carbon data to be verified, sends a number of data fields to be verified included in the carbon data to be verified to each target data node, and determines the data verification result of each target data node for verifying the carbon data to be verified. If the data verification result indicates that the carbon data to be verified has passed the verification, the carbon data to be verified is stored in the general data blockchain. By processing the data field of the carbon data to be verified, a target data node with a strong correlation with the carbon data to be verified is determined from a number of data nodes, and then each target data node performs specific verification on the data field of the carbon data to be verified according to the corresponding private smart contract to obtain the verification result of the carbon data to be verified, so as to ensure the accuracy of the verification of the carbon data to be verified. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0053] Figure 1 A flowchart of a blockchain-based carbon data storage method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0055] A carbon data storage method based on blockchain is applied to a carbon data verification system. The carbon data verification system is connected to a general data blockchain, and a plurality of data nodes are connected to the general data blockchain, and at least some of the data nodes are also connected to a private data blockchain. The general data blockchain stores a general smart contract, and each private data blockchain stores a private smart contract.
[0056] The general data blockchain is used to store carbon data, and the data nodes on the general data blockchain are used to review and verify the submitted carbon data to be verified.
[0057] The private data blockchain connected to the data nodes is used to specifically verify the carbon data, and the private smart contract stores data for specific verification of different types of carbon data.
[0058] Data nodes are also divided into different categories according to the type of carbon data to be verified. For example, a data node can be a node that verifies aviation traffic carbon emission data, a node that verifies private car carbon emission data, etc.
[0059] like Figure 1 As shown, the blockchain-based carbon data storage method described in this application includes the following steps:
[0060] Step S100: in response to receiving the carbon data to be verified, obtaining a data type identifier corresponding to the carbon data to be verified and a number of data fields to be verified included in the carbon data to be verified;
[0061] The data type identifier corresponding to the carbon data to be verified is the identifier of the data type corresponding to the carbon data to be verified, such as indicating that the carbon data to be verified is transportation carbon data or production carbon data.
[0062] The data field to be verified is a field including information such as time, displacement, and transportation tools included in the carbon data to be verified.
[0063] Each data field to be verified has a corresponding field type, and the field type has a meaning type such as time, displacement, and transportation tools.
[0064] Further, as a possible embodiment, step S100 includes step S110:
[0065] Step S110: Acquire several data fields to be verified included in the carbon data to be verified, so as to obtain a list of data fields to be verified A=(A1, A2, ..., A i ,...,A n ); wherein i = 1, 2, ..., n; n is the number of data fields to be verified included in the carbon data to be verified; A i is the i-th data field to be verified included in the carbon data to be verified.
[0066] Step S200: determining at least one first data node from a plurality of data nodes according to the node type identifier corresponding to each data node and the data type identifier corresponding to the carbon data to be verified;
[0067] The first data node is a data node whose node type corresponding to the node type identifier is the same as the data type corresponding to the data type identifier.
[0068] Further, step S200 includes steps S210 to S220:
[0069] Step S210: Obtain the node type identifier corresponding to each data node to obtain a node type identifier list B = (B1, B2, ..., B j ,...,B m ), where j = 1, 2, ..., m, and m is the number of data nodes; B j is the node type identifier corresponding to the j-th data node;
[0070] Step S220, traverse the node type identification list B, if B j If the corresponding node type is the same as the data type corresponding to the data type identifier of the carbon data to be verified, the jth data node is determined as the first data node.
[0071] Step S300: determining at least one target data node from a plurality of first data nodes according to the data update time period of each first data node and the acquisition time of the carbon data to be verified;
[0072] The target data node is the first data node whose difference between the last data update time and the acquisition time of the carbon data to be verified is within a preset time difference threshold.
[0073] Further, step S300 includes steps S310 to S350:
[0074] Step S310: Obtain the last data update time of each first data node before the current time, and obtain a data update time list C = (C1, C2, ..., C g ,...,C h ), where g = 1, 2, ..., h, h is the number of first data nodes, C g The last data update time of the g-th first data node before the current time;
[0075] Step S320: Obtain the data update time period of each first data node, and obtain a data update period list D=(D1, D2, ..., D g ,...,D h ), where D g is the data update time period of the g-th first data node;
[0076] Step S330: Determine the next data update time of each first data node according to the data update time list C and the data update period list D, and obtain the next data update time list E = (E1, E2, ..., E g ,...,Eh ), where E g is the next data update time of the g-th first data node; E g =C g +D g ;
[0077] Step S340, obtaining the acquisition time C0 of the carbon data to be verified;
[0078] Step S350, traverse the next data update time list E, if E g -C0≤E0, the g-th first data node is determined as the target data node, and step S400 is executed; wherein E0 is a preset time difference threshold;
[0079] If the difference between the next data update time of each first data node and C0 is greater than E0, then traverse the data update time list C. If C0-C g ≤E0, the g-th first data node is determined as the target data node.
[0080] Step S400: sending several data fields to be verified included in the carbon data to be verified to each target data node, and obtaining the data verification result of each target data node verifying the carbon data to be verified according to the corresponding private smart contract;
[0081] Further, step S400 includes step S410-step S440:
[0082] Step S410: According to each data field to be verified included in the carbon data to be verified and the verifiable field type corresponding to each target data node, at least one verification data node corresponding to each data field to be verified is determined from a plurality of target data nodes;
[0083] The verifiable field type is the field type that the corresponding target data node can verify. Since different data nodes may have different types and the verification data of the private smart contract of each data node is also different, the fields that can be verified by each data node are also different.
[0084] The verification data node corresponding to each data field to be verified is a target data node corresponding to a verifiable field type that is the same as the field type corresponding to the data field to be verified.
[0085] Wherein, step S410 includes steps S411 to S413:
[0086] Step S411: Obtain the verifiable field type identifier corresponding to each target data node to obtain a verifiable field type identifier list set F = (F1, F2, ..., F k ,...,Ft );F k =(F k1 ,F k2 ,...,F kp ,...,F kq(k) ), where k = 1, 2, ..., t, t is the number of target data nodes, F k is a list of verifiable field type identifiers corresponding to the k-th target data node; p = 1, 2, ..., q(k); q(k) is the number of verifiable field type identifiers corresponding to the k-th target data node; F kp Identifies the p-th verifiable field type corresponding to the k-th target data node;
[0087] Step S412: According to the data type corresponding to the carbon data to be verified and the preset data field mapping table, each data field to be verified is replaced with the corresponding corrected data field to obtain a corrected data field list G = (G1, G2, ..., G i ,...,G n ), where G i A i The corresponding correction data field;
[0088] The data field mapping table stores the mapping relationship between each data field of carbon data of several preset data types and the correction data field corresponding to the data field. Since the data field to be verified is a general field, if the carbon data to be verified is to be specifically verified through the target data node, it needs to be converted into a specific field so that the target data node can perform specific analysis and verification on it.
[0089] Step S413, traverse the verifiable field type identifier list set F and the corrected data field list G, if F kp The corresponding verifiable field type is the same as G i If the corresponding field types are the same, the kth target data node is determined as G i The corresponding verification data node.
[0090] Step S420: Send each data field to be verified to the verification data node corresponding to the data field to be verified, and obtain the node verification result of each verification data node verifying the data field to be verified according to the corresponding private smart contract;
[0091] Wherein, step S420 includes steps S421-S422:
[0092] Step S421: G i Send to G i In each corresponding verification data node;
[0093] Step S422: Get Gi Each corresponding verification data node verifies G according to the corresponding private smart contract i The node verification identification for verification is obtained i Corresponding node verification identification list H i =(H i1 ,H i2 ,...,H ia ,...,H ib(i) ); among them, a=1,2,...,b(i); b(i) is G i The number of corresponding verification data nodes; H ia G i The corresponding a-th verification data node verifies G according to the corresponding private smart contract i The verification identifier of the node performing the verification;
[0094] When H ia When it is 0, it means G i The corresponding a-th verification data node verifies G according to the corresponding private smart contract i The verification result of the node being verified is that it has failed the verification;
[0095] When H ia When it is 1, it means G i The corresponding a-th verification data node verifies G according to the corresponding private smart contract i The verification result of the node being verified is passed.
[0096] Step S430: Determine the field verification result corresponding to each data field to be verified according to the node verification results corresponding to each data field to be verified;
[0097] Wherein, step S430 includes steps S431 to S433:
[0098] Step S431: If H i If the verification flag of each node in G is 1, then i The corresponding field verification result is passed; otherwise, execute step S432;
[0099] Step S432: Get G i The corresponding geographical identifier of each verification data node is obtained by i Corresponding node geographic identification list J i =(J i1 ,J i2 ,...,J ia ,...,J ib(i) ), where J ia G iThe geographical identifier corresponding to the geographical location of the corresponding a-th verification data node;
[0100] Step S433: If J ia The corresponding geographical location is the same as the geographical location where the carbon data to be verified is obtained, and in G i In each corresponding verification data node, G i The difference between the last data update time of the corresponding a-th verification data node and C0 is the smallest, then H ia The node verification result represented by G is determined as i The corresponding field validation result.
[0101] Step S440, determining the data verification result corresponding to the carbon data to be verified according to the verification results of the plurality of fields;
[0102] Wherein, step S440 includes steps S441 to S443:
[0103] Step S441: Obtain the field verification identifier corresponding to each data field to be verified to obtain a field verification identifier list I = (I1, I2, ..., I i ,...,I n ); where I i The field verification identifier corresponding to the i-th data field to be verified;
[0104] When I i When it is 0, it means that the field verification result corresponding to the i-th data field to be verified is failed;
[0105] When I i When it is 1, it means that the field verification result corresponding to the i-th data field to be verified is passed;
[0106] Step S442, traverse the field verification identifier list I, if I i is 1, the i-th data field to be verified is determined as a field that has passed verification, so as to obtain a number of fields that have passed verification;
[0107] Step S443: If the ratio of the number of fields that pass the verification to n is greater than the preset pass ratio threshold, the data verification result corresponding to the carbon data to be verified is determined to have passed the verification; otherwise, the data verification result corresponding to the carbon data to be verified is determined to have failed the verification.
[0108] Step S500: If the data verification result indicates that the carbon data to be verified has passed the verification, the carbon data to be verified is stored in the general data blockchain.
[0109] The blockchain-based carbon data storage method of the present invention determines a first data node from a number of data nodes according to a node type identifier corresponding to each data node and a data type identifier corresponding to the carbon data to be verified, determines a target data node from a number of first data nodes according to the data update time period of each first data node and the acquisition time of the carbon data to be verified, sends a number of data fields to be verified included in the carbon data to be verified to each target data node, and determines the data verification result of each target data node for verifying the carbon data to be verified. If the data verification result indicates that the carbon data to be verified has passed the verification, the carbon data to be verified is stored in the general data blockchain. By processing the data field of the carbon data to be verified, a target data node with a strong correlation with the carbon data to be verified is determined from a number of data nodes, and then each target data node performs specific verification on the data field of the carbon data to be verified according to the corresponding private smart contract to obtain the verification result of the carbon data to be verified, so as to ensure the accuracy of the verification of the carbon data to be verified.
[0110] An embodiment of the present invention further provides a computer program product, which includes program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present invention described above in this specification.
[0111] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0112] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0113] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0114] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0115] The electronic device according to this embodiment of the present invention is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0116] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the at least one processor mentioned above, the at least one storage device mentioned above, and a bus connecting different system components (including storage devices and processors).
[0117] The storage stores program codes, which can be executed by the processor, so that the processor executes the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0118] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read only memory (ROM).
[0119] The storage may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0120] The bus may represent one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0121] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter.
[0122] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0123] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0124] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0125] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0126] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0127] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0128] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0129] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0130] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A carbon data storage method based on blockchain, characterized in that: Applied to a carbon data verification system, the carbon data verification system is connected to a universal data blockchain, the universal data blockchain is connected to a plurality of data nodes, and at least some of the data nodes are each also connected to a private data blockchain, the universal data blockchain stores a universal smart contract, and each of the private data blockchains stores a private smart contract; The method comprises the following steps: Step S100: in response to receiving the carbon data to be verified, obtaining a data type identifier corresponding to the carbon data to be verified and a number of data fields to be verified included in the carbon data to be verified; Each of the data fields to be verified has a corresponding field type; Step S200: According to the node type identifier corresponding to each of the data nodes and the data type identifier corresponding to the carbon data to be verified, at least one first data node is determined from the plurality of data nodes; the first data node is a data node whose node type corresponding to the node type identifier is the same as the data type corresponding to the data type identifier; Step S300: determining at least one target data node from a plurality of the first data nodes according to the data update time period of each of the first data nodes and the acquisition time of the carbon data to be verified; the target data node is the first data node whose difference between the last data update time and the acquisition time of the carbon data to be verified is within a preset time difference threshold; Step S400: sending several data fields to be verified included in the carbon data to be verified to each of the target data nodes, and obtaining a data verification result of each of the target data nodes verifying the carbon data to be verified according to the corresponding private smart contract; Step S500: If the data verification result indicates that the carbon data to be verified has passed the verification, the carbon data to be verified is stored in the universal data blockchain.
2. The method according to claim 1, characterized in that The step S100 includes: Step S110: Acquire several data fields to be verified included in the carbon data to be verified, so as to obtain a list of data fields to be verified A=(A1, A2, ..., A i ,...,A n ); wherein i=1, 2, ..., n; n is the number of data fields to be verified included in the carbon data to be verified; A i is the ith data field to be verified included in the carbon data to be verified.
3. The method according to claim 2, characterized in that The step S200 includes: Step S210: Obtain the node type identifier corresponding to each of the data nodes to obtain a node type identifier list B = (B1, B2, ..., B j ,...,B m ), wherein j=1, 2, ..., m, and m is the number of the data nodes; B j is the node type identifier corresponding to the j-th data node; Step S220: traverse the node type identification list B. If B j If the corresponding node type is the same as the data type corresponding to the data type identifier of the carbon data to be verified, the jth data node is determined as the first data node.
4. The method according to claim 3, characterized in that The step S300 includes: Step S310: Obtain the last data update time of each of the first data nodes before the current time, and obtain a data update time list C = (C1, C2, ..., C g ,...,C h ), wherein g = 1, 2, ..., h, h is the number of the first data nodes, C g is the last data update time of the g-th first data node before the current time; Step S320: Obtain the data update time period of each of the first data nodes to obtain a data update period list D=(D1, D2, ..., D g ,...,D h ), where D g is the data update time period of the g-th first data node; Step S330: Determine the next data update time of each of the first data nodes according to the data update time list C and the data update period list D, and obtain the next data update time list E = (E1, E2, ..., E g ,...,E h ), where E g is the next data update time of the g-th first data node; E g =C g +D g ; Step S340, obtaining the acquisition time C0 of the carbon data to be verified; Step S350, traverse the next data update time list E, if E g -C0≤E0, the g-th first data node is determined as the target data node, and step S400 is executed; wherein E0 is a preset time difference threshold.
5. The method according to claim 4, characterized in that The step S350 further includes: If the difference between the next data update time of each of the first data nodes and C0 is greater than E0, then the data update time list C is traversed, and if C0-C g ≤E0, the g-th first data node is determined as the target data node.
6. The method according to claim 5, characterized in that The step S400 includes: Step S410: According to each data field to be verified included in the carbon data to be verified and the verifiable field type corresponding to each target data node, at least one verification data node corresponding to each data field to be verified is determined from a plurality of target data nodes; the verification data node corresponding to each data field to be verified is a target data node corresponding to a verifiable field type that is the same as the field type corresponding to the data field to be verified; Step S420: Send each data field to be verified to the verification data node corresponding to the data field to be verified, and obtain the node verification result of each verification data node verifying the data field to be verified according to the corresponding private smart contract; Step S430: Determine the field verification result corresponding to each data field to be verified according to the node verification results corresponding to each data field to be verified; Step S440: Determine the data verification result corresponding to the carbon data to be verified according to the field verification results.
7. The method according to claim 6, characterized in that The step S410 includes: Step S411: Obtain the verifiable field type identifier corresponding to each target data node to obtain a verifiable field type identifier list set F = (F1, F2, ..., F k ,...,F t );F k =(F k1 ,F k2 ,...,F kp ,...,F kq(k) ), wherein k=1, 2, ..., t, t is the number of the target data nodes, F k is a list of verifiable field type identifiers corresponding to the kth target data node; p = 1, 2, ..., q(k); q(k) is the number of verifiable field type identifiers corresponding to the kth target data node; F kp is the p-th verifiable field type identifier corresponding to the k-th target data node; Step S412: According to the data type corresponding to the carbon data to be verified and the preset data field mapping table, each data field to be verified is replaced with the corresponding corrected data field to obtain a corrected data field list G = (G1, G2, ..., G i ,...,G n ), where G i A i The data field mapping table stores a mapping relationship between each data field of carbon data of a plurality of preset data types and the corresponding correction data field of the data field; Step S413: traverse the verifiable field type identifier list set F and the corrected data field list G. If F kp The corresponding verifiable field type is the same as G i If the corresponding field types are the same, the kth target data node is determined as G i The corresponding verification data node.
8. The method according to claim 7, characterized in that The step S420 includes: Step S421: G i Send to G i In each corresponding verification data node; Step S422: Get G i Each corresponding verification data node verifies G according to the corresponding private smart contract i The node verification identification for verification is obtained i Corresponding node verification identification list H i =(H i1 ,H i2 ,...,H ia ,...,H ib(i) ); among them, a=1,2,...,b(i); b(i) is G i The number of corresponding verification data nodes; H ia G i The corresponding a-th verification data node verifies G according to the corresponding private smart contract i The verification identifier of the node performing the verification; When H ia When it is 0, it means G i The corresponding a-th verification data node verifies G according to the corresponding private smart contract i The verification result of the node being verified is that it has failed the verification; When H ia When it is 1, it means G i The corresponding a-th verification data node verifies G according to the corresponding private smart contract i The verification result of the node being verified is passed.
9. The method according to claim 8, characterized in that The step S430 includes: Step S431: If H i If the verification flag of each node in G is 1, then i The corresponding field verification result is passed; otherwise, execute step S432; Step S432: Get G i The corresponding geographical identifier of each verification data node is obtained by i Corresponding node geographic identification list J i =(J i1 ,J i2 ,...,J ia ,...,J ib(i) ), where J ia G i The geographical identifier corresponding to the geographical location of the corresponding a-th verification data node; Step S433: If J ia The corresponding geographical location is the same as the geographical location where the carbon data to be verified is obtained, and in G i In each corresponding verification data node, G i The difference between the last data update time of the corresponding a-th verification data node and C0 is the smallest, then H ia The node verification result represented by G is determined as i The corresponding field validation result.
10. The method according to claim 9, characterized in that The step S440 includes: Step S441: Obtain the field verification identifier corresponding to each data field to be verified to obtain a field verification identifier list I = (I1, I2, ..., I i ,...,I n ); where I i The field verification identifier corresponding to the i-th data field to be verified; When I i When it is 0, it means that the field verification result corresponding to the i-th data field to be verified is failed; When I i When it is 1, it means that the field verification result corresponding to the i-th data field to be verified is passed; Step S442, traverse the field verification identifier list I, if I i is 1, the i-th data field to be verified is determined as a field that has passed verification, so as to obtain a number of fields that have passed verification; Step S443: If the ratio of the number of fields that pass the verification to n is greater than the preset pass ratio threshold, the data verification result corresponding to the carbon data to be verified is determined to have passed the verification; otherwise, the data verification result corresponding to the carbon data to be verified is determined to have failed the verification.