Search

CN-122022841-A - Food full-chain dynamic tracing system and method based on block chain and Internet of things

CN122022841ACN 122022841 ACN122022841 ACN 122022841ACN-122022841-A

Abstract

The invention discloses a full-chain dynamic food tracing system and method based on a blockchain and the Internet of things, and relates to the technical field of blockchains, wherein the system comprises the steps of endowing unique food identification to food outer package and binding with full-chain data; the method comprises the steps of collecting state information of each link in real time, generating associated data with a time stamp, generating a food exclusive tracing code based on a unique food identifier, using monitoring equipment as a block chain consensus node, realizing data intercommunication through a cross-chain technology, enabling consumers to check all-chain trusted information through the food exclusive tracing code, defining a preset abnormal condition set by a system, comparing data in real time through a block chain account book, immediately stopping transportation or production when abnormal, comprehensively scoring the appearance and the integrity of each link food, and sending instructions according to a threshold range to synchronize to the system for recording. The invention solves the problems of opaque data, incomplete chain and dependence on manual evaluation of the traditional traceability system, and improves the accuracy, instantaneity and credibility of food safety traceability.

Inventors

  • ZHAO RONG

Assignees

  • 曜坤智健数字科技(上海)有限公司

Dates

Publication Date
20260512
Application Date
20260129

Claims (10)

  1. 1. The full-chain dynamic food tracing method based on the block chain and the Internet of things is characterized by comprising the following steps of: Step S1, respectively deploying an adaptive sensor and detection equipment in each link of food production, and endowing unique food identification to the outer package of each piece of food, wherein the unique food identification and the food full-chain data form binding association, and associate an operator terminal ID, a supervision equipment ID and a food full-chain dynamic traceability system access identification; S2, collecting state information of each link in real time through communication equipment of the Internet of things, preprocessing collected data through a data processing layer, and establishing multidimensional association between the processed data and unique food identifiers, operator terminal IDs and supervision equipment IDs to generate associated data with time stamps; Step S3, after hash encryption and digital signature processing, the associated data are written into a distributed block chain account book to form a food full chain data file, and meanwhile, a food exclusive tracing code is generated based on a unique food identifier, and an associated mapping is established between the food exclusive tracing code and uplink data and system data of each link; S4, taking the supervision equipment as a block chain consensus node, acquiring full-chain data through a unique food identifier and a food exclusive tracing code for verification, and simultaneously realizing data intercommunication and mutual recognition of the block chain and a food full-chain dynamic tracing system through a cross-chain technology, wherein consumers check the food full-chain trusted information through the food exclusive tracing code; step S5, defining a preset abnormal condition set, judging whether the abnormal condition is matched with each link data identified in real time in the distributed blockchain account book, immediately stopping transportation or production if the abnormal condition is identified, positioning an abnormal reason based on blockchain tracing data, and synchronously uploading the abnormal condition, process parameters and image data to a chain for evidence; And S6, comprehensively grading the appearance and the integrity of the food in each link, defining a preset repair threshold, sending a transport stopping or production and repair instruction if the comprehensive grading is within the threshold range, sending a transport stopping or production and post-treatment instruction if the comprehensive grading exceeds the threshold, synchronizing to a supervision device and a system for recording, and normally circulating the rest of the food.
  2. 2. The full-chain dynamic tracing method for food based on blockchain and internet of things according to claim 1, wherein in the step S1, unique food identification is generated by adopting UUID coding rules, the unique food identification comprises food category codes, production batch codes, production time codes and random sequence codes, wherein the food category codes adopt 2-bit digital codes to represent food category, the production batch codes adopt 6-bit digital codes to represent production batch information of food, the production time codes adopt 8-bit digital codes to represent specific production year, month and day of food, and the random sequence codes adopt 16-bit digital and letter combination codes for distinguishing different single-piece food produced in the same batch and at the same time.
  3. 3. The method for dynamically tracing the whole chain of the food based on the blockchain and the internet of things according to claim 1, wherein the step S5 specifically comprises: Predefining a preset abnormal condition set of each link of a food full chain, wherein the preset abnormal condition set comprises an environment parameter abnormal subset, a food state abnormal subset and a device operation abnormal subset, and the set is synchronized to each block chain node; The multi-dimensional associated data with the time stamp is called by the block chain link point in real time, and the real-time collected data of each link is compared and matched with a preset abnormal condition set; If the abnormal condition is identified by matching, immediately triggering a transport stopping or production instruction, starting a reverse tracing flow at the same time, checking uplink data of each link step by step from an abnormal generation link forward based on a unique food identifier, and positioning an abnormal source link with abrupt data change; Uploading word description, process parameters, image data and traceability results of the abnormal condition by the operator terminal, and writing the word description, the process parameters, the image data and the traceability results into a distributed blockchain account book after hash encryption and digital signature to form an abnormal analysis file; based on the anomaly analysis file, the system updates a preset anomaly condition set, and optimizes the monitoring parameters of the sensors of each link and the identification rules of the detection equipment.
  4. 4. The method for dynamically tracing the whole chain of the food based on the blockchain and the internet of things according to claim 1, wherein the step S6 specifically comprises: determining a food comprehensive scoring index system, wherein the scoring index comprises food appearance integrity, color uniformity and morphology regularity, and weight is distributed to each index; Collecting quantitative values of all indexes through detection equipment, and calculating a comprehensive food grading value according to a comprehensive grading calculation formula; setting a preset restoration threshold interval, and comparing the calculated comprehensive grading value with the threshold interval; If the preset repair threshold interval is met, sending a transport stopping or production and repair instruction to an operator terminal, wherein the repair instruction comprises unique food identification and specific evaluation index defect information of food to be processed; if the preset restoration threshold interval is not met, sending a transport stopping or production and post-treatment instruction to an operator terminal, wherein the transport stopping or production instruction comprises a unique food identifier and a food treatment suggestion of food to be treated, and simultaneously writing comprehensive grading data and treatment results of the food into a block chain in association with the unique food identifier, and enabling other food to circulate normally; the calculation formula of the comprehensive score is as follows: Wherein, the For the purpose of the composite score, Is the first The weight of the item scoring index is determined, Is the first The scoring value of the term's index, Is the number of scoring indicators.
  5. 5. The full-chain dynamic traceability method of food based on blockchain and internet of things according to claim 1, wherein the preprocessing in step S2 comprises data cleaning, noise reduction and normalization, and the expression of the normalization is: wherein For the purpose of the raw acquisition data, For the data minimum value of this class, For the maximum value of this type of data, Is normalized acquired data.
  6. 6. The full-chain dynamic traceability method of food based on blockchain and internet of things according to claim 1, wherein the hash encryption in the step S3 adopts SHA-256 algorithm to convert associated data into 256-bit hash value, and the expression is: , wherein, As a result of the hash value(s), In order to pre-process the associated data, In order to be a time stamp, And for unique food identification, the digital signature adopts an asymmetric encryption algorithm, and encryption operation is realized through private key signature and public key verification of each link node.
  7. 7. The method for dynamically tracing the full chain of the food based on the blockchain and the internet of things according to claim 1, wherein the food-specific tracing code in the step S3 is any one of a two-dimensional code, an NFC chip and a bar code, and the food-specific tracing code is used for calling the full chain uplink data of the corresponding food through the blockchain link point after the consumer identifies the food-specific tracing code.
  8. 8. The full-chain dynamic tracing method for food based on the blockchain and the internet of things according to claim 1, wherein each link of food production in the step S1 comprises a planting and breeding link, a processing link, a storage link, a transportation link and a sales link, the sensor comprises a soil sensor, a temperature and humidity sensor, an illumination sensor, a device running rotating speed sensor, a gas concentration sensor, a GPS positioning sensor and a timer, and the detection device comprises a video monitoring device, a drug residue detection device, an appearance visual detection device and a sanitation index detection device.
  9. 9. The blockchain and internet of things-based food full-chain dynamic tracing method according to claim 8, wherein the state information in the step S2 comprises soil moisture content, fertigation data, feed feeding records, epidemic prevention information, slaughter quarantine results of the planting and breeding links, raw material batches of the processing links, cleaning and sorting data, cutting and packaging parameters, sterilization parameters, operator information, production date, storage environment temperature and humidity of the storage links, storage position information, transportation track of the transportation links, in-transit temperature and humidity data, and food appearance integrity and packaging tightness of the sales links.
  10. 10. The full-chain dynamic food tracing system based on the blockchain and the internet of things for executing the full-chain dynamic food tracing method based on the blockchain and the internet of things according to any one of claims 1 to 9, which is characterized by comprising: the sensing layer comprises sensors and detection equipment which are deployed in various links of food production, and an operator terminal and monitoring equipment, and is used for acquiring multidimensional data; The network layer comprises communication equipment of the Internet of things and is used for transmitting the data acquired by the sensing layer to the data processing layer; The data processing layer comprises a preprocessing module, an encryption signature module and a processing engine, wherein the preprocessing module is used for cleaning and standardizing acquired data, the encryption signature module is used for generating hash values and digital signatures, and the processing engine is used for executing anomaly comparison, tracing calculation and scoring operation logic; The block chain layer comprises distributed block chain account book nodes and block chain consensus nodes and is used for storing encrypted associated data; The application layer comprises a tracing inquiry module, an abnormal alarm module and a comprehensive scoring module, wherein the tracing inquiry module is used for generating tracing codes and providing data inquiry service, the abnormal alarm module is used for identifying abnormality and triggering tracing flow, and the comprehensive scoring module is used for calculating comprehensive scores of foods and sending corresponding instructions.

Description

Food full-chain dynamic tracing system and method based on block chain and Internet of things Technical Field The invention relates to the technical field of blockchains, in particular to a full-chain dynamic food tracing system and method based on a blockchain and the Internet of things. Background With the technical progress, the supply chain management no longer depends on the traditional recording mode, but gradually applies advanced technologies such as the internet of things and the blockchain to ensure transparent disclosure of information of each link, and particularly in the food field, the food quality problem is the core of high attention of each link. The prior art realizes the monitoring operation of the whole process of food production, transportation and storage to sales by tracking and recording a plurality of parameters of transportation environment and storage conditions. However, in the current food monitoring system, due to single monitoring of environmental parameters, the lack of effective multi-dimensional parameter cross analysis, problem tracing is often limited to a single link, and centralized database storage data is adopted, so that the defects of incomplete tracing chain, low information transparency and the like exist, meanwhile, the existing tracing system generally lacks real-time abnormal monitoring capability, so that when quality abnormality or potential safety hazard occurs to food, abnormal sources cannot be positioned quickly, problem food diffusion is easily caused, and the evaluation of states such as food appearance, integrity and the like is dependent on manual judgment, standardized treatment is difficult to realize, and the practical value of the tracing system is not fully exerted. Based on the method, the full-chain dynamic food tracing system and method based on the block chain and the Internet of things are provided, and the defects existing in the prior art scheme can be overcome. Disclosure of Invention The invention aims to provide a block chain and Internet of things-based food full-chain dynamic traceability system and method, which are used for solving the problems of data storage centralization, lack of multidimensional cross analysis and real-time monitoring and difficulty in standardization of manual evaluation in the prior art. In order to achieve the above purpose, the present invention provides the following technical solutions: A food full-chain dynamic tracing method based on block chains and the Internet of things specifically comprises the following steps: Step S1, respectively deploying an adaptive sensor and detection equipment in each link of food production, and endowing unique food identification to the outer package of each piece of food, wherein the unique food identification and the food full-chain data form binding association, and associate an operator terminal ID, a supervision equipment ID and a food full-chain dynamic traceability system access identification; S2, collecting state information of each link in real time through communication equipment of the Internet of things, preprocessing collected data through a data processing layer, and establishing multidimensional association between the processed data and unique food identifiers, operator terminal IDs and supervision equipment IDs to generate associated data with time stamps; Step S3, after hash encryption and digital signature processing, the associated data are written into a distributed block chain account book to form a food full chain data file, and meanwhile, a food exclusive tracing code is generated based on a unique food identifier, and an associated mapping is established between the food exclusive tracing code and uplink data and system data of each link; S4, taking the supervision equipment as a block chain consensus node, acquiring full-chain data through a unique food identifier and a food exclusive tracing code for verification, and simultaneously realizing data intercommunication and mutual recognition of the block chain and a food full-chain dynamic tracing system through a cross-chain technology, wherein consumers check the food full-chain trusted information through the food exclusive tracing code; step S5, defining a preset abnormal condition set, judging whether the abnormal condition is matched with each link data identified in real time in the distributed blockchain account book, immediately stopping transportation or production if the abnormal condition is identified, positioning an abnormal reason based on blockchain tracing data, and synchronously uploading the abnormal condition, process parameters and image data to a chain for evidence; And S6, comprehensively grading the appearance and the integrity of the food in each link, defining a preset repair threshold, sending a transport stopping or production and repair instruction if the comprehensive grading is within the threshold range, sending a transport stopping or production and post-treatment