CN105719144B - Food safety tracing method and system based on two-dimension code - Google Patents
Food safety tracing method and system based on two-dimension code Download PDFInfo
- Publication number
- CN105719144B CN105719144B CN201410721334.8A CN201410721334A CN105719144B CN 105719144 B CN105719144 B CN 105719144B CN 201410721334 A CN201410721334 A CN 201410721334A CN 105719144 B CN105719144 B CN 105719144B
- Authority
- CN
- China
- Prior art keywords
- dimensional code
- information
- circulation
- code
- national standard
- 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
Links
Images
Landscapes
- Storage Device Security (AREA)
Abstract
The embodiment of the invention provides a food safety tracing method and device based on two-dimension codes. The method mainly comprises the following steps: generating a two-dimensional code with a set format, and attaching the two-dimensional code to packaged food; recording circulation information of the packaged food at each circulation node, forming the circulation information and product information of the packaged food into tracing information of the packaged food, and storing the tracing information and the information of the two-dimensional code in a correlation manner: and scanning the two-dimension code on the packaged food to obtain the information of the two-dimension code, and inquiring the tracing information of the packaged food according to the information of the two-dimension code obtained by scanning. According to the method, the content of the private area in the two-dimensional code is hidden, so that the safety of the two-dimensional code is enhanced, and the safety of the circulation of products attached to the two-dimensional code is improved. The circulation condition of each product is recorded at each circulation node, and when the food quality problem occurs, the problem products are conveniently positioned, and the products are quickly recalled.
Description
Technical Field
The invention relates to the field of food safety tracing, in particular to a food safety tracing method and system based on two-dimension codes.
Background
Food safety is an important source for guaranteeing the health and life safety of the public. In recent years, frequent food safety accidents have attracted wide attention of all social circles, and food safety tracing is widely applied at home and abroad as a means for guaranteeing food safety.
The two-dimensional code has the characteristics of large capacity, low cost, strong error correction capability and the like, and the two-dimensional code is adopted to identify packaged food, so that the safety tracing of the food is not visible. However, most of the tracing systems on the market are built by enterprises, so that the construction cost is high, the tracing information is lack of objectivity and authority, and the data acquisition in a circulation link after the food is produced is not facilitated; the safety of a common two-dimensional code is low, and the product identification by using the common two-dimensional code can bring a plurality of potential safety hazards; enterprises can do their own work, the two-dimension code identification and the two-dimension code content are all five doors, and interconnection and intercommunication among systems are difficult to realize, so that information islands are formed.
In the prior art, a two-dimensional code-based tracing method includes: the encrypted verification code and the two-dimensional code are generated by an upstream production processor or distributor, the encrypted verification code is authorized to the distributor at the same time when the product is supplied to the next distributor, after the two-dimensional code passes the verification of the encrypted verification code, the distribution information is added into the two-dimensional code information, the two-dimensional code is encoded into a new two-dimensional code together with the newly generated encrypted verification code, and the new two-dimensional code is attached to the product. This implementation improves the safety of the product during circulation.
The two-dimensional code-based tracing method in the prior art has the following disadvantages: since the encrypted verification code needs to be authorized and a new two-dimensional code needs to be generated every time of distribution, higher requirements are put on distributors, and the distribution work becomes complicated; moreover, as the distribution information of each distribution needs to be coded into the two-dimensional code, when the distribution links are more, the information in the two-dimensional code becomes more, the size of the two-dimensional code becomes huge and is not easy to attach to a product, and even if enough space is available for printing the two-dimensional code, the two-dimensional code is easy to reduce the recognition rate due to deformation and abrasion; finally, the same two-dimensional code is used in the same production or distribution batch in the implementation method, one object and one code are not realized, the anti-counterfeiting capability of the two-dimensional code is reduced, the position of each product is not easy to track, and the product recall is not facilitated.
Disclosure of Invention
The embodiment of the invention provides a food safety tracing method and a food safety tracing system based on two-dimension codes, and aims to improve food tracing efficiency based on the two-dimension codes.
The embodiment of the invention provides the following technical scheme:
a food safety tracing method based on two-dimension codes comprises the following steps:
generating a two-dimensional code with a set format, and attaching the two-dimensional code to packaged food;
recording circulation information of the packaged food at each circulation node, forming the circulation information and product information of the packaged food into tracing information of the packaged food, and storing the tracing information and the information of the two-dimensional code in a correlation manner;
and scanning the two-dimension code on the packaged food to obtain the information of the two-dimension code, and inquiring the tracing information of the packaged food according to the information of the two-dimension code obtained by scanning.
The generating of the two-dimensional code with the set format comprises the following steps:
the method comprises the steps of carrying out data coding by adopting a mode of being compatible with a national standard two-dimensional code to obtain a binary bit stream of the two-dimensional code, wherein the binary bit stream comprises a national standard content section and an extended content section, the national standard content section comprises an identifier of the two-dimensional code, the extended content section is positioned behind the national standard content section and comprises an extended mode indicator, extended segmented content and an extended segmented mark, the extended segmented content is the content between the extended mode indicator and the extended segmented mark, and the extended segmented content comprises a verification code generated by encrypting the identifier of the two-dimensional code.
The recording of the circulation information of the packaged food at each circulation node comprises:
verifying the two-dimensional code on the food package at each circulation node, if the verification is successful, recording circulation information of the packaged food at each circulation node, wherein the circulation information comprises the identification of the two-dimensional code attached to the packaged product, the identification of the circulation node, the inflow time and the outflow time, and enabling the packaged food to flow to the next circulation node or a consumer; if the verification fails, the circulation is ended.
The two-dimensional code on the food package is verified at each circulation node, and the method comprises the following steps:
obtaining a binary bit stream of the two-dimensional code after error correction and data recombination according to a national standard decoding algorithm, decoding the binary bit stream until a national standard segmentation mark is decoded, if residual original bit information is not decoded after the national standard segmentation mark, reading bit data with the same length as the extension mode indicator after the national standard segmentation mark, judging whether the bit data is the extension mode indicator specified by the system, and if so, continuously decoding the binary bit stream until the extension segmentation mark; if not, the decoding is finished;
decoding the extended segmented content between the extended mode indicator and the extended segmented mark, decrypting the verification code when the decoded extended segmented content contains the verification code, and determining that the two-dimensional code is successfully verified when the decrypted information of the verification code contains the identifier of the two-dimensional code; and when the expansion segmented content obtained by decoding does not contain the verification code, or the information decrypted by the verification code does not contain the identification of the two-dimensional code, determining that the two-dimensional code is not verified successfully.
The scanning the two-dimensional code on the packaged food to obtain the information of the two-dimensional code, and inquiring the tracing information of the packaged food according to the information of the two-dimensional code obtained by scanning, the method comprises the following steps:
each circulation node sends updated circulation information of a packaged product to a server through a wireless or wired communication network, the server integrates the circulation information sent by all the circulation nodes, the integrated circulation information and the product information of the product form tracing information, the tracing information is stored in a product tracing database, the product information comprises product names and product identifiers, and the integrated circulation information comprises identifiers of two-dimensional codes attached to the packaged product, identifiers of each circulation node, inflow time and outflow time of each circulation node;
scanning the two-dimensional code on the packaged food, obtaining a binary bit stream of the two-dimensional code after error correction and data recombination according to a national standard decoding algorithm, decoding the binary bit stream until a national standard segmentation mark is decoded, obtaining a national standard content section in the two-dimensional code, obtaining an identifier of the two-dimensional code included in the national standard content section, inquiring the product tracing database according to the identifier of the two-dimensional code, and obtaining the tracing information of the product.
A third party food safety traceability device based on two-dimensional code comprises:
the two-dimensional code generating module is used for generating a two-dimensional code with a set format and attaching the two-dimensional code to the packaged food;
the tracing information management module is used for recording circulation information of the packaged food at each circulation node, forming the circulation information and product information of the packaged food into tracing information of the packaged food, and storing the tracing information and the information of the two-dimensional code in a correlation manner;
and the tracing information inquiry module is used for scanning the two-dimension code on the packaged food to obtain the information of the two-dimension code and inquiring the tracing information of the packaged food according to the information of the two-dimension code obtained by scanning.
The two-dimensional code generation module is used for carrying out data coding in a mode of being compatible with national standard two-dimensional codes to obtain a binary bit stream of the two-dimensional codes, wherein the binary bit stream comprises a national standard content section and an extended content section, the national standard content section is standard content which can be read by two-dimensional code reading equipment according with the national standard, the national standard content section comprises identification of the two-dimensional codes, the extended content section is positioned behind the national standard content section and comprises an extended mode indicator, extended segmented content and extended segmented marks, the extended segmented content is content between the extended mode indicator and the extended segmented marks, and the extended segmented content comprises verification codes generated by encrypting the identification of the two-dimensional codes.
The device further comprises:
the two-dimension code verification module is used for verifying the two-dimension code on the food package at each circulation node, obtaining a binary bit stream of the two-dimension code after error correction and data recombination according to a national standard decoding algorithm, decoding the binary bit stream until a national standard segmentation mark is decoded, reading bit data which is consistent with the length of the extension mode indicator and is behind the national standard segmentation mark if residual original bit information is not decoded behind the national standard segmentation mark, judging whether the bit data is the extension mode indicator specified by the system, and continuing to decode the binary bit stream until the extension segmentation mark if the bit data is the extension mode indicator specified by the system; if not, the decoding is finished;
decoding the extended segmented content between the extended mode indicator and the extended segmented mark, decrypting the verification code when the decoded extended segmented content contains the verification code, and determining that the two-dimensional code is successfully verified when the decrypted information of the verification code contains the identifier of the two-dimensional code; and when the expansion segmented content obtained by decoding does not contain the verification code, or the information decrypted by the verification code does not contain the identification of the two-dimensional code, determining that the two-dimensional code is not verified successfully.
The tracing information management module comprises:
the tracing information recording module is used for recording circulation information of the packaged food at each circulation node after the two-dimensional code verification module successfully verifies the two-dimensional code on the food package at each circulation node, wherein the circulation information comprises an identifier of the two-dimensional code attached to the packaged product, an identifier of the circulation node, inflow time and outflow time, and the packaged food flows to the next circulation node or a consumer; if the verification fails, the circulation is ended;
the tracing information storage module is used for being arranged in a server, receiving the updated circulation information of the packaged product sent by each circulation node through a wireless or wired communication network, integrating the circulation information sent by all the circulation nodes, integrating the integrated circulation information with the product information of the product to form tracing information, and storing the tracing information in a product tracing database, wherein the product information comprises product names and product identifiers, and the integrated circulation information comprises identifiers of two-dimensional codes on the packaged product, identifiers of each circulation node, and inflow time and outflow time of each circulation node.
The tracing information query module is used for scanning the two-dimensional code on the packaged food, obtaining a binary bit stream of the two-dimensional code after error correction and data recombination according to a national standard decoding algorithm, decoding the binary bit stream until a national standard segmentation mark is decoded, obtaining a national standard content section in the two-dimensional code, obtaining an identifier of the two-dimensional code included in the national standard content section, querying a product tracing database in the tracing information storage module according to the identifier of the two-dimensional code, and obtaining the tracing information of the product.
According to the technical scheme provided by the embodiment of the invention, the content of the private area in the two-dimensional code is hidden, so that the public can not be aware of the existence of the verification code in the private area when using the two-dimensional code, the safety of the two-dimensional code is enhanced on the premise of not influencing the use experience, and the safety of the product circulation attached to the two-dimensional code is further improved. The anti-counterfeiting method has the advantages that the 'one object one code' identification of packaged food is realized, the anti-counterfeiting capacity of products is enhanced, the circulation condition of each product is recorded at each circulation node, and when the food quality problem occurs, the problem products are conveniently positioned, and the products are quickly recalled.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a processing flow chart of a food safety tracing method based on two-dimensional codes according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a two-dimensional code having a private area compatible with GB/T18284-2000 quick response matrix code according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a third-party food safety tracing device based on a two-dimensional code according to a third embodiment of the present invention, in which a two-dimensional code generation module 31, a tracing information management module 32, a tracing information query module 33, a two-dimensional code verification module 34, a tracing information storage module 35, and a user management module 36 are provided.
Detailed Description
For the convenience of understanding the embodiments of the present invention, the following description will be further explained by taking several specific embodiments as examples in conjunction with the drawings, and the embodiments are not to be construed as limiting the embodiments of the present invention.
Example one
The invention aims to provide a food safety tracing method and a food safety tracing system based on two-dimension codes, which are characterized in that a private area is opened in the two-dimension codes to store verification codes, so that the self legality of the two-dimension codes is verified, the safety of the two-dimension codes is improved, and the safety of product circulation attached to the two-dimension codes is further improved; standardizing two-dimension code identification and content by uniformly issuing two-dimension codes; the cost of the enterprise using the system is reduced by providing the third-party service, and the objectivity and authority of the tracing information are guaranteed.
The embodiment provides a processing flow of a food safety tracing method based on two-dimensional codes, which is shown in fig. 1 and comprises the following processing steps:
and S110, applying for the uniformly generated two-dimensional code, attaching the two-dimensional code to a food package, and associating the two-dimensional code with product information of the packaged food.
The two-dimensional code carries out data coding by adopting a mode compatible with the national standard two-dimensional code to obtain a binary bit stream, and the binary bit stream generated by coding comprises a national standard content segment and an extended content segment.
The first section is a national standard content section which is standard content capable of being read by a two-dimensional code reading device according with the national standard, and a two-dimensional code terminator specified by the national standard or a symbol capable of being used as the terminator is used as a national standard segmentation mark. And generating a unique identifier for each two-dimensional code, and encoding the unique identifier into the national standard content segment.
The second segment is an extended content segment, and is located behind the national standard segmentation mark, and a common two-dimensional code reading device cannot read the part of the content, and a special device is needed to read the part of the content. The extended content segment comprises three parts of extended mode indicator, extended segmented content and extended segmented marker.
The mode indicator of the extended content segment is generally a different indicator mark from the mode indicator specified in the national standard, and the same indicator mark as the national mode indicator may be used without causing confusion.
And the extended section content of the extended content section is the content between the extended mode indicator and the extended section mark, the identification of the two-dimensional code is encrypted to generate a verification code, and the verification code is coded into the extended content section and is used for verifying the validity of the two-dimensional code.
The extended segment tags of the extended content segments may be the same as or different from the national segment tags.
The product information comprises product name, production and processing manufacturer name, raw material information, processing information, packaging information, quality inspection information and the like.
And step S120, verifying the two-dimensional code on the food package at each circulation node, if the verification is passed, executing step S130, and if not, ending circulation.
The circulation node may be an enterprise through which the circulation process of the packaged food passes.
Obtaining a binary bit stream of the two-dimensional code after error correction and data recombination according to a national standard decoding algorithm, decoding the binary bit stream of the two-dimensional code until a national standard segmentation mark is decoded, reading bit data which is consistent with the length of the extended mode indicator and behind the national standard segmentation mark if residual original bit information is not decoded behind the national standard segmentation mark, judging whether the bit data is the extended mode indicator specified by the system, and continuing decoding until the extended segmentation mark if the bit data is the extended mode indicator specified by the system; if not, the decoding is finished.
Decoding the extended segmented content between the extended mode indicator and the extended segmented mark, decrypting the verification code when the decoded extended segmented content contains the verification code, and determining that the two-dimensional code is successfully verified when the decrypted information of the verification code contains the identifier of the two-dimensional code; and when the expansion segmented content obtained by decoding does not contain the verification code, or the information decrypted by the verification code does not contain the identification of the two-dimensional code, determining that the two-dimensional code is not verified successfully.
The unique identification of the two-dimensional code is suggested to adopt international universal codes such as GS1 and EPC. In addition, the national standard content section of the two-dimensional code can also comprise some simple product description information, such as product names, production dates and the like. On food package, also can print the only sign of two-dimensional code at two-dimensional code periphery for the consumer inputs this sign by hand and traces back the inquiry.
And S130, recording circulation information of the packaged food at each circulation node, and enabling the packaged food to flow to the next circulation node or consumer. The circulation information includes a name of a circulation provider, an identifier of a circulation node, a number of products to be circulated, an identifier of a two-dimensional code attached to a product, inflow time and outflow time on the circulation node, and the like. The identification of the two-dimensional code attached to the product is a tracing number of the packaged food.
Each circulation node sends updated circulation information of the packaged product to a server through a wireless or wired communication network, the server integrates the circulation information sent by all the circulation nodes, the integrated circulation information and the product information of the product form traceability information, and the traceability information is stored in a product traceability database.
The integrated circulation information comprises the identification of the two-dimensional code attached to the packaged product, the identification of each circulation node, the inflow time and the outflow time of each circulation node, the warehousing information, the ex-warehouse information, the logistics transportation information, the sales information and the like of the packaged food recorded according to the tracing number of the packaged food. The integrated circulation information needs to be filled by a plurality of circulation nodes in the circulation process of the packaged food and is sent to the server.
The production information comprises information such as enterprise names, enterprise identifications, raw material producing areas, raw material inspection, raw material warehousing, production lines, processing technologies, processing dates, processing process inspection and testing, finished product quality inspection, packaging materials, production batches and the like.
Step S140, a consumer scans the two-dimension code on the packaged food through a mobile terminal to inquire the tracing information of the packaged food, obtains a binary bit stream of the two-dimension code after error correction and data recombination according to a national standard decoding algorithm, decodes the binary bit stream until a national standard segmentation mark is decoded to obtain a national standard content section in the two-dimension code, obtains an identifier of the two-dimension code included in the national standard content section, inquires the product tracing database according to the identifier of the two-dimension code, and obtains the tracing information of the product.
Example two
There are many two-dimensional codes, including QR (Quick Response Matrix code), Data Matrix, PDF417 and hanxin code, and the following takes the QR code which is most widely used at present as an example to explain how to implement the present invention.
The embodiment provides a food safety tracing method based on a QR code, and the specific processing process comprises the following steps:
step 1: the two-dimensional code generated uniformly is applied, the two-dimensional code is attached to a food package, and then the two-dimensional code is associated with product information of the packaged food.
The product information comprises a product name, a production and processing manufacturer name, raw material information, processing information, packaging information, quality inspection information and the like. The two-dimension code at least comprises a two-dimension code unique identifier and a verification code, wherein the two-dimension code unique identifier is stored in a national standard content section and is used as a tracing code.
The two-dimensional code generating module compatible with the GB/T18284-2000 quick response matrix code generates the two-dimensional code with the private area in the following manner, and the generated two-dimensional code structure is shown in FIG. 2.
There may be one or more international mode indicators in the international content segment, each international mode indicator being followed by a segment of international segmented content. For example, in actual use, the two-dimensional code unique identifier of the QR code is represented by a pure number, and the mode indicator "0001" (number) is used in encoding; the product description information is Chinese characters, and a mode indicator '1101' (Chinese characters) is used during coding. The QR code end of national content is represented by a 4-bit terminator "0000", and thus "0000" may be marked as a national segment of the QR code, followed by an extended content segment.
(2) Extending a content segment
The extended mode indicator in the extended content segment uses a different "1110" than the national mode indicator to indicate that the subsequent extended segment content is a passcode. Of course, in the QR code, "0000" is the strict national standard content end, and the extended mode indicator may also be the same as the national mode indicator without confusion, for example, "0010" may be used to indicate an alphanumeric verification code. The extended segment tags are identified using the same "0000" as the national segment tags. In practical applications, a plurality of extended mode indicators and a plurality of extended segment contents can be used to support more application scenarios according to actual needs.
And encrypting the identification of the two-dimension code to generate a verification code, and encoding the verification code into the extended content segment, wherein the verification code is used for verifying the validity of the two-dimension code. In order to improve the encryption and decryption efficiency, the symmetric domestic commercial cryptographic algorithm SM4 is used for encrypting the identification of the two-dimensional code to obtain a verification code, and the encryption and decryption algorithm is realized in a hardware mode. In order to further improve the security, the identification of the two-dimensional code and the product description information may be processed by a HASH algorithm, and the HASH value may be encrypted to generate the verification code.
The two-dimensional code generation mode can ensure that common two-dimensional code decoding equipment conforming to the national standard can only read the content of the national standard content segment, and the content of the extended content segment is hidden and can only be read by a special decoding algorithm.
The key storage module is responsible for storing various keys used by the system. The method is mainly used for storing the key with the unique identifier of the encrypted two-dimensional code, and can be used for managing one product corresponding to one key and one batch corresponding to one key, wherein the length of the key is preferably 128 bits.
Step 2: and (4) verifying the two-dimensional code on the food package at each circulation node, if the two-dimensional code passes verification, executing the step 3, and if not, finishing circulation.
In the verification process of the two-dimensional code, firstly, error correction and data recombination are carried out according to a national standard decoding algorithm to obtain an original binary code stream, then, the content is decoded until a national standard segmentation mark '0000' is decoded, if the residual original bit information is not decoded, bit data with the length equal to that of an extension mode indicator is read, whether the bit data is the extension mode indicator '1110' specified by the system is judged, if yes, the decoding is continued until the extension segmentation mark '0000', and if not, the decoding is ended.
In the two-dimensional code decoding process, if the extended mode indicator is not the extended mode indicator "1110" specified by the system, the two-dimensional code is not generated by the system.
The two-dimensional code verification module verifies the legality of the two-dimensional code in two modes of online verification and special equipment verification, and the passing verification of the two-dimensional code is a prerequisite condition that products attached to the two-dimensional code can be accepted and continuously circulate downwards.
And step 3: recording the circulation information of the packaged food at each circulation node, and enabling the packaged food to flow to the next circulation node or consumer.
The circulation information comprises a circulation merchant name, the quantity of circulated products, the two-dimensional code unique identification of the circulated products, inflow time, outflow time and the like.
And 4, step 4: the consumer scans the two-dimensional code through the mobile terminal to inquire the tracing information of the packaged food.
When the consumer inquires the tracing information, the consumer can also inquire the tracing information through a special tracing inquiry website according to the unique identifier of the two-dimensional code.
EXAMPLE III
The embodiment also provides a third-party food safety tracing device based on the two-dimensional code, the specific structure of which is shown in fig. 3 and comprises the following modules: the system comprises a two-dimensional code generating module 31, a tracing information management module 32, a tracing information inquiry module 33, a two-dimensional code verification module 34 and a user management module 35.
The two-dimensional code generating module 31 is used for generating a two-dimensional code with a set format and attaching the two-dimensional code to the packaged food;
the tracing information management module 32 is configured to record circulation information of the packaged food at each circulation node, combine the circulation information and product information of the packaged food into tracing information of the packaged food, and store the tracing information and information of the two-dimensional code in an associated manner;
and the tracing information inquiry module 33 is configured to scan the two-dimensional code on the packaged food to obtain information of the two-dimensional code, and inquire the tracing information of the packaged food according to the information of the two-dimensional code obtained by scanning.
Further, the two-dimensional code generating module 31 is configured to perform data encoding in a manner compatible with a national standard two-dimensional code to obtain a binary bit stream of the two-dimensional code, where the binary bit stream includes a national standard content segment and an extended content segment, the national standard content segment is standard content that can be read by a national standard two-dimensional code reading device and includes an identifier of the two-dimensional code, the extended content segment is located behind the national standard content segment and includes an extended mode indicator, extended segment content, and an extended segment flag, the extended segment content is content between the extended mode indicator and the extended segment flag, and the extended segment content includes a verification code generated by encrypting the identifier of the two-dimensional code.
Further, the two-dimensional code verification module 34 is configured to verify the two-dimensional code on the food package at each circulation node, obtain a binary bit stream of the two-dimensional code after error correction and data reassembly according to a national standard decoding algorithm, decode the binary bit stream until a national standard segment flag is decoded, read bit data with a length consistent with that of the extension mode indicator after the national standard segment flag if residual original bit information is not decoded after the national standard segment flag, determine whether the bit data is the extension mode indicator specified by the system, and continue to decode the binary bit stream until the extension segment flag if the bit data is the extension mode indicator specified by the system; if not, the decoding is finished;
decoding the extended segmented content between the extended mode indicator and the extended segmented mark, decrypting the verification code when the decoded extended segmented content contains the verification code, and determining that the two-dimensional code is successfully verified when the decrypted information of the verification code contains the identifier of the two-dimensional code; and when the expansion segmented content obtained by decoding does not contain the verification code, or the information decrypted by the verification code does not contain the identification of the two-dimensional code, determining that the two-dimensional code is not verified successfully.
Further, the trace back information management module 32 includes:
the tracing information recording module 321 is configured to record circulation information of the packaged food at each circulation node after the two-dimensional code verification module successfully verifies the two-dimensional code on the food package at each circulation node, where the circulation information includes an identifier of the two-dimensional code attached to the packaged product, an identifier of the circulation node, inflow time, and outflow time, and the packaged food flows to a next circulation node or a consumer; if the verification fails, the circulation is ended;
the tracing information storage module 322 is used for being arranged in a server, receiving the updated circulation information of the packaged product sent by each circulation node through a wireless or wired communication network, integrating the circulation information sent by all the circulation nodes, integrating the integrated circulation information with the product information of the product to form tracing information, and storing the tracing information in a product tracing database, wherein the product information comprises a product name and a product identifier, and the integrated circulation information comprises the identifier of a two-dimensional code on the packaged product, the identifier of each circulation node, the inflow time and the outflow time of each circulation node.
Further, the tracing information query module 33 is configured to scan the two-dimensional code on the packaged food, obtain a binary bit stream of the two-dimensional code after error correction and data recombination according to a national standard decoding algorithm, decode the binary bit stream until a national standard segment marker is decoded, obtain a national standard content segment in the two-dimensional code, obtain an identifier of the two-dimensional code included in the national standard content segment, query the product tracing database in the tracing information storage module according to the identifier of the two-dimensional code, and obtain the tracing information of the product.
Further, the user management module 35 is configured to provide system registration for the user and provide a registered user auditing function for the system administrator. The user who passes the audit can use the two-dimensional code generation, the two-dimensional code verification, the two-dimensional code decoding, the encryption and decryption and the tracing data acquisition functions of the system.
In specific implementation, the tracing information query is realized mainly by scanning a two-dimensional code on a product package through a mobile terminal; in addition, a special tracing inquiry website can be provided for a user to input the unique identification of the two-dimension code to inquire the tracing information.
The modules in the system can be combined and decomposed according to specific implementation conditions to achieve a better implementation effect. For example, the two-dimension code verification module and the tracing information query module can be integrated on a mobile phone terminal, a consumer can shoot and decode a two-dimension code picture on a food package through a mobile phone, then specific contents in a Chinese logo content section of the two-dimension code are displayed, the two-dimension code can be connected with a server end through GPRS (general packet radio service), 3G (third generation telecommunication) or WIFI (wireless fidelity) and other modes, the identification and the verification code of the two-dimension code are sent to the server end for verification, and after the verification is passed, the server end returns tracing information related to the product to the mobile phone terminal to be displayed to a user.
For another example, the two-dimension code verification module and the trace back data acquisition module can be integrated on a special intelligent terminal with a display screen and a wireless communication module, after a user logs in the special intelligent terminal by using a verified legal account, the terminal acquires a decryption key from the server, the legality of the two-dimension code is verified locally, the trace back data is uploaded to the server, and convenience and efficiency of two-dimension code verification and trace back data acquisition are improved.
The specific process of using the device of the embodiment of the invention to perform food safety tracing based on the two-dimensional code is similar to that of the method embodiment, and is not repeated here.
In summary, the embodiment of the invention hides the content of the private area in the two-dimensional code, so that the public can not be aware of the existence of the verification code in the private area when using the two-dimensional code, and on the premise of not influencing the use experience, the security of the two-dimensional code is enhanced, thereby improving the security of the product circulation attached to the two-dimensional code.
The embodiment of the invention provides the service of uniformly issuing and verifying the two-dimension code, standardizes the identification and the content of the two-dimension code, improves the use efficiency of the two-dimension code, is convenient for interconnection and intercommunication with other systems, and is easy to form scale effect. The distribution information of each distribution is not required to be coded into the two-dimensional code, and a new two-dimensional code is not required to be generated in each distribution, so that the distribution work is simple.
The embodiment of the invention realizes the 'one object one code' identification of packaged food, enhances the anti-counterfeiting capability of products, records the circulation condition of each product at each circulation node, and is convenient for positioning the problem products and recalling the products quickly when the food quality problem occurs.
According to the embodiment of the invention, the service can be provided for the user in the third-party cloud service mode and the website mode, the user does not need to build a system by himself, the cost of using the system by an enterprise is reduced, and the objectivity and authority of the tracing information are ensured.
Those of ordinary skill in the art will understand that: the figures are merely schematic representations of one embodiment, and the blocks or flow diagrams in the figures are not necessarily required to practice the present invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for apparatus or system embodiments, since they are substantially similar to method embodiments, they are described in relative terms, as long as they are described in partial descriptions of method embodiments. The above-described embodiments of the apparatus and system are merely illustrative, and the units described as separate parts may or may not be physically separate, and the 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 modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (4)
1. A food safety tracing method based on two-dimension codes is characterized by comprising the following steps:
generating a two-dimensional code with a set format at a production manufacturer, and attaching the two-dimensional code to packaged food, wherein the information of the two-dimensional code comprises an identifier of the two-dimensional code and a verification code generated by encrypting the identifier of the two-dimensional code;
the generating of the two-dimensional code with the set format comprises the following steps:
performing data coding by adopting a mode compatible with the national standard two-dimensional code to obtain a binary bit stream of the two-dimensional code, wherein the binary bit stream comprises a national standard content segment and an extended content segment,
the national standard content segment comprises the identification of the two-dimensional code, the extended content segment is positioned behind the national standard content segment and comprises an extended mode indicator, extended segmented content and an extended segmented mark,
the extended segmented content is the content between the extended mode indicator and the extended segmented marker, and the extended segmented content comprises a verification code generated by encrypting the identifier of the two-dimensional code;
at each circulation node, recording circulation information of the packaged food at each circulation node, including:
scanning the two-dimensional code on the packaged food to obtain the information of the two-dimensional code;
verifying the two-dimension code on the food package, and if the verification is successful, recording circulation information of the packaged food at the circulation node, wherein the circulation information comprises an identifier of the two-dimension code attached to the packaged food, an identifier of the circulation node, inflow time and outflow time so as to enable the packaged food to flow to the next circulation node or a consumer;
the verifying the two-dimensional code on the food package comprises:
obtaining a binary bit stream of the two-dimensional code after error correction and data recombination according to a national standard decoding algorithm, decoding the binary bit stream until a national standard segmentation mark is decoded, if residual original bit information is not decoded after the national standard segmentation mark, reading bit data which is behind the national standard segmentation mark and has the same length as the extension mode indicator, judging whether the bit data belongs to the extension mode indicator, and if so, continuing to decode the binary bit stream until the extension segmentation mark; if not, the decoding is finished;
decoding the extended segmented content between the extended mode indicator and the extended segmented mark, decrypting the verification code when the decoded extended segmented content contains the verification code, and determining that the two-dimensional code is successfully verified when the decrypted information of the verification code contains the identifier of the two-dimensional code; when the expansion segmented content obtained by decoding does not contain the verification code, or the information decrypted by the verification code does not contain the identification of the two-dimensional code, determining that the two-dimensional code is not verified successfully;
storing the circulation information of the circulation node and the information of the two-dimensional code in a correlation manner;
correspondingly, each circulation node sends updated circulation information of the packaged food to a server through a wireless or wired communication network, the server integrates the circulation information sent by all the circulation nodes, and the integrated circulation information and the product information of the packaged food form traceability information, wherein the product information of the packaged food comprises a product name, a production and processing manufacturer name, raw material information, processing information, packaging information and quality inspection information;
storing the tracing information in a product tracing database, wherein the product information comprises a product name and a product identifier, and the integrated circulation information comprises an identifier of a two-dimensional code attached to the packaged food, an identifier of each circulation node, and inflow time and outflow time of each circulation node;
at a consumer, scanning the two-dimension code on the packaged food to obtain the information of the two-dimension code, and inquiring the tracing information of the packaged food according to the information of the two-dimension code obtained by scanning, wherein the tracing information comprises:
scanning the two-dimensional code on the packaged food, obtaining a binary bit stream of the two-dimensional code after error correction and data recombination according to a national standard decoding algorithm, decoding the binary bit stream until a national standard segmentation mark is decoded, obtaining a national standard content section in the two-dimensional code, obtaining an identifier of the two-dimensional code included in the national standard content section, verifying the two-dimensional code on the food package, and inquiring the product tracing database according to the identifier of the two-dimensional code if verification is successful, so as to obtain the tracing information of the packaged food.
2. The food safety tracing method based on two-dimension code as claimed in claim 1,
the recording of the circulation information of the packaged food at each circulation node further comprises:
when the two-dimensional code on the food package is verified, if the verification fails, the distribution is ended.
3. The utility model provides a food safety device of traceing back based on two-dimensional code which characterized in that includes:
the two-dimensional code generating module is used for generating a two-dimensional code with a set format at a production processing manufacturer and attaching the two-dimensional code to packaged food, wherein the information of the two-dimensional code comprises an identifier of the two-dimensional code and a verification code generated by encrypting the identifier of the two-dimensional code;
wherein, the two-dimensional code of formation setting includes: performing data coding by adopting a mode of being compatible with a national standard two-dimensional code to obtain a binary bit stream of the two-dimensional code, wherein the binary bit stream comprises a national standard content segment and an extended content segment, the national standard content segment is standard content which can be read by a national standard two-dimensional code reading device and comprises an identifier of the two-dimensional code, the extended content segment is positioned behind the national standard content segment and comprises an extended mode indicator, extended segmented content and an extended segmented mark, the extended segmented content is content between the extended mode indicator and the extended segmented mark, and the extended segmented content comprises a verification code generated by encrypting the identifier of the two-dimensional code;
the tracing information management module is used for recording the circulation information of the packaged food at each circulation node, and comprises:
scanning the two-dimensional code on the packaged food to obtain the information of the two-dimensional code;
verifying the two-dimension code on the food package, if the verification is successful, recording circulation information of the packaged food at the circulation node, wherein the circulation information comprises an identifier of the two-dimension code attached to the packaged food, an identifier of the circulation node, inflow time and outflow time, and enabling the packaged food to flow to the next circulation node or a consumer;
storing the circulation information of the circulation node and the information of the two-dimensional code in a correlation manner;
wherein, verify the two-dimensional code on the food package, include:
obtaining a binary bit stream of the two-dimensional code after error correction and data recombination according to a national standard decoding algorithm, decoding the binary bit stream until a national standard segmentation mark is decoded, if residual original bit information is not decoded after the national standard segmentation mark, reading bit data with the same length as the extension mode indicator after the national standard segmentation mark, judging whether the bit data belongs to the extension mode indicator, and if so, continuously decoding the binary bit stream until the extension segmentation mark; if not, the decoding is finished;
decoding the extended segmented content between the extended mode indicator and the extended segmented mark, decrypting the verification code when the decoded extended segmented content contains the verification code, and determining that the two-dimensional code is successfully verified when the decrypted information of the verification code contains the identifier of the two-dimensional code; when the expansion segmented content obtained by decoding does not contain the verification code, or the information decrypted by the verification code does not contain the identification of the two-dimensional code, determining that the two-dimensional code is not verified successfully;
the traceability information storage module is arranged in the server and used for receiving updated circulation information of the packaged food sent by each circulation node through a wireless or wired communication network, integrating the circulation information sent by all the circulation nodes and combining the integrated circulation information and the product information of the packaged food into traceability information, wherein the product information of the packaged food comprises information such as a product name, a production and processing manufacturer name, raw material information, processing information, packaging information, quality inspection information and the like;
storing the tracing information in a product tracing database, wherein the product information comprises a product name and a product identifier, and the integrated circulation information comprises an identifier of a two-dimensional code attached to the packaged food, an identifier of each circulation node, and inflow time and outflow time of each circulation node;
and the tracing information inquiry module is used for scanning the two-dimensional code on the packaged food at a consumer, obtaining a binary bit stream of the two-dimensional code after error correction and data recombination according to a national standard decoding algorithm, decoding the binary bit stream until a national standard segmentation mark is decoded to obtain a national standard content section in the two-dimensional code, obtaining an identifier of the two-dimensional code included in the national standard content section, verifying the two-dimensional code on the food package, and inquiring a product tracing database in the tracing information storage module according to the identifier of the two-dimensional code if verification is successful to obtain the tracing information of the packaged food.
4. The food safety tracing device based on two-dimensional code of claim 3,
the tracing information management module, when verifying the two-dimensional code on the food package, further comprises:
if the verification fails, the circulation is ended.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410721334.8A CN105719144B (en) | 2014-12-02 | 2014-12-02 | Food safety tracing method and system based on two-dimension code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410721334.8A CN105719144B (en) | 2014-12-02 | 2014-12-02 | Food safety tracing method and system based on two-dimension code |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105719144A CN105719144A (en) | 2016-06-29 |
CN105719144B true CN105719144B (en) | 2021-07-27 |
Family
ID=56146403
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410721334.8A Active CN105719144B (en) | 2014-12-02 | 2014-12-02 | Food safety tracing method and system based on two-dimension code |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105719144B (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106228377A (en) * | 2016-07-27 | 2016-12-14 | 江苏商达水务有限公司 | A kind of product complete period retroactive method based on Quick Response Code and device |
CN106408324A (en) * | 2016-08-29 | 2017-02-15 | 星空电讯科技(北京)股份有限公司 | Intelligent cloud screen identification code matching method |
CN108229969A (en) * | 2016-12-09 | 2018-06-29 | 北京大码技术有限公司 | Combined two-dimension code anti-fake system and method, combined two-dimension code, reading device |
CN106846012A (en) * | 2017-01-10 | 2017-06-13 | 深圳市法兰智联股份有限公司 | A kind of false proof retroactive method and system |
CN107992917B (en) * | 2017-12-13 | 2020-01-31 | 广东正业科技股份有限公司 | Quality tracing method for multilayer PCBs |
CN108681910A (en) * | 2018-06-27 | 2018-10-19 | 中南民族大学 | Retroactive method, device, terminal device based on network structure and storage medium |
CN109447663A (en) * | 2018-10-26 | 2019-03-08 | 杨溢 | A kind of food safety control method and system |
CN110458585A (en) * | 2019-08-12 | 2019-11-15 | 北京星汉特种印刷有限公司 | Based on block chain technical label traceability system |
CN111242527A (en) * | 2019-12-30 | 2020-06-05 | 航天信息股份有限公司 | Grain transportation management method and device |
CN111507736A (en) * | 2020-04-21 | 2020-08-07 | 贵州大学 | Method for recording product packaging process by using nested digital twin |
CN115131038A (en) * | 2022-07-06 | 2022-09-30 | 青岛数普智能互联科技有限公司 | Food safety tracing method and device and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2005111926A1 (en) * | 2004-05-18 | 2005-11-24 | Silverbrook Research Pty Ltd | Method and apparatus for security document tracking |
CN101236623A (en) * | 2008-01-04 | 2008-08-06 | 中信二十一世纪(中国)科技有限公司 | Electronic monitoring code system |
CN102314644A (en) * | 2011-08-25 | 2012-01-11 | 广州宽度信息技术有限公司 | Application system and method for realizing food information tracing by two-dimensional codes |
CN102609543A (en) * | 2012-02-27 | 2012-07-25 | 华南农业大学 | Multifunctional two-dimensional code product traceability system and traceability method |
CN102609803A (en) * | 2011-01-11 | 2012-07-25 | 华南农业大学 | Two-dimension code based low-cost product safety tracking system and method thereof |
CN103729707A (en) * | 2012-10-16 | 2014-04-16 | 廖利平 | Chinese herbal piece supply chain management system based on codes |
CN103886469A (en) * | 2014-03-31 | 2014-06-25 | 南京理工大学 | Product two-dimension code generation and query system |
-
2014
- 2014-12-02 CN CN201410721334.8A patent/CN105719144B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2005111926A1 (en) * | 2004-05-18 | 2005-11-24 | Silverbrook Research Pty Ltd | Method and apparatus for security document tracking |
CN101236623A (en) * | 2008-01-04 | 2008-08-06 | 中信二十一世纪(中国)科技有限公司 | Electronic monitoring code system |
CN102609803A (en) * | 2011-01-11 | 2012-07-25 | 华南农业大学 | Two-dimension code based low-cost product safety tracking system and method thereof |
CN102314644A (en) * | 2011-08-25 | 2012-01-11 | 广州宽度信息技术有限公司 | Application system and method for realizing food information tracing by two-dimensional codes |
CN102609543A (en) * | 2012-02-27 | 2012-07-25 | 华南农业大学 | Multifunctional two-dimensional code product traceability system and traceability method |
CN103729707A (en) * | 2012-10-16 | 2014-04-16 | 廖利平 | Chinese herbal piece supply chain management system based on codes |
CN103886469A (en) * | 2014-03-31 | 2014-06-25 | 南京理工大学 | Product two-dimension code generation and query system |
Also Published As
Publication number | Publication date |
---|---|
CN105719144A (en) | 2016-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105719144B (en) | Food safety tracing method and system based on two-dimension code | |
EP3262785B1 (en) | Tracking unitization occurring in a supply chain | |
CN107038594A (en) | A kind of commodity counterfeit prevention traceability system based on two-dimensional bar code | |
CN103413227B (en) | Product anti-counterfeiting tracing system and the false proof implementation method reviewing examination thereof | |
CN111861455B (en) | Personal information query method and device based on mobile terminal bar code | |
CN104834999B (en) | Commodity based on cloud, which are traced to the source and consumed, flows to statistical analysis technique and system | |
CN104424579B (en) | Anti-counterfeiting tracing management system | |
CN105678365B (en) | Two-dimensional code electronic ticket generating method and system, verification method and verification terminal | |
CN104281866A (en) | Two-dimensional code application method and device | |
CN107430755A (en) | The encrypted authentication in source in supply chain | |
CN102609803A (en) | Two-dimension code based low-cost product safety tracking system and method thereof | |
CN101847225B (en) | A kind of method based on CN39 code managing commodity circulation | |
CN103020682B (en) | Books Quick Response Code identification generation apparatus, Quick Response Code identification recognition device and system | |
CN102855593A (en) | Intelligent mobile terminal electronic guarantee system and method based on same | |
CN101593265A (en) | Antiforge system based on radio-frequency (RF) identification | |
CN101094383A (en) | IPTV authentication and authorization method, server and system | |
CN107992923A (en) | A kind of QR Quick Response Codes generation and the method read | |
CN101593264A (en) | Method for anti-counterfeit based on radio-frequency (RF) identification | |
CN104766113A (en) | Plain and secret code type anti-fake label and anti-fake method thereof | |
CN104794626A (en) | Anti-counterfeiting method and anti-counterfeiting device based on hardware information | |
CN105184590A (en) | Laser on-line efficient etching and product anti-fake traceability system applied to steels | |
CN103984972A (en) | Product information acquiring method and device, as well as electronic tag code acquiring method | |
US20180205714A1 (en) | System and Method for Authenticating Electronic Tags | |
CN104680392A (en) | Identity-based product tracing system and method | |
CN104836817A (en) | Architecture and method for ensuring network information safety |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 |