Livestock and poultry food processing and safety tracing method and system based on block chain
By employing a main chain and side chain collaborative architecture, on-chain and off-chain storage mechanisms, and node reputation scoring, the system addresses the issues of data silos and low regulatory efficiency in traditional livestock and poultry food traceability systems. This enables reliable traceability and efficient regulation throughout the entire food lifecycle, while also improving system scalability and data consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG AGRICULTURAL UNIVERSITY
- Filing Date
- 2026-03-27
- Publication Date
- 2026-04-28
AI Technical Summary
Traditional livestock and poultry food traceability systems suffer from data silos, susceptibility to tampering, low regulatory efficiency, difficulty in data integration, and inability to achieve real-time dynamic monitoring. Furthermore, existing blockchain solutions have failed to effectively address the issues of unified data collection across multiple stages, intelligent monitoring, and data privacy protection.
A blockchain architecture that integrates the main chain and multiple side chains is constructed. A two-layer collaborative mechanism of on-chain index storage and off-chain entity storage is adopted. Combined with a probability and strategy hybrid grouping mechanism of node reputation scoring, automatic verification and anomaly detection are achieved through smart contracts, and anti-counterfeiting traceability codes that comply with the GS1-128 standard are generated.
It achieves the immutability and authenticity of livestock and poultry food data throughout the entire life cycle, reduces the main chain storage load, improves system throughput and regulatory efficiency, ensures data consistency and reliable synchronization, supports multi-entity and multi-stage collaboration, and enhances the transparency and public trust in food safety.
Smart Images

Figure CN121937142A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of food safety traceability technology, specifically to a blockchain-based method and system for traceability of livestock and poultry food processing and safety. Background Technology
[0002] In the current context of the rapid development of the livestock and poultry food industry, its production chain is characterized by complex links, diverse participants, and dispersed geographical distribution. It encompasses multiple key stages, including breeding, slaughtering, processing, transportation, warehousing, and sales. Data from each stage is often stored in independent systems of different enterprises or departments, forming data silos. This decentralized data management model leads to poor information flow, significant difficulties in cross-departmental and cross-enterprise collaboration, and, in the event of a food safety issue, makes it difficult to quickly trace the source of the problem and identify the responsible party, posing a significant challenge to food safety supervision.
[0003] Traditional livestock and poultry food traceability systems mostly employ a centralized database storage architecture, and this centralized management model for core data has many inherent flaws. On the one hand, centralized storage makes data highly susceptible to human tampering, deletion, or falsification. Some companies may falsify or alter production and testing data to evade responsibility, leading to distorted traceability information and making it difficult for consumers to obtain accurate product information. On the other hand, the stability of centralized systems depends on a single server or a few core nodes. Once they encounter network attacks or hardware failures, data loss or system paralysis may occur, affecting the normal operation of the traceability system. Furthermore, traditional traceability systems lack unified data collection standards and intelligent monitoring mechanisms. Inconsistent data formats and non-standardized collection processes at different stages make data integration difficult. Regulatory departments need to invest significant manpower and resources in manual verification, resulting in low regulatory efficiency and making it difficult to achieve real-time dynamic monitoring of the entire chain.
[0004] Blockchain technology, with its core characteristics of decentralization, immutability, traceability, and transparency, offers a novel technological path to solving traditional traceability challenges. Utilizing blockchain technology to record data throughout the entire lifecycle of livestock and poultry products can build a trusted data sharing platform, achieving the traceability goals of "traceable origin, traceable destination, and accountable responsibility," effectively improving the information transparency of the food supply chain. However, existing blockchain-based livestock and poultry product traceability solutions still have significant shortcomings: First, they lack a unified collection and standardized processing mechanism for data from multiple stages such as breeding, slaughtering, and processing, resulting in inconsistent data quality and affecting traceability accuracy. Second, a comprehensive intelligent regulatory system has not been established, relying heavily on manual intervention for anomaly detection and handling, which is insufficient to meet the real-time monitoring needs of large-scale, high-concurrency scenarios. Third, some solutions directly upload all data to the blockchain, leading to excessive storage load, low transaction processing efficiency, and failing to effectively balance data privacy protection with traceability convenience. Summary of the Invention
[0005] In order to solve the above-mentioned technical problems, this application proposes the following technical solution: In a first aspect, embodiments of this application provide a blockchain-based method for traceability of livestock and poultry food processing and safety, including: A blockchain architecture that coordinates the main chain and multiple side chains is constructed. After collecting data from all aspects of livestock and poultry food through the Internet of Things information collection module, the collected data is stored and associated using a two-layer collaborative mechanism of on-chain index storage and off-chain physical storage. After achieving data consensus by adopting a probability and strategy hybrid grouping mechanism based on node reputation scoring, data trust synchronization and cross-chain verification are performed between the main chain and side chains to generate index paths; Smart contracts are deployed on the main chain. Each side chain node completes data verification locally and then uploads it to the main chain. The smart contracts automatically verify and detect anomalies according to preset rules, and trigger warnings and handle abnormal events. During the product manufacturing stage, the hash digest and timestamp corresponding to each product batch are extracted from each relevant sidechain. The root hash is generated by the Merkle tree aggregation algorithm. The product batch number and enterprise code are combined to generate a unique anti-counterfeiting and traceability code that conforms to the GS1-128 standard. The main chain node then performs digital signature to generate a QR code. Consumers or regulatory agencies can scan the QR code to verify the authenticity of products and trace their entire lifecycle data.
[0006] In one possible implementation, the construction of a blockchain architecture that coordinates the main chain and multiple side chains involves collecting data from various stages of livestock and poultry food production via an IoT information collection module. The collected data is then stored and associated using a two-layer collaborative mechanism of on-chain index storage and off-chain physical storage, including: The Internet of Things (IoT) information collection module collects data from all stages of livestock and poultry food production, including breeding, slaughtering, processing, transportation, storage, and sales, forming a set of raw business data. The original business data set is divided into lightweight metadata and large payload based on data attributes; The large payload is transmitted to an off-chain distributed storage system or encrypted database, generating a unique storage address pointer; Perform a one-way hash operation on the large payload stored off-chain, and generate a digital digest by combining the data generation time and collision-proof random salt value; Construct an on-chain index data packet and broadcast the index data packet to the corresponding sidechain node for consensus storage.
[0007] In one possible implementation, the formula for constructing the on-chain index data packet is: in, For index data packets, A unique identifier for the batch. For lightweight metadata, For digital digests, Digital signature for the data source, This is a hash address for the distributed file system. For a secure hash algorithm, For large-volume loads. For the time the data was generated, To prevent collisions, random salt values are used. For cascading, This represents the function for generating memory addresses.
[0008] In one possible implementation, after achieving data consensus using a probability-policy hybrid grouping mechanism based on node reputation scoring, data trust synchronization and cross-chain verification between the main chain and side chains are performed to generate an index path, including: The reputation score of each participating node in the sidechain network is calculated based on the node's historical behavior. All nodes are sorted in descending order according to the reputation score, and the preset number of nodes with the highest scores are selected as the master nodes of each consensus group. The remaining nodes are randomly grouped by probability using a hash modulo algorithm and assigned to the corresponding consensus groups. Within each consensus group, the lightweight Chain-Raft algorithm is used to achieve data consistency and preprocessing within the group, and the PBFT algorithm is used between groups to achieve global consensus. After a new block is generated on the sidechain, the block header hash is calculated, and a cross-chain anchored transaction is constructed by combining the timestamp and the sidechain ID. The calculation formula is as follows: ; in, For cross-chain anchored transactions, For sidechain digital signature functions, A unique identifier for the sidechain. This is the hash of the current sidechain block header. The hash value of the previous anchor transaction. For timestamps, For cascading, For the new block, For a secure hash algorithm, This is the block header data for the new block; After receiving the cross-chain anchored transaction, the main chain node executes the smart contract to perform signature legality checks, timestamp window verification, and hash chain continuity verification. After successful verification, the main chain writes the sidechain block header hash into the global index tree, generating an index path.
[0009] In one possible implementation, the formula for calculating the reputation score of each participating node in the sidechain network based on its historical behavior is as follows: in, For reputation rating, For nodes The number of times a participant contributes to consensus and generates a valid block. This represents the total number of times the node has been selected to participate in the consensus process. The average response latency of the node. Count the penalties for nodes going offline or engaging in malicious behavior. The preset weighting coefficients, and .
[0010] In one possible implementation, within each consensus group, a lightweight Chain-Raft algorithm is used to achieve data consistency and preprocessing within the group, including: Let the number of nodes in the group be Once the group master node receives the list of transaction requests, it packages the request into a preparatory block and broadcasts it to the group. The nodes within the group verify the prepared block. Upon successful verification, a partial signature is generated. Once confirmation is received from more than half of the nodes, the group master node aggregates the partial signatures to generate a threshold signature, calculated using the following formula: in, For partial signatures, For the preparation block, To verify the function, For indicator functions, This represents the number of nodes within the group. For the summation operation, As a participating node within the group, For the current consensus group, For group threshold signatures, For aggregate functions, For collected A set of valid partial signatures.
[0011] In one possible implementation, the deployment of smart contracts on the main chain, with each sidechain node completing data verification locally and then uploading it to the main chain, involves the smart contract automatically verifying and detecting anomalies according to preset rules, and triggering early warnings and handling for abnormal events, including: Regulatory agencies or enterprise administrators publish regulatory rules on the main chain through a multi-signature mechanism. These regulatory rules include temperature and humidity thresholds, quarantine standards, transportation time limits, data format requirements, and node signature matching conditions. After each sidechain node completes local data verification, it generates a verification digest data packet containing a verification result identifier, data hash value, timestamp and node signature, and uploads it to the main chain after digital signature; After receiving the verification digest data packet, the smart contract automatically verifies whether the data format is consistent with the rule definition, the identity of the uploading node and the validity of the signature, the continuity of the hash value format and timestamp, and whether the verification result identifier meets the regulatory conditions. If the detection passes, the verification pass identifier is recorded; otherwise, the abnormal judgment process is initiated. The anomaly type and severity are automatically determined based on the inspection results of the on-chain verification digest; When a serious anomaly is detected, an early warning event is generated, which includes the time of the anomaly, the node identifier, the cause of the anomaly, and related hash digest information. This event is reported to the main chain in the form of a transaction and triggers the regulatory node notification mechanism. Based on the anomaly type and rule settings, the smart contract automatically executes actions such as freezing abnormal batches, locking associated node accounts, generating regulatory reports, or triggering manual review. All actions are executed on-chain and recorded in the ledger.
[0012] In one possible implementation, during the product manufacturing stage, the hash digests and timestamps corresponding to each product batch are extracted from the relevant sidechains. A root hash is generated using a Merkle tree aggregation algorithm. This root hash is then combined with the product batch number and enterprise code to generate a unique anti-counterfeiting and traceability code conforming to the GS1-128 standard. Finally, a QR code is generated after digital signature by the main chain node, including: Extract block hash digests and timestamp information associated with the target product batch from various side chains such as breeding, slaughtering, processing, transportation, and warehousing; The Merkle tree aggregation algorithm is used to calculate the extracted hash digest and generate the root hash value for the entire lifecycle as a digital fingerprint of the product data. A unique anti-counterfeiting and traceability code is generated based on the product batch number, enterprise code, production time, and product category, following the GS1-128 coding standard. The main chain nodes digitally sign the root hash value and the anti-counterfeiting traceability code to form an anti-counterfeiting traceability data package. The anti-counterfeiting and traceability data package is converted into a QR code. The binding relationship between the QR code and the product batch is recorded through the main chain. The QR code is then attached to the product packaging as an tamper-evident label.
[0013] In one possible implementation, the consumer or regulatory agency verifies the authenticity of the product and performs full lifecycle data traceability by scanning the QR code, including: After consumers or regulatory agencies initiate an inquiry by scanning the QR code on the product packaging, the system verifies the authenticity of the QR code and the digital signature of the main chain to confirm that the anti-counterfeiting data package is from a legitimate source and has not been tampered with. Based on the product identification code and main chain index information embedded in the QR code, the corresponding global root hash value is parsed, and the associated side chain block digest records are located. The hash digest information corresponding to the product batch is retrieved from each sidechain, and a hash consistency comparison is performed through the main chain verification interface to confirm that the on-chain hash digest matches the off-chain original data hash. After hash verification is successful, the corresponding non-sensitive business data is retrieved from the off-chain database and displayed to users in a visual manner, showing the product source, quarantine and testing status, processing and transportation conditions, warehousing information and sales records. Regulatory agencies can access the complete on-chain logs and anomaly records. If the QR code is tampered with, the hash comparison is inconsistent, or the main chain signature is invalid, the system will automatically prompt that the data is abnormal or the anti-counterfeiting verification has failed, and generate an abnormal access log to write to the main chain.
[0014] Secondly, embodiments of this application provide a blockchain-based livestock and poultry food processing and safety traceability system, including: The Internet of Things (IoT) information collection module is used to collect data from all stages of livestock and poultry food processing. The blockchain data management and traceability module uses a two-layer collaborative mechanism of on-chain index storage and off-chain physical storage to store and associate the collected data. After achieving data consensus, it uses a probability and strategy hybrid grouping mechanism based on node reputation scoring to perform trusted data synchronization and cross-chain verification between the main chain and side chains, and generates index paths. The smart contract module is used to deploy smart contracts on the main chain. Each side chain node completes data verification locally and then uploads it to the main chain. The smart contract performs automatic verification and anomaly detection according to preset rules, and triggers early warnings and handling for abnormal events. The anti-counterfeiting and traceability QR code generation module is used to extract the hash digest and timestamp corresponding to the product batch from the relevant side chains during the product manufacturing stage. The root hash is generated by the Merkle tree aggregation algorithm. Combined with the product batch number and enterprise code, a unique anti-counterfeiting and traceability code that conforms to the GS1-128 standard is generated. After being digitally signed by the main chain node, the QR code is generated. Consumers or regulatory agencies can scan the QR code to verify the authenticity of the product and query the full life cycle data traceability. The user interaction and oversight module provides tiered access interfaces for businesses, consumers, and regulatory agencies.
[0015] Compared with the prior art, the beneficial effects of this application are as follows: This application employs a collaborative architecture of main chain and multiple side chains, combined with a two-layer collaborative mechanism of on-chain index storage and off-chain entity storage. Utilizing SHA-256 hash anchoring technology and digital signatures, it ensures the immutability and authenticity of livestock and poultry food data throughout its entire lifecycle, from breeding to sales. Even minor modifications to off-chain data can be quickly identified through hash comparison, achieving data consistency verification.
[0016] This application adopts a "lightweight on-chain index + massive off-chain storage" model, only uploading lightweight information such as data hash digests and key metadata to the chain, significantly reducing the main chain's storage load and solving the block congestion problem caused by directly uploading large amounts of data to the chain. Simultaneously, sidechains operate independently according to business processes to achieve parallel processing. Combined with a hybrid group consensus algorithm based on node reputation scoring, this significantly reduces network communication complexity and improves system throughput and response speed.
[0017] This application achieves unattended automated supervision through smart contracts deployed on the main chain. By pre-setting temperature and humidity thresholds, quarantine standards, and other regulatory rules, it performs real-time monitoring, rule matching, and anomaly detection on verification summaries reported by various side chains. It can automatically identify anomalies such as data mismatches, signature expiration, and delayed reporting, quickly generating warnings and executing actions such as freezing batches and locking nodes, forming a complete and traceable chain of regulatory evidence, significantly improving regulatory efficiency and accuracy. Simultaneously, the main chain undertakes global control, rule management, and cross-chain anchoring functions. Each side chain independently maintains its data ledger according to its stage (breeding, slaughtering, processing, etc.), achieving stage-level data isolation and secure storage. Through a cross-chain verification mechanism, side chain data summaries are anchored to the main chain, ensuring reliable cross-chain data synchronization, balancing system scalability and data consistency, and meeting the needs of multi-entity, multi-stage collaboration.
[0018] This application generates unique anti-counterfeiting and traceability QR codes based on the Merkle tree aggregation algorithm and the GS1-128 standard, enabling precise traceability of each product with a unique code. Consumers can quickly verify the authenticity of products and obtain information such as product origin, testing reports, and circulation records by scanning the code. Enterprises and regulatory agencies can obtain data with corresponding permissions through tiered access interfaces, ensuring accountability and regulatory transparency, effectively reducing the risk of counterfeit and substandard products circulating in the market, and enhancing public trust in the safety of livestock and poultry food. Attached Figure Description
[0019] Figure 1 A schematic flowchart illustrating a blockchain-based method for traceability of livestock and poultry food processing and safety, provided in an embodiment of this application; Figure 2 The blockchain-based traceability model for livestock and poultry food processing and safety provided in this application embodiment; Figure 3 This is a schematic diagram of the traceability data query process provided in the embodiments of this application; Figure 4 This is a schematic diagram of a blockchain-based livestock and poultry food processing and safety traceability system provided in an embodiment of this application. Detailed Implementation
[0020] The present solution will now be described in conjunction with the accompanying drawings and specific embodiments.
[0021] Figure 1 A flowchart illustrating a blockchain-based method for traceability of livestock and poultry food processing and safety, provided in this application embodiment, is shown below. Figure 1 This embodiment of a blockchain-based method for livestock and poultry food processing and safety traceability includes: S101 constructs a blockchain architecture that coordinates the main chain and multiple side chains. After collecting data from various stages of livestock and poultry food through the Internet of Things information collection module, it uses a two-layer collaborative mechanism of on-chain index storage and off-chain physical storage to store and associate the collected data.
[0022] In this embodiment, the constructed livestock and poultry food processing and safety traceability data model is based on a main chain and multiple side chain collaborative architecture design, such as... Figure 2 As shown, in various business processes of livestock and poultry breeding, slaughtering, processing, warehousing, transportation, and sales, IoT information collection modules collect on-site data to form raw business data, i.e., plaintext data. Plaintext data includes environmental parameters, equipment operating status, operation records, and video image data. The collected plaintext data first enters the encryption algorithm module, where it is encrypted using a preset encryption algorithm, converting the plaintext data into ciphertext data to ensure the security and privacy of the data during storage and transmission. The encrypted ciphertext data is stored in an off-chain database or distributed storage system, generating a unique sidechain transaction address to identify the off-chain storage location of the data. The system calls the mapping contract deployed on the blockchain to bind the off-chain storage information with the on-chain index. The mapping contract generates on-chain mapping relationship data to establish a one-to-one correspondence between the on-chain index and the off-chain data.
[0023] The mapped index data is broadcast to the corresponding business sidechain, where it is verified through consensus by the ledger management nodes of each sidechain before being written into the blockchain ledger. Data from different business processes is written to their respective sidechains, and each sidechain maintains its ledger independently, achieving data isolation and parallel processing.
[0024] After each sidechain completes the data writing, it will synchronize key index information such as block hashes and mapping relationship summaries to the main chain.
[0025] The main chain manages data from all sidechains uniformly through deployed smart contracts. When a user needs to query traceability information, they initiate a traceability information query request by calling the query smart contract on the main chain through the system interface. The query smart contract first retrieves the index information of the target data in the main chain and locates the corresponding business sidechain based on the mapping relationship. Then, it obtains the index information of the data from the corresponding sidechain ledger, retrieves the corresponding encrypted data from the off-chain storage system based on the obtained sidechain transaction address, and performs a decryption operation through the data decryption module to restore the original plaintext data. The system recalculates the hash value of the decrypted plaintext data and compares it with the hash digest recorded in the sidechain or the main chain. If the two match, the data is determined to be tamper-proof; otherwise, the data is determined to be abnormal. After successful verification, the restored plaintext data is returned to the user, completing the traceability information query process and realizing a traceable display of the entire process from production to sales.
[0026] In this embodiment, the main chain serves as the global control and indexing layer of the system, responsible for recording the global block index, smart contract rules, cross-chain mapping relationships, and regulatory node information. It does not directly store large amounts of raw data, thereby effectively reducing the main chain's storage load and improving the overall operating efficiency of the system.
[0027] Each sidechain is functionally divided according to its business process, corresponding to the following sidechains: breeding management, slaughtering management, processing management, warehousing management, transportation management, and sales management. Each sidechain independently maintains its own data ledger, storing hash values and digital signature information uploaded by the IoT acquisition module, achieving process-level data isolation and parallel processing. While the sidechains are independent of each other, they are also subject to unified scheduling by the main chain, thus ensuring both system scalability and data consistency.
[0028] To address the issues of block congestion and storage redundancy caused by directly uploading large volumes of data, such as high-definition surveillance videos and high-resolution inspection reports, to the blockchain in high-concurrency scenarios, this embodiment introduces a hash-anchored, on-chain and off-chain dual-layer collaborative storage mechanism. This mechanism constructs a mathematical mapping model to divide business data into off-chain physical storage and on-chain index storage. Specifically, an IoT information collection module collects data from each stage of livestock and poultry food production, including breeding, slaughtering, processing, transportation, warehousing, and sales, forming the original business data set. Then, based on the data attributes, the original business data set is... Segmented into lightweight metadata and large volume load The lightweight metadata includes device ID, key environmental parameters, and timestamps, while the bulk payload includes video stream data and image files. The bulk payload is transmitted to an off-chain distributed storage system or an encrypted database, generating a unique storage address pointer.
[0029] in, It is a hash address of the distributed file system. This represents the function for generating memory addresses.
[0030] To establish a strong correlation between on-chain and off-chain data and prevent data tampering, the system performs a one-way hash operation on the off-chain stored data, combining the data generation time and a collision-resistant random salt value to generate a digital digest. The calculation formula is as follows: in, For digital digests, For a secure hash algorithm, For the time the data was generated, To prevent collisions, random salt values are used. For large-volume loads. For cascading, It is a large-volume load.
[0031] Subsequently, an on-chain index data packet is constructed and broadcast to the corresponding sidechain nodes for consensus storage. This data packet contains only a few tens of bytes of verification information and does not contain the original file. The calculation formula is as follows: in, For index data packets, A unique identifier for the batch. For lightweight metadata, A digital signature for the data source, used to prove data ownership. This is the hash address of the distributed file system. Using this formula, the system achieves indexing of GB-level off-chain data with KB-level on-chain overhead.
[0032] During the data query and tracing phase, the system adopts a read-write separation mode: reading the index from the sidechain. ,in accordance with The system retrieves raw data from the off-chain database in parallel. To ensure that the retrieved off-chain data has not been replaced or modified during storage, the system performs the following real-time consistency check operation: First, the hash digest is recalculated based on the downloaded data: in, For the recalculated hash digest, For a secure hash algorithm, For the downloaded data content, For the time the data was generated, To prevent collisions, random salt values are used. For cascading.
[0033] Then, the calculation result is compared with the immutable anchor hash on the chain: in, To verify the results, For digital digests, This is used to index data packets. This mechanism leverages the avalanche effect of hash functions to ensure that even a single bit change in off-chain data will lead to... With the records on the chain The mismatch ensures the authenticity and integrity of data throughout its entire lifecycle without relying on centralized auditing, through mathematical means.
[0034] S102 adopts a probability and strategy hybrid grouping mechanism based on node reputation scoring to achieve data consensus, and then performs trusted data synchronization and cross-chain verification between the main chain and side chains to generate index paths.
[0035] In this embodiment, to address the problem that the communication complexity of the traditional PBFT algorithm increases exponentially with the number of nodes, an improved PBFT algorithm is proposed, employing a hybrid probability and policy grouping mechanism based on node reputation scoring. Assume there are a total of [number missing] nodes in the sidechain network. There are participating nodes, denoted as _ . The reputation score of each participating node in the sidechain network is calculated based on its historical behavior, using the following formula: in, For reputation rating, For nodes The number of times a participant contributes to consensus and generates a valid block. This represents the total number of times the node has been selected to participate in the consensus process. The average response latency of the node. Count the penalties for nodes going offline or engaging in malicious behavior. The preset weighting coefficients, and .
[0036] All nodes are sorted in descending order based on their reputation scores. The X nodes with the highest scores are selected as the master nodes of each consensus group. The remaining nodes NX are randomly grouped using a hash modulo algorithm and assigned to the appropriate nodes. Consensus Group middle, in, As a participating node within the group, As a unique identifier for the node, The total number of consensus groups, The random number for the current consensus round. For hash functions, This represents the XOR operation. This grouping strategy balances the dominant role of high-performance nodes with the random supervision role of ordinary nodes.
[0037] Within each consensus group, the lightweight Chain-Raft algorithm is used to achieve data consistency and preprocessing. Let the number of nodes in the group be... When the group master node receives the list of transaction requests, it packages the blocks into a preparatory block and broadcasts it to the group. Nodes within the group verify the preparatory block; upon successful verification, a partial signature is generated. After receiving confirmation from more than half of the nodes, the group master node aggregates the partial signatures to generate a threshold signature. The calculation formula is as follows: in, For partial signatures, For the preparation block, To verify the function, For indicator functions, This represents the number of nodes within the group. For the summation operation, As a participating node within the group, For the current consensus group, For group threshold signatures, For aggregate functions, For collected A set of valid partial signatures. This step limits the complexity of intra-group communication to local, outputting only a single endorsed group signature to the outside world.
[0038] Global consensus is achieved among groups using the PBFT algorithm. It is considered a logical supernode. At the global level, the PBFT protocol runs between the master nodes of each group. Global consensus is no longer based on a single node, but rather on the number of valid votes for the group. Let the system fault tolerance threshold be... The total number of consensus groups A new global block awaiting confirmation. The necessary and sufficient condition for being confirmed and written to the sidechain ledger is receiving Submission confirmations from different consensus groups: in, This is a new global block awaiting confirmation. To indicate the new block To reach a global consensus The total number of consensus groups. This is the consensus threshold. For the current consensus group, For group threshold signatures, The set of signatures for all legitimate groups.
[0039] At this point, the system generates a new block, whose block header contains the aggregated global signature set, ensuring the consistency of data across the entire network.
[0040] After a new block is generated on the sidechain, its digest needs to be anchored to the main chain. The sidechain calculates the block header hash and combines it with the timestamp and sidechain ID to construct a cross-chain anchor transaction. The calculation formula is as follows: ; in, For cross-chain anchored transactions, For timestamps, For the new block, For block header hash; After receiving the cross-chain anchored transaction, the main chain node executes the smart contract to perform the following cross-chain verification logic: Signature validity check: in, This is the signature verification function. This is the public key for the sidechain; the mainchain nodes use this public key for decryption and verification. Whether the signature in the data was indeed generated by the sidechain consensus node.
[0041] Timestamp window validation: ,in, The current system time when the main link receives and processes the anchored transaction. This is the timestamp, where the original generation time carried in the anchor transaction is used. This is the preset maximum allowed time window threshold.
[0042] Hash chain continuity: verification Whether it points to the hash of the block on the sidechain recorded on the main chain.
[0043] After verification, the main chain will Write to the global index tree and generate the index path. At this point, the sidechain data is locked to the main chain through mathematical means, and any tampering with the sidechain's historical data will result in a hash that is anchored to the main chain. The mismatch ensures reliable data synchronization.
[0044] S103 deploys smart contracts on the main chain. Each side chain node completes data verification locally and then uploads it to the main chain. The smart contract performs automatic verification and anomaly detection according to preset rules, and triggers warnings and handles abnormal events.
[0045] In this embodiment, the smart contract automatic monitoring module runs on the main chain and is the core functional module for achieving automated monitoring and risk warning. This module uses preset monitoring rules and automatic execution logic to monitor and intelligently determine the data verification summary information uploaded to the main chain at each stage of the system, thereby achieving unattended monitoring and automated handling throughout the entire process.
[0046] Smart contracts do not directly parse raw off-chain business data. Instead, they execute rule matching, signature verification, and anomaly triggering logic on the blockchain based on the hash digest, verification result identifier (Pass or Fail), timestamp, and node signature information recorded on the blockchain. When off-chain data does not match the on-chain digest, the system can automatically identify and report the anomaly through hash comparison, thereby ensuring data privacy while achieving automatic on-chain supervision.
[0047] The process involves regulatory agencies or enterprise administrators publishing regulatory rules on the main chain through a multi-signature mechanism. These rules include temperature and humidity thresholds, quarantine standards, transportation time limits, data format requirements, and node signature matching conditions. The rules are solidified into the main chain ledger in the form of smart contracts to ensure that the content of the rules is immutable and can be verified by all nodes.
[0048] After each sidechain node completes the raw data collection locally, it performs threshold judgment and data verification, and generates a verification digest data packet containing a verification result identifier, data hash value, timestamp, and node signature. This data packet is then digitally signed and uploaded to the main chain. Upon receiving the packet, the smart contract automatically performs the following checks: whether the verification digest data format is consistent with the rule definition, the identity of the uploading node and the validity of the signature, the continuity of the hash value format and timestamp, and whether the verification result identifier meets regulatory requirements. If the checks pass, a verification pass identifier is recorded; if the checks fail, the anomaly judgment process begins.
[0049] The smart contract automatically determines the type and severity of anomalies based on the on-chain verification digest check results. Anomaly types include unqualified verification results, invalid signatures, data hash mismatches, upload delays, or duplicate data reporting. The smart contract categorizes and processes anomalies according to preset thresholds and rules. When an anomaly is determined to be severe, a warning event is generated containing the anomaly time, node identifier, cause, and relevant hash digest information. This event is reported to the main chain as a transaction and triggers a regulatory node notification mechanism, ensuring that regulatory agencies can monitor the anomaly status in real time. Based on the anomaly type and rule settings, the smart contract automatically executes corresponding handling operations, including freezing the anomaly batch, locking associated node accounts, generating regulatory reports, or triggering manual review. All handling actions are executed on-chain and recorded in the ledger, forming a complete and traceable chain of regulatory evidence.
[0050] S104: During the product manufacturing stage, the hash digest and timestamp corresponding to the product batch are extracted from each relevant sidechain. The root hash is generated by the Merkle tree aggregation algorithm. Combined with the product batch number and enterprise code, a unique anti-counterfeiting and traceability code that conforms to the GS1-128 standard is generated. The main chain node then performs digital signature to generate a QR code.
[0051] In this embodiment, block hash digests and timestamp information associated with the target product batch are extracted from various sidechains such as breeding, slaughtering, processing, transportation, and warehousing. The extracted hash digests are calculated using the Merkle tree aggregation algorithm to generate a root hash value for the entire lifecycle as a digital fingerprint of the product data. Based on the product batch number, enterprise code, production time, and product category, a unique anti-counterfeiting traceability code is generated in accordance with the GS1-128 coding standard. The main chain node digitally signs the root hash value and the anti-counterfeiting traceability code to form an anti-counterfeiting traceability data package. The anti-counterfeiting traceability data package is converted into a QR code. The binding relationship between the QR code and the product batch is recorded through the main chain. The QR code is attached to the product packaging as an tamper-evident label for scanning verification and full traceability.
[0052] S105. Consumers or regulatory agencies can verify the authenticity of products and trace the data throughout their entire lifecycle by scanning a QR code.
[0053] In this embodiment, the user interaction and regulatory interface module provides tiered access interfaces for enterprises, consumers, and regulatory agencies. The system implements access control for different roles: consumers can query product origin and testing information; enterprises can view data from their respective stages; and regulatory agencies can access full-chain logs, anomaly events, and traceability reports. All access operations are automatically logged and written to the main chain for evidence storage, ensuring that access behavior is traceable and responsibility is definitively determined. Figure 3As shown, the traceability data query process includes: after consumers or regulatory agencies initiate a query request by scanning the QR code on the product packaging, the system verifies the authenticity of the QR code and the main chain digital signature to confirm that the anti-counterfeiting data package is legitimate and has not been tampered with. Based on the product identification code embedded in the QR code and the main chain index information, the system parses the corresponding global root hash value and locates the block digest records of each associated side chain. The system retrieves the hash digest information corresponding to the product batch from each side chain, such as breeding, slaughtering, processing, transportation, and warehousing. The system performs a hash consistency comparison through the main chain verification interface to confirm that the hash digest recorded on the chain matches the original data hash stored in the off-chain database.
[0054] After hash verification is successful, the corresponding non-sensitive business data, such as test report summaries and temperature control status records, are retrieved from the off-chain database and displayed to users in a visual manner, showing the product origin, quarantine and testing status, processing and transportation conditions, warehousing information and sales records. Regulatory agencies can access the complete on-chain logs and anomaly records.
[0055] If the QR code is tampered with, the hash comparison is inconsistent, or the main chain signature is invalid, the system will automatically prompt data anomaly or anti-counterfeiting verification failure, and generate an abnormal access log written to the main chain for subsequent regulatory auditing. Through the above process, users can achieve "one item, one code" anti-counterfeiting verification and full-process traceability based on the product's QR code. The system ensures that the query results are authentic, verifiable, and tamper-proof through the mapping of the main chain index and off-chain data.
[0056] Corresponding to the blockchain-based livestock and poultry food processing and safety traceability method provided in the above embodiments, this application also provides an embodiment of a blockchain-based livestock and poultry food processing and safety traceability system.
[0057] See Figure 4 This application provides a blockchain-based traceability system for livestock and poultry food processing and safety, comprising: an IoT information collection module, a blockchain data management and traceability module, a smart contract automatic monitoring module, an anti-counterfeiting traceability code generation module, and a user interaction and monitoring module. These modules are connected via a blockchain network, forming a comprehensive information traceability system covering the entire process of livestock and poultry food breeding, slaughtering, processing, transportation, storage, and sales. Through data collection, encryption, on-chain processing, consensus mechanisms, and evidence storage, this system achieves reliable traceability of livestock and poultry food from source to end consumer.
[0058] The Internet of Things (IoT) information collection module is deployed in various links of the livestock and poultry food industry chain to collect multi-source data, including breeding environment parameters, quarantine and testing data, processing information, transportation temperature control data, storage conditions and sales records.
[0059] In the breeding stage, RFID technology is used to uniquely identify individual livestock or batches, and real-time information on the breeding environment and health is collected through temperature and humidity sensors, gas sensors, video monitoring and other equipment. In the slaughtering and processing stage, quarantine results, processing temperature and equipment operating status are collected. In the transportation stage, GPS is used to collect vehicle location, temperature and humidity and transportation time. In the warehousing stage, cold chain conditions and inventory status are collected. In the sales stage, product flow and sales batches are collected.
[0060] The collected raw data is first hashed and digitally signed at edge computing nodes. Only the generated hash value and signature result are uploaded to the blockchain node, while the raw data is stored in an off-chain database or distributed file system. This method ensures data authenticity, privacy, and immutability. The data collection terminal communicates with the blockchain node via 5G or LoRa networks to achieve secure transmission and real-time on-chain uploading.
[0061] The blockchain data management and traceability module employs a constructed blockchain-based traceability model for livestock and poultry food quality and safety. The main chain is responsible for global indexing, rule management, and cross-chain anchoring, while side chains maintain business data for each stage, including breeding, slaughtering, processing, transportation, and sales, achieving data isolation and parallel processing. To address the low efficiency of uploading large volumes of data to the chain, the system adopts a two-layer collaborative mechanism of on-chain hash indexing and off-chain entity storage. Hash anchoring enables lightweight evidence storage and highly reliable consistency verification. At the consensus level, a probability and strategy-based hybrid grouping mechanism based on node reputation scoring is proposed. Two-stage collaborative consensus, involving intra-group Chain-Raft and inter-group PBFT, reduces communication complexity and improves throughput. New blocks from side chains are anchored to the main chain after cross-chain verification, ensuring reliable synchronization and tamper-proof cross-chain data.
[0062] In this embodiment, the blockchain data management and traceability module includes a security service submodule and a distributed ledger submodule. The security service submodule ensures the security, integrity, and controllable access of data within the system, and includes units such as digital signatures, encryption algorithms, account management, and key management. The digital signature unit is used to sign collected data, transaction information, and index data to verify the authenticity and integrity of the data source. Each node generates a digital signature using its private key before uploading data to the blockchain, and other nodes can verify it using the corresponding public key, thereby preventing data forgery and tampering.
[0063] The encryption algorithm unit encrypts raw business data to ensure confidentiality during transmission and storage. The account management unit manages the identities of participants in the blockchain network, including enterprise nodes, regulatory nodes, and user nodes. This unit assigns a unique account identifier to each node and records its permission information, implementing hierarchical access control and authentication. The key management unit generates, stores, and updates public-private key pairs for each node and is responsible for the secure distribution and lifecycle management of keys. Through the key management mechanism, the secure and reliable operation of digital signatures and data encryption processes is ensured.
[0064] The distributed ledger submodule is used to implement distributed data storage, consistency maintenance, and transaction processing, including components such as the ledger, transactions, a P2P network, and a consensus mechanism. The ledger unit stores consensus-confirmed data records in a block structure, including data indexes, hash digests, timestamps, and signature information. The ledger is immutable and traceable, used to completely record data throughout the entire lifecycle of livestock and poultry products. The transaction unit encapsulates the operational behaviors during the data uploading process, including data writing, index submission, cross-chain anchoring, and query requests. Each transaction includes a sender, receiver, data digest, and signature information, and serves as the basic unit for block generation. The P2P network unit enables peer-to-peer communication between blockchain nodes. Nodes broadcast transactions, propagate blocks, and synchronize states through the P2P network, thereby ensuring the system's decentralized nature and efficient data distribution. The consensus mechanism unit is used to reach consensus among distributed nodes on the validity of data. This embodiment adopts a probability and policy hybrid group consensus mechanism based on node reputation scoring. Local consensus is achieved within a group through Chain-Raft, and global consensus is achieved between groups through PBFT, thereby improving system throughput performance while ensuring security.
[0065] The smart contract module, deployed on the main chain, is used to monitor, match rules, and automatically determine anomalies in real time for business data from various sidechains based on on-chain hash digests, signature information, verification results, and timestamps, thereby constructing a fully unattended regulatory mechanism. Regulatory agencies solidify rules such as temperature and humidity thresholds, quarantine standards, and transportation timeliness into contract logic through multi-signature methods. After completing local data verification, sidechain nodes submit verification digests. The smart contract automatically reviews the format, signature, timestamp continuity, and the legality of the verification results, and identifies and classifies anomalies based on the comparison results. When a serious anomaly occurs, the system automatically generates an early warning event and uploads it to the chain, while simultaneously executing actions such as freezing batches, locking nodes, generating regulatory reports, or triggering reviews according to the rules. All regulatory and handling records are written to the on-chain ledger, achieving a traceable, transparent, and tamper-proof intelligent regulatory process.
[0066] The anti-counterfeiting and traceability QR code generation module operates during the product manufacturing stage. It is used to generate a unique anti-counterfeiting and traceability code that corresponds to each product batch, enabling product authenticity verification and full traceability.
[0067] The User Interaction and Regulatory Module provides tiered access interfaces for businesses, consumers, and regulatory agencies.
[0068] The system's storage layer comprises a blockchain ledger, a MySQL database, and an IPFS file system, enabling layered storage of different data types. The blockchain ledger stores on-chain data, including transaction records, hash digests, index information, and smart contract execution results. This data is immutable, ensuring reliable evidence storage and traceability. The MySQL database stores structured business data and system operation support information, including user information, device information, business index cache, and query acceleration data. This database supports efficient data retrieval and business logic processing. The IPFS file system stores large volumes of unstructured data, such as video surveillance files and inspection report images. A unique hash address is generated through a content addressing mechanism and bound to the on-chain index, enabling efficient access and correlation between on-chain and off-chain data.
[0069] The blockchain-based traceability system and method for livestock and poultry food processing and safety proposed in this application successfully constructs a main chain-multi-side chain collaborative architecture. It combines an on-chain and off-chain dual-layer storage mechanism, a probability and strategy hybrid group consensus algorithm based on node reputation scoring, and an automatic supervision strategy of main chain smart contracts. It systematically solves the core pain points of traditional traceability systems, such as data silos, easy tampering, high storage pressure, low supervision efficiency, and incomplete traceability chains.
[0070] In this embodiment, "multiple" refers to two or more. "And / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.
[0071] It should be noted that, in this document, 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 a process, method, article, or apparatus. Without further limitation, 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 said element.
[0072] The above description is merely a specific embodiment of this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. The protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A blockchain-based method for traceability of livestock and poultry food processing and safety, characterized in that, include: A blockchain architecture that coordinates the main chain and multiple side chains is constructed. After collecting data from all aspects of livestock and poultry food through the Internet of Things information collection module, the collected data is stored and associated using a two-layer collaborative mechanism of on-chain index storage and off-chain physical storage. After achieving data consensus by adopting a probability and strategy hybrid grouping mechanism based on node reputation scoring, data trust synchronization and cross-chain verification are performed between the main chain and side chains to generate index paths; Smart contracts are deployed on the main chain. Each side chain node completes data verification locally and then uploads it to the main chain. The smart contracts automatically verify and detect anomalies according to preset rules, and trigger warnings and handle abnormal events. During the product manufacturing stage, the hash digest and timestamp corresponding to each product batch are extracted from each relevant sidechain. The root hash is generated by the Merkle tree aggregation algorithm. The product batch number and enterprise code are combined to generate a unique anti-counterfeiting and traceability code that conforms to the GS1-128 standard. The main chain node then performs digital signature to generate a QR code. Consumers or regulatory agencies can scan the QR code to verify the authenticity of products and trace their entire lifecycle data.
2. The blockchain-based method for traceability of livestock and poultry food processing and safety according to claim 1, characterized in that, The aforementioned blockchain architecture, which coordinates the main chain and multiple side chains, collects data from various stages of livestock and poultry food production through an IoT information collection module. It then employs a two-layer collaborative mechanism of on-chain index storage and off-chain physical storage to store and associate the collected data, including: The Internet of Things (IoT) information collection module collects data from all stages of livestock and poultry food production, including breeding, slaughtering, processing, transportation, storage, and sales, forming a set of raw business data. The original business data set is divided into lightweight metadata and large payload based on data attributes; The large payload is transmitted to an off-chain distributed storage system or encrypted database, generating a unique storage address pointer; Perform a one-way hash operation on the large payload stored off-chain, and generate a digital digest by combining the data generation time and collision-proof random salt value; Construct an on-chain index data packet and broadcast the index data packet to the corresponding sidechain node for consensus storage.
3. The blockchain-based method for traceability of livestock and poultry food processing and safety according to claim 2, characterized in that, The formula for constructing the on-chain index data packet is: in, For index data packets, A unique identifier for the batch. For lightweight metadata, For digital digests, Digital signature for the data source, This is a hash address for the distributed file system. For a secure hash algorithm, For large-volume loads. For the time the data was generated, To prevent collisions, random salt values are used. For cascading, This represents the function for generating memory addresses.
4. The blockchain-based method for traceability of livestock and poultry food processing and safety according to claim 1, characterized in that, The process involves using a probability- and strategy-based hybrid grouping mechanism based on node reputation scoring to achieve data consensus, followed by trusted data synchronization and cross-chain verification between the main chain and side chains, generating an index path, including: The reputation score of each participating node in the sidechain network is calculated based on the node's historical behavior. All nodes are sorted in descending order according to the reputation score, and the preset number of nodes with the highest scores are selected as the master nodes of each consensus group. The remaining nodes are randomly grouped by probability using a hash modulo algorithm and assigned to the corresponding consensus groups. Within each consensus group, the lightweight Chain-Raft algorithm is used to achieve data consistency and preprocessing within the group, and the PBFT algorithm is used between groups to achieve global consensus. After a new block is generated on the sidechain, the block header hash is calculated, and a cross-chain anchored transaction is constructed by combining the timestamp and the sidechain ID. The calculation formula is as follows: ; in, For cross-chain anchored transactions, For sidechain digital signature functions, A unique identifier for the sidechain. This is the hash of the current sidechain block header. The hash value of the previous anchor transaction. For timestamps, For cascading, For the new block, For a secure hash algorithm, This is the block header data for the new block; After receiving the cross-chain anchored transaction, the main chain node executes the smart contract to perform signature legality checks, timestamp window verification, and hash chain continuity verification. After successful verification, the main chain writes the sidechain block header hash into the global index tree, generating an index path.
5. The blockchain-based method for traceability of livestock and poultry food processing and safety according to claim 4, characterized in that, The formula for calculating the reputation score of each participating node in the sidechain network based on its historical behavior is as follows: in, For reputation rating, For nodes The number of times a participant contributes to consensus and generates a valid block. This represents the total number of times the node has been selected to participate in consensus. The average response latency of the node. Count the penalties for nodes going offline or engaging in malicious behavior. The preset weighting coefficients, and .
6. The blockchain-based method for traceability of livestock and poultry food processing and safety according to claim 4, characterized in that, Within each consensus group, a lightweight Chain-Raft algorithm is used to achieve data consistency and preprocessing within the group, including: Let the number of nodes in the group be Once the group master node receives the list of transaction requests, it packages the request into a preparatory block and broadcasts it to the group. The nodes within the group verify the prepared block. Upon successful verification, a partial signature is generated. Once confirmation is received from more than half of the nodes, the group master node aggregates the partial signatures to generate a threshold signature, calculated using the following formula: in, For partial signatures, For the preparation block, To verify the function, For indicator functions, This represents the number of nodes within the group. For the summation operation, As a participating node within the group, For the current consensus group, For group threshold signatures, For aggregate functions, For collected A set of valid partial signatures.
7. The blockchain-based method for traceability of livestock and poultry food processing and safety according to claim 1, characterized in that, The process involves deploying smart contracts on the main chain. Each sidechain node verifies its data locally and then uploads it to the main chain. The smart contract automatically verifies and detects anomalies according to preset rules, and triggers alerts and responses for abnormal events, including: Regulatory agencies or enterprise administrators publish regulatory rules on the main chain through a multi-signature mechanism. These regulatory rules include temperature and humidity thresholds, quarantine standards, transportation time limits, data format requirements, and node signature matching conditions. After each sidechain node completes local data verification, it generates a verification digest data packet containing a verification result identifier, data hash value, timestamp and node signature, and uploads it to the main chain after digital signature; After receiving the verification digest data packet, the smart contract automatically verifies whether the data format is consistent with the rule definition, the identity of the uploading node and the validity of the signature, the continuity of the hash value format and timestamp, and whether the verification result identifier meets the regulatory conditions. If the detection passes, the verification pass identifier is recorded; otherwise, the abnormal judgment process is initiated. The anomaly type and severity are automatically determined based on the inspection results of the on-chain verification digest; When a serious anomaly is detected, an early warning event is generated, which includes the time of the anomaly, the node identifier, the cause of the anomaly, and related hash digest information. This event is reported to the main chain in the form of a transaction and triggers the regulatory node notification mechanism. Based on the anomaly type and rule settings, the smart contract automatically executes actions such as freezing abnormal batches, locking associated node accounts, generating regulatory reports, or triggering manual review. All actions are executed on-chain and recorded in the ledger.
8. The blockchain-based method for traceability of livestock and poultry food processing and safety according to claim 1, characterized in that, During the product manufacturing stage, hash digests and timestamps corresponding to each product batch are extracted from relevant sidechains. A root hash is generated using a Merkle tree aggregation algorithm. This root hash is then combined with the product batch number and enterprise code to generate a unique anti-counterfeiting and traceability code conforming to the GS1-128 standard. The main chain node then digitally signs this code to generate a QR code, including: Extract block hash digests and timestamp information associated with the target product batch from various side chains such as breeding, slaughtering, processing, transportation, and warehousing; The Merkle tree aggregation algorithm is used to calculate the extracted hash digest and generate the root hash value for the entire lifecycle as a digital fingerprint of the product data. A unique anti-counterfeiting and traceability code is generated based on the product batch number, enterprise code, production time, and product category, following the GS1-128 coding standard. The main chain nodes digitally sign the root hash value and the anti-counterfeiting traceability code to form an anti-counterfeiting traceability data package. The anti-counterfeiting and traceability data package is converted into a QR code. The binding relationship between the QR code and the product batch is recorded through the main chain. The QR code is then attached to the product packaging as an tamper-evident label.
9. The blockchain-based method for traceability of livestock and poultry food processing and safety according to claim 1, characterized in that, Consumers or regulatory agencies can verify product authenticity and trace the entire product lifecycle by scanning the QR code, including: After consumers or regulatory agencies initiate an inquiry by scanning the QR code on the product packaging, the system verifies the authenticity of the QR code and the digital signature of the main chain to confirm that the anti-counterfeiting data package is legitimate and has not been tampered with. Based on the product identification code and main chain index information embedded in the QR code, the corresponding global root hash value is parsed, and the associated side chain block digest records are located. The hash digest information corresponding to the product batch is retrieved from each sidechain, and a hash consistency comparison is performed through the main chain verification interface to confirm that the on-chain hash digest matches the off-chain original data hash. After hash verification is passed, the corresponding non-sensitive business data is retrieved from the off-chain database and displayed to users in a visual manner, showing the product source, quarantine and testing status, processing and transportation conditions, warehousing information and sales records. Regulatory agencies can access the complete on-chain logs and anomaly records. If the QR code is tampered with, the hash comparison is inconsistent, or the main chain signature is invalid, the system will automatically prompt that the data is abnormal or the anti-counterfeiting verification has failed, and generate an abnormal access log to write to the main chain.
10. A blockchain-based traceability system for livestock and poultry food processing and safety, characterized in that, include: The Internet of Things (IoT) information collection module is used to collect data from all stages of livestock and poultry food processing. The blockchain data management and traceability module uses a two-layer collaborative mechanism of on-chain index storage and off-chain physical storage to store and associate the collected data. After achieving data consensus, it uses a probability and strategy hybrid grouping mechanism based on node reputation scoring to perform trusted data synchronization and cross-chain verification between the main chain and side chains, and generates index paths. The smart contract module is used to deploy smart contracts on the main chain. Each side chain node completes data verification locally and then uploads it to the main chain. The smart contract performs automatic verification and anomaly detection according to preset rules, and triggers early warnings and handling for abnormal events. The anti-counterfeiting and traceability QR code generation module is used to extract the hash digest and timestamp corresponding to the product batch from the relevant side chains during the product manufacturing stage. The root hash is generated by the Merkle tree aggregation algorithm. Combined with the product batch number and enterprise code, a unique anti-counterfeiting and traceability code that conforms to the GS1-128 standard is generated. After being digitally signed by the main chain node, the QR code is generated. Consumers or regulatory agencies can scan the QR code to verify the authenticity of the product and query the full life cycle data traceability. The user interaction and oversight module provides tiered access interfaces for businesses, consumers, and regulatory agencies.
Citation Information
Patent Citations
Grain block chain information tracing method based on master-slave multiple chains
CN115994770A
Block chain-based electronic evidence full-life-cycle evidence storage and tracing method and system
CN121009587A
Livestock and poultry product full-chain traceability and slaughter supervision system based on block chain
CN121581898A
Food safety traceability system and method based on block chain technology
CN121724648A
Hierarchical Blockchain Architecture for Global Trade Management
US20200118068A1