Data processing method, device, equipment and medium
1. A data processing method applied to a first node in a data storage system, wherein a plurality of nodes of the data storage system are configured with a consensus mechanism, the method comprising:
acquiring the carbon emission allowance of a target object at the current stage;
acquiring transaction data of the target object at the current stage;
storing the carbon emission allowance of the target object at the current stage and the transaction data of the target object at the current stage into the first node.
2. The method of claim 1, further comprising:
and acquiring the carbon emission provided by the counterparty of each link of the corresponding stage based on the trading exchange.
3. The method of claim 1, further comprising:
obtaining the carbon emission allowance of a first stage of the flow according to the carbon emission allowance index of the whole flow and the carbon emission consumption of the first stage of the flow, wherein the flow comprises at least one stage;
the carbon emission margin of the first stage is calculated as follows:
UCXO(A)=UCXO(Req)–CC(A.HP)–CC(A.PL)–CC(A.PA)–CC(A.VE)–CC(A.EN)–CC(A.WA);
wherein ucxo (a) is a carbon emission margin of a stage, ucxo (req) is a whole process carbon emission margin index, CC (a.hp) is a carbon emission consumption amount for human resources in a stage, CC (a.pl) is a carbon emission consumption amount for a production line in a stage, CC (a.pa) is a carbon emission consumption amount for a packaging plant in a stage, CC (a.ve) is a carbon emission consumption amount for a transportation vehicle in a stage, CC (a.en) is a carbon emission consumption amount for a power plant in a stage, CC (a.wa) is a carbon emission consumption amount for a water plant in a stage, the a stage being the first stage of the process.
4. The method of claim 1, further comprising:
after the transaction is successful, acquiring the carbon emission allowance of the current stage according to a formula based on the carbon emission allowance of the previous stage and the carbon emission consumption of each link of the current stage:
UCXO(B)=UCXO(A)–CC(B.HP)–CC(B.PL)–CC(B.PA)–CC(B.VE)–CC(B.EN)–CC(B.WA);
wherein, ucxo (a) is carbon emission allowance of a stage in the whole process, ucxo (B) is carbon emission allowance of B stage, CC (b.hp) is carbon emission consumption for manpower of B stage, CC (b.pl) is carbon emission consumption for production line of B stage, CC (b.pa) is carbon emission consumption for packaging plant of B stage, CC (b.ve) is carbon emission consumption for transportation vehicle of B stage, CC (b.en) is carbon emission consumption for power plant of B stage, CC (b.wa) is carbon emission consumption for water plant of B stage;
wherein the stage A is the last stage of the stage B in the process.
5. The method of claim 3, wherein UCXO (ind) represents a personal carbon emission balance rating index, and wherein the consumer's own carbon emission balance is equal to:
UCXO(ind)+(UCXO(G)-UCXO(ave)),
wherein, ucxo (ave) is a preset average margin, ucxo (g) represents a carbon emission margin corresponding to a consumer stage, and when the commercial carbon emission margin consumed by the consumer is higher than or equal to the preset average margin, the carbon emission margin of the consumer is increased; when the consumer consumes the commodity carbon emission balance below the preset average balance, its own carbon emission balance is reduced.
6. The method of claim 5,
when a consumer purchases commodities with different residual carbon emission margins, comparing UCXO (ind) with UCXO (F), judging whether the carbon consumption of the consumer exceeds the standard or not, and adjusting the rated index of the carbon consumption margin of the consumer based on whether the carbon consumption exceeds the standard or not;
wherein ucxo (f) represents a carbon emission margin corresponding to the target.
7. The method of any of claims 1-6, further comprising:
the first node generates a hash value of the data based on the stored data;
and signing the hash value based on a private key of the first node to obtain signature data, wherein the signature data comprises expenditure and carbon emission allowance of each link in the corresponding stage of the first node for each production element.
8. The method according to any one of claims 1to 6, further comprising:
acquiring the life cycle allowance of the target object at the current stage;
and when the functional relation between the life cycle allowance and the carbon emission allowance meets a certain relation, further storing the life cycle allowance of the target object in the current stage into the first node.
9. The method of claim 8, further comprising:
providing a bar code on the product at any stage, the bar code pointing to an address providing at least one of the latest carbon emission balance, the latest transaction data and the latest life cycle balance of the target.
10. The method of claim 9, wherein the barcode further provides network addresses of a plurality of second nodes, and the scanning terminal sends the scanned data to the second nodes for verification.
11. The method according to any one of claims 1to 6, further comprising:
obtaining audit information of the first node, wherein the audit information is used for indicating data stored in the first node;
broadcasting audit information for the first node to a plurality of second nodes of the data storage system.
12. The method of claim 11, wherein the audit information includes data stored by the first node; or, the audit information includes data stored by the first node in a preset time period.
13. The method of claim 12, wherein the audit information further comprises context signature data obtained by the first node signing context information of a current stage with a private key, wherein the context information comprises at least one of a timestamp, geographic address information, and network address information.
14. The method of any one of claims 1to 6, wherein storing the carbon emission balance of the target object at the current stage and the transaction data of the target object at the current stage into the first node comprises:
storing the carbon emission allowance of the target object at the current stage and the transaction data of the target object at the current stage into a resource pool of the first node; when a consensus confirmation notice sent by any second node is received, storing the carbon emission allowance of the target object at the current stage and the transaction data of the target object at the current stage, which are stored in the resource pool, into a preset storage space of the first node; or the like, or, alternatively,
and when a consensus confirmation notice sent by any second node is received, storing the carbon emission allowance of the target object at the current stage and the transaction data of the target object at the current stage into the first node.
15. A data processing method applied to any second node in a data storage system, wherein a plurality of second nodes in the data storage system are configured with a consensus mechanism, the method comprising:
receiving audit information of a first node, wherein the audit information is used for indicating data stored by the first node, and the data comprises carbon emission allowance of a target object at a current stage and transaction data of the target object at the current stage;
checking the audit information based on target audit information of at least one target first node, wherein the target audit information is used for indicating data stored in each target first node transacting with the first node;
broadcasting a check-passing notification in the data storage system when the check passes;
and when the received verification passing notification meets a consensus passing condition, the audit information passes the consensus and sends a consensus confirmation notification to the first node.
16. The method of claim 15, wherein the auditing information is verified based on target audit information for at least one target first node, and when verified, broadcasting a verification pass notification in the data storage system comprises:
and acquiring target audit information sent after the successful transaction of the production elements and the first node is carried out from the corresponding target first node based on the public key of each production element carried in the audit information, verifying the audit information of the first node based on the target audit information of each production element, if the audit information is consistent, passing the audit information verification of the first node, and broadcasting a verification passing notice to other second nodes.
17. A data processing apparatus for use in a first node in a data storage system, a plurality of nodes of the data storage system being configured with a consensus mechanism, the apparatus comprising:
the first data acquisition module is used for acquiring the carbon emission allowance of the target object at the current stage;
the second data acquisition module is used for acquiring the transaction data of the target object at the current stage;
a storage module, configured to store the carbon emission allowance of the target object at the current stage and the transaction data of the target object at the current stage into the first node.
18. A data processing apparatus, applied to any second node in a data storage system, wherein a plurality of second nodes in the data storage system are configured with a consensus mechanism, the apparatus comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving audit information of a first node, the audit information is used for indicating data stored by the first node, and the data comprises carbon emission allowance of a target object at a current stage and transaction data of the target object at the current stage;
the verification module is used for verifying the audit information based on target audit information of at least one target first node, wherein the target audit information is used for indicating data stored in the target first node which conducts transaction with the first node;
a sending module, configured to broadcast a verification-passed notification in the data storage system when the verification passes;
the sending module is further configured to send a consensus confirmation notification to the first node when the received verification-passing notification meets the consensus-passing condition, and the audit information passes the consensus.
19. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by the processor to implement the data processing method of any one of claims 1to 16.
20. A data storage system, the system comprising a plurality of first nodes and a plurality of second nodes, the plurality of second nodes in the data storage system configured with a consensus mechanism,
each first node in the plurality of first nodes is used for acquiring the carbon emission allowance of the target object at the current stage; acquiring transaction data of the target object at the current stage, storing the carbon emission allowance of the target object at the current stage and the transaction data of the target object at the current stage into the first node, and acquiring audit information of the first node, wherein the audit information is used for indicating the data stored in the first node; broadcasting audit information for the first node to a plurality of second nodes of the data storage system;
each of the plurality of second nodes, configured to receive audit information of a first node, the audit information indicating data that the first node has stored, the data including a carbon emission margin of a target at a current stage and transaction data of the target at the current stage; checking the audit information based on target audit information of at least one target first node, wherein the target audit information is used for indicating data stored in the target first node which transacts with the first node; broadcasting a check-passing notification in the data storage system when the check passes; and when the received verification passing notification meets a consensus passing condition, the audit information passes the consensus and sends a consensus confirmation notification to the first node.
Background
With the development of the block chain technology, more and more services begin to use the block chain as a storage medium to realize data storage and sharing, however, the block chain technology can only ensure traceability of data on the chain in the application process, and cannot ensure that the data on the chain is real certainly, that is, the data on the chain is not linked with actual production life, so that the technology has great limitation, and cannot assist real production.
Disclosure of Invention
The embodiment of the invention provides a data processing method, a data processing device, data processing equipment and a storage medium. The technical scheme is as follows:
in one aspect, a data processing method is provided and applied to a first node in a data storage system, where multiple nodes of the data storage system are configured with a consensus mechanism, and the method includes:
acquiring the carbon emission allowance of a target object at the current stage;
acquiring transaction data of the target object at the current stage;
storing the carbon emission allowance of the target object at the current stage and the transaction data of the target object at the current stage into the first node.
In one aspect, a data processing method is provided, which is applied to any second node in a data storage system, where multiple second nodes in the data storage system are configured with a consensus mechanism, and the method includes:
receiving audit information of a first node, wherein the audit information is used for indicating data stored by the first node, and the data comprises carbon emission allowance of a target object at a current stage and transaction data of the target object at the current stage;
checking the audit information based on target audit information of at least one target first node, wherein the target audit information is used for indicating data stored in the target first node which transacts with the first node;
broadcasting a check-passing notification in the data storage system when the check passes;
and when the received verification passing notification meets a consensus passing condition, the audit information passes the consensus and sends a consensus confirmation notification to the first node.
In one aspect, a data processing apparatus is provided, which is applied to a first node in a data storage system, where a plurality of nodes of the data storage system are configured with a consensus mechanism, and the apparatus includes:
the first data acquisition module is used for acquiring the carbon emission allowance of the target object at the current stage;
the second data acquisition module is used for acquiring the transaction data of the target object at the current stage;
a storage module, configured to store the carbon emission allowance of the target object at the current stage and the transaction data of the target object at the current stage into the first node.
In one aspect, a data processing apparatus is provided, which is applied to any second node of a data storage system, where a plurality of second nodes in the data storage system are configured with a consensus mechanism, and the apparatus includes:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving audit information of a first node, the audit information is used for indicating data stored by the first node, and the data comprises carbon emission allowance of a target object at a current stage and transaction data of the target object at the current stage;
the verification module is used for verifying the audit information based on target audit information of at least one target first node, wherein the target audit information is used for indicating data stored in the target first node which conducts transaction with the first node;
a sending module, configured to broadcast a verification-passed notification in the data storage system when the verification passes;
the sending module is further configured to send a consensus confirmation notification to the first node when the received verification-passing notification meets the consensus-passing condition, and the audit information passes the consensus.
In one aspect, a computer device is provided, and the computer device includes a processor and a memory, where at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement the operations performed by the data processing method.
In one aspect, a computer-readable storage medium is provided, and at least one instruction is stored in the storage medium, and the instruction is loaded and executed by the processor to implement the operation performed by the data processing method.
In one aspect, a data storage system is provided, the system comprising a plurality of first nodes and a plurality of second nodes, the plurality of second nodes in the data storage system configured with a consensus mechanism,
each first node in the plurality of first nodes is used for acquiring the carbon emission allowance of the target object at the current stage; acquiring transaction data of the target object at the current stage, storing the carbon emission allowance of the target object at the current stage and the transaction data of the target object at the current stage into the first node, and acquiring audit information of the first node, wherein the audit information is used for indicating the data stored in the first node; broadcasting audit information for the first node to a plurality of second nodes of the data storage system;
each of the plurality of second nodes, configured to receive audit information of a first node, the audit information indicating data that the first node has stored, the data including a carbon emission margin of a target at a current stage and transaction data of the target at the current stage; checking the audit information based on target audit information of at least one target first node, wherein the target audit information is used for indicating data stored in the target first node which transacts with the first node; broadcasting a check-passing notification in the data storage system when the check passes; and when the received verification passing notification meets a consensus passing condition, the audit information passes the consensus and sends a consensus confirmation notification to the first node.
According to the embodiment of the invention, the data of different dimensions of the target object are mainly obtained, so that the stages and links of the target object from the production stage to the circulation stage can be recorded from multiple angles, the purpose of closely associating the online data with the real production life can be achieved, and the online data has practical significance.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic structural diagram of a data storage system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a computer device provided by an embodiment of the invention;
FIG. 3 is a flow chart of a data storage method according to an embodiment of the present invention;
FIG. 4 is a flow chart of a data verification method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a data association network in a data verification process according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an implementation process involved in different stages from production to circulation and different links of the stages of a dairy product provided by the embodiment of the invention;
FIG. 7 is a schematic structural diagram of a data storage device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a data verification apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is a schematic structural diagram of a data storage system according to an embodiment of the present invention. The system comprises a plurality of first nodes 101 and a plurality of second nodes 102;
each first node in the plurality of first nodes is used for acquiring first data of a target object; acquiring second data of the target object, wherein the first data and the second data are data with different dimensions; storing the first data and the second data of the target object into the first node, and acquiring audit information of the first node, wherein the audit information is used for indicating the data stored in the first node; broadcasting audit information for the first node to a plurality of second nodes of the data storage system;
the plurality of second nodes are used for receiving the audit information of the first node, and the audit information is used for indicating the data stored by the first node; verifying the audit information based on target audit information of at least one target first node; broadcasting a verification pass notification in the data storage system when the verification passes; when the received verification passing notice meets the consensus passing condition, the audit information passes the consensus.
The plurality of first nodes 101 may be nodes of different business entities, respectively, and are configured to store data related to production and transaction of the corresponding business entity, each first node 101 may store its own data in a database or in a block manner, where the database is configured to establish an index for each data and store the data in a corresponding storage space based on the index, and the block manner is that, for the data stored in the first node, each data has a certain association, and may take a block form similar to a block chain, so as to ensure that the data is not tamper-able. The plurality of first nodes 101 may form a basic data layer of the data storage system, and may also provide a data query function for corresponding business entities, so as to trace back transactions with other nodes and production activities of the corresponding business entities. Specifically, a plurality of first nodes 101 may communicate with each other to perform a transaction, for example, a first node 1 may perform a transaction with a first node 2, so as to perform processes of transferring money, delivering products, communicating information, and the like to an account corresponding to the first node 2 through an account of the first node 1, thereby completing a transaction with the first node 2. Of course, the completion of the transaction may refer to the completion of an online transaction, and in the actual transaction process, related offline transportation may also be involved, and the like, which is not limited in the embodiment of the present invention. In addition, it should be noted that the first node may also be an agent node of the business entity, and is configured to act on line for trading, data storage, and the like of one or more business entities, and when the first node acts on one or more business entities, data storage may be performed for different business entities, and data privacy of each business entity may be ensured by means of setting a key, and the like.
The plurality of second nodes 102 may be configured to verify data generated by the plurality of first nodes during production, transactions, and indicate authenticity of the data of the first nodes based on transaction results. It should be noted that the multiple second nodes 102 may deploy the same block chain, that is, the multiple second nodes 102 may follow the same set of consensus mechanism, may respectively check the data of the first node 101, and perform consensus based on the consensus mechanism and the check results of the multiple second nodes 102, where if the check results meet the consensus passing condition (for example, the number of passed second nodes exceeds 2/3 of the total number), the multiple second nodes 102 achieve consensus, determine the authenticity of the data of the first node 101, and when the check results do not meet the consensus passing condition, the multiple second nodes 101 do not achieve consensus, and determine that the data of the first node 101 does not have authenticity. It should be noted that, in the embodiment of the present invention, which kind of consensus mechanism is specifically adopted is not limited.
The plurality of first nodes 101 form a basic data layer of the data storage system, and are used for storing data of the respective nodes, and the plurality of second nodes 102 form an auditing layer of the data storage system, and are used for providing verification services for the plurality of first nodes 101, and certain data isolation may be provided between the respective first nodes 101, for example, transaction data of the first node 1 is invisible to the first node 2, and the first node 1 may send a transaction request carrying account information to the second node. The data of each first node 101 is transparent or relatively transparent to the plurality of second nodes 102, that is, the second nodes 102 may acquire the data or the characteristic value (e.g., hash value) of the data stored in the first node 101.
For example, fig. 2 is a schematic diagram of a computer device provided in an embodiment of the present invention, and the computer device 200 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 201 and one or more memories 202, where the memory 202 stores therein at least one instruction, and the at least one instruction is loaded and executed by the processor 201 to implement a data storage method or a data verification method provided in each of the embodiments described below. Certainly, the computer device may further have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input and output, and the computer device may further include other components for implementing the functions of the device, which is not described herein again.
Fig. 3 is a flowchart of a data storage method according to an embodiment of the present invention. The data storage method can be applied to any one of the first nodes shown in fig. 1, and referring to fig. 3, the method includes:
301. first data of a target object is acquired.
The target may be any product capable of being transacted or circulated offline or online. The object may be a tangible product, which may be obtained based on manual production or machine production, for example, the tangible product may be food, daily chemical products, household articles, home appliances, and the like, and the embodiments of the present invention are not particularly limited. The object may also be a ticketed product, i.e. a product represented in the form of a ticket, for example, the object may be a financial product such as a stock, a bond, a fund share, etc. Of course, the target object may also be a virtual product, that is, a product represented in electronic data form, which may correspond to a certain actual monetary value or virtual monetary value, which may not be fixed but may float according to market rules, for example, the virtual product may be a financial product such as an online fund product, an online stock product, and the like.
The first data may refer to data of a dimension of the object, the dimension referring to information for measuring any aspect of the object from generation to its lifetime. For example, the dimensions may include a time dimension, a trade dimension, an environmental dimension, and so forth. The time dimension may include a previous time of the target object, a time left by the target object from extinction, a time left by the target object from settlement or expiration, and the like, the transaction dimension may include a transaction partner of the target object in generating the related transaction behavior until the previous time, a transaction amount, a transaction time, and the like, and the environmental dimension may include a harmful substance emission or generation situation, such as a carbon emission situation, a formaldehyde generation situation, an industrial waste generation situation, and the like.
302. And acquiring second data of the target object, wherein the first data and the second data are data with different dimensions.
Wherein the second data may refer to data of a different dimension than the first data. For example, the first data is data in a time dimension, and the second data may be a transaction dimension or an environmental dimension.
303. And storing the first data and the second data of the target object into the first node.
The first node may store data related to production or transaction of the node, and the data may include information of any transaction occurring in a production stage or a circulation stage of a target object corresponding to the node.
It should be noted that, when data storage is performed, the first data and the second data may be stored correspondingly, which is convenient for query. For example, the first data and the second data may be stored in one data item or related data items of a database of the first node, the first data and the second data may also be stored in one block, or the first data and the second data may be stored in different blocks respectively and identified by the same data identification, so as to facilitate the query.
In some embodiments, the first node may perform cross-matching based on the acquired data of the at least two dimensions before storing, and perform the storing step of step 303 when the acquired data of the at least two dimensions match. Because the data of each dimension should accord with a certain functional relationship, the data of at least two dimensions can be cross-compared based on the functional relationship between the dimensions, and when the comparison result is matched, the data can be stored, and if the comparison result is not matched, the storage step is not executed. For example, the life cycle and carbon emission should have a certain functional relationship, for example, when the life cycle is reduced by 2 days, the carbon emission should be increased by 10 units, and if the above multidimensional data does not satisfy the functional relationship, the data is incorrect, and the comparison result is not matched.
It should be noted that the cross comparison may be any dimension data provided in the embodiment of the present invention, that is, when the obtained data is the first data and the second data, the comparison is performed based on the first data and the second data, when the obtained data is the first data, the second data, and the third data, the comparison is performed based on the first data, the second data, and the third data, and similarly, when the obtained data further includes other data, the comparison process is performed according to the above principle. Of course, the above comparison is only a simple example of a specific comparison process, and other comparison processes may also be performed based on multidimensional data in the embodiment of the present invention, which is not limited in the embodiment of the present invention.
According to the embodiment of the invention, the data of different dimensions of the target object are mainly obtained, so that the stages and links of the target object from the production stage to the circulation stage can be recorded from multiple angles, the purpose of closely associating the online data with the real production life can be achieved, the online data has practical significance, and the online data is not only a simple expression of some virtual currencies. Furthermore, in each embodiment of the present application, the data of multiple dimensions recorded by the first node corresponding to each stage are related to each other, not only each stage and each link can be verified against each other, but also the data of multiple dimensions can be verified against each other, forming a streaming and seamless data chain, and because the data of each first node is stored on the node itself, the security of the data is improved.
For the target object, the target object may include a plurality of stages from production to circulation, and the plurality of stages may be divided according to actual needs, and for the food, the plurality of stages may include a raw material production stage, a target object production stage, a transportation stage, a sale stage, and the like, wherein the sale stage is different according to a sale manner, and may further include different stages, for example, if a manner of sale by an electric company is adopted, an electric company stage, a storage stage, a logistics stage, and a consumer stage may be included, and if a manner of sale by an electric company is adopted, an on-shelf stage and a consumer stage may be included, and for example, any virtual product may include a design stage, a commissioning stage or a pre-sale stage, a formal release stage, and the like.
Based on the embodiment shown in fig. 3, in some embodiments, the first data of the object includes a life cycle margin of the object at a current stage, and the second data of the object includes transaction data of the object at the current stage.
The life cycle refers to a time period from an original state of the target to generation of the target and then to the expiration of the target, or the target reaches a use period or is exhausted. For example, it may be expressed as a shelf life for food, a shelf life for milk, for example, 30 days, a shelf life for a virtual product, a financial product, for example, 60 days, a software product, for example, a usage right, for example, a high-class member, for example, 1 month, and a discard life or a number of uses, for example, a washing machine, for example, a discard life for 5 years or 10000 uses. Based on the above description of the life cycle, it can be known that the life cycle residual amount is the residual amount of the life cycle of the target object at the current time point. For example, the life cycle of the food is 30 days, and if the circulation of 10 days has been passed at this time, the remaining life cycle is 20 days. Since a certain amount of consumption may occur in each stage of the object and affect the use or persistence of the object, the life cycle margin of the object can be acquired in order to record such an effect.
In some embodiments, each stage of the target object may have a corresponding life cycle margin, and of course, the life cycle margin may also be determined only at some stages of the target object, and specifically, the life cycle margin may be determined according to characteristics of the target object, for example, for some target objects having raw materials, the life cycle margin is already provided at a production stage of the raw materials, and in subsequent stages, the life cycle margin is decreased on the basis of the life cycle margin at the production stage of the raw materials, and for some target objects not having raw materials, the life cycle may occur only at some stage, which is not limited in the embodiments of the present invention. Through the above description, it can be known that, if the phase corresponding to the first node is the start phase of the life cycle, the value of the life cycle margin is equal to the length of the life cycle.
In some embodiments, the life cycle margin can be expressed in any time granularity, and the specific time granularity can be set according to the type of the target object. In some embodiments, the life cycle residual amount may further include a value of the life cycle residual amount and a start time of the life cycle, so as to provide an intuitive time point to further indicate the possible existence or use condition of the object.
In some embodiments, the life cycle margin of the target object at the current stage is a difference between the life cycle margin of the previous stage and the elapsed time of the current stage.
The obtaining process of the life cycle allowance of the target object at the current stage may include: and acquiring the life cycle allowance of the previous stage and the consumed time of the current stage, and acquiring the difference value of the life cycle allowance of the previous stage and the consumed time of the current stage as the life cycle allowance of the current stage.
For a first node, before starting processing at a current stage, a life cycle margin sent by a first node corresponding to a previous stage of the target object may be obtained, where the life cycle margin may be obtained when a transaction between the first node corresponding to the previous stage is completed, the first node corresponding to the previous stage sends the life cycle margin to the first node at the current stage, and when sending the life cycle margin, the first node corresponding to the previous stage may also send signature data obtained by signing the life cycle margin with a private key and a public key of the first node corresponding to the previous stage.
In some embodiments, the elapsed time for the current phase may be set according to the characteristics of the current phase. Each stage may be associated with different links of investing or spending activities, such as human resources, production, packaging, transportation, power supply, water supply, etc., each link may correspond to a different time consumption, and thus, the time consumption of different stages may be different, and the time consumption of the link associated with each stage needs to be analyzed to determine the time consumption of the stage. Certainly, in some embodiments, the time consumption of each stage may be set according to experience, or may be set based on analysis of historical processing time consumption of each stage, or may be set according to analysis of historical processing time consumption of each link associated with each stage, so as to achieve the purpose of more accurately calculating the life cycle residual. In some embodiments, the time consumption of each stage can be counted in real time, so as to obtain more real life cycle allowance according to real data.
In some embodiments, the transaction data of the target at the current stage includes transaction data of each link of the target at the current stage, and the transaction data of the target at the current stage further includes signature data of the transaction data of each link of the target at the current stage. The first node records transaction information of transactions occurring in each link at the current stage, for example, in a transportation link, a fee EX transferred from an account 1 of the first node to an account 2 of a node undertaking transportation services is obtained, and signature data provided by a transaction counterpart of each link after the transaction counterpart accepts the transaction is also obtained, where the signature data may be obtained by the first node of the transaction counterpart signing the transaction information with a private key, and for example, the signature data may be Sig _ (EX (account 1to account 2)). Optionally, the counterparty may also return the public key of the counterparty when the signature data is returned, so as to verify the counterparty and the signature data.
In some embodiments, the first data for the target includes a resource consumption margin of the target at the current stage, and the second data for the target includes transaction data for the target at the current stage.
In order to limit the impact, it is necessary to record data that is likely to cause a certain amount of resource consumption in each stage of the object and that affects the environment.
The resource consumption refers to the consumption of some limited resources from the original state of a target object to the generation of the target object and then to the expiration of the target object or the target object reaching the use period or the target object being exhausted. For example, the emission amount of the incidental substances due to resource consumption in industrial production activities, for example, the emission amount of the incidental substances for production such as carbon emission amount and formaldehyde emission amount, etc. may be expressed for industrial products.
In some embodiments, the resource consumption margin of the target at the current stage is a difference between the resource consumption margin of the previous stage and the resource consumption of the current stage.
The obtaining process of the resource consumption margin of the target object at the current stage may include: the first node obtains the resource consumption allowance of the previous stage and the resource consumption of the current stage, and then obtains the difference value of the resource consumption allowance of the previous stage and the resource consumption of the current stage as the resource consumption allowance of the current stage.
For the first node, before starting the processing of the current stage, the resource consumption allowance sent by the first node corresponding to the previous stage of the target object may be obtained, where the resource consumption allowance may be obtained when the transaction between the first node corresponding to the previous stage is completed, and the first node corresponding to the previous stage sends the resource consumption allowance to the first node, and when sending the resource consumption allowance, the first node corresponding to the previous stage may also send signature data obtained by signing the resource consumption allowance with a private key and a public key of the first node corresponding to the previous stage.
In some embodiments, the resource consumption of the current stage is a sum of resource consumptions of the links of the target object at the current stage. The first node records transaction information of transactions generated in each link and resource consumption obtained based on the transactions in each link at the current stage, for example, in a transportation link, an account 1 of the first node transfers EX to an account 2 of a node undertaking transportation business, and obtains carbon emission CC provided by a transaction counterpart of each link based on the transactions, and correspondingly, the obtained signature data is signature data obtained by performing signature based on the transaction information and the resource consumption.
It should be noted that the resource consumption balance may be a resource consumption balance normalized to a single target, for example, for a carbon emission balance, the carbon emission balance may be a carbon emission balance normalized to a single product. It should be noted that, for any object, the resource consumption index may be set to guide the actual generation according to the resource consumption index, and for example, the carbon emission amount may be set based on an upper limit of the carbon emission amount established in an international conference.
In some embodiments, the method further comprises: the first node acquires third data of the target object, and the third data is associated with the second data; when the first data and the second data of the object are stored in the first node, the third data of the object are stored in the first node. Wherein the third data may be data of a different dimension than the first data and the second data. The generation of the third data may be associated with the generation of second data, the second data may be transaction data of the object at the current stage, and the second data is generated based on the input or expenditure behavior of the generation or circulation process of the object, and the third data is generated based on the input or expenditure behavior of the generation or circulation process of the object, and the corresponding third data may be generated along with the generation of the second data.
It should be noted that the second data does not necessarily have associated third data, and the third data is necessarily generated due to the generation of the second data, for example, when any expenditure behavior occurs, the two trading parties have traded funds and also complete the trading of the corresponding resource consumption dimension (for example, the carbon emission of the seller is transferred to the buyer due to the trading).
It should be noted that, when data is stored, the first node may store the first data, the second data, and the third data in one block, or store the first data, the second data, and the third data in different blocks respectively, and use the same data identifier to identify the first data, so as to facilitate querying.
In some embodiments, the third data for the object includes: the resource consumption allowance of the object in the current stage. For example, the first data may be a life cycle margin of a current stage, the second data may be transaction data of the current stage, and the third data may be a resource consumption margin of the target object at the current stage, where the resource consumption margin is a carbon emission margin.
In some embodiments, the first node may further obtain audit information of the first node, the audit information indicating the data stored by the first node; broadcasting audit information for the first node to a plurality of second nodes of the data storage system.
It should be noted that, for the first node, the step of acquiring the audit information of the first node may be executed when the first data and the second data are not stored, that is, the step of acquiring and broadcasting the audit information may be executed when the steps 301 and 302 are executed, so that the step of storing the first data and the second data of the target object in the first node is executed again when the consensus confirmation notification is received.
In some embodiments, the first node may further have a resource pool for temporarily storing data, that is, when the first data and the second data are acquired, the first data and the second data of the target object may be stored in the resource pool of the first node; and when a consensus confirmation notice sent by any second node is received, storing the first data and the second data stored in the resource pool into a preset storage space of the first node.
In some embodiments, the audit information comprises data stored by the first node; or, the audit information includes data stored by the first node in a preset time period. In the implementation mode, the audit information can be the data stored by the first node, but not the characteristic value, so that the second node can obtain the original data of the transaction, and the verification precision of the second node is greatly improved.
In some embodiments, the audit information comprises a characteristic value of data stored by the first node; or, the audit information includes a characteristic value of data stored by the first node in a preset time period. The data stored in the preset time period may be data acquired by the first node in at least one production process, not only data acquired in a certain production process, so as to avoid excessively frequent data transmission caused by a large production scale and a high production frequency.
The feature value may be a hash value or any feature value calculated based on an irreversible algorithm.
In some embodiments, the audit information is signature data obtained by the first node signing data stored by the first node with a private key of the first node. The signature may enable the second node to learn the source node of the audit information. In some embodiments, the audit information also includes a public key of the first node. The public key can be used for the second node to verify based on the public key and the signature data, the audit information is confirmed to be from the first node indeed, and then a specific verification process is carried out based on a characteristic value or other data obtained after the signature data is decompressed.
In some embodiments, the audit information further includes context signature data obtained by the first node signing context information of the current stage with a private key, where the context information includes at least one of a timestamp, geographical address information, and network address information. The context information can provide information such as the occurrence time and the occurrence environment corresponding to the data to be audited, and the traceability of the data can be ensured.
For a second node of the auditing layer, there may be the data interaction as in fig. 4 and fig. 5, where the second node receives auditing information of the first node, and the auditing information is used to indicate data already stored by the first node; verifying the audit information based on target audit information of at least one target first node; when the check is passed, the second node broadcasts a check passing notice in the data storage system; and when the received verification passing notification meets a consensus passing condition, the first audit information passes consensus. When the audit information consensus passes, the second node can also send a consensus confirmation notice to the first node.
The stored data may be first data and second data, or first data, second data and third data, or second data and third data, and of course, according to different data requirements, there may also be a combination of the first data and the third data, which is not limited in the embodiment of the present invention.
The first node includes the target first node, which is one of the plurality of first nodes. The target first node may refer to one or more nodes associated with the current production activity of the first node, for example, the target first node may be a node upstream of the first node in the production or circulation process of a target object, or the target first node may be a node participating in a production link (i.e., a production element) of the first node (for example, may be a first node corresponding to a company providing transportation service for the first node). Therefore, the target audit information corresponding to the target node is used for indicating the data stored by each target first node which carries out transaction with the first node.
In each embodiment of the application, the audit layer provides a checking function for each first node in the data storage system, and since the plurality of second nodes of the audit layer can acquire the audit information of each first node, the authenticity and the accuracy of the data to be stored can be determined through cross comparison of the audit information, and the authenticity and the accuracy of the data are ensured while the data safety is ensured.
In some embodiments, the second node may perform cross comparison according to the multidimensional data in the audit information provided by the first node itself, and when the multidimensional data conforms to the preset functional relationship, it is determined that the audit information passes verification. Therefore, the at least one target first node may also be the first node itself, and the target audit information of the at least one target first node may also be the audit information of the first node itself.
In some embodiments, the verifying, by the second node, the audit information based on the target audit information of the at least one target first node includes: the second node acquires target audit information uploaded by the at least one target first node according to the audit information, wherein the target audit information can be audit information uploaded by each target first node after transaction with the first node; and the second node compares the target audit information of the at least one target first node with the audit information, and when the target audit information of the at least one target first node is matched with the audit information, the audit information is determined to pass the verification.
The second node acquires the target audit information uploaded by the at least one target first node according to the audit information, wherein the acquiring of the target audit information uploaded by the at least one target first node by the second node comprises: the second node acquires a public key in at least one piece of signature data in the audit information; the second node takes the first node corresponding to the acquired public key as the at least one target first node; and acquiring the audit information of the first node corresponding to the public key as the target audit information of the at least one target first node according to the public key.
In a process of comparing, by the second node, the target audit information of the at least one target first node with the audit information of the first node, in some embodiments, the target audit information and the audit information are not original data stored in the node, but are signatures of characteristic values of the data, and then the comparison process may include: firstly, respectively decompressing signatures based on public keys of all nodes to obtain a target characteristic value of at least one target first node and a characteristic value of the first node, then judging whether the characteristic value of the first node comprises the target characteristic value of the at least one target first node, if so, indicating that transactions are in one-to-one correspondence and transaction contents are in one-to-one correspondence, determining that target audit information of the at least one target first node is matched with the audit information, and when the target audit information is matched with the audit information, determining that the audit information passes verification.
In some embodiments, the audit information may be data stored in the signed first node, the second node may perform cross comparison according to multidimensional data in the audit information provided by each different node, when the multidimensional data conforms to a preset functional relationship, it is determined that the target audit information of the at least one target first node matches the audit information, and when the multidimensional data matches the preset functional relationship, it is determined that the audit information passes verification.
In some embodiments, the at least one target first node is a counterparty of the transaction indicated by the audit information.
In some embodiments, the at least one target first node comprises: the at least one target first node comprises: and the node corresponding to each production element of the current stage and the node corresponding to the target object in the previous stage of the current stage.
In some embodiments, the method further comprises: the first node provides a bar code on the product at any stage, and the address pointed by the bar code is used for providing at least one of the latest first data or the latest third data of the target object. The bar code can be in the form of one-dimensional code, two-dimensional code and the like, the bar code can point to the address of a certain network resource, and the data stored in the address can be updated according to the first data of the current stage of the target object, so that at least one of the latest first data, the second data and the latest third data of the target object can be obtained by scanning the bar code every time, a pointer for the data in the data storage system is formed through the bar code, and the real product and the on-line data corresponding to the product are associated. For a user-oriented bar code, the second data relating to transaction privacy may not be provided, but in the case of an audit work oriented bar code, the second data of the target object may also be provided in the address to which the bar code points. For example, transaction data of a first node in the raw milk production process may be provided, and specifically, which data may be provided according to actual requirements may be provided, which is not limited in the embodiment of the present invention.
It should be noted that, the data stored in the address may be updated by the first node, taking the update of the first data as an example, when any first node completes a transaction, the first data may be updated to the address, of course, the content included in the address may include an update timestamp, the first node may compare the update timestamp with the timestamp of the first data to be uploaded, if the timestamp of the first data to be uploaded is later than the update timestamp, the first data is uploaded to cover the existing first data on the address, and if the timestamp of the first data to be uploaded is not later than the update timestamp, the first data is not uploaded. In addition, the update can be performed by the second node, and the specific execution process may be that the second node receives the audit information of the first node, and uploads the audit information after the audit information passes the consensus, so as to ensure that the first data stored in the address is real and reliable.
The address of the network Resource may be in the form of Uniform Resource Identifier (URI).
For example, taking the milk product production and the first data as the life cycle residual amount as an example, a two-dimensional code may be printed or pasted on the package of the raw milk when the raw milk is shipped, and the two-dimensional code is generated based on the target URI, so that after the user scans the raw milk using the terminal, the user may jump to the target URI and check that the life cycle residual amount of the raw milk is 15 days. Alternatively, if the target URI is used to store the carbon emission balance, the carbon emission balance of the raw milk can also be viewed through the target URI.
Certainly, the barcode can also provide network addresses of a plurality of second nodes, the terminal can send the scanned data to the plurality of second nodes for verification, and when the verification is passed, an information verification passing notice can be returned, so that a user can know that the data is true and accurate, and the transaction is also true and reliable.
For the implementation of the present application, the production elements of each stage may be analyzed according to different stages related to different targets to form a data chain diagram, corresponding resource consumption indexes may be formulated for each stage, and according to characteristics of each production element, time consumption, Transaction amount, resource consumption amount, and the like may be determined for each stage, and the three data are expressed in a streaming manner in each stage, and follow the real association between the data in economic Life, for example, there is a certain association between UCXO (unused Transaction Output) and UTXO (unused Transaction Output) and UCLO (unused Life Cycle Output, Life Cycle consumption and value inevitably bring equivalent resource consumption, and UCXO has a certain association with UCXO, resource consumption and value consumption, the consumption of the life cycle is equal, and the potential connection enables data to be closely connected to form a seamless data chain crossing each first node, so that the data cannot be tampered and has actual data value.
Furthermore, a basic data layer formed by each first node is associated with each production element to form a seamless data link layer, and the basic data layer is also associated with an audit layer to form a double-layer data link layer structure, so that the authenticity of data is guaranteed, meanwhile, the anti-tampering characteristic of the data is guaranteed, and the safety of the data is greatly improved.
Referring to fig. 6, the implementation processes involved in different stages and links of each stage in the production to circulation of a dairy product, the resource consumption involved are illustrated by taking carbon emissions as an example:
first, some nouns appearing in the following detailed description will be introduced:
CC Carbon Cost, Carbon emission consumption
ULCO, Unpendt Life Cycle Output, Life Cycle residual
EX: expense, cost.
Then, the various stages of the dairy product are introduced: for a dairy product, the whole process may comprise: raw milk (A) -dairy production (B) -transportation (C) -E-commerce (D) -storage (E) -stream (F) -consumer (G). Based on the flow from production to circulation, the raw milk can enter a dairy product production stage through transportation after the production is finished, can reach an e-commerce stage through transportation after the dairy product production is finished, can enter a storage stage after the e-commerce stage is released, and can enter a logistics stage when the dairy product is ordered, and enters a consumer stage after the logistics stage is finished.
In the raw milk stage a, it is assumed that the production elements corresponding to the different involved links may include: the method comprises the following steps that A.HP human resources, an A.PL production line, an A.PA packaging plant, an A.VE transport vehicle, an A.EN power plant, an A.WA water plant and the like, a node corresponding to a business entity in a raw milk stage is represented by a first node A, and a first node in a dairy product production stage is represented by a first node B, so that the following processes can be carried out:
1. the first node a pays fees EX (a.hp), EX (a.pl), EX (a.pa), EX (a.ve), EX (a.en), and EX (a.wa) to the respective production elements in each link of producing the raw milk, and after the transaction is successful, the first node a acquires the following signature data and stores the data in the first node a:
the HP accepts a transaction HASH signature Sig _ EX (HP2A), Sig _ CC (HP2A), HP's public key pubkey (HP);
the PL accepts A's transaction HASH signature Sig _ EX (PL2A), Sig _ CC (PL2A), PL's public key Pubkey (PL);
PA accepts A's transaction HASH signature Sig _ EX (PA2A), Sig _ CC (PA2A), PA's public key Pubkey (PA);
VE receives the transaction HASH signature Sig _ EX (VE2A), Sig _ CC (VE2A) of A, and the public key Pubkey (VE) of VE;
EN accepts A's transaction HASH signature Sig _ EX (EN2A), Sig _ CC (EN2A), EN's public key Pubkey (EN);
WA receives transaction HASH signature Sig _ EX (WA2A), Sig _ CC (WA2A) of A and public key Pubkey (WA) of WA;
the Pubkey () refers to a public key of the node, Sig _ EX (itoj) refers to signature data of EX paid by the node i to the node j to the node i, and Sig _ CC (itoj)) refers to signature data of CC transferred by the node i to the node j, wherein the signature data indicates that the corresponding carbon emission transaction is also completed when the first node a conducts fund transaction.
2. And the first node A obtains the carbon emission allowance of the raw milk stage according to the carbon emission index and the carbon emission consumption of the stage, and stores the carbon emission allowance in the first node A.
The specific calculation method of the carbon emission margin can be as follows:
UCXO(A)=UCXO(Req)–CC(A.HP)–CC(A.PL)–CC(A.PA)–CC(A.VE)–CC(A.EN)–CC(A.WA)。
wherein, UCXO (A) is the carbon emission allowance of the raw milk stage, and UCXO (req) is the carbon emission allowance index of the whole process. For example, the index can be decomposed into carbon emission credit of each economic link according to the total carbon emission determined by international conference or industry standard; CC (a.hp) is carbon emission consumption for human resources in a stage, and its value is equal to CC (HP2A), CC (a.pl) is carbon emission consumption for production line in a stage, and its value is equal to CC (PL2A), CC (a.pa) is carbon emission consumption for packaging plant in a stage, and its value is equal to CC (PA2A), CC (a.ve) is carbon emission consumption for transportation vehicle in a stage, and its value is equal to CC (VE2A), CC (a.en) is carbon emission consumption for power plant in a stage, and its value is equal to CC (EN2A), and CC (a.wa) is carbon emission consumption for water plant in a stage, and its value is equal to CC (WA 2A).
Optionally, ucxo (a) may be a carbon emission balance normalized to a single piece product.
3. The first node a and the first node B carry out transaction, the manufacturer B pays a money available transaction EX (B2A) to the raw milk supplier a for purchasing raw milk, after the transaction is successful, the first node a may send the output raw milk life cycle residual amount ulco (a) to the first node B, and obtain and store the following signature data in the first node a:
b received a trade HASH signature of raw milk from a: sigULCO (A2B), sigEX (BtoA), sigCC (BtoA) and the public key Pubkey (B) of B;
wherein Sig _ ULCO (itoj) refers to the signature data of node j on the ULCO of the target provided by i to j.
In any of the processes 1, 2, and 3 above, the first node a may perform cross comparison based on the acquired data of at least two dimensions, and perform the storing step when the acquired data of at least two dimensions match.
4. The first node A obtains the audit information and broadcasts the audit information of the first node to a plurality of second nodes of the data storage system.
Specifically, the first node a generates a HASH (HASH) value of the data based on the stored data, and signs the HASH value based on a private key of the first node a to obtain signed data, where the data includes expenses and carbon emission margins of various production elements in various stages corresponding to the first node a, and for example, the audit information may include the following:
Sig((Sig_EX(HP2A),Sig_CC(HP2A),Pubkey(HP),
Sig_EX(PL2A),Sig_CC(PL2A),Pubkey(PL),
Sig_EX(PA2A),Sig_CC(PA2A),Pubkey(PA),
Sig_EX(VE2A),Sig_CC(VE2A),Pubkey(VE),
Sig_EX(EN2A),Sig_CC(EN2A),Pubkey(EN),
Sig_EX(WA2A),Sig_CC(WA2A),Pubkey(WA),
Sig_ULCO(A2B),Pubkey(B))
optionally, in addition to the above, the audit information may further include a public key pubkey (a) of the first node a, or may further include context signature data obtained by the first node a signing context information of the current stage by using a private key, where the context information includes at least one of a timestamp, geographic address information, and network address information. The context signature data can be represented by Sig (loc, timestamp, ip), where loc is geographical address information, timestamp is timestamp, and ip is network address information.
In this example, only the audit information includes the signature data, and the signature data is obtained by signing the signature data stored by the first node a based on the private key of the first node a, and in another embodiment, the audit information may also include the stored data of the first node a, that is, the transaction information of the first node a in each link, so that the plurality of second nodes perform more intuitive verification by using the original data of the actual transaction.
5. And after receiving the audit information, the second nodes perform consensus, and when the consensus passes, the data stored by the first node A at this time is determined to be real and accurate.
The consensus process may refer to that each second node acquires target audit information sent after the production element and the first node a successfully transact based on a public key of each production element carried in the audit information, verifies the audit information of the first node based on the target audit information of each production element, if the audit information is consistent, the second node passes the audit information verification of the first node a, broadcasts a verification passing notification to other second nodes, and if the verification passing notification received by any second node meets the consensus passing condition, the consensus is determined to pass.
In some embodiments, the verifying the audit information of the first node based on the audit information of each production element may include: acquiring target audit information uploaded by the at least one target first node according to the audit information, wherein the target audit information refers to audit information uploaded by each target first node after transaction with the first node; and comparing the target audit information of the at least one target first node with the audit information, and determining that the audit information passes the verification when the comparison is consistent. Wherein, the obtaining of the target audit information uploaded by the at least one target first node according to the audit information comprises: acquiring a public key in at least one piece of signature data in the audit information; taking the first node corresponding to the acquired public key as the at least one target first node; and acquiring audit information of the at least one target first node, which contains the public key of the first node, according to the public key of the first node, and taking the audit information as target audit information of the at least one target first node.
For example, taking as an example a transaction between a first node a and a first node PL corresponding to a production element PL, for the first node a, the audit information includes: sig _ EX (PL2A), Sig _ CC (PL2A), and if the transaction is true and accurate, its audit information should include for the first node PL: sig _ EX (PL2A) and Sig _ CC (PL2A), through comparison, if the audit information is consistent, the transaction really exists and the transaction content is accurate, and when the audit information between the first node A and all the production elements is consistent through comparison in the same way, and after the audit information is confirmed to be consistent, the second node can determine that the verification is passed. For the example, only the audit information of a certain production element is compared, and actually, when the second node is verified, the audit information is verified according to each production element and the audit information uploaded by the upstream first node, and the specific process is the same as the example, and is not described herein again.
6. And after receiving the audit information, the second nodes perform consensus, and when the consensus fails, the data stored by the first node A at this time is determined to have problems.
Specifically, when the consensus fails, it is described that the data stored by the first node a does not match the real data, and there may be a case of data falsification or the like in the first node, so that the second node may record the data distortion event of the first node a for subsequent processing. When the occurrence frequency of the data distortion event meets a certain condition, the business entity corresponding to the first node can be marked as a loss business entity, or other processing is carried out, so that the functions of punishment and publicity are achieved.
It should be noted that each first node records relevant information of the transaction performed by the node, such as transaction parties, transaction amount, transaction location, transaction time, and the like, which is not described in detail in the embodiments of the present invention.
The production elements corresponding to the different links assumed to be involved in the production phase B may include: b.hp human resources, b.pl production line, b.pa packaging plant, b.ve transport vehicle, b.en power plant and b.wa water plant, with the first node of the dairy production stage denoted as first node B, there may be the following process:
1. the first node B transacts with the first node a, the obtained life cycle balance of the dairy product is ulco (B), for example, the validity period of the dairy product is 6 months, and the obtained carbon emission balance is ucxo (a).
2. In each link of raw milk production, the fees EX (b.hp), EX (b.pl), EX (b.pa), EX (b.ve), EX (b.en), and EX (b.wa) are paid to each production element, respectively, and after the transaction is successful, the first node B acquires the following signature data and stores it in the first node B:
the HP accepts B's transaction HASH signature Sig _ EX (HP2B), Sig _ CC (HP2B), HP's public key pubkey (HP);
the PL accepts B's transaction HASH signature Sig _ EX (PL2B), Sig _ CC (PL2B), PL's public key Pubkey (PL);
PA accepts B's transaction HASH signature Sig _ EX (PA2B), Sig _ CC (PA2B), PA's public key Pubkey (PA);
VE receives the transaction HASH signature Sig _ EX (VE2B), Sig _ CC (VE2B) of B, and the public key Pubkey (VE) of VE;
EN accepts B's transaction HASH signature Sig _ EX (EN2B), Sig _ CC (EN2B), EN's public key Pubkey (EN);
WA receives transaction HASH signature Sig _ EX (WA2B), Sig _ CC (WA2B) of B and public key Pubkey (WA) of WA;
after the transaction is successful, the carbon emission balance ucxo (b) -ucxo (a) -CC (b.hp) -CC (b.pl) -CC (b.pa) -CC (b.ve) -CC (b.en) -CC (b.wa) at this stage may also be obtained.
Wherein CC (b.hp) is carbon emission consumption for manpower in B-stage, CC (b.pl) is carbon emission consumption for production line in B-stage, CC (b.pa) is carbon emission consumption for packaging plant in B-stage, CC (b.ve) is carbon emission consumption for transportation vehicle in B-stage, CC (b.en) is carbon emission consumption for power plant in B-stage, and CC (b.wa) is carbon emission consumption for water plant in B-stage. The numerical relationship between the carbon emission consumption and the raw milk stage is the same, and will not be described herein. Optionally, ucxo (b) may be a carbon emission balance normalized to a single piece product.
Unused fund balance in dairy production stage utxo (b) ═ utxo (cap) -ex (b.hp) -ex (b.pl) -ex (b.pa) -ex (b.ve) -ex (b.en) -ex (b.wa);
wherein utxo (cap) is an unused transaction output of the dairy production plant, e.g. corresponding to an investment in the dairy plant.
3. The first node B transacts with the first node C and outputs ulco (B) to the first node C for transport by the b.ve transporter after production is complete, and accordingly the first node B records:
c accepts the trade HASH signature of the dairy product from B: sig _ ULCO (B2C), Sig _ EX (BtoC), Sig _ CC (BtoC) and the public key Pubkey (C) of C.
It should be noted that the first node B may make a transaction with the first node C at any time before the transportation, pay the manufacturer B by the e-commerce company C a money available transaction EX (D2B) for purchasing the dairy product, and store information related to the transaction.
4. The first node B obtains the audit information and broadcasts the audit information of the first node to a plurality of second nodes of the data storage system. For example, the audit information may include the following:
Sig((Sig_EX(HP2B),Sig_CC(HP2B),Pubkey(HP),
Sig_EX(PL2B),Sig_CC(PL2B),Pubkey(PL),
Sig_EX(PA2B),Sig_CC(PA2B),Pubkey(PA),
Sig_EX(VE2B),Sig_CC(VE2B),Pubkey(VE),
Sig_EX(EN2B),Sig_CC(EN2B),Pubkey(EN),
Sig_EX(WA2B),Sig_CC(WA2B),Pubkey(WA),
Sig_ULCO(B2C),Pubkey(C))
optionally, other information included in the audit information is the same as that in the previous stage, and is not described herein again. Similarly, the accounting process in the same manner as above may be performed for each stage of the dairy product, and is not described herein again.
ULCO (F) is the balance of the life cycle of the dairy product as it reaches the consumer via process stream D.
For dairy products it also comprises a final stage, namely the consumer G, for which there may also be a nominal index ucxo (ind) of the personal carbon emission residual, for example an amount allocated to the individual based on the global index of G20 for global carbon emissions. Furthermore, the dairy product package in the embodiment of the present invention may be marked with a two-dimensional code, etc., in the consumption stage G, a consumer may obtain uclo (f) of the dairy product by scanning the code, that is, the remaining validity period, and compare the uclo (f) with the shelf life of the dairy product, to determine whether the dairy product is expired. Of course, based on the difference of the data stored in the address corresponding to the two-dimensional code, the consumer may also obtain UCXO (f) corresponding to the consumer stage G, that is, the remaining carbon emission allowance UCXO of the dairy product, and when the consumer purchases a commodity with different remaining carbon emission allowances, the UCXO of the consumer is affected. In this stage, ucxo (ind) and ucxo (f) may be compared to determine whether the carbon consumption of the consumer exceeds the standard, so as to adjust the rated index of the carbon consumption surplus of the consumer based on whether the carbon consumption of the consumer exceeds the standard, for example, if the carbon consumption of the consumer does not exceed the standard within a preset time period, the rated index of the carbon consumption surplus of the consumer may be increased to achieve the purpose of rewarding.
For example, the consumer's own carbon emission margin is ucxo (ind) + (ucxo (g) -ucxo (ave)), where ucxo (ave) is a preset average margin, and when the consumer consumes the commodity carbon emission margin higher than the industry average level, the consumer's own carbon emission margin is increased; when the commercial carbon emission balance consumed by the consumer is below the average level in the industry, its own carbon emission balance is reduced.
Of course, the consumer stage G also involves storing data, and the specific principle is the same as the above process, which is not described herein again.
Fig. 7 is a schematic structural diagram of a data storage apparatus provided in an embodiment of the present invention, applied to a first node in a data storage system, and referring to fig. 7, the apparatus includes:
a first data acquiring module 701, configured to acquire first data of a target object;
a second data obtaining module 702, configured to obtain second data of the target object, where the first data and the second data are data with different dimensions;
a storage module 703, configured to store the first data and the second data of the target object into the first node.
In some embodiments, the first data for the object includes a life cycle margin of the object at a current stage, and the second data for the object includes transaction data for the object at the current stage.
In some embodiments, the life cycle margin of the target object at the current stage is a difference between the life cycle margin of the previous stage and the elapsed time of the current stage.
In some embodiments, the elapsed time of the current stage is set according to characteristics of the current stage.
In some embodiments, the transaction data of the object at the current stage includes transaction data of the object at various links of the current stage.
In some embodiments, the transaction data of the target object at the current stage further comprises signature data of the transaction data of the target object at each link of the current stage
In some embodiments, the first data for the target includes a resource consumption margin of the target at the current stage, and the second data for the target includes transaction data for the target at the current stage.
In some embodiments, the apparatus further comprises:
a third data acquisition module for acquiring third data of the target object, the third data being associated with the first data and the second data;
the storage module is further configured to store third data of the object into the first node when the first data and the second data of the object are stored into the first node.
In some embodiments, the third data of the object includes: the resource consumption allowance of the target object at the current stage.
In some embodiments, the resource consumption margin of the target in the current stage is a difference between the resource consumption margin of the previous stage and the resource consumption of the current stage.
In some embodiments, the resource consumption of the current stage is a sum of resource consumption of the target object at each link of the current stage.
In some embodiments, the resource consumption balance is a carbon emission balance.
In some embodiments, the apparatus further comprises:
an audit information acquisition module, configured to acquire audit information of the first node, where the audit information is used to indicate data stored in the first node;
a sending module, configured to broadcast audit information of the first node to a plurality of second nodes of the data storage system.
In some embodiments, the audit information comprises data stored by the first node; or, the audit information includes data stored by the first node in a preset time period.
In some embodiments, the audit information comprises a characteristic value of data stored by the first node; or, the audit information includes a characteristic value of data stored by the first node in a preset time period.
In some embodiments, the characteristic value is a hash value.
In some embodiments, the audit information comprises signature data signed by the first node using a private key of the first node to data stored by the first node.
In some embodiments, the audit information further includes a public key of the first node.
In some embodiments, the audit information further includes context signature data obtained by the first node signing context information of a current stage with a private key, where the context information includes at least one of a timestamp, geographical address information, and network address information.
In some embodiments, the storage module is configured to store the first data and the second data of the object in a resource pool of the first node; and when a consensus confirmation notice sent by any second node is received, storing the first data and the second data stored in the resource pool into a preset storage space of the first node.
In some embodiments, the storage module is configured to store the first data and the second data of the target object in the first node when receiving a consensus confirmation notification sent by any one of the second nodes.
In some embodiments, the apparatus further includes a comparison module configured to perform cross comparison based on the acquired data of the at least two dimensions; and when the comparison module determines that the acquired data of at least two dimensions are matched, triggering the storage module to execute a storage step.
In some embodiments, the apparatus further comprises:
and the bar code module is used for providing a bar code on a product produced at any stage, and the address pointed by the bar code is used for providing at least one of the latest first data, the latest second data and the latest third data of the target object.
In some embodiments, the barcode further provides network addresses of a plurality of second nodes, and the scanning terminal sends the scanned data to the plurality of second nodes for verification.
Fig. 8 is a schematic structural diagram of a data verification apparatus according to an embodiment of the present invention, which is applied to any second node of a data storage system, where a plurality of second nodes in the data storage system are configured with a consensus mechanism, and referring to fig. 8, the apparatus includes:
a receiving module 801, configured to receive audit information of a first node, where the audit information is used to indicate data stored in the first node;
a checking module 802, configured to check, based on target audit information of at least one target first node, the audit information;
a sending module 803, configured to broadcast a verification-passed notification in the data storage system when the verification is passed;
the checking module 802 is further configured to, when the received checking-passing notification meets a consensus passing condition, enable the audit information to pass the consensus.
In some embodiments, the sending module 802 is further configured to send a consensus confirmation notification to the first node when the audit information passes the consensus. The target audit information is used for indicating data stored by each target first node which conducts transaction with the first node.
In some embodiments, the verification module 802 is configured to:
and acquiring target audit information uploaded by the at least one target first node according to the audit information, comparing the target audit information of the at least one target first node with the audit information, and determining that the audit information passes verification when the target audit information of the at least one target first node is matched with the audit information.
In some embodiments, the verification module 802 is configured to: acquiring a public key in at least one piece of signature data in the audit information; taking the first node corresponding to the acquired public key as the at least one target first node; and acquiring the audit information of the first node corresponding to the public key as the target audit information of the at least one target first node according to the public key.
In some embodiments, the at least one target first node is a counterparty of the transaction indicated by the audit information.
In some embodiments, the at least one target first node comprises: and the node corresponding to each production element of the current stage and the node corresponding to the target object in the previous stage of the current stage.
In some embodiments, there is provided a data storage system comprising a plurality of first nodes and a plurality of second nodes, the plurality of second nodes in the data storage system being configured with a consensus mechanism,
each first node in the plurality of first nodes is used for acquiring first data of a target object; acquiring second data of the target object, wherein the first data and the second data are data with different dimensions; storing the first data and the second data of the target object into the first node, and acquiring audit information of the first node, wherein the audit information is used for indicating the data stored in the first node; broadcasting audit information for the first node to a plurality of second nodes of the data storage system;
each second node in the plurality of second nodes is used for receiving audit information of the first node, and the audit information is used for indicating data stored by the first node; verifying the audit information based on target audit information of at least one target first node; broadcasting a check-passing notification in the data storage system when the check passes; and when the received verification passing notice meets the consensus passing condition, the audit information passes the consensus.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
In an exemplary embodiment, a computer-readable storage medium, such as a memory, is also provided that includes instructions executable by a processor in a terminal to perform any of the methods of the above embodiments. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.