CN108595980B - Method and device for protecting commodity traceability information - Google Patents

Method and device for protecting commodity traceability information Download PDF

Info

Publication number
CN108595980B
CN108595980B CN201810411525.2A CN201810411525A CN108595980B CN 108595980 B CN108595980 B CN 108595980B CN 201810411525 A CN201810411525 A CN 201810411525A CN 108595980 B CN108595980 B CN 108595980B
Authority
CN
China
Prior art keywords
commodity
commodities
tree
batch
merkle
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.)
Active
Application number
CN201810411525.2A
Other languages
Chinese (zh)
Other versions
CN108595980A (en
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.)
Guangzhou Pinwei Software Co Ltd
Original Assignee
Guangzhou Pinwei Software 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 Guangzhou Pinwei Software Co Ltd filed Critical Guangzhou Pinwei Software Co Ltd
Priority to CN201810411525.2A priority Critical patent/CN108595980B/en
Publication of CN108595980A publication Critical patent/CN108595980A/en
Application granted granted Critical
Publication of CN108595980B publication Critical patent/CN108595980B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • 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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Medical Informatics (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method and a device for protecting commodity traceability information, wherein the method comprises the following steps: the method comprises the steps of obtaining a commodity identification of each commodity in the same batch of commodities and circulation information of the batch of commodities; generating a merkle tree according to the commodity identification of each commodity in the same batch of commodities and the circulation information of the batch of commodities; and storing the hash value corresponding to the root node of the merkle tree in the public chain, and storing the rest nodes and paths of the merkle tree in the union chain. The invention provides a method and a device for protecting commodity traceability information, which realize that the traceability information can be public and fair and can not be randomly modified, and protect the privacy of merchants.

Description

Method and device for protecting commodity traceability information
Technical Field
The invention relates to the technical field of electronic transactions, in particular to a method and a device for protecting commodity traceability information.
Background
With the increase of the consumption level of people and the development of electronic commerce technology, the channel for people to purchase goods is also changed from the original off-line physical mode to the mode of dual development of off-line and on-line, and virtual shopping gradually enters the daily life of people, such as internet shopping, electronic shopping malls and other computer network shopping systems based on electronic commerce.
The commodity tracing is to start tracking and recording basic information and circulation process of each product from the source. After the consumer scans the anti-counterfeiting label of the commodity, the consumer can inquire the information recorded before the product, thereby being assured to purchase. The block chain has the natural anti-tampering characteristic, is particularly suitable for storing the traceability information of commodities, and adopts the block chain technology in many traceability products in the industry.
At present, various traceability products are based on an alliance chain, although privacy data of merchants can be well protected, consumers cannot directly verify the privacy data and need to be supervised by a third party supervision mechanism, and the consumers expect that traceability information of commodities can be publicly, fairly and randomly modified, so that a method and a device for protecting the traceability information of the commodities need to be provided to achieve the purposes that the traceability information can be publicly, fairly and randomly modified, and meanwhile, the privacy of the merchants is protected.
Disclosure of Invention
The invention provides a method and a device for protecting commodity traceability information, which realize that the traceability information can be public and fair and can not be randomly modified, and protect the privacy of merchants.
The invention provides a method for protecting commodity traceability information, which comprises the following steps:
acquiring a commodity identification of each commodity in the same batch of commodities and circulation information of the batch of commodities;
generating a merkle tree according to the commodity identification of each commodity in the same batch of commodities and the circulation information of the batch of commodities;
and storing the hash value corresponding to the root node of the merkle tree in the public chain, and storing the rest nodes and paths of the merkle tree in the alliance chain.
Optionally, the generating a merkle tree according to the commodity identifier of each commodity in the same batch of commodities and the circulation information of the batch of commodities specifically includes:
generating a left sub-tree of the merkle tree according to the commodity identification of each commodity in the same batch of commodities;
and generating a right subtree of the merkle tree according to the circulation information of the batch of commodities.
Optionally, the generating a left sub-tree of the merkle tree according to the product identifier of each product in the same batch of products specifically includes:
and taking the commodity identification of a single commodity in the same batch of commodities as a leaf node of a left subtree of the merkle tree, and generating a commodity identification merkle subtree comprising leaf nodes with preset number, wherein the commodity identification merkle subtree is the left subtree of the merkle tree, and if the actual number of the single commodity in the batch of commodities is less than the preset number, generating random data to fill the leaf node with a null value in the commodity identification merkle subtree.
Optionally, before obtaining the commodity identifier of each commodity in the same batch of commodities and the circulation information of the batch of commodities, the method further includes:
the article identification of each article is signed by the manufacturer's private key.
Optionally, before obtaining the commodity identifier of each commodity in the same batch of commodities and the circulation information of the batch of commodities, the method further includes:
and signing the circulation information of the batch of commodities by a private key of a logistics initiator.
The invention provides a protection device for commodity traceability information, which comprises:
the system comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring a commodity identification of each commodity in the same batch of commodities and circulation information of the batch of commodities;
the Merkle tree generating unit is used for generating a Merkle tree according to the commodity identification of each commodity in the same batch of commodities and the circulation information of the batch of commodities;
and the storage unit is used for storing the hash value corresponding to the root node of the merkle tree in the public chain, and storing the other nodes and paths of the merkle tree in the alliance chain.
Optionally, the Merkle tree generating unit specifically includes:
the left sub-tree generating subunit is used for generating a left sub-tree of the marker tree according to the commodity identification of each commodity in the same batch of commodities;
and the right sub-tree generating subunit is used for generating a right sub-tree of the merkle tree according to the circulation information of the batch of commodities.
Optionally, the left sub-tree generating subunit is further configured to use the commodity identifier of the single commodity in the same batch of commodities as a leaf node of the left sub-tree of the merkle tree, and generate a commodity identifier merkle sub-tree including leaf nodes in a preset number, where the commodity identifier merkle sub-tree is the left sub-tree of the merkle tree, and if the actual number of the single commodity in the batch of commodities is less than the preset number, generate random data to fill the leaf node in the commodity identifier merkle sub-tree, which is a null value.
The invention provides a commodity traceability information protection device, which comprises:
a memory to store instructions;
a processor coupled to the memory, the processor configured to perform an implementation of the method as recited in any one of the above based on instructions stored by the memory.
The invention provides a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement a method as defined in any one of the above.
According to the technical scheme, the invention has the following advantages:
the invention provides a method for protecting commodity traceability information, which comprises the following steps: the method comprises the steps of obtaining a commodity identification of each commodity in the same batch of commodities and circulation information of the batch of commodities; generating a merkle tree according to the commodity identification of each commodity in the same batch of commodities and the circulation information of the batch of commodities; and storing the hash value corresponding to the root node of the merkle tree in the public chain, and storing the rest nodes and paths of the merkle tree in the alliance chain.
According to the method, the commodity identification of each commodity in a batch of commodities and the circulation information of the batch of commodities are stored in the alliance chain and the public chain in the form of a merkle tree, wherein the hash value corresponding to the root node of the merkle tree is stored in the public chain, so that the merkle tree is not falsifiable without requiring an alliance credit endorsement, and other nodes and paths of the merkle tree are stored in the alliance chain, so that the privacy of a merchant is protected.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic flow chart of a method for protecting commodity traceability information according to the present invention;
FIG. 2 is a schematic diagram of a merkle tree structure;
fig. 3 is another schematic flow chart of the method for protecting the commodity traceability information according to the present invention;
fig. 4 is a first schematic structural diagram of a protection device for commodity traceability information provided by the present invention;
fig. 5 is a schematic structural diagram of a second protection device for commodity traceability information according to the present invention;
fig. 6 is a schematic structural diagram of a third protection device for commodity traceability information according to the present invention.
Detailed Description
The embodiment of the invention provides a method and a device for protecting commodity traceability information, which realize that the traceability information can be public and fair and can not be randomly modified, and protect the privacy of merchants.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Referring to fig. 1 and fig. 2, an embodiment of a method for protecting commodity traceability information according to the present invention includes:
101. acquiring a commodity identification of each commodity in the same batch of commodities and circulation information of the batch of commodities;
it should be noted that the product identifier of each product in the same batch of products is a unique identifier, the product is randomly generated when the product leaves the factory, the same batch of products does not represent that the product is produced in the same batch, but the circulation information of the same batch of products is the same and unique, and is provided by the logistics initiator, for example, batch a of products is delivered to the transfer station C by the producer B, the producer B provides the first circulation information for batch a of products, the transfer station C delivers batch a of products to the warehouse D, and the transfer station C provides the second circulation information for batch a of products.
102. Generating a market tree according to the commodity identification of each commodity in the same batch of commodities and the circulation information of the batch of commodities;
it should be noted that, as shown in fig. 2, after the product identifier of each product in the same batch of products and the circulation information of the batch of products are obtained, a market tree is generated according to the product identifier of each product in the same batch of products and the circulation information of the batch of products, and the market tree has a zero-knowledge proof property, and is capable of verifying the validity of data without returning values of all nodes of the market tree.
103. Storing the hash value corresponding to the root node of the merkle tree in a public chain, and storing other nodes and paths of the merkle tree in a alliance chain;
it should be noted that, after the merkle tree is generated, the hash value corresponding to the root node of the merkle tree is stored in the public chain, and the rest nodes and paths of the merkle tree are stored in the alliance chain, because the alliance chain is established by different organizations and institutions, different roles have different data authorities, so that the privacy of the commodity information of the merchant can be protected, and the supervision of the data can be guaranteed, a consumer cannot speculate complete data, and when receiving the commodity, the consumer can transmit the commodity identification printed on the commodity package and associated with the commodity information through the provided software, obtain the information of the node associated with the commodity identification through the service provided by the alliance chain, obtain the hash value of the verified commodity after calculation, and compare the hash value with the hash value corresponding to the root node of the merkle tree which is not tampered with the public chain to judge whether the commodity is genuine.
In the embodiment of the invention, the commodity identification of each commodity in a batch of commodities and the circulation information of the batch of commodities are stored in an alliance chain and a public chain in the form of a merkle tree, wherein the hash value corresponding to the root node of the merkle tree is stored in the public chain, so that the commodities are not falsifiable and an alliance credit endorsement is not needed, other nodes and paths of the merkle tree are stored in the alliance chain, the privacy of a merchant is protected, and by utilizing the zero knowledge proving characteristic of the merkle tree, the traceability verification can be carried out by acquiring the hash value corresponding to the node of the necessary path of the commodity through a program and comparing the hash value with the root node of the merkle tree stored in the public chain to complete the commodity traceability verification, so that the traceability information can be disclosed, fair and not randomly modified, and the privacy of the merchant is protected.
The above is a description of an embodiment of the method for protecting the commodity tracing information provided by the present invention, and another embodiment of the method for protecting the commodity tracing information provided by the present invention is described below.
Referring to fig. 3, another embodiment of the present invention provides a method for protecting commodity traceability information, including:
201. signing the commodity identification of each commodity through a private key of a manufacturer;
it should be noted that, in order to ensure that the data source information of the commodity identification cannot be tampered, the private key signature adding process of the manufacturer is performed on the commodity identification of the single commodity.
202. Signing the circulation information of the batch of commodities through a private key of a logistics initiator;
it should be noted that, it is further ensured that the circulation process of the commodities cannot be tampered, and the private key signature processing of the logistics initiator is performed on the circulation information of the commodities in the same batch.
203. Acquiring a commodity identification of each commodity in the same batch of commodities and circulation information of the batch of commodities;
it should be noted that the product identifier of each product in the same batch of products is a unique identifier, the product is randomly generated when the product leaves the factory, the same batch of products does not represent that the product is produced in the same batch, but the circulation information of the same batch of products is the same and unique, and is provided by the logistics initiator, for example, batch a of products is delivered to the transfer station C by the producer B, the producer B provides the first circulation information for batch a of products, the transfer station C delivers batch a of products to the warehouse D, and the transfer station C provides the second circulation information for batch a of products.
204. Taking a commodity identification of a single commodity in the same batch of commodities as a leaf node of a left subtree of the merkle tree, and generating a commodity identification merkle subtree comprising leaf nodes with preset number, wherein the commodity identification merkle subtree is the left subtree of the merkle tree, and if the actual number of the single commodity in the batch of commodities is less than the preset number, generating random data to fill the leaf node with a null value in the commodity identification merkle subtree;
it should be noted that the merckle tree is divided into a left sub-tree and a right sub-tree, and according to fig. 2, the product identifier of a single product in the same batch of products is taken as a leaf node of the left sub-tree of the merckle tree to generate a product identifier merckle sub-tree including a preset number of leaf nodes, that is, the left sub-tree of the merckle tree, where the preset number of leaf nodes can ensure that the number of layers of the generated left sub-tree of the merckle tree is the same, and can prevent the user from deducing the approximate number of a batch of products by returning the depth of the merckle tree, thereby knowing sensitive information such as the inventory of the merchant.
If the actual number of the single commodities in one batch is less than the preset number, random data is generated to fill leaf nodes which are null values in the commodity identification merkle subtree, and the commodity identification merkle subtree consistent with other batches is generated;
if the actual number of the single commodities in one batch is higher than the preset number, the batch is firstly divided into a plurality of batches by taking the preset number as a unit to generate a commodity identification merkle sub-tree, and similarly, if the actual number of the single commodities in the last batch is lower than the preset number, the solution is realized according to the method.
205. Generating a right subtree of the merkle tree according to the circulation information of the batch of commodities;
it should be noted that the right subtree of the merkle tree is generated according to the circulation information of the batch of commodities, and the commodity identification merkle subtree and the right subtree of the merkle tree together form the merkle tree, and the hash value corresponding to the root node of the merkle tree is obtained by calculating the hash value corresponding to the root node of the commodity identification merkle subtree and the hash value corresponding to the root node of the right subtree of the merkle tree through a hash function.
206. And storing the hash value corresponding to the root node of the merkle tree in the public chain, and storing the rest nodes and paths of the merkle tree in the alliance chain.
It should be noted that, after the merkle tree is generated, the hash value corresponding to the root node of the merkle tree is stored in the public chain, and the rest nodes and paths of the merkle tree are stored in the alliance chain, and because the alliance chain is established by different organizations and institutions, different roles have different data authorities, so that the privacy of the commodity information of the merchant can be protected, and the supervision of the data can be guaranteed, and a consumer cannot speculate complete data.
In the embodiment of the invention, the commodity identification of each commodity in a batch of commodities and the circulation information of the batch of commodities are stored in an alliance chain and a public chain in the form of a merkle tree, wherein a hash value corresponding to a root node of the merkle tree is stored in the public chain, so that the commodity identification and the circulation information of the batch of commodities are not tampered and do not need an alliance credit endorsement, other nodes and paths of the merkle tree are stored in the alliance chain, the privacy of a merchant is protected, the zero knowledge proving characteristic of the merkle tree is utilized, the hash value corresponding to the node of the necessary path of the commodity can be obtained through a program to carry out traceability verification, the traceability verification is completed by comparing with the root node of the merkle tree stored in the public chain, the traceability verification is realized, the traceability information can be disclosed to be legitimate and not randomly modified, the privacy of the merchant is protected, further, the commodity identification of each commodity is signed through a private key of a manufacturer, the circulation information of each commodity is signed through the private key of a logistics initiator, the source data and the circulation information of the batch of the commodity is prevented from being tampered by a private key of the commodity, and the user from knowing about the depth of the batch of the commodity, and the commodity, so that the inventory information is sensitive.
The above is a description of another embodiment of the method for protecting the product traceability information, and the following is a description of a first embodiment of the device for protecting the product traceability information.
Referring to fig. 4, the present invention provides a first embodiment of a protection device for commodity tracing information, including:
an obtaining unit 401, configured to obtain a commodity identifier of each commodity in the same batch of commodities and circulation information of the batch of commodities;
a Merkle tree generating unit 402, configured to generate a Merkle tree according to the commodity identifier of each commodity in the same batch of commodities and the circulation information of the batch of commodities;
a storing unit 403, configured to store the hash value corresponding to the root node of the merkle tree in the public chain, and store the other nodes and paths of the merkle tree in the federation chain.
The above is a description of a first embodiment of the product traceability information protection apparatus provided by the present invention, and a second embodiment of the product traceability information protection apparatus provided by the present invention is described below.
Referring to fig. 5, a second embodiment of the present invention provides a protection device for commodity traceability information, including:
a first encryption unit 501, configured to sign an article identifier of each article with a private key of a manufacturer;
a second encryption unit 502, configured to add a label to the circulation information of the batch of commodities through a private key of the logistics initiator;
the acquiring unit 503 is configured to acquire a commodity identifier of each commodity in the same batch of commodities and circulation information of the batch of commodities;
the Merkle tree generating unit 504 is configured to generate a Merkle tree according to the commodity identifier of each commodity in the same batch of commodities and the circulation information of the batch of commodities;
the Merkle tree generating unit 504 specifically includes:
a left sub-tree generation subunit 5041, configured to generate a left sub-tree of the merkle tree according to the commodity identifier of each commodity in the same batch of commodities;
the left sub-tree generating subunit 5041 is further configured to use the commodity identifier of a single commodity in the same batch of commodities as a leaf node of a left sub-tree of the merkle tree, and generate a commodity identifier merkle sub-tree including leaf nodes in a preset number, where the commodity identifier merkle sub-tree is the left sub-tree of the merkle tree, and if the actual number of the single commodity in the batch of commodities is less than the preset number, generate random data to fill the leaf node in the commodity identifier merkle sub-tree, which is a null value;
a right sub-tree generation subunit 5042, configured to generate a right sub-tree of the merkle tree according to the circulation information of the batch of commodities;
a storing unit 505, configured to store the hash value corresponding to the root node of the merkle tree in the public chain, and store the other nodes and paths of the merkle tree in the federation chain.
The above is a description of a second embodiment of the product traceability information protection apparatus provided by the present invention, and a third embodiment of the product traceability information protection apparatus provided by the present invention will be described below.
As shown in fig. 6, the third embodiment of the present invention provides a protection apparatus for commodity traceability information, including:
a memory 601 for storing instructions;
a processor 602 coupled to the memory 601, wherein the processor 602 is configured to execute a method according to any one of the embodiments of fig. 1 or fig. 3 based on instructions stored in the memory.
As shown in fig. 6, the apparatus for protecting the traceability information of a commodity further includes a communication interface 603 for performing information interaction with other devices. The device also includes a bus 604, and the processor 602, the communication interface 603 and the memory 601 communicate with each other through the bus 604.
The memory 601 may comprise a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 601 may also be a memory array. The memory 601 may also be partitioned and the blocks may be combined into virtual volumes according to certain rules.
Further, the processor 602 may be a central processing unit CPU, or may be an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement an embodiment of the present invention.
The above is a description of a third embodiment of the product traceability information protection apparatus provided by the present invention, and an embodiment of a computer-readable storage medium provided by the present invention is described below.
One embodiment of a computer-readable storage medium is provided, which stores computer instructions that, when executed by a processor, implement a method according to any one of the embodiments of fig. 1 or fig. 3.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (4)

1. A protection method for commodity traceability information is characterized by comprising the following steps:
signing the commodity identification of each commodity through a private key of a manufacturer; the commodity identification is randomly generated when the commodity leaves a factory;
acquiring a commodity identification of each commodity in the same batch of commodities and circulation information of the batch of commodities;
generating a market tree according to the commodity identification of each commodity in the same batch of commodities and the circulation information of the batch of commodities;
storing the hash value corresponding to the root node of the merkle tree in a public chain, and storing other nodes and paths of the merkle tree in a alliance chain;
the generating the merkle tree according to the commodity identification of each commodity in the same batch of commodities and the circulation information of the batch of commodities specifically comprises the following steps:
generating a left sub-tree of the merkle tree according to the commodity identification of each commodity in the same batch of commodities;
generating a right subtree of the merkle tree according to the circulation information of the batch of commodities;
the generating of the left sub-tree of the merkle tree according to the commodity identification of each commodity in the same batch of commodities specifically comprises:
and taking the commodity identification of a single commodity in the same batch of commodities as a leaf node of a left subtree of the marker tree, and generating a commodity identification marker subtree comprising leaf nodes with a preset number, wherein the commodity identification marker subtree is the left subtree of the marker tree, and if the actual number of the single commodity in the batch of commodities is less than the preset number, generating random data to fill the leaf node with a null value in the commodity identification marker subtree.
2. The method for protecting the commodity traceability information of claim 1, wherein before obtaining the commodity identification of each commodity in the same batch of commodities and the circulation information of the batch of commodities, the method further comprises:
and signing the circulation information of the batch of commodities through a private key of a logistics initiator.
3. The utility model provides a protection device of commodity traceability information which characterized in that includes:
the first encryption unit is used for signing the commodity identification of each commodity through a private key of a manufacturer; the commodity identification is randomly generated when the commodity leaves a factory;
the system comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring the commodity identification of each commodity in the same batch of commodities and the circulation information of the batch of commodities;
the Merkle tree generating unit is used for generating a Merkle tree according to the commodity identification of each commodity in the same batch of commodities and the circulation information of the batch of commodities;
the storage unit is used for storing the hash value corresponding to the root node of the merkle tree in the public chain, and storing the other nodes and paths of the merkle tree in the alliance chain;
the Merkle tree generating unit specifically comprises:
the left sub-tree generating subunit is used for generating a left sub-tree of the marker tree according to the commodity identification of each commodity in the same batch of commodities;
the right sub-tree generating subunit is used for generating a right sub-tree of the merkle tree according to the circulation information of the batch of commodities;
the left sub-tree generating subunit is further configured to use the commodity identification of the single commodity in the same batch of commodities as a leaf node of the left sub-tree of the merkle tree, and generate a commodity identification merkle sub-tree including leaf nodes in a preset number, where the commodity identification merkle sub-tree is the left sub-tree of the merkle tree, and if the actual number of the single commodity in the batch of commodities is less than the preset number, generate random data to fill the leaf node in the commodity identification merkle sub-tree, which is a null value.
4. A computer-readable storage medium storing computer instructions which, when executed by a processor, implement the method of any one of claims 1 to 2.
CN201810411525.2A 2018-05-02 2018-05-02 Method and device for protecting commodity traceability information Active CN108595980B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810411525.2A CN108595980B (en) 2018-05-02 2018-05-02 Method and device for protecting commodity traceability information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810411525.2A CN108595980B (en) 2018-05-02 2018-05-02 Method and device for protecting commodity traceability information

Publications (2)

Publication Number Publication Date
CN108595980A CN108595980A (en) 2018-09-28
CN108595980B true CN108595980B (en) 2023-01-24

Family

ID=63620592

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810411525.2A Active CN108595980B (en) 2018-05-02 2018-05-02 Method and device for protecting commodity traceability information

Country Status (1)

Country Link
CN (1) CN108595980B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109377244B (en) * 2018-10-24 2022-04-15 武汉珞樱联创信息科技有限公司 Food fast traceability system and method based on multi-chain interconnection block chain network
CN109508905A (en) * 2018-12-18 2019-03-22 深圳壹账通智能科技有限公司 Drug monitoring and managing method and device, storage medium and server based on block chain
CN109741078B (en) * 2018-12-28 2020-01-14 广东长盈科技股份有限公司 Traceability-oriented Internet of things storage system and method
CN110119763B (en) * 2019-04-16 2021-06-29 福建天晴数码有限公司 Logistic regression data optimization method based on merkel tree idea and storage medium
CN110688377B (en) * 2019-08-30 2020-07-17 阿里巴巴集团控股有限公司 Method and device for updating state Merck tree
US10992459B2 (en) 2019-08-30 2021-04-27 Advanced New Technologies Co., Ltd. Updating a state Merkle tree
CN111080311B (en) * 2019-10-24 2024-04-26 广州运通链达金服科技有限公司 Commodity tracing method and device based on blockchain
CN111967028B (en) * 2020-08-04 2021-05-25 中国科学院上海微系统与信息技术研究所 Data interaction system
CN112632060B (en) * 2020-08-31 2022-10-11 上海墨珩网络科技有限公司 Block chain based hierarchical traceability batch information recording method and device
CN113382005B (en) * 2021-06-10 2023-09-29 南京财经大学 Traceable logistics method with privacy protection function and traceable logistics system with same
CN117875990B (en) * 2024-03-13 2024-05-28 贵州省畜牧兽医研究所 Honey tracing method and system based on blockchain

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138478A (en) * 2015-07-28 2015-12-09 哈尔滨工程大学 Memory integrity protection method employing unbalanced hash tree mode
CN106372533A (en) * 2016-09-14 2017-02-01 中国银联股份有限公司 Block chain technology-based content storage method
CN107657460A (en) * 2017-09-08 2018-02-02 众安信息技术服务有限公司 A kind of tobacco based on block chain is false proof and source tracing method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10176481B2 (en) * 2015-12-21 2019-01-08 Beston Technologies Pty Ltd Method and apparatus for managing and providing provenance of product using blockchain
CN107122985A (en) * 2017-05-09 2017-09-01 广东工业大学 A kind of agricultural-product supply-chain traceability system based on Internet of Things and block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138478A (en) * 2015-07-28 2015-12-09 哈尔滨工程大学 Memory integrity protection method employing unbalanced hash tree mode
CN106372533A (en) * 2016-09-14 2017-02-01 中国银联股份有限公司 Block chain technology-based content storage method
CN107657460A (en) * 2017-09-08 2018-02-02 众安信息技术服务有限公司 A kind of tobacco based on block chain is false proof and source tracing method and system

Also Published As

Publication number Publication date
CN108595980A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
CN108595980B (en) Method and device for protecting commodity traceability information
JP6674961B2 (en) Computer-implemented method for adapting a deterministically reproducible, cryptographic representation to a group of all associated items in a lot of similar items across a distribution chain
CN108681853B (en) Logistics information transmission method, system and device based on block chain
CN108764877B (en) Digital asset right-confirming trading method based on block chain technology
US20210051027A1 (en) User identity information authentication and verification methods and devices
CN110807641A (en) Pet food traceability system
US8112626B1 (en) Method and apparatus to provide public key authentication with low complexity devices
CN102831529B (en) A kind of commodity information identification method based on radio frequency and system
CN107431622A (en) The blocking tracking in supply chain occurs
CN104854642A (en) Method and apparatus for marking manufactured items using physical characteristic
CN110046996A (en) The generation method and device of block chain transaction
CN107292629A (en) Anti-counterfeit tracking verification method based on block chain and the device using this method
US9721259B2 (en) Rules-based selection of counterfeit detection techniques
CN105096134A (en) Security scheme for authenticating digital entities and aggregate object origins
CN110032882A (en) Card method and apparatus are deposited based on block chain
CN102063633A (en) Anti-counterfeiting method based on radio frequency identification technology
US11037147B2 (en) Money transfer fraud prevention methods and systems
CN111291122B (en) Bidding method and device based on block chain
CN105787739A (en) Anti-counterfeiting method and system based on two-dimensional code and jigsaw
CN111881482B (en) User identity privacy encryption method based on block chain technology
US11516014B2 (en) Methods, systems, and apparatuses for cryptographic wireless detection and authentication of fluids
CN112070567A (en) Quality control system based on block chain and control method thereof
CN105593876A (en) Validation in serialization flow
CN114140133B (en) Method for processing tracing data
CN110798321B (en) Article information service method based on block chain

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
GR01 Patent grant
GR01 Patent grant