Disclosure of Invention
The invention aims to provide a product tracing system and method based on information carried by food packaging, which solve the following technical problems:
when the existing product tracing technology based on information carried by food packaging performs product tracing through a blockchain technology, a large amount of information needs to be written into a blockchain, so that the load on a blockchain network is high.
The aim of the invention can be achieved by the following technical scheme:
product traceability system based on information carried by a food package, comprising:
the product data acquisition module: the method comprises the steps of collecting production data in the production process of a product in real time through an MES system and sensor equipment;
and a transportation management module: the system is used for collecting logistics data of the product in the transportation process;
Product supply chain node: setting product supply chain nodes at physical positions of all links of a supply chain, arranging edge computing nodes by all the product supply chain nodes, writing product tracing key information into a block chain through a data transmission module by the product supply chain nodes, and reserving product tracing non-key information at the corresponding edge computing nodes of the supply chain nodes;
and a data transmission module: for passing product supply chain nodes the block chain network is in communication connection;
and the data query and trace module: the unique traceability code of the product is inquired through identifying the embedded RFID chip in the food package, and the product traceability key information of the product is inquired through inputting the unique traceability code of the product in the inquire platform.
As a further scheme of the invention: the product data acquisition module acquires production data in the production process of a product in real time, and the production data comprises: production and packaging equipment operating state, temperature, humidity, shelf life end date, raw material batch data, production batch data, and product factory detection data.
As a further scheme of the invention: the transportation management module is arranged at each transfer station of the product transportation line, and is used for collecting temperature, humidity, position and shelf life end date data of the product transported and stored at the transfer station as logistics data in the product transportation process.
As a further scheme of the invention: the product supply chain nodes are deployed at physical positions of a production link, a transportation link and a sales link of the supply chain, the production link of the supply chain sets workshops and warehouses for product production as product supply chain nodes, the transportation link of the supply chain sets each transit site of a product transportation line as a product supply chain node, and the sales link of the supply chain sets a place for product sales as a product supply chain node.
As a further scheme of the invention: the product tracing key information comprises: raw material batch data, production batch data and product factory detection data in the production data, and position data in the logistics data; the product tracing non-critical information includes: production and packaging equipment operation state, temperature, humidity and expiration date data in the production data, and transit station transportation stored temperature and humidity in the logistics data;
And automatically deleting the product traceable non-key information stored in the local edge computing node after the expiration date.
As a further scheme of the invention: the data query and trace module is used for tracing and inquiring raw material batch data, production batch data and product delivery detection data in the production data of the product and position data in the logistics data through interaction of the unique trace code of the input product and the blockchain network.
As a further scheme of the invention: the data transmission module enables the product supply chain nodes to be in communication connection through a blockchain network, and the method comprises the following steps of:
each product supply chain node establishes connection with a blockchain network through a deployed management Agent;
Creating an intelligent contract on the blockchain, wherein the intelligent contract is used for defining communication rules and message formats between the nodes of the product supply chain;
deploying a Web3.js library at a product production node in a product supply chain node, enabling the product production node to interactively call an intelligent contract function with an intelligent contract in an Ethernet network through the Web3.js library, and enabling the product production node to authenticate other nodes in the same product supply chain through the intelligent contract function;
By defining a rights modifier in the smart contract, only the address of the authenticated node can be granted to the rights modifier, and the authenticated node communicates with other authenticated nodes by invoking the rights modifier to perform a function in the smart contract;
The product supply chain node encrypts the message when sending and receiving the message through the deployed management Agent and verifies the identity of the product supply chain node sending and receiving the message.
The product tracing method based on the information carried by the food package comprises the following steps:
s1: acquiring production data in the production process and logistics data in the transportation process of the product in real time;
S2: setting product supply chain nodes at physical positions of all links of a supply chain, deploying edge computing nodes at all the product supply chain nodes, and enabling the product supply chain nodes to be in communication connection through a block chain network;
S3: the product supply chain link point writes product tracing key information in the production data and the logistics data into the block chain through the data transmission module, and retains product tracing non-key information in the production data and the logistics data in corresponding edge computing nodes of the supply chain node;
s4: and inquiring the unique traceability code of the product by identifying the embedded RFID chip in the food package, and inquiring the traceability key information of the product.
As a further scheme of the invention: step S2, comprising the steps of:
Setting product supply chain nodes at physical positions of all links of a supply chain, deploying edge computing nodes at all product supply chain nodes, and establishing connection between each product supply chain node and a blockchain network through deployed management agents;
Creating an intelligent contract on the blockchain, wherein the intelligent contract is used for defining communication rules and message formats between the nodes of the product supply chain;
deploying a Web3.js library at a product production node in a product supply chain node, enabling the product production node to interactively call an intelligent contract function with an intelligent contract in an Ethernet network through the Web3.js library, and enabling the product production node to authenticate other nodes in the same product supply chain through the intelligent contract function;
by defining a rights modifier in the smart contract, only the address of the authenticated node can be granted to the rights modifier, and the authenticated node communicates with other authenticated nodes by invoking the rights modifier to perform a function in the smart contract.
As a further scheme of the invention: step S3, comprising the following steps:
establishing connection with a blockchain network at a product supply chain node through a deployed management Agent;
The product supply chain node writes raw material batch data, production batch data and product delivery detection data in the production data and position data in the logistics data into the blockchain as product tracing key information through a deployed management Agent; the method comprises the steps of reserving the operation state, temperature, humidity and expiration date data of production and packaging equipment in production data and the temperature and humidity of transit site transportation storage in logistics data as product traceability non-key information on corresponding edge computing nodes of supply chain nodes;
and automatically deleting the product traceable non-key information stored in the local edge computing node after the expiration date.
The invention has the beneficial effects that:
The invention can reduce the storage pressure of the blockchain by tracing back that non-critical information generally contains a large amount of data and keeping it on the edge computing nodes. The traced non-key information is reserved on the edge computing node, so that the load of the blockchain can be shared, and the overall performance is improved. The edge computing nodes can perform some data processing and aggregation, and reduce the load on the blockchain network. Some product traceability non-critical information other nodes may contain detailed information in the process of product production or transportation or sales, when the local node needs to control more specific information of a product in a specific link of a product supply chain, the local product supply chain node may need to frequently inquire the product traceability non-critical information, and the non-critical information is reserved on a local corresponding edge computing node, so that faster and efficient data inquiry and access can be provided. The edge computing nodes can build indexes according to the requirements, and the faster data retrieval speed is provided.
According to the invention, the unique traceability code of the product is inquired through identifying the embedded RFID chip in the food package, and the product traceability key information of the product is inquired through inputting the unique traceability code of the product in the inquire platform, so that the product traceability key information of the corresponding product is conveniently inquired, and the product is quickly traced.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
Referring to fig. 1-2, the present invention is a product tracing system based on information carried by food packaging, comprising:
the product data acquisition module: the method comprises the steps of collecting production data in the production process of a product in real time through an MES system and sensor equipment;
and a transportation management module: the system is used for collecting logistics data of the product in the transportation process;
Product supply chain node: setting product supply chain nodes at physical positions of all links of a supply chain, arranging edge computing nodes by all the product supply chain nodes, writing product tracing key information into a block chain through a data transmission module by the product supply chain nodes, and reserving product tracing non-key information at the corresponding edge computing nodes of the supply chain nodes;
and a data transmission module: for passing product supply chain nodes the block chain network is in communication connection;
and the data query and trace module: the unique traceability code of the product is inquired through identifying the embedded RFID chip in the food package, and the product traceability key information of the product is inquired through inputting the unique traceability code of the product in the inquire platform.
In particular, traceback non-critical information typically contains a large amount of data, which is retained on the edge compute nodes to reduce the storage pressure of the blockchain. The traced non-key information is reserved on the edge computing node, so that the load of the blockchain can be shared, and the overall performance is improved. The edge computing nodes can perform some data processing and aggregation, and reduce the load on the blockchain network.
Some product-traceable non-critical information other nodes may include detailed information during the production or transportation or sales of the product, and when the local node needs to control more specific information of the product in a specific link of the product supply chain, the local product supply chain node may need to frequently query the product-traceable non-critical information, and the query cost of the blockchain is higher. Retaining this non-critical information on locally corresponding edge computing nodes may provide faster, more efficient data querying and access. The edge computing nodes can build indexes according to the requirements, and the faster data retrieval speed is provided.
The unique traceability code of the product is inquired through identifying the embedded RFID chip in the food package, the product traceability key information of the product is inquired through inputting the unique traceability code of the product in the inquire platform, the product traceability key information of the corresponding product is conveniently inquired, and the product is quickly traced.
In one embodiment of the present invention, the product data acquisition module acquires production data in a product production process in real time, including: production and packaging equipment operating state, temperature, humidity, shelf life end date, raw material batch data, production batch data, and product factory detection data.
In one embodiment of the invention, the transportation management module is arranged at each transfer station of the product transportation line, and the transportation management module is arranged at each transfer station of the product transportation line and collects temperature, humidity, position and date data of the product transported and stored at the transfer station as logistics data in the product transportation process.
In one embodiment of the invention, the product supply chain nodes are deployed at physical locations of production links, transportation links and sales links of the supply chain, the production links of the supply chain set workshops and warehouses for product production as the product supply chain nodes, the transportation links of the supply chain set as the product supply chain nodes at various transit sites of the product transportation line, and the sales links of the supply chain set as the product supply chain nodes.
Specifically, the transportation link is as follows: in the transportation link, each transfer site of the product transportation line is set as a product supply chain node for monitoring logistics track, environmental parameters of the transfer site and the like. The nodes can collect sensor data and conduct real-time data processing and analysis, and the state of products in the logistics process is ensured.
Production link of supply chain: in the production link, workshops and warehouses for product production are set as product supply chain nodes, edge computing nodes can be deployed on equipment of the production workshops, and sensors are arranged at the nodes to collect information for data collection and real-time monitoring of the production process.
When the production link carries out storage, the storage can be set as a product supply chain node for managing and monitoring the storage and processing real-time storage and delivery information. These nodes may provide real-time inventory tracking and management through connections to logistics nodes.
Sales links: in the sales link, edge computing nodes can be deployed at the site of product sales for collecting sales data, performing real-time inventory management, executing promotional policies, and the like. These nodes enable real-time uploading of sales data.
In one embodiment of the present invention, the product traceability key information includes: raw material batch data, production batch data and product factory detection data in the production data, and position data in the logistics data; the product tracing non-critical information includes: production and packaging equipment operation state, temperature, humidity and expiration date data in the production data, and transit station transportation stored temperature and humidity in the logistics data;
And automatically deleting the product traceable non-key information stored in the local edge computing node after the expiration date.
Specifically, raw material batch data, production batch data and product delivery detection data in the production data, and position data in the logistics data are important information of product tracing in each link of the process from raw materials to logistics, so that the whole process monitoring of tracing the flow direction of the product from raw material sources to logistics can be traced, and the comprehensive control of a plurality of links of a supply chain of the product is facilitated.
By automatically deleting the product traceable non-key information stored in the local edge computing node after the expiration date, the storage space of the local edge computing node is more reasonably utilized.
In one embodiment of the invention, the data query and trace module traces and queries raw material batch data, production batch data and product factory detection data in the production data of the product and position data in the logistics data through interaction of the unique trace code of the input product and the blockchain network.
In one embodiment of the present invention, the data transmission module enables the product supply chain nodes to be communicatively connected through a blockchain network, comprising the steps of:
each product supply chain node establishes connection with a blockchain network through a deployed management Agent;
Creating an intelligent contract on the blockchain, wherein the intelligent contract is used for defining communication rules and message formats between the nodes of the product supply chain;
deploying a Web3.js library at a product production node in a product supply chain node, enabling the product production node to interactively call an intelligent contract function with an intelligent contract in an Ethernet network through the Web3.js library, and enabling the product production node to authenticate other nodes in the same product supply chain through the intelligent contract function;
By defining a rights modifier in the smart contract, only the address of the authenticated node can be granted to the rights modifier, and the authenticated node communicates with other authenticated nodes by invoking the rights modifier to perform a function in the smart contract;
The product supply chain node encrypts the message when sending and receiving the message through the deployed management Agent and verifies the identity of the product supply chain node sending and receiving the message.
Specifically, the multi-Agent system refers to that a plurality of mutually independent intelligent agents which can independently make decisions and act exist in one system at the same time. Each agent may make individual decisions and actions based on its own goals, knowledge, and capabilities, and communicate, coordinate, and cooperate with other agents to achieve the goals at the system level. multi-Agent systems are commonly used to address complex, distributed and co-resolved problems.
Forming a multi-Agent system through each product supply chain node through a deployed management Agent, deploying a Web3.js library through a product production node in the product supply chain node, and enabling the product production node to interactively call an intelligent contract function with intelligent contracts in an Ethernet network through the Web3.js library, wherein the product production node authenticates other nodes in the same product supply chain through the intelligent contract function; the product producer can authenticate the nodes of the product supply chain, other nodes in the authenticated same product supply chain can communicate, information stored in the corresponding edge computing nodes by the nodes can be mutually transmitted, each node in the same product supply chain can conveniently send and receive information, the nodes can conveniently access product traceability non-key information stored in other nodes in the same product supply chain, and various elements in the product supply process are known.
The product supply chain node checks the signature of the message and the identity of the sender through the deployed management Agent and ensures that the message has not been tampered with. By the management Agent deployed by the product supply chain node, the node can encrypt messages as they are sent and received and verify the identity of the product supply chain node that sent and received the message to ensure that only nodes in the same product supply chain can send and receive messages. Through the management agents deployed by the product supply chain nodes, the nodes can add a layer of security when sending and receiving messages. The management Agent deployed by the product supply chain node may implement some security policies, such as message encryption and authentication, to ensure that only legitimate nodes can send and receive messages.
Example two
Referring to fig. 1-2, a product tracing method based on information carried by a food package includes the following steps:
s1: acquiring production data in the production process and logistics data in the transportation process of the product in real time;
S2: setting product supply chain nodes at physical positions of all links of a supply chain, deploying edge computing nodes at all the product supply chain nodes, and enabling the product supply chain nodes to be in communication connection through a block chain network;
S3: the product supply chain link point writes product tracing key information in the production data and the logistics data into the block chain through the data transmission module, and retains product tracing non-key information in the production data and the logistics data in corresponding edge computing nodes of the supply chain node;
s4: and inquiring the unique traceability code of the product by identifying the embedded RFID chip in the food package, and inquiring the traceability key information of the product.
In one embodiment of the present invention, step S2 includes the steps of:
Setting product supply chain nodes at physical positions of all links of a supply chain, deploying edge computing nodes at all product supply chain nodes, and establishing connection between each product supply chain node and a blockchain network through deployed management agents;
Creating an intelligent contract on the blockchain, wherein the intelligent contract is used for defining communication rules and message formats between the nodes of the product supply chain;
deploying a Web3.js library at a product production node in a product supply chain node, enabling the product production node to interactively call an intelligent contract function with an intelligent contract in an Ethernet network through the Web3.js library, and enabling the product production node to authenticate other nodes in the same product supply chain through the intelligent contract function;
by defining a rights modifier in the smart contract, only the address of the authenticated node can be granted to the rights modifier, and the authenticated node communicates with other authenticated nodes by invoking the rights modifier to perform a function in the smart contract.
Specifically, through each product supply chain node, a Web3.js library is deployed through a deployed management Agent and through a product production node in the product supply chain node, the product production node interactively calls an intelligent contract function with an intelligent contract in an Ethernet network through the Web3.js library, and the product production node authenticates other nodes in the same product supply chain through the intelligent contract function; the product producer can authenticate the nodes of the product supply chain, other nodes in the authenticated same product supply chain can communicate, information stored in the corresponding edge computing nodes by the nodes can be mutually transmitted, each node in the same product supply chain can conveniently send and receive information, the nodes can conveniently access product traceability non-key information stored in other nodes in the same product supply chain, and various elements in the product supply process are known.
In one embodiment of the present invention, step S3 includes the steps of:
establishing connection with a blockchain network at a product supply chain node through a deployed management Agent;
The product supply chain node writes raw material batch data, production batch data and product delivery detection data in the production data and position data in the logistics data into the blockchain as product tracing key information through a deployed management Agent; the method comprises the steps of reserving the operation state, temperature, humidity and expiration date data of production and packaging equipment in production data and the temperature and humidity of transit site transportation storage in logistics data as product traceability non-key information on corresponding edge computing nodes of supply chain nodes;
and automatically deleting the product traceable non-key information stored in the local edge computing node after the expiration date.
Specifically, raw material batch data, production batch data and product delivery detection data in the production data, and position data in the logistics data are important information of product tracing in each link of the process from raw materials to logistics, so that the whole process monitoring of tracing the flow direction of the product from raw material sources to logistics can be traced, and the comprehensive control of a plurality of links of a supply chain of the product is facilitated.
By automatically deleting the product traceable non-key information stored in the local edge computing node after the expiration date, the storage space of the local edge computing node is utilized more reasonably, and useless historical data in the local edge computing node is automatically cleared.
In the description of the present invention, it should be understood that the terms "upper," "lower," "left," "right," and the like indicate an orientation or a positional relationship based on that shown in the drawings, and are merely for convenience of description and for simplifying the description, and do not indicate or imply that the apparatus or element in question must have a specific orientation, as well as a specific orientation configuration and operation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present invention, unless otherwise indicated, the meaning of "a plurality" is two or more.
In the description of the present invention, it should be noted that, unless explicitly specified and limited otherwise, the terms "mounted," "connected," and the like are to be construed broadly and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
The foregoing describes one embodiment of the present invention in detail, but the description is only a preferred embodiment of the present invention and should not be construed as limiting the scope of the invention. All equivalent changes and modifications within the scope of the present invention are intended to be covered by the present invention.