Food material supply chain full-process tracking management system and method based on Internet of Things

By deploying IoT nodes in the food supply chain and performing trusted encryption and cross-chain index generation, the problem of low efficiency in cross-chain data interaction is solved, and efficient and secure cross-chain data tracking and management of the food supply chain is achieved.

CN121860656AInactive Publication Date: 2026-04-14FUZHOU YOURUIDA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-04
Publication Date
2026-04-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing food supply chain suffers from inefficient cross-chain data interaction, data silos, synchronization delays, and security risks, making it difficult to meet real-time tracking and regulatory requirements.

Method used

IoT nodes are deployed at each stage of the food supply chain to collect status data in real time and perform trusted encryption processing to generate status summaries. Tracking identifiers are created for each batch of food and stored on the blockchain. Cross-chain indexes are generated through cross-chain status synchronization and smart contract verification to achieve seamless connection and verification of cross-chain data.

Benefits of technology

It improves the efficiency of cross-chain data interaction, reduces security risks, ensures the authenticity and immutability of the source data, simplifies the cross-chain interaction process, and enhances the cross-chain response speed and security controllability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121860656A_ABST
    Figure CN121860656A_ABST
Patent Text Reader

Abstract

The invention provides a food material supply chain full-process tracking management system and method based on the Internet of Things, and relates to the technical field of block chains, credible encryption processing is performed on state data of food materials, and a state abstract of Internet of Things node time sequence integrity proof is obtained; creating a tracking identifier for the food materials of the current transportation batch; when the food materials are about to be transferred to the next circulation link, determining a state lock voucher pointing to the main alliance chain, and submitting the state lock voucher to an intelligent contract on the main alliance chain; after the smart contract verifies the validity of the state lock voucher signature, generating a cross-chain index of a next circulation link tracking identifier; and performing cross-chain verification on the state lock voucher of the main alliance chain in the previous circulation link through the cross-chain index, taking the state lock voucher passing the verification as initialization input of the Internet of Things node in the next circulation link, and starting data tracking of the next circulation link. According to the invention, the cross-chain data interaction efficiency of the food material supply chain can be improved, so that the cross-chain safety risk is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and more specifically, to an IoT-based end-to-end tracking management system and method for food supply chains. Background Technology

[0002] With the frequent occurrence of food safety incidents, blockchain technology, with its decentralized, tamper-proof, and fully traceable characteristics, has become a core support for ensuring the credibility of supply chain data. In food supply chain management, blockchain not only enables real-time recording and verification of data, but also optimizes process automation through smart contracts, effectively improving the transparency and regulatory efficiency of the supply chain. This provides a solid technical foundation for consumer health protection, industry compliance management, and the construction of smart supply chains, and significantly promotes the digital upgrade of the entire process from farm to table.

[0003] In existing technologies, the food supply chain involves multiple stages such as production, transportation, and warehousing. Each stage often uses independent IoT systems and private blockchain platforms, resulting in widespread data silos. Traditional methods rely on manual data entry or centralized databases for cross-stage information transmission, which is not only inefficient and has high response delays, but also prone to food safety risks due to data inconsistencies or tampering. For example, when food flows across stages, the interaction between different blockchains requires third-party intermediaries or complex protocols, causing data synchronization delays, soaring verification costs, and even missing or falsified records of critical statuses (such as temperature and location), making it difficult to meet the regulatory requirements for real-time tracking. At the same time, the lack of unified standards and security mechanisms for cross-chain operations causes data security risks and efficiency bottlenecks to overlap, severely restricting the collaborative optimization and emergency response capabilities of the supply chain. Therefore, how to improve the efficiency of cross-chain data interaction in the food supply chain, thereby reducing cross-chain security risks, has become a challenge for the industry. Summary of the Invention

[0004] This application provides an IoT-based end-to-end tracking and management system and method for food supply chain, which can improve the efficiency of cross-chain data interaction in the food supply chain, thereby reducing cross-chain security risks.

[0005] Firstly, this application provides a method for tracking and managing the entire food supply chain based on the Internet of Things (IoT), the tracking and management method comprising the following steps: IoT nodes are deployed at each stage of the food flow to collect the food status data in real time. The food status data is then encrypted in a reliable manner to obtain a status digest that proves the temporal integrity of the IoT nodes. Create a tracking identifier for the current batch of food items, and store the tracking identifier and the status summary on the blockchain for evidence. When the ingredients are about to be transferred to the next stage of the process, the tracking identifier is synchronized across chains to obtain a state lock certificate pointing to the main consortium chain. The state lock certificate is then submitted to the smart contract on the main consortium chain. After the smart contract verifies the validity of the state lock certificate signature, it records the location proof and transfer timestamp of the current transportation batch of ingredients in the current circulation stage on the main consortium chain, and then generates a cross-chain index for the tracking identifier of the next circulation stage. The cross-chain index is used to verify the state lock credentials of the main consortium chain in the previous circulation stage. The verified state lock credentials are used as the initialization input of the IoT node in the next circulation stage, and data tracking is started in the next circulation stage.

[0006] In this embodiment, the state data of the food ingredients is subjected to trusted encryption processing to obtain a state digest that proves the temporal integrity of the IoT node. Specifically, this includes: Obtain the status data of the ingredients collected by the IoT nodes deployed in the current circulation process; The state data is digitally signed to obtain the digital signature unit of the IoT node in the current circulation process; The data sequence chain of the IoT node in the current circulation stage is determined based on the digital signature unit; The state digest of the IoT node's temporal integrity proof is determined through the data time sequence chain.

[0007] In this embodiment, creating a tracking identifier for the current shipment of food items specifically includes: Generate a unique identifier for the food ingredients in the current shipment; A tracking identifier for the current shipment batch of ingredients is generated based on the unique identifier and the batch information of the current shipment batch.

[0008] In this embodiment, the on-chain storage of the tracking identifier and the state digest specifically includes: The authorized device in the current circulation process invokes the evidence storage smart contract deployed on the sub-alliance chain of this circulation process; The tracking identifier and the status summary are passed to the evidence storage smart contract; After the evidence storage smart contract verifies the signature, it binds the state digest with the tracking identifier to obtain a binding relationship record, and then writes the binding relationship record into the distributed ledger of the sub-consortium chain in this circulation process.

[0009] In this embodiment, performing cross-chain state synchronization on the tracking identifier to obtain a state lock credential pointing to the main consortium chain specifically includes: When the ingredients are about to be transferred to the next stage of the process, the state-locking smart contract is invoked on the sub-consortium chain of this stage. The state locking contract marks the state corresponding to the tracking identifier as a locked state, thereby determining the cross-chain synchronization event of the sub-consortium chain in this circulation process; The state lock credential pointing to the main consortium chain is determined based on the cross-chain synchronization event of the sub-consortium chain in this circulation process.

[0010] In this embodiment, generating the cross-chain index for the next flow tracking identifier specifically includes: Obtain proof of the location and transfer timestamp of the current transportation batch of food at the current stage of circulation; The transaction hash of the food transfer event is determined based on the location proof and transfer timestamp of the current transportation batch of food in the current circulation stage; The cross-chain index of the next transfer stage tracking identifier is determined by the transaction hash and the chain identifier of the next transfer stage.

[0011] In this embodiment, the cross-chain verification of the state lock credential of the main consortium chain in the previous transfer stage through the cross-chain index specifically includes: The sub-alliance link in the next transfer stage receives the cross-chain index; Initiate an inter-chain verification request to the main consortium chain based on the cross-chain index, and obtain the complete flow event record associated with the cross-chain index; The consistency verification result of the state lock credential in the previous transfer stage is obtained by using the complete transfer event record to verify the consistency of the state lock credential.

[0012] In this embodiment, using the verified state lock credential as the initialization input for the IoT node in the next workflow stage and initiating data tracking for the next workflow stage specifically includes: When the consistency verification result of the state lock credential passes, the verified state lock credential will be sent to the IoT node in the next process link; Extract the final state summary of the previous process from the verified state lock credential; The preceding hash reference of the data time-series chain of the IoT node in the next flow stage is determined based on the final state summary; Data tracking for the next round of circulation is initiated based on the aforementioned preceding hash reference.

[0013] In this embodiment, the cross-chain index represents a cryptographic pointer that tracks and verifies the food transfer record of the previous transfer stage by identifying the next transfer stage.

[0014] Secondly, this application provides an IoT-based end-to-end tracking and management system for food supply chains, used to execute an IoT-based end-to-end tracking and management method for food supply chains, the tracking and management system comprising: The trusted encryption processing module is used to deploy IoT nodes at each stage of the food flow to collect the status data of the food in real time, and then perform trusted encryption processing on the status data of the food to obtain a status digest that proves the temporal integrity of the IoT nodes. The on-chain evidence storage module is used to create a tracking identifier for the current batch of food, and to store the tracking identifier and the status summary on the blockchain for evidence storage. The cross-chain state synchronization module is used to synchronize the tracking identifier across chains when the ingredients are about to be transferred to the next circulation stage, obtain a state lock certificate pointing to the main consortium chain, and submit the state lock certificate to the smart contract on the main consortium chain. The cross-chain index generation module is used to record the location proof and transfer timestamp of the current transportation batch of ingredients in the current circulation stage on the main consortium chain after the smart contract verifies the validity of the state lock certificate signature, and then generate a cross-chain index for the tracking identifier of the next circulation stage. The cross-chain verification module is used to perform cross-chain verification of the state lock credentials of the main consortium chain in the previous circulation stage through the cross-chain index, and use the verified state lock credentials as the initialization input of the IoT node in the next circulation stage, and start data tracking in the next round of circulation stage.

[0015] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects: IoT nodes are deployed at each stage of the food supply chain to collect real-time status data. This data is then encrypted to obtain a status digest proving the temporal integrity of the IoT nodes. A tracking identifier is created for the current batch of food, and both the identifier and the status digest are stored on the blockchain. When the food is about to be transferred to the next stage, the tracking identifier is synchronized across chains to obtain a state lock credential pointing to the main consortium blockchain. This credential is then submitted to a smart contract on the main consortium blockchain. After the smart contract verifies the signature validity of the state lock credential, the location proof and transfer timestamp of the current batch of food at the current stage are recorded on the main consortium blockchain, generating a cross-chain index for the tracking identifier of the next stage. This cross-chain index is used to verify the state lock credential on the main consortium blockchain from the previous stage. The verified state lock credential is then used as the initialization input for the IoT nodes in the next stage, initiating data tracking for the next round of the supply chain.

[0016] Therefore, this application demonstrates that the verified state lock credential can be used as the initialization input for the IoT node in the next flow stage, initiating data tracking for the next round of flow stages. Firstly, by deploying IoT nodes at each flow stage of the food ingredients to collect state data in real time and performing trusted encryption processing to obtain a state digest with proven time-series integrity, it replaces the traditional manual entry and centralized database transmission methods. This ensures the authenticity and immutability of the cross-chain data source and avoids the redundancy problem of transmitting the entire original data during cross-chain interaction. Secondly, a unique tracking identifier is created for the current batch of food ingredients and stored on the blockchain along with the state digest, establishing a unified index benchmark for cross-chain data. This breaks down the identifier barriers of private blockchains at each stage, enabling rapid location of the target batch data during cross-chain operations. This effectively solves the problems of cross-chain adaptation confusion and retrieval delays caused by data silos, significantly improving cross-chain data matching efficiency. Furthermore, by generating an index through cross-chain state synchronization... The standardized state lock credentials submitted to the main consortium blockchain and then to the smart contract replace the traditional cross-chain model that relies on third-party intermediaries or complex protocols, simplifying the cross-chain interaction process. Simultaneously, the smart contract's automated verification of credential signatures avoids the lag and human risk associated with manual verification, improving cross-chain response speed while constructing a unified cross-chain security verification mechanism. Finally, a cross-chain index is generated through the smart contract, and cross-chain verification is completed based on this index. The verified state lock credentials are used as the initialization input for the next flow stage, achieving seamless connection and rapid verification of cross-chain data. This reduces the cost of repeated cross-chain verification and ensures the legality and continuity of data in the next flow stage, forming a full-process cross-chain optimization mechanism of "source trust - unified identifier - credential standard - smart verification - index verification." This comprehensively and simultaneously improves the efficiency and security controllability of cross-chain data interaction, effectively solving the problem of overlapping efficiency bottlenecks and security risks in existing technologies.

[0017] In summary, the technical solution adopted in this application can improve the efficiency of cross-chain data interaction in the food supply chain, thereby reducing cross-chain security risks. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this embodiment of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is an exemplary flowchart of a method for tracking and managing the entire food supply chain based on the Internet of Things, provided in this application. Figure 2This is a flowchart illustrating the process of determining a status summary as provided in this application; Figure 3 This is a flowchart illustrating the process of generating a cross-chain index according to the present application; Figure 4 This is a module structure diagram of a food supply chain end-to-end tracking and management system based on the Internet of Things provided in this application. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] This application provides an IoT-based end-to-end tracking management system and method for food supply chains. The core of this system involves deploying IoT nodes at each stage of food distribution to collect real-time status data. This data is then encrypted to obtain a status digest proving the temporal integrity of the IoT nodes. A tracking identifier is created for each batch of food being transported, and the tracking identifier and status digest are stored on the blockchain. When the food is about to be transferred to the next stage, the tracking identifier is synchronized across blockchains to obtain a status lock credential pointing to the main consortium blockchain. This status lock credential is then submitted to a smart contract on the main consortium blockchain. After the smart contract verifies the signature validity of the status lock credential, the location proof and transfer timestamp of the current batch of food at the current stage are recorded on the main consortium blockchain, generating a cross-chain index for the tracking identifier of the next stage. The cross-chain index is used to cross-chain verify the status lock credential on the main consortium blockchain from the previous stage. The verified status lock credential is then used as the initialization input for the IoT nodes in the next stage, initiating data tracking for the next round of distribution.

[0022] Example 1: To better understand the above technical solution, the following will provide a detailed description of the technical solution in conjunction with the accompanying drawings and specific implementation methods. (Refer to...) Figure 1 As shown in the figure, this is an exemplary flowchart of a method for tracking and managing the entire food supply chain based on the Internet of Things, according to this embodiment of the present application. The tracking and management method includes the following steps: In step S1, IoT nodes are deployed at each stage of the food flow to collect the status data of the food in real time. The status data of the food is then encrypted in a reliable manner to obtain a status digest that proves the temporal integrity of the IoT nodes.

[0023] In practice, IoT nodes are deployed at each stage of the food supply chain to collect real-time food status data. This can be achieved in the following way: IoT nodes are deployed at each specific stage of the food supply chain (e.g., production and processing, cold chain transportation, warehousing and storage, and retail shelf placement). Each IoT node is a dedicated embedded hardware device that collects, temporarily stores and reports the status of the food it monitors. The IoT node automatically collects the temperature and humidity values ​​of the food at preset time intervals (e.g., every 5 minutes in the transportation stage and every 15 minutes in the warehousing stage) through its built-in wireless communication module. The collected data is then arranged into an ordered sequence, which is used as the status data of the food.

[0024] Preferably, in this embodiment, the state data of the food ingredients is subjected to trusted encryption processing to obtain a state digest proving the temporal integrity of the IoT node, which is then referred to... Figure 2 As shown in the figure, this is a flowchart illustrating the process of determining a state digest in some embodiments of this application. In this embodiment, determining the state digest can be achieved using the following steps: In step S11, the status data of the ingredients collected by the IoT nodes deployed in the current circulation process is obtained; In step S12, the status data is digitally signed to obtain the digital signature unit of the IoT node in the current circulation process; In step S13, the data time sequence chain of the IoT node in the current flow stage is determined according to the digital signature unit; In step S14, the state summary of the IoT node's time integrity proof is determined through the data time sequence chain.

[0025] It should be noted that, in this application, the state data refers to the temperature and humidity status of the food ingredients; the digital signature unit refers to the data packet obtained after signing the state data; the data time sequence chain refers to a chain-like data structure that links the digital signature units in chronological order through hash pointers to ensure that the data is immutable and the order is irreversible; and the state digest refers to a cryptographic hash value that promises the integrity of all data in the data time sequence chain of the IoT node.

[0026] In practice, firstly, the status data of the ingredients collected by the IoT nodes deployed in the current circulation process is obtained; secondly, the status data of the ingredients is signed using the elliptic curve digital signature algorithm, and the calculated signature value, status data, and public key certificate of the IoT node are packaged together, and the resulting data packet is used as the digital signature unit of the IoT node in the current circulation process; then, a data sequence chain is created for the IoT node. When the first digital signature unit is generated, the SHA-256 hash value of the unit is calculated, and this hash value is used as the hash of the first block, while the preceding hash reference of the block is set to 64 "0"s; when the second and subsequent digital signature units are generated, the SHA-256 hash value of the digital signature unit is calculated. The hash value is then concatenated with the hash value of the previous block, and the SHA-256 hash value is calculated again. The resulting hash value is used as the hash of the current block, while the hash value of the previous block is used as the preceding hash reference of the current block. This process is iterated to form a data time-series chain with consecutive hash pointers, which serves as the data time-series chain for the IoT node in the current flow stage. Finally, the hash value of each block in the data time-series chain is used as a leaf node. The Merkle tree algorithm (which concatenates the hash values ​​of two adjacent leaf nodes to calculate the SHA-256 hash to obtain the parent node hash, and then concatenates them in pairs until a root node hash is generated) is used as the state digest for the IoT node's time-series integrity proof.

[0027] In step S2, a tracking identifier is created for the current batch of ingredients, and the tracking identifier and the status summary are stored on the blockchain.

[0028] In this embodiment, creating a tracking tag for the current shipment of ingredients can be achieved through the following steps: Generate a unique identifier for the food ingredients in the current shipment; A tracking identifier for the current shipment batch of ingredients is generated based on the unique identifier and the batch information of the current shipment batch.

[0029] It should be noted that the unique identifier mentioned in this application represents a string that guarantees the uniqueness of the current batch of ingredients; the tracking identifier represents a digital identity code that tracks the current batch of ingredients.

[0030] In practice, firstly, an encrypted secure random number generator is used to generate a 128-bit random hexadecimal string (e.g., "9a3f7b2e1c4d8e5f"), and the current system timestamp accurate to milliseconds (e.g., "20231001143005987") is appended to it. The concatenated string is used as the unique identifier for the current batch of ingredients. Secondly, the batch information of the current batch of ingredients is read from the enterprise's production management database. The batch information includes the manufacturer's organization code, the national standard code of the product variety, the production date, and the production serial number of the day. These fields are concatenated with the unique identifier in a fixed order of "organization code|product variety code|production date|serial number|unique identifier" and separated by delimiters to form a complete description string. Then, this description string is used as input to call the SHA-256 hash algorithm to generate a 64-bit hexadecimal hash value. Finally, this hash value is used as the tracking identifier for the current batch of ingredients.

[0031] In this embodiment, the on-chain storage of the state digest based on the tracking identifier can be achieved through the following steps: The authorized device in the current circulation process invokes the evidence storage smart contract deployed on the sub-alliance chain of this circulation process; The tracking identifier and the status summary are passed to the evidence storage smart contract; After the evidence storage smart contract verifies the signature, it binds the state digest with the tracking identifier to obtain a binding relationship record, and then writes the binding relationship record into the distributed ledger of the sub-consortium chain in this circulation process.

[0032] It should be noted that, in this application, the authorized device refers to a terminal device that has been authorized by the sub-consortium chain in this circulation process and holds a valid digital certificate and private key; the sub-consortium chain refers to a permissioned blockchain jointly maintained by different participants in the current circulation process; the evidence storage smart contract refers to on-chain code that is pre-deployed on the sub-consortium chain and defines the evidence storage data structure and logic; and the binding relationship record refers to a structured data entry formed by associating and storing the tracking identifier with the corresponding state summary and related metadata.

[0033] In practice, firstly, the authorized device in the current circulation process (e.g., a driver's handheld PDA) uses its private key to digitally sign the storage request for the tracking identifier and the state digest, and constructs a transaction pointing to the storage smart contract address. Secondly, this transaction is broadcast to the sub-consortium blockchain network of this circulation process, triggering the execution of the storage smart contract. The contract code first uses the pre-stored public key of the authorized device to verify the validity of the request signature using an elliptic curve digital signature algorithm. Then, after the signature verification is successful, the smart contract uses the incoming tracking identifier as the key and the state digest, the current block timestamp, and the transaction sender address as the values, and writes them into the key-value pair mapping maintained within the contract, thereby generating a binding relationship record. The change in the contract state is included in the transaction. After consensus verification is completed by the consensus nodes of the sub-consortium blockchain (using, for example, the PBFT consensus algorithm), it is packaged into a new block, and all nodes in the sub-consortium blockchain network append this block to their respective stored blockchain copies, thus completing the entire process of permanently writing the binding relationship record into the distributed ledger.

[0034] In step S3, when the ingredients are about to be transferred to the next transfer stage, the tracking identifier is synchronized across chains to obtain a state lock credential pointing to the main consortium chain, and the state lock credential is submitted to the smart contract on the main consortium chain.

[0035] In this embodiment, the cross-chain state synchronization of the tracking identifier to obtain the state lock credential pointing to the main consortium chain can be achieved through the following steps: When the ingredients are about to be transferred to the next stage of the process, the state-locking smart contract is invoked on the sub-consortium chain of this stage. The state locking contract marks the state corresponding to the tracking identifier as a locked state, thereby determining the cross-chain synchronization event of the sub-consortium chain in this circulation process; The state lock credential pointing to the main consortium chain is determined based on the cross-chain synchronization event of the sub-consortium chain in this circulation process.

[0036] It should be noted that the state-locking smart contract mentioned in this application refers to an on-chain program deployed on the sub-consortium chain to manage, track, and identify the circulation status; the main consortium chain refers to the blockchain that coordinates the various circulation links of the sub-consortium chains in the entire food supply chain process; the cross-chain synchronization event refers to the on-chain log that identifies the cross-chain synchronization status after the state-locking smart contract successfully updates the status; and the state lock credential refers to the digital credential submitted by the sub-consortium chain to the main consortium chain to prove the circulation status of the food.

[0037] In practice, firstly, when the ingredients are about to be transferred to the next stage of the process, the authorized device in the current stage initiates a transaction, calling the `lock` function of the state-locking smart contract deployed on the sub-consortium blockchain of this stage, and passing the tracking identifier to be transferred as a parameter. Secondly, when the state-locking smart contract executes, it updates the state value corresponding to the tracking identifier from "in transit" to "locked" in its internally maintained state mapping, and records the timestamp of the current block as the lock time. Subsequently, the contract triggers an event called `CrossChainLock`, writing the tracking identifier, lock time, lock initiator address, and current transaction hash to... The event log is used as a cross-chain synchronization event for the sub-consortium chain in this circulation process. Next, the transaction receipt containing the cross-chain synchronization event, the corresponding Merkle proof path, and the block header hash of the block where the transaction is located are obtained from the sub-consortium chain. Finally, the tracking identifier, lock time, and transaction hash in the cross-chain synchronization event, together with the aforementioned Merkle proof path, block header hash, and the unique identifier of the sub-consortium chain, are packaged together. The sub-consortium chain's administrator private key is used to perform an elliptic curve digital signature on the data packet, and the signature is appended to the end of the data packet. The resulting complete data packet is used as a state lock credential pointing to the main consortium chain.

[0038] In practice, the state lock credential can be submitted to the smart contract on the main consortium blockchain in the following way: the authorized device in the current circulation process uses the generated state lock credential as a parameter, uses the private key of the main consortium blockchain to sign a transaction that calls the smart contract on the main consortium blockchain, and then broadcasts the transaction to the main consortium blockchain network. After receiving the transaction, the nodes in the main consortium blockchain network trigger the smart contract on the main consortium blockchain to execute the verification of the state lock credential.

[0039] In step S4, after the smart contract verifies the validity of the state lock certificate signature, the location proof and transfer timestamp of the current transportation batch of ingredients in the current circulation stage are recorded on the main consortium chain, thereby generating a cross-chain index for the tracking identifier of the next circulation stage.

[0040] It should be noted that the location proof mentioned in this application represents the geographical information of the location where the food transfer event occurred; the transfer timestamp represents the recording time that identifies the transfer operation of the main consortium chain.

[0041] In specific implementation, after the smart contract verifies the validity of the state lock certificate signature, recording the location proof and transfer timestamp of the current transport batch of ingredients in the current circulation stage on the main consortium blockchain can be achieved in the following way: After the smart contract verifies the validity of the state lock certificate signature, the smart contract calls an authorized and verifiable external location service oracle interface, uses the source sub-consortium blockchain identifier and transaction hash carried in the state lock certificate as the query basis, and requests the return of the physical location coordinates and location signature when the current transfer operation is verified. This information is used as the location proof of the current transport batch of ingredients in the current circulation stage. At the same time, the smart contract reads the block time of the current execution environment (i.e., the block.timestamp variable in Solidity) and uses it as the transfer timestamp of the current transport batch of ingredients in the current circulation stage.

[0042] Preferably, in this embodiment, a cross-chain index for generating the tracking identifier of the next flow stage is generated, referring to... Figure 3 As shown in the figure, this is a schematic diagram of the process of generating a cross-chain index in some embodiments of this application. In this embodiment, generating a cross-chain index can be achieved by the following steps: In step S41, the location proof and transfer timestamp of the current transportation batch of ingredients in the current circulation stage are obtained; In step S42, the transaction hash of the food transfer event is determined based on the location proof and transfer timestamp of the food in the current transportation batch at the current transfer stage; In step S43, the cross-chain index of the next transfer link tracking identifier is determined by the transaction hash and the chain identifier of the next transfer link.

[0043] It should be noted that the transaction hash mentioned in this application represents the unique hash identifier of the blockchain transaction that successfully completed the food transfer record operation on the main consortium chain; the chain identifier represents the unique code pre-assigned to the sub-consortium chain; and the cross-chain index represents the cryptographic pointer for the next transfer link to track and verify the food transfer record of the previous transfer link.

[0044] In practice, firstly, the location proof and transfer timestamp of the current batch of ingredients in the current circulation stage are obtained; secondly, after the location proof and transfer timestamp are successfully verified and recorded in the main consortium blockchain smart contract, the smart contract immediately calls the 'Access Transaction Context' interface provided by the blockchain execution environment (e.g., using the tx.hash global variable in Solidity) to directly read and return the cryptographic hash value of the blockchain transaction that triggered the complete recording operation (i.e., writing the location proof and transfer timestamp), and uses it as the transaction hash of the ingredient circulation event; then, the obtained transaction hash and the preset chain identifier of the next circulation stage are concatenated into a string in the fixed format of "transaction hash: next stage chain identifier"; finally, the concatenated string is subjected to SHA-256 hash operation, and the calculated 256-bit hash value is used as the cross-chain index of the next circulation stage tracking identifier.

[0045] In step S5, the cross-chain index is used to verify the state lock credentials of the main consortium chain in the previous circulation stage. The verified state lock credentials are used as the initialization input of the IoT node in the next circulation stage, and data tracking in the next circulation stage is started.

[0046] In this embodiment, the cross-chain verification of the state lock credential of the main consortium chain in the previous transfer stage through the cross-chain index can be achieved by the following steps: The sub-alliance link in the next transfer stage receives the cross-chain index; Initiate an inter-chain verification request to the main consortium chain based on the cross-chain index, and obtain the complete flow event record associated with the cross-chain index; The consistency verification result of the state lock credential in the previous transfer stage is obtained by using the complete transfer event record to verify the consistency of the state lock credential.

[0047] It should be noted that the complete transfer event record mentioned in this application refers to the data structure stored in the main consortium blockchain smart contract that includes complete fields such as location proof, transfer timestamp, and verified state lock credential hash; the consistency verification result refers to the verification result describing the consistency of the state lock credential before and after.

[0048] In specific implementation, firstly, the sub-consortium link in the next transfer stage receives the cross-chain index; secondly, it retrieves the encapsulated transaction hash portion from the cross-chain index, and uses this transaction hash as a parameter to construct a read-only transaction that calls the getTransferRecord function in the smart contract on the main consortium chain. This transaction is then sent to the main consortium chain network as an inter-chain verification request via cross-chain communication relay or direct peer-to-peer connection. Next, the requesting node on the main consortium chain executes the query, and the smart contract searches its internal state mapping based on the input transaction hash, finding the information including location proof and transfer time. The complete flow event record, including fields such as the stamp and state lock credential hash, is returned to the requesting node. Then, the requesting node extracts the "state lock credential hash" field from the complete flow event record. At the same time, the requesting node uses the SHA-256 hash function to calculate the local hash value of the state lock credential provided by the previous flow stage. Finally, the requesting node compares the calculated local hash value with the value of the "state lock credential hash" field. If every character of the two is exactly the same, the consistency verification result of the state lock credential is "passed"; otherwise, it is "failed".

[0049] In this embodiment, using the verified state lock credential as the initialization input for the IoT node in the next flow stage and enabling data tracking in the next flow stage can be achieved through the following steps: When the consistency verification result of the state lock credential passes, the verified state lock credential will be sent to the IoT node in the next process link; Extract the final state summary of the previous process from the verified state lock credential; The preceding hash reference of the data time-series chain of the IoT node in the next flow stage is determined based on the final state summary; Data tracking for the next round of circulation is initiated based on the aforementioned preceding hash reference.

[0050] It should be noted that the final state digest mentioned in this application represents the root hash value of the data time-series chain of the blockchain evidence stored in the previous circulation stage; the preceding hash reference points to the hash value of the final state digest.

[0051] In practice, firstly, when the consistency verification result of the state lock credential passes, the verified state lock credential is issued to the IoT node in the next flow stage. Secondly, the IoT node reads the value of the field named `state_digest_at_lock` and uses this field value as the final state digest of the previous flow stage. Next, when initializing the data sequence chain of the next flow stage, the IoT node directly writes the final state digest extracted in the previous step into the "previous block hash" field in the block header of the first data block (genesis block), and uses this field as the preceding hash reference of the IoT node's data sequence chain in the next flow stage. Finally, the IoT node uses the genesis block carrying the preceding hash reference as... As the unique head of the current data time-series chain, its hash value is loaded into memory as the latest block hash. The IoT node starts periodically collecting data. When a new batch of ingredient status data is obtained, the IoT node combines the new ingredient status data with the hash value of the previously generated data block, and then calculates the SHA-256 hash value of the combination to generate a new data block. This new blockchain is then attached to the end of the existing data time-series chain. The entire process starts from the first block (whose "previous block hash" field is the initial previous hash reference). Each new block points to the previous block through its hash value, thus forming a continuous and tamper-proof data chain, thereby initiating data tracking for the next round of ingredient circulation.

[0052] Therefore, this application demonstrates that the verified state lock credential can be used as the initialization input for the IoT node in the next flow stage, initiating data tracking for the next round of flow stages. Firstly, by deploying IoT nodes at each flow stage of the food ingredients to collect state data in real time and performing trusted encryption processing to obtain a state digest with proven time-series integrity, it replaces the traditional manual entry and centralized database transmission methods. This ensures the authenticity and immutability of the cross-chain data source and avoids the redundancy problem of transmitting the entire original data during cross-chain interaction. Secondly, a unique tracking identifier is created for the current batch of food ingredients and stored on the blockchain along with the state digest, establishing a unified index benchmark for cross-chain data. This breaks down the identifier barriers of private blockchains at each stage, enabling rapid location of the target batch data during cross-chain operations. This effectively solves the problems of cross-chain adaptation confusion and retrieval delays caused by data silos, significantly improving cross-chain data matching efficiency. Furthermore, by generating an index through cross-chain state synchronization... The standardized state lock credentials submitted to the main consortium blockchain and then to the smart contract replace the traditional cross-chain model that relies on third-party intermediaries or complex protocols, simplifying the cross-chain interaction process. Simultaneously, the smart contract's automated verification of credential signatures avoids the lag and human risk associated with manual verification, improving cross-chain response speed while constructing a unified cross-chain security verification mechanism. Finally, a cross-chain index is generated through the smart contract, and cross-chain verification is completed based on this index. The verified state lock credentials are used as the initialization input for the next flow stage, achieving seamless connection and rapid verification of cross-chain data. This reduces the cost of repeated cross-chain verification and ensures the legality and continuity of data in the next flow stage, forming a full-process cross-chain optimization mechanism of "source trust - unified identifier - credential standard - smart verification - index verification." This comprehensively and simultaneously improves the efficiency and security controllability of cross-chain data interaction, effectively solving the problem of overlapping efficiency bottlenecks and security risks in existing technologies.

[0053] In summary, the technical solution adopted in this application can improve the efficiency of cross-chain data interaction in the food supply chain, thereby reducing cross-chain security risks.

[0054] Example 2: This application provides an IoT-based end-to-end tracking and management system for the food supply chain, referencing... Figure 4 As shown in the figure, this is a modular structure diagram of a food supply chain end-to-end tracking and management system based on the Internet of Things, according to this embodiment of the present application. The tracking and management system includes: The trusted encryption processing module 100 is used to deploy IoT nodes in each link of the food flow to collect the status data of the food in real time, and then perform trusted encryption processing on the status data of the food to obtain a status digest of the IoT node's time sequence integrity proof. The on-chain evidence storage module 200 is used to create a tracking identifier for the current batch of food, and to store the tracking identifier and the status summary on the blockchain for evidence storage. The cross-chain state synchronization module 300 is used to synchronize the tracking identifier across chains when the ingredients are about to be transferred to the next circulation stage, obtain a state lock certificate pointing to the main consortium chain, and submit the state lock certificate to the smart contract on the main consortium chain. The cross-chain index generation module 400 is used to record the location proof and transfer timestamp of the current transportation batch of ingredients in the current circulation stage on the main consortium chain after the smart contract verifies the validity of the signature of the state lock certificate, and then generate a cross-chain index of the tracking identifier of the next circulation stage. The cross-chain verification module 500 is used to perform cross-chain verification on the state lock credentials of the main consortium chain in the previous circulation stage through the cross-chain index, use the verified state lock credentials as the initialization input of the IoT node in the next circulation stage, and start data tracking in the next round of circulation stage.

[0055] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0056] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compactdisc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0057] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

Claims

1. A method for end-to-end tracking and management of the food supply chain based on the Internet of Things, characterized in that, The tracking management method includes the following steps: IoT nodes are deployed at each stage of the food flow to collect the food status data in real time. The food status data is then encrypted in a reliable manner to obtain a status digest that proves the temporal integrity of the IoT nodes. Create a tracking identifier for the current batch of food items, and store the tracking identifier and the status summary on the blockchain for evidence. When the ingredients are about to be transferred to the next stage of the process, the tracking identifier is synchronized across chains to obtain a state lock certificate pointing to the main consortium chain. The state lock certificate is then submitted to the smart contract on the main consortium chain. After the smart contract verifies the validity of the state lock certificate signature, it records the location proof and transfer timestamp of the current transportation batch of ingredients in the current circulation stage on the main consortium chain, and then generates a cross-chain index for the tracking identifier of the next circulation stage. The cross-chain index is used to verify the state lock credentials of the main consortium chain in the previous circulation stage. The verified state lock credentials are used as the initialization input of the IoT node in the next circulation stage, and data tracking is started in the next circulation stage.

2. The method for end-to-end tracking and management of food supply chains based on the Internet of Things as described in claim 1, characterized in that, The state data of the food ingredients is subjected to trusted encryption processing to obtain a state digest that proves the temporal integrity of the IoT node. Specifically, this includes: Obtain the status data of the ingredients collected by the IoT nodes deployed in the current circulation process; The state data is digitally signed to obtain the digital signature unit of the IoT node in the current circulation process; The data sequence chain of the IoT node in the current circulation stage is determined based on the digital signature unit; The state digest of the IoT node's temporal integrity proof is determined through the data time sequence chain.

3. The method for end-to-end tracking and management of food supply chains based on the Internet of Things as described in claim 1, characterized in that, Creating tracking tags for the current shipment of food items specifically includes: Generate a unique identifier for the food ingredients in the current shipment; A tracking identifier for the current shipment batch of ingredients is generated based on the unique identifier and the batch information of the current shipment batch.

4. The method for end-to-end tracking and management of food supply chains based on the Internet of Things as described in claim 1, characterized in that, The on-chain storage of the tracking identifier and the state digest specifically includes: The authorized device in the current circulation process invokes the evidence storage smart contract deployed on the sub-alliance chain of this circulation process; The tracking identifier and the status summary are passed to the evidence storage smart contract; After the evidence storage smart contract verifies the signature, it binds the state digest with the tracking identifier to obtain a binding relationship record, and then writes the binding relationship record into the distributed ledger of the sub-consortium chain in this circulation process.

5. The method for end-to-end tracking and management of food supply chains based on the Internet of Things as described in claim 1, characterized in that, The specific steps for cross-chain state synchronization of the tracking identifier to obtain a state lock credential pointing to the main consortium chain include: When the ingredients are about to be transferred to the next stage of the process, the state-locking smart contract is invoked on the sub-consortium chain of this stage. The state locking contract marks the state corresponding to the tracking identifier as a locked state, thereby determining the cross-chain synchronization event of the sub-consortium chain in this circulation process; The state lock credential pointing to the main consortium chain is determined based on the cross-chain synchronization event of the sub-consortium chain in this circulation process.

6. The method for end-to-end tracking and management of food supply chains based on the Internet of Things as described in claim 1, characterized in that, The cross-chain index for generating the tracking identifier for the next flow stage specifically includes: Obtain proof of the location and transfer timestamp of the current transportation batch of food at the current stage of circulation; The transaction hash of the food transfer event is determined based on the location proof and transfer timestamp of the current transportation batch of food in the current circulation stage; The cross-chain index of the next transfer stage tracking identifier is determined by the transaction hash and the chain identifier of the next transfer stage.

7. The method for end-to-end tracking and management of food supply chain based on the Internet of Things as described in claim 1, characterized in that, The cross-chain verification of the state lock credentials of the main consortium chain in the previous transfer stage through the cross-chain index specifically includes: The sub-alliance link in the next transfer stage receives the cross-chain index; Initiate an inter-chain verification request to the main consortium chain based on the cross-chain index, and obtain the complete flow event record associated with the cross-chain index; The consistency verification result of the state lock credential in the previous transfer stage is obtained by using the complete transfer event record to verify the consistency of the state lock credential.

8. The method for end-to-end tracking and management of food supply chain based on the Internet of Things as described in claim 1, characterized in that, The verified state lock credential is used as the initialization input for the IoT node in the next process flow, and data tracking is initiated in the next round of process flow. This specifically includes: When the consistency verification result of the state lock credential passes, the verified state lock credential will be sent to the IoT node in the next process link; Extract the final state summary of the previous process from the verified state lock credential; The preceding hash reference of the data time-series chain of the IoT node in the next flow stage is determined based on the final state summary; Data tracking for the next round of circulation is initiated based on the aforementioned preceding hash reference.

9. The method for end-to-end tracking and management of food supply chain based on the Internet of Things as described in claim 1, characterized in that, The cross-chain index represents a cryptographic pointer that tracks and verifies the food flow record of the previous flow stage by identifying the next flow stage's tracking identifier.

10. An IoT-based end-to-end tracking and management system for food supply chains, used to execute the IoT-based end-to-end tracking and management method for food supply chains as described in any one of claims 1 to 9, characterized in that, The tracking and management system includes: The trusted encryption processing module is used to deploy IoT nodes at each stage of the food flow to collect the status data of the food in real time, and then perform trusted encryption processing on the status data of the food to obtain a status digest that proves the temporal integrity of the IoT nodes. The on-chain evidence storage module is used to create a tracking identifier for the current batch of food, and to store the tracking identifier and the status summary on the blockchain for evidence storage. The cross-chain state synchronization module is used to synchronize the tracking identifier across chains when the ingredients are about to be transferred to the next circulation stage, obtain a state lock certificate pointing to the main consortium chain, and submit the state lock certificate to the smart contract on the main consortium chain. The cross-chain index generation module is used to record the location proof and transfer timestamp of the current transportation batch of ingredients in the current circulation stage on the main consortium chain after the smart contract verifies the validity of the state lock certificate signature, and then generate a cross-chain index for the tracking identifier of the next circulation stage. The cross-chain verification module is used to perform cross-chain verification of the state lock credentials of the main consortium chain in the previous circulation stage through the cross-chain index, and use the verified state lock credentials as the initialization input of the IoT node in the next circulation stage, and start data tracking in the next round of circulation stage.