Industrial product traceability information storage method, traceability method and device based on blockchain
By building a mesh blockchain structure and state index tree in the industrial blockchain network, the problems of complex industrial product traceability process, large computing overhead and insufficient efficiency in the existing technology are solved, and efficient and secure product traceability management is achieved.
Patent Information
- Application Number
- CN202210232618.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-03-09
AI Technical Summary
In the prior art, the traceability process of industrial products is complex, the calculation overhead is large, and the traceability efficiency is insufficient.
Build a mesh blockchain structure in the industrial blockchain network, build a product circulation chain and user operation chain through product circulation sequence and user operation time sequence, form a blockchain subnet, and establish a state index tree at each node to quickly find product status.
It improves the security and efficiency of industrial product traceability, reduces data volume and calculation overhead, and realizes efficient tracking and management of the entire life cycle of the product.
Smart Images

Figure CN114612115B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data information storage management, and in particular to a blockchain-based industrial product traceability information storage method, a traceability method and a device. Background Art
[0002] In recent years, with the vigorous rise of a new round of global scientific and technological revolution and industrial transformation, the Industrial Internet has emerged and is promoting the intelligent transformation of the global industrial system. The identification resolution system is an important part of the Industrial Internet network architecture, and the intelligent product traceability based on the Industrial Internet is one of the typical application scenarios of identification resolution technology. Product traceability refers to the process of using identification technology to record and query product status, attributes, location and other information throughout the entire life cycle of a product from manufacturing, circulation, consumption to recycling. Its purpose is to record product information data in all aspects and promote the effective sharing of information between internal information systems of enterprises, between enterprises, and between enterprises and users.
[0003] In the prior art, the nodes participating in query scheduling can scan the resource utilization status of the running blockchain nodes and forward the query request to the nodes with low resource utilization. However, this solution increases the workload of the client. In addition to basic data submission and query, it also adds the function of blockchain system node supervision. Moreover, the client's calculation of the resource utilization of each node will increase with the increase of the blockchain scale, which is not suitable for large-scale blockchain systems. The MySQL database can also store each traceability record, and the blockchain account book stores the summary and signature of the traceability record. Since the complete record is mainly stored in MySQL, the blockchain is used to ensure the integrity of these data, so it can achieve more complex queries than the blockchain. However, in this solution, the blockchain only plays a role in ensuring data integrity, and the efficiency of blockchain traceability has not been effectively improved. Summary of the invention
[0004] In view of this, the embodiments of the present invention provide a blockchain-based industrial product traceability information storage method, traceability method and device to eliminate or improve one or more defects existing in the prior art, so as to solve the problems in the prior art that the traceability process is relatively complicated, the computational overhead is high and the traceability efficiency is insufficient.
[0005] The technical solution of the present invention is as follows:
[0006] On the one hand, the present invention provides a method for storing industrial product traceability information based on blockchain, the method running on an industrial blockchain network composed of multiple nodes, each node constructing a product circulation chain based on the product circulation sequence, and each node also constructing a user operation chain based on the operation time sequence to form a mesh blockchain; for the first type of nodes included in a single product circulation chain and the second type of nodes on the product circulation chain corresponding to all products on the user operation chain of each first type of node, the first type of nodes and the second type of nodes are connected as a blockchain sub-network, and the industrial blockchain network contains multiple blockchain sub-networks with crossed or non-crossed nodes; the method comprises:
[0007] Obtain the identity information of the member user who logs in to the current node, and verify the legitimacy of the member user based on the identity information;
[0008] Under the condition that the member user is legal, receiving the traceability information of the current product sent by the member user, the traceability information includes the traceability record, and the traceability record includes at least: data subject information recording the quantity, type and name of the current batch of products, proxy object information and operation behavior information;
[0009] According to the hash value of the current block generated by the traceability record, the traceability record, the hash value of the current block, all or a specified part of the hash value of the previous block in the current product circulation chain, and all or a specified part of the hash value of the previous block in the current user operation chain are packaged to form the current block;
[0010] Connect the current block to the corresponding product circulation chain and user operation chain and store it on the blockchain subnetwork related to the current product;
[0011] A status index tree is constructed for all products operated by the current node, which is used to record the latest status of each batch of different products processed by the current node and the location of the corresponding block.
[0012] In some embodiments, the identity information is a hash value obtained by hashing member information using a set algorithm, and the member information at least includes a member ID (Identity document) and functional information.
[0013] In some embodiments, the current node and the member user issue digital certificates and perform identity authentication based on a CA (Certification Authority) platform.
[0014] In some embodiments, the set algorithm is a SHA256 algorithm.
[0015] In some embodiments, the state index tree records the corresponding latest block positions of different batches of products step by step by constructing root nodes, branch nodes, extension nodes and leaf nodes; wherein the extension node will have a collection of products with the same product identification code prefix to reduce the height of the state index tree.
[0016] In some embodiments, the leaf node is a pointer to the latest status of the product in the blockchain.
[0017] On the other hand, the present invention also provides a blockchain-based industrial product traceability method, comprising:
[0018] Obtain the product identification code of the specified batch of products to be traced;
[0019] Based on the legal identity information of the member user, log in to the blockchain sub-network to which the specified batch of products to be traced belongs, wherein the blockchain sub-network is constructed according to the above-mentioned blockchain-based industrial product traceability information storage method;
[0020] According to the product identification code, query any node in the blockchain subnetwork according to the state index tree constructed according to the above-mentioned blockchain-based industrial product traceability information storage method, and query the complete product circulation chain corresponding to the specified batch of products to be traced according to the state index tree.
[0021] In some embodiments, the method further includes: directly querying the product circulation chain or user operation chain in the blockchain subnetwork according to the product identification code, and retrieving the block corresponding to the latest status of the specified batch of products to be traced.
[0022] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0023] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.
[0024] The beneficial effects of the present invention are at least:
[0025] In the blockchain-based industrial product traceability information storage method, traceability method and device of the present invention, a mesh blockchain structure including a product circulation chain and a user operation chain is constructed to record the circulation and operation information of different products in each batch, so as to improve security by utilizing the tamper-proof characteristics of the blockchain itself; at the same time, in the industrial blockchain network, the first-class nodes on the production chain of a product and the second-class nodes on the product circulation chain corresponding to all products on the user operation chain of each first-class node form a blockchain sub-network, and the blocks formed by the circulation and operation information of a certain product of a specified batch are only recorded on the blockchain sub-network related to it, so as to reduce the amount of data on the entire industrial blockchain network and reduce the computing overhead. At the same time, for each node of the industrial blockchain network, a state index tree is established to record the status update of the product processed by the current node, so as to facilitate users to quickly find all blocks of the specified batch of products.
[0026] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically pointed out in the written description, claims, and drawings.
[0027] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0029] Figure 1 This is a flowchart of a blockchain-based industrial product traceability information storage method according to an embodiment of the present invention;
[0030] Figure 2 This is a schematic diagram of a block structure constructed in a blockchain-based industrial product traceability information storage method according to an embodiment of the present invention;
[0031] Figure 3 A schematic diagram of a mesh-structured blockchain in a blockchain-based industrial product traceability information storage method according to an embodiment of the present invention;
[0032] Figure 4 This is a schematic diagram of the state index tree structure in the blockchain-based industrial product traceability information storage method according to an embodiment of the present invention;
[0033] Figure 5This is a flowchart of a blockchain-based industrial product traceability method according to an embodiment of the present invention;
[0034] Figure 6 Query time graph for chain-structured blockchain;
[0035] Figure 7 Query time graph for mesh-structured blockchain;
[0036] Figure 8 This is a comparison chart of the traceability delay of blockchains with pointer chain structures, blockchains without pointer chain structures, and blockchains with mesh structures. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0038] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0039] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0040] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0041] The demand for traceability in the industrial Internet has changed from simply checking product information to ensuring the safety, reliability and efficiency of product traceability. For traditional traceability technology, the product's own data and circulation data information are stored in a centralized database, and the data is at risk of being tampered with. In addition, the data recording process lacks supervision, and the authenticity and accuracy of the data are questionable. Due to the perfect match between the traceability chain and the chain storage structure of the blockchain, coupled with the encryption technology used by the blockchain itself, it is easy to realize a traceability system with anti-counterfeiting capabilities. There are two main types of existing blockchain-based traceability methods: one is to directly access a block and then access its parent block in sequence, and retrieve the required information by traversing; the other is to synchronize the data records in the blockchain to the local database, and use database query statements to realize the retrieval and tracing of blockchain data; but these two methods have great problems in terms of traceability efficiency and data security. Therefore, the present invention provides a technical solution for realizing the traceability of industrial Internet products based on blockchain technology.
[0042] Specifically, the present invention provides a blockchain-based industrial product traceability information storage method, which runs on an industrial blockchain network composed of multiple nodes. Each node constructs a product circulation chain based on the product circulation sequence, and each node also constructs a user operation chain based on the operation time sequence to form a mesh blockchain; for the first-class nodes contained in a single product circulation chain and the second-class nodes on the product circulation chain corresponding to all products on the user operation chain of each first-class node, the first-class nodes and the second-class nodes are connected to form a blockchain sub-network, and the industrial blockchain network contains multiple blockchain sub-networks with intersecting or non-intersecting nodes.
[0043] In the present invention, the industrial blockchain is composed of multiple nodes that are business-related or unrelated, and each node can be constructed by the producer, supplier or seller in the process of product production or circulation. Further, for a certain type of product, multiple nodes corresponding to the producer, supplier or seller can be pre-set in order during the production and circulation process, and the product data of a specified batch is continuously processed during the circulation of these nodes to generate new blocks that record the circulation information. At the same time, each node also constructs a user operation chain for the blocks corresponding to different batches and types of products processed by its own operation. When a product arrives at the producer, supplier or seller corresponding to a node for processing, the blocks it generates are recorded in the product circulation chain and the user operation chain at the same time. Specifically, each formed block is simultaneously connected to the previous block of the product circulation chain and the previous block of the user operation chain.
[0044] In this embodiment, the product circulation information recorded in the block becomes the traceability record, which includes the data body part recording the product type, name, quantity and the traceability identification technology adopted, the proxy object part recording the creator and operator of the product, and the behavior part recording the specific content of the operation behavior. Each block forms a unique hash value of the block as an identifier by hashing the traceability record. Each block records all or part of the hash value of a block on the product circulation chain and the user operation chain, which is used to indicate the connection relationship of the block in the blockchain.
[0045] Specifically, in the process of storing industrial product traceability information, the present invention Figure 1 As shown, the blockchain-based industrial product traceability information storage method includes steps S101 to S105:
[0046] Step S101: Obtain the identity information of the member user who logs in to the current node, and verify the legitimacy of the member user based on the identity information.
[0047] Step S102: Under the legal conditions of the member user, receive the traceability information of the current product sent by the member user, the traceability information includes the traceability record, and the traceability record includes at least: data subject information recording the quantity, type and name of the current batch of products, proxy object information and operation behavior information.
[0048] Step S103: According to the hash value of the current block generated by the traceability record, the traceability record, the hash value of the current block, all or a specified part of the hash value of the previous block in the current product circulation chain, and all or a specified part of the hash value of the previous block in the current user operation chain are packaged to form the current block.
[0049] Step S104: Connect the current block to the corresponding product circulation chain and user operation chain and store it on the blockchain subnetwork related to the current product.
[0050] Step S105: construct a status index tree for all products operated by the current node, which is used to record the latest status of each batch of different products processed by the current node and the location of the corresponding block.
[0051] In step S101, the feature of traditional blockchain that allows any node to join the blockchain network is not applicable to the scenario of industrial blockchain. The product generation and circulation information recorded in the industrial blockchain cannot be modified arbitrarily by unrelated entities. Therefore, in order to further improve the security in industrial application scenarios, the present invention requires the nodes or corresponding members connected to the industrial blockchain to register their identities to ensure that the traceability information of the product will not be uploaded and recorded arbitrarily.
[0052] In some embodiments, the identity information is a hash value obtained by hashing the member information using a set algorithm, and the member information includes at least the member ID and the function information, wherein the set algorithm is the SHA256 algorithm.
[0053] Specifically, the system uses the SHA256 algorithm to encrypt user information, and uses the encrypted hash value UH as the unique identity information. The encryption algorithm is shown in Formula 1.
[0054] UH=SHA256(UserInfo) (1)
[0055] In formula 1, UserInfo is member information, including member ID, function and other information.
[0056] In some embodiments, the current node and member users issue digital certificates and perform identity authentication based on the CA platform. Its main function is to bind the identity of the certificate holder and the relevant key pair (by issuing digital certificates for the public key and related user identity information), provide users with convenient ways to apply for certificates, cancel certificates, obtain certificates, and query certificate status, and use digital certificates and related services (certificate issuance, blacklist issuance, timestamp services, etc.) to achieve identity authentication, integrity, non-repudiation and confidentiality of each entity in the communication. The industrial Internet, that is, the industrial blockchain, needs to issue certificates based on PKI (Public Key Infrastructure) to legitimate network members according to its own certificate management components. When a new production line is about to be generated in the industrial Internet, a sub-certificate can be applied for from the root certificate. Members joining the production line need to register in the sub-certificate through their public keys, thereby ensuring that only authorized nodes have the opportunity to participate in the product circulation process and the security of the data transmission process.
[0057] Only after passing identity authentication are legal members allowed to access the industrial blockchain and process product flow and operation information.
[0058] In step S102, the legal member user generates corresponding blocks during the operation and circulation of the product. In this embodiment, the traceability information is marked at the granularity of a specific batch of specific products.
[0059] Since information will overlap between different production lines in the industrial Internet, in order to better realize the interaction of product information, the system needs to design a unified data structure that can be transmitted between systems. The present invention divides the traceability data record into three parts, namely the main part, the agent part and the behavior part. Among them, the main part of the data should describe the information of the traceability object, such as product type, name, quantity, and the traceability identification technology used; the agent part is the creator or operator of the data, that is, the various roles of the production line during the product circulation process, such as the producer, supplier, seller, etc.; behavior refers to the operation performed on the subject within a period of time, such as the classification and transfer of products. The traceability record TR is shown in Formula 2.
[0060] TR=(e,ag,ac) (2)
[0061] Among them, e represents data subject information, ag represents agent object information, and ac represents behavior information. This ensures that the data complies with open standards and helps promote interaction between different users in a standardized data exchange format.
[0062] In step S103, based on the data traceability record TR, a product information storage block can be generated, and its structure is as follows: Figure 2 shown. Figure 2 In the product information storage block, the Hash field represents the hash value of the block, which is obtained based on the TR hashing of the traceability record. Considering that each block only stores the data flow information of a single product in a specified batch, the block Hash can also be roughly regarded as the Hash corresponding to the single product in the specified batch. Therefore, there is no need to use the Merkle tree to verify data integrity, but only the hash value needs to be used as a unique identifier.
[0063] The Agent field in the traceability record TR records the role hash of the data subject that generated the information block, and the EntityMessage field records the product information, such as product type, name, quantity, and the traceability identification technology used. The Active field records the subject's operations, such as product classification and transfer. In addition, two reference fields for hash values, UHash and PHash, are designed in the block. UHash refers to the previous block produced by the current node, that is, the previous block on the user operation chain of the current node, and the node associated with the reference has the same agent. PHash refers to the hash of the block generated by the first-level node on the production line where the product is located, that is, the previous block in the production chain of the product, and has the same entity as the node associated with the reference.
[0064] In step S104, the block generated by the current node in step S103 is packaged and stored on the chain. It should be emphasized here that the present application is different from the traditional blockchain. The blocks generated by each node in the present application are not stored in the entire industrial blockchain, but are stored in the blockchain subnetwork related to the corresponding product. The blockchain subnetwork here, as described above, includes the nodes preset or introduced by the product circulation chain being processed by the current node, and also includes the nodes on the product circulation chain corresponding to all products processed by each node on the user operation chain. Exemplarily, for a product with data subject information P2, it is circulated and processed along nodes C0, C1, C2 and C3, so nodes C0, C1, C2 and C3 are the first type of nodes corresponding to the product. And further, nodes C1 and C3 have operations on products with data subject information P1 upstream of their user operation chains, so the nodes on the product circulation chain corresponding to P1 are used as the second type of nodes, and the first type of nodes and the second type of nodes together constitute the blockchain subnetwork, and the blocks generated by the circulation of products with data subject information P1 are stored in the blockchain subnetwork. The mesh blockchain relationship formed by the product with data subject information P1 is as follows Figure 3 As shown, each row corresponds to the product circulation chain of a product, and each column corresponds to the user operation chain of a node, which are connected based on the reference fields UHash and PHash.
[0065] Compared with the chain-like blockchain structure that is purely based on time sequence, the novel mesh blockchain structure proposed in this invention can be associated not only according to the product circulation sequence, but also according to the user's operation time sequence. The storage of data in the blockchain can be abstracted as a directed acyclic graph. Considering that the speed of product information generation in the industrial blockchain scenario is much lower than that in the transaction scenario, Figure 3 Each block in the graph only stores the circulation information of a single product. The edges in the graph are composed of reference relationships between product information. Each node exists on two chains at the same time, namely the product circulation chain and the user operation chain. Among them, the order of nodes in the product circulation chain is determined by the circulation order of the product on the production line, as shown in the solid line part in the figure. In most cases, the chain can be regarded as starting from the product manufacturer, passing through the supplier, seller and other roles and finally reaching the user's hands. The nodes in the agent operation chain are sorted according to the time sequence of the agent processing different products, as shown in the dotted line part in the figure. Taking the manufacturer as an example, it may need to manufacture multiple products or multiple batches of the same product. Therefore, it is also very necessary to establish a reference relationship between nodes with the agent as the clue.
[0066] By referencing each other, nodes form a mesh structure that is interconnected and difficult to tamper with. Product circulation data can be abstracted as a search for a specified edge in the graph. Compared with the traditional blockchain traceability process, which requires traversing all nodes, the mesh structure can directly find the edge corresponding to the corresponding product production chain through reference due to the existence of product clues. For agents, they can also quickly find their operations on different products through user clues, reducing access to irrelevant nodes and improving the efficiency and speed of queries. In addition, since all information data related to a product is stored and only stored on the chain where the member nodes related to it are located, it can effectively protect product information from being overly exposed, and at the same time effectively reduce redundant data in the system.
[0067] In step S105, each node constructs a state index tree to record the latest status of different batches of different products processed by the current node and the location of the corresponding blocks. The state index tree records the latest block locations of different batches of products step by step by constructing root nodes, branch nodes, extension nodes and leaf nodes; wherein the extension node sets products with the same product identification code prefix to reduce the height of the state index tree. In some embodiments, the leaf node stores a pointer to the latest status of the product in the blockchain.
[0068] Specifically, the present invention proposes a new data structure, the state index tree, which maintains the latest state of assets in real time and reduces the time cost of updating the asset state. Figure 4As shown in the figure, the upper part of this structure diagram is the coding index tree for the product information stored by the current node role. The state index tree is a model expanded on the basis of the prefix tree, which mainly includes four types of nodes, namely the root node (root), branch node (Branch Node), extension node (Extension Node) and leaf node (Leaf Node). Among them, the extension node will have a collection of products with the same PID code (product identification code) prefix, which will reduce the height of the state index tree in the future; the PID of the product is the path hash value from the root node to the leaf node, which is conducive to quickly verifying whether the transaction exists or not. The leaf node in the lower part of the state index tree records a pointer to the latest status of the product in the blockchain.
[0069] The state index tree mainly includes three types of operations, namely update, retrieval, and insertion. When a new production line is generated, the state index tree maintained by the participating nodes will generate a new index path from the root node to the leaf node based on the PID of the product. Exemplarily, for a node, an index path from the root node to the leaf node is constructed for the PID of the specified batch and specified type of products processed by it, wherein the state index tree updates the latest status of the specified batch and specified type of products by continuously extending branch nodes, and introduces product information of different batches or types by constructing extension nodes. Connect the leaf node under the last branch node, and record the pointer of the latest status to point to the location of the corresponding block in the blockchain.
[0070] On the other hand, the present invention also provides a blockchain-based industrial product traceability method, such as Figure 5 As shown, steps S201 to S203 are included:
[0071] Step S201: Obtain the product identification code of a specified batch of products to be traced.
[0072] Step S202: Log in to the blockchain sub-network to which the specified batch of products to be traced belongs based on the member user's legal identity information. The blockchain sub-network is constructed according to the blockchain-based industrial product traceability information storage method described in steps S101 to S105 above.
[0073] Step S203: query any node in the blockchain subnetwork according to the product identification code, and construct a state index tree according to the blockchain-based industrial product traceability information storage method described in S101 to S105 above, and query the complete product circulation chain corresponding to the specified batch of products to be traced according to the state index tree.
[0074] In steps S201 to S203, the authenticated member user logs in to the industrial blockchain network, retrieves the blockchain sub-network corresponding to the product to be queried, and finds the complete product circulation chain corresponding to the specified batch of products to be traced by querying the status index tree.
[0075] In some embodiments, the method further includes step S204: directly querying the product circulation chain or user operation chain in the blockchain subnetwork according to the product identification code, and retrieving the block corresponding to the latest status of the specified batch of products to be traced.
[0076] When users need to trace the product, the state index tree is first responsible for helping users locate the block where the latest status of the product is located in the blockchain according to the product PID. Parse the corresponding product information in the block to achieve traceability of the previous link of the product. Follow the same method to trace forward in sequence, and eventually you can get a traceability chain of product circulation information. By achieving efficient tracking and management of the entire life cycle of the product, and achieving efficient tracking and management of the life cycle of digital assets, the security of product data, the authenticity and credibility of data information are greatly improved. The combination of mesh blockchain and state index tree provides a basic guarantee for the efficiency of product traceability.
[0077] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0078] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.
[0079] Further, it should be clarified that in the blockchain-based industrial product traceability information storage method, traceability method and device described in the present invention, each node stores all the data of the products involved in the circulation, and the information data of each product is only stored in the node related to it. If a node is the latest node in the circulation process of a product, then the node can be called the current manager of the product. It is stipulated that if and only if a node is the manager of a product, the node has the authority to update the product information. Every time product information data is generated, the manager node will synchronize the product circulation information along the production line to the upstream node. The node that receives the product circulation information first needs to verify the legitimacy of its identity and data integrity locally according to the manager's public key. After the verification is passed, the data is stored in the local blockchain, and the information continues to be transmitted upward. In order to ensure the integrity and correctness of the data transmission process, the product circulation information needs to be verified by the manager's public key before it can be uploaded to the chain. When the product needs to enter the next link, that is, the manager is about to change, the new manager needs to apply for registration with the original manager. After receiving the new manager's request, the original manager will use the certificate to verify the legitimacy of the applicant's public key locally. After verification, the administrator will submit the finalized new administrator public key to the upstream node for subsequent identity verification, and send a successful registration instruction to the applicant. After the registration is passed, the control of the product is transferred, and the right to enter information is also transferred.
[0080] In the industrial Internet traceability system, the main purpose of introducing blockchain for product flow data storage is to prevent product flow data from being easily fabricated and tampered with. Fabricating product flow information refers to submitting product flow data to other nodes without product control rights, that is, when the operating node is not the manager. Since each node stores all the flow information records of the products processed by the node and the public key information of the latest manager. Therefore, the verification node can obtain the only controller of the current product by querying the product record. When the pseudo-manager node without control enters information and synchronizes it with the upstream node, it cannot make the node reach a consensus and is rejected. In addition, since each node locally stores the public key backup assigned by the other roles at the beginning of participating in the production line, it can prevent the risk of the public key being replaced by an illegal node during the transmission process, thereby further ensuring the security and legitimacy of the role. As for tampering with product data, since the product information block contains a hash value field, the generation process of the hash value is irreversible. When a user attempts to modify the product information in the product information block, if the hash value is not regenerated, the hash value will not match the specific information, resulting in the invalidation of the modified data. If a node regenerates a hash value before consensus, the upstream node will determine that the data is abnormal based on the hash value, resulting in consensus failure; if a node regenerates a hash value after consensus, other information blocks in the system that reference the information block will become invalid. For a production line, since all blocks are referenced in chronological order, tampering with one block will affect all blocks generated by the node later, and it is easier to detect and locate.
[0081] The present invention mainly introduces an efficient traceability mechanism of a mesh blockchain based on a state index tree, which ensures the legitimacy of participating users and the security of the product circulation process through the blockchain's own encryption technology and PKI certificates. In addition, the use of a mesh blockchain can ensure that all information data related to a product is stored and only stored on the chain where the member nodes related to it are located, which can effectively protect product information from being over-exposed and effectively reduce redundant data in the system. The state index tree can help users locate the block where the latest status of the product in the blockchain is located according to the product PID, and parse the corresponding product information in the block, so as to achieve tracing of the previous link of the product. Finally, through the combination of the mesh blockchain and the state index tree, the efficiency of product traceability is guaranteed.
[0082] Considering the security of user information in the design process of the traceability system, the present invention uses the SHA256 algorithm to encrypt user information and uses the hash value as the user's unique identifier. In addition, the Industrial Internet needs to issue PKI-based certificates to legitimate network members based on its own certificate management components, thereby ensuring that only authorized nodes have the opportunity to participate in the product circulation process, thereby ensuring the security of the data transmission process.
[0083] Considering that the speed of product information generation in the context of industrial Internet is much lower than that in the transaction scenario of traditional blockchain, the present invention proposes a new mesh blockchain structure. The blockchain nodes in this structure can be associated according to the product circulation order or the user's operation time order.
[0084] In view of the time-consuming query of the latest status of products in the traceability process, the present invention proposes a new data structure based on prefix tree expansion, namely, status index tree, which can maintain the latest status of products in real time and reduce the time cost of updating product status.
[0085] Through experimental analysis of the query response delay of chain structure and mesh structure blockchain, the system compares the query efficiency of the two blockchain structures under different numbers of product records, initiates 100 query requests for nodes under different blockchain structures and different numbers of records, calculates the average query delay, and the query time of the chain structure is shown in Figure 6, and the query time of the mesh structure adopted by the present invention is shown in Figure 7. The results show that the efficiency of product information query of the mesh structure blockchain is significantly better than that of the chain structure, and as the number of product information records increases, the query time of the chain structure gradually increases, while the mesh structure tends to be flat, that is, the latter can better adapt to the scene with large data volume.
[0086] Through experimental analysis of the product traceability delay of chain structure and mesh structure blockchain, the state index tree is introduced for both chain structure and mesh structure blockchain in the process of product traceability delay. In addition, under the chain structure, it can be specifically subdivided into the traditional blockchain data structure and the blockchain data structure with the introduction of forward pointers. The product traceability delay is the average time required for all product information traceability. As shown in Figure 8, through the comparison of the three traceability data structures, it can be found that the traceability efficiency of the mesh blockchain improved by the state index tree is much higher than that of other traceability structures, and the traceability time of the chain structure without pointer, the chain structure with pointer and the mesh structure is less sensitive to the amount of blockchain data.
[0087] In summary, the blockchain-based industrial product traceability information storage method, traceability method and device of the present invention construct a mesh blockchain structure including a product circulation chain and a user operation chain, record the circulation and operation information of different products in each batch, and improve security by utilizing the tamper-proof characteristics of the blockchain itself; at the same time, in the industrial blockchain network, the first-class nodes on the production chain of a product and the second-class nodes on the product circulation chain corresponding to all products on the user operation chain of each first-class node form a blockchain sub-network, and the blocks formed by the circulation and operation information of a certain product of a specified batch are only recorded on the blockchain sub-network related to it, so as to reduce the amount of data on the entire industrial blockchain network and reduce the computing overhead. At the same time, for each node of the industrial blockchain network, a state index tree is established to record the status update of the product processed by the current node, so as to facilitate users to quickly find all blocks of the specified batch of products.
[0088] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted on a transmission medium or a communication link via a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, and the like. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0089] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0090] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or replace features of other embodiments.
[0091] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A blockchain-based industrial product traceability information storage method. It is characterized in that The method is run on an industrial blockchain network consisting of multiple nodes, each node constructs a product circulation chain based on the product circulation sequence, and each node also constructs a user operation chain based on the operation time sequence, forming a mesh blockchain; For the first-type nodes included in a single product circulation chain and the second-type nodes on the product circulation chain corresponding to all products on the user operation chain of each first-type node, the first-type nodes and the second-type nodes are connected to form a blockchain sub-network, and the industrial blockchain network contains multiple blockchain sub-networks with or without nodes crossing; the method includes: Obtain the identity information of the member user who logs in to the current node, and verify the legitimacy of the member user based on the identity information; Under the condition that the member user is legal, receiving the traceability information of the current product sent by the member user, the traceability information includes the traceability record, and the traceability record includes at least: data subject information recording the quantity, type and name of the current batch of products, proxy object information and operation behavior information; According to the hash value of the current block generated by the traceability record, the traceability record, the hash value of the current block, all or a specified part of the hash value of the previous block in the current product circulation chain, and all or a specified part of the hash value of the previous block in the current user operation chain are packaged to form the current block; Connect the current block to the corresponding product circulation chain and user operation chain and store it on the blockchain subnetwork related to the current product; A state index tree is constructed for all products operated by the current node, which is used to record the latest status of each batch of different products processed by the current node and the location of the corresponding blocks; the state index tree records the corresponding latest block locations of different batches of products step by step by constructing root nodes, branch nodes, extension nodes and leaf nodes; wherein the extension node is a collection of products with the same product identification code prefix to reduce the height of the state index tree; the leaf node is a pointer to the latest status of the product in the blockchain.
2. According to the blockchain-based industrial product traceability information storage method of claim 1, It is characterized in that The identity identification information is a hash value obtained by hashing the member information using a set algorithm, and the member information at least includes a member ID and function information.
3. According to the blockchain-based industrial product traceability information storage method of claim 1, It is characterized in that The current node and the member user issue digital certificates and perform identity authentication based on the CA platform.
4. According to the blockchain-based industrial product traceability information storage method of claim 2, It is characterized in that The setting algorithm is the SHA256 algorithm.
5. A blockchain-based industrial product traceability method, It is characterized in that include: Obtain the product identification code of the specified batch of products to be traced; Based on the legal identity information of the member user, log in to the blockchain sub-network to which the specified batch of products to be traced belongs, wherein the blockchain sub-network is constructed according to the blockchain-based industrial product traceability information storage method according to any one of claims 1 to 4; According to the product identification code, query any node in the blockchain subnetwork according to the state index tree constructed by the blockchain-based industrial product traceability information storage method according to any one of claims 1 to 4, and query the complete product circulation chain corresponding to the specified batch of products to be traced according to the state index tree.
6. According to the blockchain-based industrial product traceability method of claim 5, It is characterized in that The method further comprises: According to the product identification code, the product circulation chain or user operation chain is directly queried in the blockchain sub-network to retrieve the block corresponding to the latest status of the specified batch of products to be traced.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Blockchain, generating method thereof and equipment
CN107729471A