CN115330400A - Block chain tracing method, device, system, computing equipment and storage medium - Google Patents

Block chain tracing method, device, system, computing equipment and storage medium Download PDF

Info

Publication number
CN115330400A
CN115330400A CN202110455612.XA CN202110455612A CN115330400A CN 115330400 A CN115330400 A CN 115330400A CN 202110455612 A CN202110455612 A CN 202110455612A CN 115330400 A CN115330400 A CN 115330400A
Authority
CN
China
Prior art keywords
tracing
chain
information
traceability
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110455612.XA
Other languages
Chinese (zh)
Inventor
郎晓夫
李丽颖
井长青
谭敏
代翔
杨鹏
赵雯静
梁清梅
张高山
詹义
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Group Design Institute Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Design Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Group Design Institute Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202110455612.XA priority Critical patent/CN115330400A/en
Publication of CN115330400A publication Critical patent/CN115330400A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • G06Q30/0185Product, service or business identity fraud
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The invention discloses a block chain tracing method, a block chain tracing device, a block chain tracing system, a computing device and a storage medium, wherein the block chain tracing method comprises the following steps: selecting a tracing target from a pre-constructed tracing directory chain, and generating a cross-chain tracing request carrying a target tracing code of the tracing target; the source tracing directory chain comprises source tracing codes of the product and source tracing codes of materials at all levels in the product; each tracing code is associated with a corresponding tracing chain; initiating a cross-chain tracing request to a target tracing chain corresponding to the target tracing code, and performing identity authority authentication by using an identity authority authentication chain; and after the identity authority authentication is passed, obtaining the tracing information in the target tracing chain. The method realizes the source tracing code mapping and cross-chain information interaction between the source tracing directory chain and the source tracing chain, achieves end-to-end accurate source tracing, and solves the technical problems that the product and materials at all levels cannot be traced in the prior art, and participants at all levels in the product circulation link cannot acquire credible source tracing information.

Description

Block chain tracing method, device, system, computing equipment and storage medium
Technical Field
The invention relates to the technical field of communication, in particular to a method, a device, a system, a computing device and a storage medium for tracing a block chain.
Background
The blockchain technique is a completely new distributed infrastructure and computing paradigm for authenticating and storing data using blockchain data structures, generating and updating data using distributed consensus algorithms, securing data transmission and access using cryptography, and programming and manipulating data using intelligent contracts composed of automated script code. In the block chain system, transaction data generated by each participating main body can be packaged into a data block, the data blocks are sequentially arranged according to a time sequence to form a chain of the data blocks, and each participating main body has the same data chain and has the characteristics of information falsification prevention, data counterfeiting prevention, data traceability and the like. With the emergence of alliance chain technology, the block chain technology is gradually applied to product traceability anti-counterfeiting application.
Most of the prior art mainly focuses on anti-counterfeiting traceability application based on product granularity, and is difficult to meet the requirement of manufacturers in the manufacturing industry for structural traceability of middle parts and raw materials in products with complex BOM (Bill of Material) systems. In actual production operation, each process link has a related service code, and the problem of connection and association with the related service code is not involved in the prior art, so that the actual process operation of multiple subjects in reality is difficult to match.
BOM information is a file that describes the structure of a product in a data format, usually presented in a structure tree, and is a data file of the product structure that can be recognized by a computer, and is also a dominant file of an ERP (Enterprise Resource Planning) system. In the prior art, the application of tracing by combining the BOM structure and the block chain technology is less, so that the authenticity and reliability of the information cannot be guaranteed during uploading and updating, meanwhile, the prior art does not relate to precise tracing to a supplier level based on the BOM, only depends on the centralized information of a production enterprise, and participants and consumers in all links of the downstream are difficult to obtain credible terminal tracing information.
Disclosure of Invention
In view of the above, the present invention has been developed to provide a blockchain tracing method, apparatus, system, computing device and storage medium that overcome or at least partially address the above-mentioned problems.
According to an aspect of the present invention, there is provided a method for tracing a blockchain, including:
selecting a tracing target from a pre-constructed tracing directory chain, and generating a cross-chain tracing request carrying a target tracing code of the tracing target; the source tracing directory chain comprises source tracing codes of products and source tracing codes of materials at all levels in the products; each tracing code is associated with a corresponding tracing chain;
initiating the cross-chain tracing request to a target tracing chain corresponding to the target tracing code, and performing identity authority authentication by using an identity authority authentication chain;
and after the identity authority authentication is passed, obtaining the tracing information in the target tracing chain by using an intelligent contract.
According to another aspect of the present invention, there is provided a blockchain tracing apparatus, including:
the request generation module is used for selecting a tracing target from a pre-constructed tracing directory chain and generating a cross-chain tracing request carrying a target tracing code of the tracing target; the source tracing directory chain comprises source tracing codes of products and source tracing codes of materials at all levels in the products; each tracing code is associated with a corresponding tracing chain;
the source tracing initiating module is used for initiating the cross-chain source tracing request to a target source tracing chain corresponding to the target source tracing code and performing identity authority authentication by using an identity authority authentication chain;
and the source tracing module is used for acquiring the source tracing information in the target source tracing chain by using an intelligent contract after the identity authority authentication is passed.
According to another aspect of the present invention, a block chain tracing system is provided, which includes the block chain tracing apparatus; and the number of the first and second groups,
the block chain applies a bottom layer environment and is used for enabling the user to be added into the alliance chain after obtaining the authorization;
the public node resource pool module is used for constructing a public node resource pool and dividing each public node into a plurality of accounting nodes;
and the unified service gateway module is used for interacting with the intelligent contract deployed on the public node through the unified service gateway and sharing data between the traceability directory chain and the traceability chain.
According to yet another aspect of the present invention, there is provided a computing device comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface are communicated with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the block chain tracing method.
According to still another aspect of the present invention, a computer storage medium is provided, where at least one executable instruction is stored, and the executable instruction causes a processor to perform operations corresponding to the above-mentioned blockchain tracing method.
According to the block chain traceability method, device, system, computing equipment and storage medium, a traceability target is selected from a pre-constructed traceability directory chain, and a cross-chain traceability request carrying a target traceability code of the traceability target is generated; the source tracing directory chain comprises source tracing codes of products and source tracing codes of materials at all levels in the products; each tracing code is associated with a corresponding tracing chain; initiating a cross-chain tracing request to a target tracing chain corresponding to the target tracing code, and performing identity authority authentication by using an identity authority authentication chain; and after the identity authority authentication is passed, obtaining the tracing information in the target tracing chain by using the intelligent contract. The method and the device realize accurate association of the product and all levels of materials in the product based on the traceability directory chain, and initiate a cross-chain traceability request on the traceability chain through the traceability codes of the product and the traceability codes of all levels of materials in the product.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 shows a flowchart of a method for tracing a blockchain according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a correspondence relationship between a traceability directory chain and BOM information provided in an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a tracing chain building flow provided by an embodiment of the present invention;
fig. 4 is a schematic structural diagram illustrating a blockchain tracing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram illustrating a blockchain traceability system according to an embodiment of the present invention;
fig. 6 shows a schematic structural diagram of a computing device provided by an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 is a flowchart illustrating an embodiment of a blockchain tracing method according to the present invention, as shown in fig. 1, the method includes the following steps:
step S110: determining materials of all levels of the product according to the bill of materials information of the product in the enterprise management system, and constructing a tree structure according to the materials of all levels of the product.
BOM information (namely bill of material information) of the product is stored in the ERP system, materials of all levels of the product are determined according to the BOM information of the product in the ERP system, and a tree structure is constructed according to the materials of all levels of the product; the materials of each level of the product may include the finished product itself, an intermediate component or a raw material of the produced product, and the like, and in this embodiment, the finished product itself is collectively referred to as the product; the intermediate parts or raw materials for producing the product are collectively referred to as materials.
Step S120: and setting traceability codes for the product and materials at all levels in the product according to a preset coding rule to obtain a traceability directory chain, and storing the traceability codes in a shared account book.
Fig. 2 is a schematic diagram of a correspondence relationship between a traceability directory chain and BOM information provided in this embodiment, as shown in fig. 2, a production manufacturer constructs a tree structure of the traceability directory chain according to the BOM information, and each level of material of the product corresponds to a unique traceability code as an information index tag according to a preset coding rule. The source code is stored in the shared account in a block manner and agrees with suppliers at different levels, wherein the suppliers at different levels comprise raw material suppliers, secondary suppliers, primary suppliers and the like. Specifically, the traceability codes are generated according to production index information or traceability index information, BOM structure tree information and the like, wherein if the material is produced autonomously, the production index information points to necessary traceability information such as process and quality conditions related to the product or the material in the production and manufacturing process; if the material is introduced for replacement work or purchasing source searching, the source tracing index information points to secondary source tracing information of the material from purchasing, production to delivery by a supplier; the BOM structure tree information points to the material structure information of the product. Every level product and material all have a unique code of tracing to the source to correspond as long as relate to purchase and delivery.
In this step, in order to accurately obtain the key information of each material in the ERP system, the traceability directory chain is directly associated with the BOM information in the ERP, so that the ERP system and the traceability directory chain are ensured to perform information interaction according to a unique mapping relationship. As shown in fig. 2, in order to ensure the accuracy of tracing and the uniqueness of information, in the tree structure of the tracing directory chain, each intermediate component is taken as a starting point, and the formed tree subdirectories all include a complete end-to-end tracing structure; on the contrary, the secondary tree subdirectories satisfying the traceable directory chain definition can be added into the upper level directory chain in a BOM structure mapping mode. The tracing directory chain is stored in the alliance chain of the tracing source block chain environment in a block chain mode, a product-specific tracing directory chain corresponding to any complex product can be established in the tracing directory chain, the tracing directory chain contains the tracing chain index information of materials at all levels of the product, and the tracing accuracy and the information uniqueness are guaranteed.
In order to conveniently call the material information of each level of the traceability directory chain, an intelligent contract automatically indexed by the traceability directory chain is established, the read and write permissions of suppliers of each level are set, and the identity authentication information and the permission information of the suppliers of each level are stored in the identity permission authentication chain. After the identity information and the authority information are authenticated by the identity authority authentication chain, the tracing directory chain information in the authority of each supplier is read, the intermediate part or the raw material provided by each supplier is directly used as a tracing information index label of the material according to the read tracing code, and a direct tracing relation is established with the final product. When a user needs to retrieve material traceability information of other traceability chains associated with the user, the user can point to the corresponding traceability codes through the automatic index intelligent contract and realize data calling through the traceability chains, so that the end-to-end traceability chain of the relation from the material structure to the supply chain circulation of the product, the intermediate component and the raw material is established.
Step S130: for each tracing code in the tracing directory chain, each business flow sub-link end transmits tracing information of a product or material corresponding to the tracing code in each business flow sub-link to a block chain, and a tracing chain corresponding to the tracing code is constructed.
In this embodiment, the product is mainly subjected to business flow sublinks such as flow processing, warehouse logistics, channel sales, after-sales service and recycling from production completion to business circulation, and each business flow sublink is usually operated by a different business entity, so that differentiated business flow codes (such as flow processing codes, logistics material codes, sales codes, recycling codes and the like) are generated in different business flow sublinks, the business flow codes are core data of a business system, and full-flow tracing of the whole business flow can be realized based on the business flow codes.
In an optional manner, the service flow link includes n service flow sub-link ends, where n > 1; step S130 further includes: each service flow sub-link inputs the tracing codes of the products or materials in the corresponding service flow sub-link, and identity authority authentication is carried out by using the identity authority authentication chain; after the identity authority authentication is passed, reading and verifying the traceability information of the last block, after the authentication is passed, inputting the service flow code of the service flow sub-link end, uploading the Hash value of the traceability information in the service flow sub-link and the service flow code to a block chain to generate a new block, encrypting to obtain Hash encryption information of the new block, and updating the connection of the traceability codes to the Hash encryption information of the new block; the 1 st service flow sublink encrypts a Hash value and a service flow code of the tracing information in the corresponding service flow sublink to obtain Hash encryption information of a new block, the t th service flow sublink encrypts the Hash value, the service flow code and the Hash encryption information of the previous block of the tracing information in the corresponding service flow sublink to obtain the Hash encryption information of the new block, wherein t is more than 1 and less than or equal to n.
In an optional manner, before uploading the Hash value of the tracing information in the traffic flow sublink and the traffic flow code to the blockchain to generate a new block, the method further includes: and calling the tracing information corresponding to the business process code from the business information system by using an intelligent contract as the tracing information in the business flow sublink, and calculating the Hash value of the tracing information in the business flow sublink.
Based on the steps, unique traceability labels, namely traceability codes, are respectively given to products and materials of each level of the products and correspond to the minimum packages of the products or the materials one by one, so that the traceability codes can be used as inlets of traceability chains, key traceability information of each business flow sub-chain is bound with the business flow codes, the traceability chains are put on, and therefore the accurate corresponding relation between the traceability codes and the traceability chains, the business flow sub-chains and the business flow codes is established, and the bidirectional butt joint of the traceability information of the products or the materials of each participant (including suppliers or sellers and the like) and a business information system and an operation flow of the participant is realized.
Specifically, the service circulation link includes n service circulation sub-link ends, and the service circulation link corresponds to a product circulation link, so that a participant in any link of product circulation inputs traceability codes of products or materials through the corresponding service circulation sub-link ends in a scanning mode and the like, the participant is authenticated by an identity authority authentication chain, after the identity authority authentication is passed, traceability information of a last block is read and verified, a user scans or inputs the service flow codes of the link after the verification is passed, traceability information and transaction information corresponding to the traceability information are obtained from a service information system, hash values of the traceability information and the transaction information are automatically calculated, the Hash values and the service flow codes are uploaded and encrypted to generate a new block, and after the block is generated, the connection of the traceability codes updates encryption information (namely Hash encryption information of the new block) pointing to the new block, thereby completing the uplink of the traceability information of the link.
Fig. 3 shows a schematic view of a tracing chain construction process provided in an embodiment of the present invention, as shown in fig. 3, a business flow link includes n business flow sub-link ends, for example, a production manufacturing sub-link end, a processing flow sub-link end, a logistics transportation sub-link end, a channel selling sub-link end, and an after-sale recycling sub-link end; the corresponding business process code may include: product order code, processing code, logistics material code, product sale code, recovery code and the like. Taking a product or a material in a channel sale sub-link as an example, a channel dealer scans a traceability code of the product or the material through a channel sale sub-link end, utilizes an identity authority authentication chain to authenticate the identity authority of the channel dealer, reads and verifies traceability information of a last block (corresponding to a last sub-link sold by a channel-logistics transportation) after the verification is passed, compares and verifies the traceability information by a Hash value (Hash), the channel dealer records a business process code of the sale business sub-link end by scanning the product sale code, automatically calculates the Hash value of the traceability information of the corresponding channel sale sub-link by an intelligent contract, uploads the Hash value of the traceability information in the channel sale sub-link and the business process code (product sale code) to a block chain to generate a new block, encrypts the Hash value of the traceability information in the channel sale sub-link, the business process code and the Hash encryption information of the last block to obtain Hash encryption information of the new block, and points the connection update of the traceability code to the new Hash information and the encryption information of the Hash information of the product or the traceability information and the material. In specific application, according to a service flow code of any service flow sublink, tracing information corresponding to the service flow code is automatically called from a service information system through an intelligent contract to carry out Hash calculation to obtain a Hash value, the Hash value of the tracing information of the service flow sublink corresponding to the mth block obtained through the asymmetric key is compared with the Hash value of the tracing information stored in the block for verification, and the tracing information is proved to be accurate after the verification is passed.
For example, as shown in fig. 3, taking a sales channel link as an example, a channel dealer scans a traceability code at the sales channel sublink to point to a block 3 generated by a logistics transportation sublink, after the channel dealer passes identity authority authentication through an identity authority authentication chain, the channel dealer reads the block 3 by using an asymmetric key (public key) to obtain a business process code of the logistics transportation sublink, hash3 of the traceability information 3, and Hash encryption information of the block 2, meanwhile, the business process code automatically maps the traceability information 3 and recalculates Hash, the Hash is compared with the Hash3 to verify the traceability information and transaction information of the logistics transportation sublink, and similarly, the block 2 and the block 1 are read and verified by the method, so that full-process traceability information from production to the logistics transportation link is obtained.
Step S140: and selecting a tracing target from a pre-constructed tracing directory chain, and generating a cross-chain tracing request carrying a target tracing code of the tracing target.
The source tracing directory chain comprises source tracing codes of products and source tracing codes of materials at all levels in the products; each tracing code is associated with a corresponding tracing chain. The tracing target can be a product, and can also be a material or an intermediate part of a certain level of the product. The target tracing code refers to a tracing code of a tracing target.
Specifically, the tracing code directly points to and links the tracing chain of the material, thereby mapping the tracing information of the material; and then, mapping and connecting the BOM tree structure information accurately through a traceability directory chain, and establishing the traceability relation between the product and the materials (such as intermediate components and raw materials) related to the product.
Step S150: and initiating a cross-chain tracing request to a target tracing chain corresponding to the target tracing code, and performing identity authority authentication by using the identity authority authentication chain.
Specifically, the identity authority authentication chain stores identity authentication information and authority information of each user who successfully registers, and the identity authentication information and the authority information are authenticated and called by the intelligent contract, wherein the user can comprise a query user (such as a user who purchases a product or a material) and participants of each process, and the participants of each process can comprise suppliers at all levels, production manufacturers, processing distributors, third-party logistics, channels/consumers, after-sale service providers and the like. When a user needs to inquire the tracing information of a tracing target, the tracing target can be selected from a pre-constructed tracing directory chain, a cross-chain tracing request carrying a target tracing code of the tracing target is generated, and then when the cross-chain tracing request is initiated to the target tracing chain corresponding to the target tracing code, the identity authority authentication chain needs to authenticate the identity authority of the user according to the stored information. Wherein, the user can only operate the intelligent contract in the authority.
Step S160: and after the identity authority authentication is passed, obtaining the tracing information in the target tracing chain by using the intelligent contract.
In an alternative, assuming that the target tracing chain includes m blocks, the connection of the tracing codes points to Hash encryption information of the mth block (i.e. the end block of the target tracing chain); step S160 further includes: obtaining Hash encryption information of the mth block of the target tracing chain; starting from i = m, decrypting the Hash encryption information of the ith block by using an asymmetric key to obtain a Hash value and a service flow code of the tracing information in the service flow sublink corresponding to the ith block and the Hash encryption information of the (i-1) th block; decrypting the Hash value of the traceability information in the service flow sublink corresponding to the ith block to obtain the traceability information in the service flow sublink corresponding to the ith block; and assigning i to be i-1, and repeatedly executing the steps until the traceability information in the service flow sub-link corresponding to the 1 st block is obtained.
In this step, after the identity authority authentication is passed, hash encryption information of an mth block of the target tracing chain is obtained, and from the mth block, the Hash encryption information of the mth block is obtained through an asymmetric key and decrypted, so as to obtain a Hash value of tracing information of a traffic flow sublink corresponding to the mth block, a traffic flow code, and Hash encryption information of an m-1 block (i.e., the last block), and the Hash value of the tracing information in the traffic flow sublink corresponding to the mth block is decrypted, so as to obtain the tracing information in the traffic flow sublink corresponding to the mth block.
By adopting the method of the embodiment, the traceability directory chain is constructed based on the BOM information of the product, the traceability directory chain is a tree structure based on the common account book, clear product and material information based on the BOM information is defined, the node of each traceability directory chain contains traceability index information of the product or the material of the node, and the index information is used as a traceability code and is directly mapped with the traceability chain corresponding to the product or the material information, so that any traceability chain can perform traceability information association and data intercommunication on the sub-components and the raw materials formed by the traceability directory chain through the traceability directory chain, and a one-to-one corresponding link relation is established; the method organically combines product tracing and the service flow codes of each service flow sublink of product circulation, realizes automatic reading of service data of each service flow sublink through the service flow codes so as to realize Hash chaining of tracing information, realizes verification of the tracing information through subsequent Hash comparison, further establishes accurate corresponding relation between the tracing codes and each service flow sublink, and facilitates participants of each service flow sublink to automatically butt-joint tracing information into a service system and an operation flow without secondary information input and conversion while realizing full-flow tracing of product circulation; according to the method, a plurality of tracing chains are established according to a BOM information structure, automatic and accurate linking and mapping are realized among the tracing chains through the tracing directory chains, cross-chain data calling is realized, and long-chain tracing from products to materials is realized.
Fig. 4 is a schematic structural diagram illustrating an embodiment of a blockchain tracing apparatus according to the present invention. As shown in fig. 4, the apparatus includes: a traceability directory chain building module 410, a traceability chain building module 420, a request generating module 430, a traceability initiating module 440 and a traceability module 450.
A source-tracing directory chain construction module 410, configured to determine, according to bill of material information of a product in the enterprise management system, materials at each level of the product, and construct a tree structure according to the materials at each level of the product; and setting traceability codes for products and materials at all levels in the products according to preset coding rules to obtain traceability directory chains, and storing the traceability codes in the shared account book.
The source tracing chain building module 420 is configured to, for each source tracing code in the source tracing directory chain, transmit, by each service flow sub-link end, source tracing information of a product or material corresponding to the source tracing code in each service flow sub-link to the block chain, and build the source tracing chain corresponding to the source tracing code.
In an optional manner, the traffic flow link includes n traffic flow sub-link ends, where n > 1; the source chain building module 420 is further configured to: each service flow sub-link inputs the tracing codes of the products or materials in the corresponding service flow sub-link, and identity authority authentication is carried out by using the identity authority authentication chain; after the identity authority authentication is passed, reading and verifying the traceability information of the last block, after the authentication is passed, inputting the service flow code of the service flow sub-link end, uploading the Hash value of the traceability information in the service flow sub-link and the service flow code to a block chain to generate a new block, encrypting to obtain Hash encryption information of the new block, and updating the connection of the traceability codes to the Hash encryption information of the new block; the 1 st service flow sublink encrypts a Hash value and a service flow code of the tracing information in the corresponding service flow sublink to obtain Hash encryption information of a new block, the t th service flow sublink encrypts the Hash value, the service flow code and the Hash encryption information of the previous block of the tracing information in the corresponding service flow sublink to obtain the Hash encryption information of the new block, wherein t is more than 1 and less than or equal to n.
In an optional manner, the traceback chain building module 420 is further configured to: and calling the tracing information corresponding to the business process codes from the business information system by using the intelligent contract as the tracing information in the business circulation sublink, and calculating the Hash value of the tracing information in the business circulation sublink.
The request generating module 430 is configured to select a source tracing target from a pre-constructed source tracing directory chain, and generate a cross-chain source tracing request carrying a target source tracing code of the source tracing target. The source tracing directory chain comprises source tracing codes of products and source tracing codes of materials at all levels in the products; each tracing code is associated with a corresponding tracing chain.
The source tracing initiating module 440 is configured to initiate a cross-chain source tracing request to a target source tracing chain corresponding to the target source tracing code, and perform identity authority authentication by using the identity authority authentication chain.
And the tracing module 450 is configured to obtain tracing information in the target tracing chain by using the intelligent contract after the identity authority authentication is passed.
In an optional mode, the target tracing chain comprises m blocks, and the connection of the tracing codes points to the Hash encryption information of the mth block; the tracing module 450 is further configured to: obtaining Hash encryption information of the mth block of the target tracing chain; starting from i = m, decrypting the Hash encryption information of the ith block by using an asymmetric key to obtain a Hash value and a service flow code of the tracing information in the service flow sublink corresponding to the ith block and the Hash encryption information of the (i-1) th block; decrypting the Hash value of the traceability information in the service flow sublink corresponding to the ith block to obtain the traceability information in the service flow sublink corresponding to the ith block; and assigning i to be i-1, and repeatedly executing the steps until the traceability information in the service flow sub-link corresponding to the 1 st block is obtained.
By adopting the device in the embodiment, the traceability directory chain is constructed based on the BOM information of the product, the traceability directory chain is a tree structure based on the common identification account book, clear product and material information based on the BOM information is defined, the node of each traceability directory chain contains traceability index information of the product/middle component/raw material of the node, and the index information is used as a traceability code and is directly mapped with the traceability chain corresponding to the product or material information, so that the sub-components and the raw material formed by any traceability chain can be associated with each other through the traceability directory chain and communicated with each other through the traceability information, and a one-to-one corresponding link relation is established; the device organically combines product traceability with service flow codes of service flow sublinks of product circulation, realizes automatic reading of service data of the service flow sublinks through the service flow codes to realize Hash chaining of traceability information, realizes traceability information verification through subsequent Hash comparison, further establishes accurate corresponding relation between the traceability codes and the service flow sublinks, realizes whole flow traceability of product circulation, and simultaneously facilitates participants of the service flow sublinks to automatically butt-joint traceability information into a service system and an operation flow without secondary information input and conversion; according to the multiple tracing chains established by the device based on the BOM information structure, automatic and accurate linking and mapping are realized among the tracing chains through the tracing directory chains, cross-chain data calling is realized, and long-chain tracing from products to materials is realized.
Fig. 5 is a schematic structural diagram illustrating an embodiment of a blockchain traceability system according to the present invention. As shown in fig. 5, the system includes the above-mentioned blockchain tracing apparatus; and the block chain application bottom layer environment is used for enabling the user to be added into the alliance chain after obtaining the authorization; the public node resource pool module is used for constructing a public node resource pool and dividing each public node into a plurality of accounting nodes; and the unified service gateway module is used for interacting with the intelligent contract deployed on the public node through the unified service gateway and sharing data between the source tracing directory chain and the source tracing chain.
Specifically, the present embodiment constructs a blockchain traceability system, which includes a blockchain Application infrastructure environment, where the blockchain Application infrastructure environment is a shared general blockchain infrastructure Application alliance chain environment, and the infrastructure of the system performs identity authorization and traceability code calling on a blockchain Application unified Certificate Authority (CA), a unified key algorithm module, a standard SDK, and an API Interface deployed therein, and through a unified service gateway module, where a standard Software Development Kit (SDK) and an Application Programming Interface (API) are used to encapsulate an intelligent contract of a blockchain infrastructure, thereby constructing a cross-chain relay mechanism, satisfying information sharing of cross-chain, and implementing accurate information calling of different traceability chains through traceability chains.
The unified CA module generally adopts a tree CA structure, and after a user applies for CA and authority, a manager uniformly issues CA; the unified key algorithm module is used for realizing the unification of the key algorithm in a bottom layer environment of block chain application, and ensuring that the tracing chain application of each party conveniently and safely and efficiently shares cross-chain data through an asymmetric key; the standard SDK and the API interface are used for packaging the intelligent contracts related to the traceability chain by the SDK and the API, and the intelligent contracts are directly provided for users to call, so that the users with different technical capabilities can conveniently establish the traceability chain at low cost, and the information of other traceability chains can be conveniently read through the standard interface.
In an optional manner, the common node resource pool module is further configured to: and deploying block chain node software on cloud resources or servers to construct a public node resource pool, wherein each public node can divide a plurality of accounting nodes through a channel mechanism corresponding to the selected bottom-layer framework, and the public node resource pool supports the establishment of a plurality of traceability chains based on the alliance chain.
In an optional manner, the unified service gateway module is further configured to: and through a uniform service gateway, the interaction between the user identity and the authority authentication, the interaction between the user identity and the intelligent contract deployed on the public node and the cross-link data sharing of the application are supported.
In an optional manner, the tracing chain further includes a service code management module, an information uploading module, an information calling module, an information verifying module, and a tracing directory chain docking module.
As shown in fig. 5, based on the blockchain traceability system, taking data interaction to the middle component traceability chain A1 according to the product traceability chain a as an example, a method for implementing data cross-chain and completing end-to-end traceability is as follows: the user of the tracing chain A carries out identity authority authentication through the unified service gateway module; selecting the intermediate component A1 through the traceability directory chain, automatically retrieving the traceability codes of the component A1, and pointing to the A1 traceability chain through the traceability code chain; initiating a transaction application of tracing information cross-chain calling to a tracing chain A1, and returning an application authority to an identity authority authentication chain; after the identity authority authentication is passed, obtaining the traceability information of the traceability chain A1 through a unified key algorithm module and an intelligent contract by a unified key algorithm, returning the traceability information to the traceability chain A through a unified service gateway module, and re-encrypting to generate a new block, so that a user of the traceability chain A can trace the key information of the A1; similarly, the middle component tracing chain A1 can trace the source of the raw material M1.
It should be particularly noted that the traceability directory chain map in this embodiment is a flat traceability structure, the upper traceability chain can directly trace all the traceability information of the middle hierarchy and the end under its association, and as shown in fig. 2, the traceability chain a can directly trace the traceability information of the raw materials M1 and M2 without the step-by-step call through the traceability chains A1 and A2. In addition, under the tracing directory chain, the upper tracing code can only be associated with the sub-sequence, and can not trace across the sub-sequence, for example, the A1 sequence can not trace the related tracing information of the A2 sequence.
By adopting the system of the embodiment, the system is deployed in a bottom-layer environment of block chain application, and comprises core modules such as a unified service gateway module, an identity authority authentication chain, a tracing directory chain, a public node resource pool and the like, certificate issuance is performed through a unified CA, a unified key algorithm module and a standard SDK \ API module are performed, wherein the SDK \ API module integrates a standard interface of an intelligent contract, a plurality of tracing chains can be conveniently deployed through the system, and a user can realize data call among the plurality of tracing chains at low cost and high efficiency through the unified service gateway module.
The embodiment of the invention provides a nonvolatile computer storage medium, wherein at least one executable instruction is stored in the computer storage medium, and the computer executable instruction can execute a block chain tracing method in any method embodiment.
The executable instructions may be specifically configured to cause the processor to:
selecting a tracing target from a pre-constructed tracing directory chain, and generating a cross-chain tracing request carrying a target tracing code of the tracing target; the source tracing directory chain comprises source tracing codes of products and source tracing codes of materials at all levels in the products; each tracing code is associated with a corresponding tracing chain;
a cross-chain tracing request is sent to a target tracing chain corresponding to the target tracing code, and identity authority authentication is carried out by utilizing an identity authority authentication chain;
and after the identity authority authentication is passed, obtaining the tracing information in the target tracing chain by using the intelligent contract.
Fig. 6 is a schematic structural diagram of an embodiment of a computing device according to the present invention, and a specific embodiment of the present invention does not limit a specific implementation of the computing device.
As shown in fig. 6, the computing device may include:
a processor (processor), a Communications Interface (Communications Interface), a memory (memory), and a Communications bus.
Wherein: the processor, the communication interface, and the memory communicate with each other via a communication bus. A communication interface for communicating with network elements of other devices, such as clients or other servers. The processor is configured to execute a program, and may specifically execute related steps in the above embodiment of the block chain tracing method.
In particular, the program may include program code comprising computer operating instructions.
The processor may be a central processing unit CPU or an Application Specific Integrated Circuit ASIC or one or more Integrated circuits configured to implement embodiments of the present invention. The server comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And the memory is used for storing programs. The memory may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program may specifically be adapted to cause a processor to perform the following operations:
selecting a tracing target from a pre-constructed tracing directory chain, and generating a cross-chain tracing request carrying a target tracing code of the tracing target; the source tracing directory chain comprises source tracing codes of products and source tracing codes of materials at all levels in the products; each tracing code is associated with a corresponding tracing chain;
initiating a cross-chain tracing request to a target tracing chain corresponding to the target tracing code, and performing identity authority authentication by using an identity authority authentication chain;
and after the identity authority passes the authentication, obtaining the traceability information in the target traceability chain by using the intelligent contract.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore, may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
Various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.

Claims (10)

1. A method for tracing a blockchain, comprising:
selecting a tracing target from a pre-constructed tracing directory chain, and generating a cross-chain tracing request carrying a target tracing code of the tracing target; the source tracing directory chain comprises source tracing codes of products and source tracing codes of materials at all levels in the products; each tracing code is associated with a corresponding tracing chain;
initiating the cross-chain tracing request to a target tracing chain corresponding to the target tracing code, and performing identity authority authentication by using an identity authority authentication chain;
and after the identity authority authentication is passed, obtaining the traceability information in the target traceability chain by using an intelligent contract.
2. The method of claim 1, further comprising:
determining materials of all levels of a product according to bill of materials information of the product in an enterprise management system, and constructing a tree structure according to the materials of all levels of the product;
and setting traceability codes for the product and materials at all levels in the product according to a preset coding rule to obtain a traceability directory chain, and storing the traceability codes in a shared account book.
3. The method of claim 1, further comprising:
for each tracing code in the tracing directory chain, each business flow sub-link end transmits tracing information of a product or material corresponding to the tracing code in each business flow sub-link to a block chain, and a tracing chain corresponding to the tracing code is constructed.
4. The method of claim 3, wherein the traffic flow link comprises n traffic flow sub-link ends, where n > 1; the method includes that each business flow sub-link end transmits traceability information of a product or material corresponding to the traceability code in each business flow sub-link to a block chain, and constructing the traceability chain corresponding to the traceability code further includes:
each service flow sublink inputs the tracing code of the product or material in the corresponding service flow sublink, and utilizes the identity authority authentication chain to authenticate the identity authority;
after the identity authority authentication is passed, reading and verifying the traceability information of the last block, after the authentication is passed, inputting the business process code of the business flow sub-link end, uploading the Hash value of the traceability information in the business flow sub-link and the business process code to a block chain to generate a new block, encrypting to obtain the Hash encryption information of the new block, and updating the connection of the traceability codes to the Hash encryption information of the new block; the 1 st service flow sublink encrypts a Hash value and a service flow code of the tracing information in the corresponding service flow sublink to obtain Hash encryption information of a new block, the t th service flow sublink encrypts the Hash value, the service flow code and the Hash encryption information of the previous block of the tracing information in the corresponding service flow sublink to obtain the Hash encryption information of the new block, wherein t is more than 1 and less than or equal to n.
5. The method according to claim 4, wherein before uploading the Hash value of the tracing information in the traffic flow sublink and the traffic flow code to a blockchain generation new block, the method further comprises:
and calling the tracing information corresponding to the business process code from a business information system by using an intelligent contract as the tracing information in the business flow sublink, and calculating the Hash value of the tracing information in the business flow sublink.
6. The method of claim 4, wherein the target traceback chain comprises m blocks, and the connection of the traceback codes points to Hash encryption information of the m block;
the obtaining the tracing information in the target tracing chain by using the intelligent contract further comprises:
obtaining Hash encryption information of the mth block of the target tracing chain;
starting from i = m, decrypting the Hash encryption information of the ith block by using an asymmetric key to obtain a Hash value and a service flow code of tracing information in a service flow sublink corresponding to the ith block and the Hash encryption information of the (i-1) th block; decrypting the Hash value of the tracing information in the service flow sublink corresponding to the ith block to obtain the tracing information in the service flow sublink corresponding to the ith block;
and assigning i to be i-1, and repeatedly executing the steps until the traceability information in the service flow sub-link corresponding to the 1 st block is obtained.
7. A blockchain tracing apparatus, comprising:
the request generation module is used for selecting a tracing target from a pre-constructed tracing directory chain and generating a cross-chain tracing request carrying a target tracing code of the tracing target; the source tracing directory chain comprises source tracing codes of products and source tracing codes of materials at all levels in the products; each tracing code is associated with a corresponding tracing chain;
the source tracing initiating module is used for initiating the cross-chain source tracing request to a target source tracing chain corresponding to the target source tracing code and performing identity authority authentication by using an identity authority authentication chain;
and the source tracing module is used for acquiring the source tracing information in the target source tracing chain by using an intelligent contract after the identity authority authentication is passed.
8. A blockchain traceability system, comprising the blockchain traceability device of claim 7; and the number of the first and second groups,
the block chain applies a bottom layer environment and is used for enabling the user to be added into the alliance chain after obtaining the authorization;
the public node resource pool module is used for constructing a public node resource pool and dividing each public node into a plurality of accounting nodes;
and the unified service gateway module is used for interacting with the intelligent contract deployed on the public node through the unified service gateway and sharing data between the source tracing directory chain and the source tracing chain.
9. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface are communicated with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the block chain tracing method as claimed in any one of claims 1-6.
10. A computer storage medium having stored thereon at least one executable instruction for causing a processor to perform operations corresponding to a blockchain tracing method according to any one of claims 1 to 6.
CN202110455612.XA 2021-04-26 2021-04-26 Block chain tracing method, device, system, computing equipment and storage medium Pending CN115330400A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110455612.XA CN115330400A (en) 2021-04-26 2021-04-26 Block chain tracing method, device, system, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110455612.XA CN115330400A (en) 2021-04-26 2021-04-26 Block chain tracing method, device, system, computing equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115330400A true CN115330400A (en) 2022-11-11

Family

ID=83912373

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110455612.XA Pending CN115330400A (en) 2021-04-26 2021-04-26 Block chain tracing method, device, system, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115330400A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115829595A (en) * 2023-02-14 2023-03-21 江西服装学院 Garment products supply chain system of traceing back based on block chain
CN115858308A (en) * 2022-12-30 2023-03-28 珠海市众知科技有限公司 Automatic processing information intelligent monitoring system and method based on big data
CN115965388A (en) * 2022-12-30 2023-04-14 国网数字科技控股有限公司 Industrial chain financial confidential traceability method and device based on block chain and related equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858308A (en) * 2022-12-30 2023-03-28 珠海市众知科技有限公司 Automatic processing information intelligent monitoring system and method based on big data
CN115965388A (en) * 2022-12-30 2023-04-14 国网数字科技控股有限公司 Industrial chain financial confidential traceability method and device based on block chain and related equipment
CN115965388B (en) * 2022-12-30 2023-12-22 国网数字科技控股有限公司 Block chain-based industrial chain financial secret state tracing method, device and related equipment
CN115829595A (en) * 2023-02-14 2023-03-21 江西服装学院 Garment products supply chain system of traceing back based on block chain

Similar Documents

Publication Publication Date Title
CN109462588B (en) Decentralized data transaction method and system based on block chain
US11587069B2 (en) Digital contracts in blockchain environments
CN108197891B (en) Electronic signing device and method based on block chain
JP7166453B2 (en) Zero-knowledge proof payment using blockchain
CN110349056B (en) Service processing system and method based on block chain
CN115330400A (en) Block chain tracing method, device, system, computing equipment and storage medium
US11341503B2 (en) Deploying a cloud-based system using a distributed ledger
CN110766406B (en) Resource transfer method, resource transfer device, storage medium and electronic equipment
US20190116185A1 (en) Access authority management method, access authority management system, and access authority management apparatus
CN111934996B (en) Message transmission method and device
CN112131298B (en) Data conversion method and device based on block chain
CN111314172B (en) Block chain-based data processing method, device, equipment and storage medium
CN111292041A (en) Electronic contract generating method, device, equipment and storage medium
CN111740966A (en) Data processing method based on block chain network and related equipment
US20190386968A1 (en) Method to securely broker trusted distributed task contracts
US20150127563A1 (en) System and method for displaying product certification
US20140215220A1 (en) Application distribution system and method
CN110955724A (en) Data processing method and device based on block chain, node equipment and storage medium
US20220277405A1 (en) Adaptation of a Production Process, Edge Device of an Industrial Control System and Product Ordering Process
US11568091B2 (en) Method and system for integrity protected distributed ledger for component certificate attestation
CN115705601A (en) Data processing method and device, computer equipment and storage medium
Yiu Decentralizing supply chain anti-counterfeiting systems using blockchain technology
CN111445265A (en) House purchasing method and device based on block chain
CN111050326A (en) Short message verification method, device, equipment and medium based on block chain
US20220231846A1 (en) System functionality activation using distributed ledger

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination