Food production traceability management system based on block chain
Through electronic signature verification based on SHA-256 hashing algorithm and smart contracts, combined with encrypted signature of hardware security module, the credible evidence-based problem of identity authentication and skill inheritance relationship between intangible cultural heritage inheritors is solved, and the entire process traceability and rapid risk response in the food production process is achieved, and the credibility and prevention and control efficiency of data are improved.
Patent Information
- Application Number
- CN202510635810.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-08-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the identity authentication, skill inheritance relationship and qualification verification of intangible cultural heritage inheritors are stored separately, which makes it difficult to verify in real time. The teacher-heritance relationship and skill inheritance incident lack credible evidence on-chain evidence, and the authenticity of the participation of inheritors in the food production process is difficult to trace, and there is a risk of information tampering and identity impersonation.
Based on the SHA-256 hash algorithm, the inheritor's unique identification ID is generated, the Merkle tree root hash value dynamically correlates the food production data, and an untamperable digital identity file is built, and the electronic signature validity is automatically verified through smart contracts. The encrypted signature is combined with the ECDSA key of the hardware security module to ensure strong binding of the inheritor's identification to the production batch and equipment. It also uses the Apache Kafka message middleware to achieve cross-departmental collaborative response.
It has achieved a credible relationship between intangible cultural heritage technology and production process, improved risk prevention and control efficiency, prevented identity impersonation or qualification forgery, ensured that the entire life cycle of intangible cultural heritage technology inheritance is traceable, and significantly shortened the risk response time.
Smart Images

Figure CN120525552A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of food management systems, and more specifically, to a food production traceability management system based on blockchain. Background Art
[0002] At present, although food production traceability technology has made significant progress driven by blockchain and the Internet of Things, the identity authentication, skill inheritance relationship and qualification verification of intangible cultural heritage inheritors are still significantly separated from the food production traceability system.
[0003] In existing technologies, the management of intangible cultural heritage inheritors often relies on traditional paper archives or isolated information systems. Their identity information, lineage of apprenticeship, and skill certification data are stored in different institutions (such as cultural departments, industry associations, or training institutions), forming data silos. This decentralized management model makes it difficult to verify the qualifications of inheritors in real time. In addition, there is a lack of reliable on-chain evidence of apprenticeship relationships and skill inheritance events (such as teaching, assessment, and certification). This easily leads to problems such as information tampering and identity fraud, making it difficult to provide reliable credit endorsement for inheritors in the food production process.
[0004] In the field of food traceability, although existing blockchain systems can record data on raw material procurement, processing, circulation and other links, there are few solutions to deeply embed the digital identity of intangible cultural heritage inheritors and their skill inheritance chain into the production traceability process. For example, in traditional technologies, the inheritor's biometric information (such as fingerprints and faces) is only used for local identity authentication and is not dynamically bound to the blockchain public key system; key data such as skill certification certificates and proof of master-disciple relationship still exist in the form of offline files, which is difficult to achieve automatic association with production batches and processing equipment through smart contracts. This makes it difficult to trace the authenticity of the inheritor's participation in the food production process, and it is difficult to ensure the compliance of "intangible cultural heritage skills" in food manufacturing.
[0005] Therefore, it is particularly important to build a blockchain system that deeply integrates the digital identity of intangible cultural heritage inheritors and food production traceability, break the data silos, realize the whole process of inheritor identity authentication, skill inheritance relationship and qualification verification, and ensure its dynamic binding with production data. Therefore, we proposed a blockchain-based food production traceability management system to solve the above problems. Summary of the Invention
[0006] 1. Technical problems to be solved
[0007] In response to the problems existing in the prior art, the purpose of the present invention is to provide a food production traceability management system based on blockchain, which generates a unique identification ID for the inheritor based on the SHA-256 hash algorithm, dynamically associates the Merkle tree root hash value of food production data, constructs an unalterable digital identity file, breaks the data silos of traditional decentralized management, ensures the full-chain trusted association between intangible cultural heritage skills and production processes, and relies on smart contracts to automatically verify the validity of electronic signatures. By comparing the public key decryption result with the signature hash value, it can identify the risk of data tampering or identity failure in real time, and push JSON format alarms with the help of Apache Kafka message middleware to achieve cross-departmental collaborative response, significantly improve the efficiency of risk prevention and control, and use smart contracts to solidify the timestamp nodes of events such as the master-apprentice relationship and the teaching cycle, combined with the ECDSA key pair encryption signature of the hardware security module to ensure the strong binding of the inheritor's identification with the production batch and equipment, prevent identity fraud or qualification forgery, and achieve traceability of the entire life cycle of intangible cultural heritage skills inheritance.
[0008] 2. Technical solution
[0009] To solve the above problems, the present invention adopts the following technical solutions.
[0010] A blockchain-based food production traceability management system, including a blockchain platform, a data collection module, a traceability management module, and an intangible cultural heritage inheritor map module;
[0011] The blockchain platform is a distributed ledger system that uses a consortium chain architecture. It allows intangible cultural heritage protection organizations, food production companies, and certification agencies to serve as consensus nodes. It verifies data through the PBFT consensus algorithm and stores food production data, circulation data, and data on intangible cultural heritage inheritors. The data is stored in a chain structure that includes the hash value of the previous block, a timestamp, and transaction data. The Merkle tree root hash value of each block is generated by calculating the transaction data summary.
[0012] The data acquisition module includes:
[0013] The IoT collection unit collects production data in real time through RFID sensors, cameras, and environmental sensors, and cleans the data through an embedded gateway deployed at the production site. Specifically, it includes:
[0014] The Z-score algorithm is used to detect abnormal values in temperature and humidity data. If the data exceeds the preset threshold range, it is marked as invalid and eliminated in real time through the edge computing gateway. The timestamps are aligned based on the time series interpolation method to generate structured data containing timestamps and device IDs.
[0015] The inheritor data entry unit collects fingerprint eigenvalues and facial feature codes through biometric identification equipment, uses the local binary pattern algorithm to extract biometric feature vectors, and combines OCR technology to recognize identity cards and skill certification certificates to generate basic inheritor data;
[0016] The traceability management module is configured as follows:
[0017] Based on the blockchain platform, food production, processing, and circulation links are traced and the validity of the electronic signature authentication field in the food production data is verified. If the hash value of the electronic signature authentication field does not match the public key decryption result stored in the blockchain, or the field is missing, the preset rules in the smart contract are triggered, and a risk warning containing the product traceability code, verification failure type, and blockchain transaction ID is pushed to market supervision departments, consumers, and brands through the Apache Kafka messaging middleware. The warning information is transmitted asynchronously through the RESTful protocol API interface;
[0018] The intangible cultural heritage inheritor map module is configured as follows:
[0019] The inheritor's official identity information, biometric information, skill certification certificate, and apprenticeship certification documents are hashed with SHA-256 to generate a unique identification ID. This information is then linked and stored on the blockchain through a smart contract, forming an unalterable digital identity file that includes the certification chain and the apprenticeship chain.
[0020] When a master-apprentice relationship is established, the master, apprentice, and certification body jointly sign a confirmation document containing both parties' digital identities, skill categories, training cycles, and assessment standards through a smart contract. After verification by the PBFT consensus mechanism, it is written into the blockchain to form a tree-like inheritance graph node with a timestamp. The node contains the three-party private key signature and consensus node verification information;
[0021] The blockchain timestamp is used to fix the certification time and content of skill certification events, including official certifications, competition awards, and academic achievements, and the event hash value is linked to the inheritor's unique ID across chains;
[0022] Based on the digital identity file, an ECDSA key pair is generated based on the FIPS140-2 standard using a hardware security module, the private key is stored in the HSM, the public key is filed on the chain, and the private key is used to digitally sign the composite field containing the production batch number, equipment number and the inheritor's unique identification ID, and an electronic signature field containing signature data and blockchain height is generated, and the extended field of the corresponding production data block of the blockchain is embedded through a smart contract.
[0023] Furthermore, the method for generating the unique identification ID includes splicing the inheritor's ID number and the food production batch number, generating a cross-chain unique identification ID through the SHA-256 hash algorithm, and dynamically binding the ID to the Merkle tree root hash value of the production data block through a smart contract.
[0024] Furthermore, the electronic signature verification method includes the traceability management module obtaining the corresponding public key from the blockchain, verifying the consistency of the signature data and the production data based on the digital signature algorithm of the secp256k1 elliptic curve parameters, and querying whether the inheritor status in the digital identity map is valid through the smart contract. If the inheritor status is "invalid" or the signature data does not match the production batch number or equipment number, it is determined that the verification has failed.
[0025] Furthermore, the abnormal value filtering rules of the data acquisition module include setting a threshold range of -20°C to 50°C for temperature data collected by the sensor and a threshold range of 10% to 90% for humidity data, and marking data out of the range as invalid.
[0026] Furthermore, the PBFT consensus algorithm of the blockchain platform specifically includes consensus nodes performing multiple rounds of voting to verify the hash value, timestamp and electronic signature of transaction data. If more than 2 / 3 of the nodes reach a consensus, the transaction data is packaged into blocks and the global ledger is updated.
[0027] Furthermore, the smart contract signing method for the master-disciple relationship confirmation document includes generating an on-chain transaction containing the teaching cycle, assessment standards, and digital identity identifiers of the master, apprentice, and certification agency after the PBFT consensus node verification is passed. The Merkle tree root hash value of the transaction is calculated and generated using the SHA-512 hash algorithm and stored in association with the parent hash value of the inheritance graph node.
[0028] A food production traceability management method based on blockchain, comprising the following steps:
[0029] S1. Data collection and preprocessing: The IoT acquisition unit of the data acquisition module acquires information about the entire food production process. This includes collecting raw material sources, processing time, equipment number, and temperature and humidity data through RFID sensors and environmental sensors. Temperature and humidity outliers are filtered using the Z-score algorithm, and timestamps are aligned using time series interpolation.
[0030] The inheritor data entry unit collects the OCR identification information, fingerprint feature code, facial feature code and skill certification certificate image of the intangible cultural heritage inheritor's ID card, and generates structured production data and inheritor basic data including timestamp and device ID;
[0031] S2. Constructing an intangible cultural heritage inheritor map. Using the intangible cultural heritage inheritor map module, perform a SHA-256 hash operation on the collected inheritor data to generate a unique identification ID. When a master-disciple relationship is established, the master, apprentice, and certification body sign a confirmation document containing the teaching cycle, assessment standards, and the three-party digital identity through a smart contract. After verification by the PBFT consensus node, an on-chain transaction containing the Merkle tree root hash value calculated by the SHA-512 hash is generated. The Merkle tree root hash value of the transaction is associated with the parent hash value of the inheritance map node and stored, forming a tree node structure with a timestamp. The node contains the digital signature of the certification body and PBFT consensus verification information.
[0032] S3. Generate and write an electronic signature. The private key is called through the HSM based on the FIPS140-2 standard to encrypt and sign the composite field containing the production batch number, equipment number, and the inheritor's unique identification ID. At the same time, a mixed hash calculation is performed on the master-disciple relationship smart contract transaction ID and the hash value of the skill certification certificate to generate a dynamically updated Merkle tree root hash value. The 64-byte signature data, blockchain height, and the above-mentioned Merkle tree root hash value are used as the electronic signature field. These are associated with the Merkle tree root hash value of the food production block through the smart contract and written into the blockchain extension field.
[0033] S4. Data verification and risk warning. The traceability management module obtains the electronic signature and corresponding public key from the blockchain, verifies the consistency of the signature data and the production data based on the secp256k1 elliptic curve parameters, and queries the inheritor status in the digital identity map through the smart contract. If the inheritor status is 'invalid' or the signature data does not match the production batch number or equipment number, it is determined that the verification has failed. When the verification fails, a blockchain transaction containing a risk identifier is generated, the product status field is updated, and the message is encapsulated into a JSON format message through the Apache Kafka message middleware according to the RESTful protocol API interface to achieve partitioned storage and asynchronous push of risk warnings.
[0034] Furthermore, the step of generating the electronic signature in step S4 includes performing a mixed hash calculation on the hash value of the master-disciple relationship smart contract transaction ID and the skill certification certificate to generate a dynamically updated Merkle tree root hash value, and associating the root hash value with the inheritor's unique identification ID and storing it in the blockchain digital identity map index.
[0035] Furthermore, the asynchronous transmission method of the risk warning described in step S4 includes encapsulating the risk data into JSON format messages through the RESTful protocol API interface, and realizing partitioned storage and asynchronous push of messages based on the Apache Kafka architecture, ensuring that market supervision departments, consumers and brands can subscribe to and receive warning information in real time.
[0036] 3. Beneficial effects
[0037] Compared with the prior art, the advantages of the present invention are:
[0038] (1) This solution realizes the deep integration of the digital identity of intangible cultural heritage inheritors and the traceability of food production, and improves the credibility of data. That is, by building an intangible cultural heritage inheritor map module based on blockchain, the SHA-256 hash algorithm is used to generate a unique identification ID from the inheritor's biometric information, skill certification certificate and master-disciple relationship certificate, and dynamically bind it with the Merkle tree root hash value of the food production data to form an unalterable digital identity file. This design breaks the data island problem of traditional decentralized management, ensures the trustworthy connection of the inheritor's qualifications, skill inheritance chain and production batch information throughout the entire process, and provides authoritative credit endorsement for the application of intangible cultural heritage skills in food manufacturing;
[0039] (2) This solution builds an automated risk warning mechanism to improve the efficiency of risk prevention and control. That is, the traceability management module automatically verifies the validity of electronic signatures based on smart contracts, and detects data tampering or identity failure risks in real time by comparing the public key decryption results stored in the blockchain with the signature hash value. If the verification fails, the system pushes risk alerts to regulators, consumers and other parties through the Apache Kafka message middleware, supporting asynchronous transmission and partitioned subscription of JSON format messages. This mechanism significantly shortens risk response time, reduces manual verification costs, and realizes cross-departmental collaborative warnings;
[0040] (3) This solution solidifies the traceability of the intangible cultural heritage inheritance chain and promotes the transparency of skill inheritance. That is, through smart contracts, the master-apprentice relationship, the teaching cycle and the assessment standards are written into the blockchain in a tree node structure with a timestamp. Combined with the ECDSA key pair generated by the hardware security module, the inheritor identification in the production data is encrypted and signed to ensure a strong connection between the skill inheritance event and the production process. This technology realizes the full life cycle traceability of the intangible cultural heritage inheritance chain, prevents identity fraud or qualification fraud, and helps the compliance protection and dissemination of intangible cultural heritage. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 Schematic diagram of the system architecture and core modules of the present invention;
[0042] Figure 2 Schematic diagram of the principle of the unique identification ID generation method and electronic signature verification method of the present invention;
[0043] Figure 3 This is a schematic diagram of the data collection model outlier filtering rules and blockchain platform consensus mechanism principles of the present invention;
[0044] Figure 4This is a schematic diagram of the principle of the smart contract signing method for the master-disciple relationship confirmation document of the present invention;
[0045] Figure 5 Schematic diagram of the method steps of the present invention;
[0046] Figure 6 Schematic diagram of the technical details of step S1 and step S2 of the present invention;
[0047] Figure 7 Schematic diagram of the technical details of step S3 and step S4 of the present invention;
[0048] Figure 8 This is a schematic diagram of the technical details of the electronic signature generation details and risk warning transmission method of the present invention. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the specification of the present invention; it is obvious that the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0050] Example 1:
[0051] Please refer to the attached drawings in the manual Figures 1-4 The system architecture and module implementation of this blockchain-based food production traceability management system are as follows:
[0052] This embodiment takes a certain intangible cultural heritage food production enterprise (such as a traditional liquor brewing enterprise) as an example to specifically illustrate the implementation method of a blockchain-based food production traceability management system.
[0053] (1) Blockchain platform construction
[0054] 1. Alliance chain architecture:
[0055] Invite intangible cultural heritage protection institutions (such as provincial intangible cultural heritage protection centers), food production companies (breweries), and third-party certification agencies (quality supervision and inspection centers) as consensus nodes, deploy the Hyperledger Fabric consortium chain framework, and verify data between nodes through the PBFT consensus algorithm.
[0056] Each block structure contains:
[0057] The hash value of the previous block (generated by the SHA-256 algorithm, 64 bytes), the timestamp (Unix timestamp accurate to milliseconds), and the Merkle tree root hash value of the transaction data (calculated by aggregating the transaction data using SHA-256).
[0058] 2.PBFT consensus process:
[0059] Pre-preparation stage:
[0060] The master node broadcasts the transaction data (including hash value, timestamp, and electronic signature) to all consensus nodes.
[0061] Preparation stage:
[0062] The node verifies the transaction data and broadcasts a "prepare" message to other nodes if it is valid.
[0063] Submission stage:
[0064] When a node receives "prepare" messages from more than 2 / 3 of the nodes and they are consistent, it broadcasts a "commit" message to complete the consensus, package the data into blocks and update the global ledger.
[0065] (2) Implementation of data acquisition module
[0066] 1. Internet of Things collection unit:
[0067] RFID sensors (model: ImpinjR2000, for raw material batch tracking) and temperature and humidity sensors (model: SHT30, accuracy ±2%RH / ±0.3℃) are deployed in the brewing workshop to collect data in real time to an embedded gateway (Raspberry Pi 4B).
[0068] Outlier filtering:
[0069] The temperature threshold is set to -20℃~50℃, and the humidity threshold is set to 10%~90%. Data outside the range is marked as invalid and discarded.
[0070] The Z-score algorithm is used to detect abnormal fluctuations in sensor data (if three consecutive time points exceed the ±3σ range, it is considered abnormal).
[0071] Timestamp alignment:
[0072] The timestamps of different sensors are synchronized through time series interpolation (linear interpolation) to generate structured data (JSON format) containing device ID (such as "WINERY-SENSOR-001"), timestamp, and data value.
[0073] 2. Inheritor data entry unit:
[0074] Biometric collection:
[0075] A fingerprint collector (model: FBI-certified CrossMatch L-Series) was used to extract 1024-bit fingerprint feature codes, a camera (with liveness detection function) was used to capture facial images, and a local binary pattern (LBP) algorithm was used to extract 2048-dimensional facial feature vectors.
[0076] Document recognition:
[0077] Through OCR technology (Baidu AI Open Platform API), the inheritor’s ID card and skill certification certificate (such as the “Provincial Intangible Cultural Heritage Inheritor Certificate”) are identified to generate basic data including name, ID number, certificate number, and issuing agency.
[0078] Data format:
[0079] Generate structured data, the example is as follows:
[0080]
[0081]
[0082] (3) Intangible Cultural Heritage Inheritors Module
[0083] 1. Unique ID generation:
[0084] After concatenating the inheritor's ID number (such as "32010619850101XXXX") and the food production batch number (such as "20250514-WINE-001"), a 64-bit hexadecimal string is generated using the SHA-256 algorithm as a unique identification ID (for example: `SHA256("32010619850101XXXX20250514-WINE-001")`).
[0085] The ID is dynamically bound to the Merkle tree root hash value of the production data block (such as `0x4a5e1e4...`) through a smart contract and stored in the "Inheritor Identity Index" table of the blockchain.
[0086] 2. The master-disciple relationship is put on the chain:
[0087] When inheritor A (master, ID: 0x123) accepts apprentice B (apprentice, ID: 0x456), both parties and certification body C (ID: 0x789) sign a confirmation document through a smart contract, including:
[0088] Teaching period:
[0089] 2024.01.01-2026.12.31
[0090] Assessment criteria:
[0091] Master three core brewing techniques (distillation, cellar maintenance, and blending)
[0092] Three-party digital identity:
[0093] Master ID, apprentice ID, certification agency ID
[0094] After the PBFT consensus node passes verification, an on-chain transaction is generated. Its Merkle tree root hash value (generated by the SHA-512 algorithm, 128 bytes) is associated with the parent hash value of the inheritance graph node (i.e., the hash value of the master node), forming a tree structure. The example nodes are as follows:
[0095]
[0096]
[0097] (IV) Traceability Management Module
[0098] 1. Electronic Signature Verification:
[0099] Production data signature:
[0100] An ECDSA key pair (secp256k1 curve) is generated using a hardware security module (HSM, model: SafeNetLuna). The private key is stored in the HSM, and the public key is uploaded to the blockchain. A composite field (production batch number + device number + inheritor unique ID) is signed to generate a 64-byte signature.
[0101] Verification process:
[0102] 1. Obtain the public key and production data to be verified (including signature data, batch number, and device ID) from the blockchain.
[0103] 2. Use the secp256k1 algorithm to verify the consistency of the signature data with the production data (i.e. decrypt the signature using the public key and compare whether it matches the data hash value).
[0104] 3. Query the status of the inheritor through the smart contract (such as "valid" or "invalid", invalid status includes certificate expiration, termination of the master-apprentice relationship, etc.).
[0105] 4. If the signature does not match or the status is "invalid", the verification is considered failed and a risk warning is triggered.
[0106] 2. Risk warning push:
[0107] When verification fails, a blockchain transaction is generated to update the product status to "risk" and the message is encapsulated (JSON format) through the Apache Kafka messaging middleware. The example is as follows:
[0108] {
[0109] "traceability_code":"20250514-WINE-001",
[0110] "failure_type":"Electronic signature does not match",
[0111] "transaction_id":"0xdef7...",
[0112] "timestamp":"2025-05-14T11:00:00Z"
[0113] }.
[0114] It pushes information to regulatory authorities (such as the Market Supervision Administration), consumers (triggering prompts when scanning codes for inquiries), and brands (pop-up alerts in the enterprise management backend) through the RESTful API interface, supporting asynchronous reception and partitioned storage (partitioned by recipient type, such as "Regulatory-Partition 1" and "Consumer-Partition 2").
[0115] Example 2:
[0116] Please refer to the attached drawings in the manual Figure 5-Figure 8 The system architecture and module implementation of this blockchain-based food production traceability management system are as follows:
[0117] 2. Implementation Process of Food Production Traceability Management Method Taking the production process of a batch of liquor (batch number: 20250514-WINE-001) as an example, the specific steps are as follows:
[0118] (1) Data collection and preprocessing (S1)
[0119] 1. Production data collection:
[0120] The RFID sensor reads the batch number (GRAIN-20250401) and storage time (2025-04-05 08:00) of the raw material sorghum, and the environmental sensor collects the temperature and humidity of the brewing workshop (temperature 28°C, humidity 65%, both within the threshold range).
[0121] The device number is FERMENTER-003. The data is verified to be normal using the Z-score algorithm, and the timestamp is aligned to 2025-05-14T09:30:00Z.
[0122] 2. Data collection of inheritors:
[0123] The inheritor, Master Li (ID number: 32010619800202XXXX), entered his fingerprint and facial features, and OCR recognized his "Provincial Intangible Cultural Heritage Inheritor Certificate" (number: 2022015), generating basic data including the device ID "INPUT-PC-002" and the timestamp 2025-05-14T09:45:00Z.
[0124] (2) Construction of the Intangible Cultural Heritage Inheritors Map (S2)
[0125] 1. Generate a unique identification ID:
[0126] Concatenate the ID number and batch number "32010619800202XXXX20250514-WINE-001" and generate the ID: `0x7a8b9c...` through SHA-256.
[0127] 2. The master-disciple relationship is put on the chain:
[0128] Master Li's master is Master Zhang (ID: 0x098), and the certification body is the Provincial Intangible Cultural Heritage Protection Center (ID: 0x678). The smart contract signed the apprenticeship period from 2005 to 2010, and the assessment standard is "mastering the traditional five-steamer brewing method." After PBFT consensus, an inheritance map node is generated, and the parent hash value is the hash value of Master Zhang's node, `0x1011...`.
[0129] (3) Electronic signature generation and writing (S3)
[0130] 1. Encrypted signature:
[0131] The HSM uses Mr. Li's private key to sign the composite field "20250514-WINE-001|FERMENTER-003|0x7a8b9c...", generating a 64-byte signature data `0x5f6061...`.
[0132] Hybrid hash calculation:
[0133] The apprenticeship relationship smart contract transaction ID (`0x2345...`) and the skill certificate hash value (`0x6789...`) are combined using SHA-256 to generate a dynamic Merkle tree root hash `0xabcd...`.
[0134] 2. Data on-chain:
[0135] The signature data, blockchain height (current block height 15000), and root hash value are used as electronic signature fields, embedded in the extension field of the production data block, and stored in association with the Merkle tree root hash value.
[0136] (IV) Data Verification and Risk Warning (S4)
[0137] 1. Electronic Signature Verification:
[0138] When consumers scan the code to query, the traceability management module obtains the public key from the blockchain, verifies the consistency of the signature data with the production data (batch number, equipment ID, inheritor ID), and at the same time checks that Master Li's status is "valid". The verification passes and the entire production process information is displayed.
[0139] 2. Examples of abnormal scenarios:
[0140] If Mr. Li's certificate expires (status changes to "invalid"), the system will determine that it has failed the re-verification, generate a risk transaction, and push an alert to the regulatory authorities through Kafka, indicating that "the successor's qualifications have expired and batch number 20250514-WINE-001 is at risk."
[0141] 3. Implementation Effect
[0142] 1. Data Trust Association:
[0143] The identity ID of the inheritor, Master Li (`0x7a8b9c...`), is bound to the Merkle tree root hash (`0xabcd...`) of the brewing batch data to ensure the authenticity of his participation in production and prevent identity fraud.
[0144] 2. Rapid risk response:
[0145] The delay from verification failure to regulatory authorities receiving the alert is ≤5 seconds, which is an efficiency improvement of more than 99% compared to traditional manual verification (an average of 2 hours).
[0146] 3. The inheritance chain is traceable:
[0147] Through the tree-like map nodes, one can clearly query Master Li's lineage (Master Zhang → Master Li → Apprentice Wang). Information such as the teaching cycle and assessment standards are stored on the chain to prevent tampering with skill inheritance data. The above embodiment fully covers the technical features of claims 1-9. Through specific equipment models, data formats, algorithm parameters, and business scenarios, the feasibility and technical advantages of the system are verified, providing a detailed implementation reference for the practical application of the patent.
[0148] The above description is merely a preferred embodiment of the present invention; however, the scope of protection of the present invention is not limited thereto. Any person skilled in the art who, within the technical scope disclosed by the present invention, makes equivalent substitutions or modifications based on the technical solutions and improved concepts of the present invention shall be covered by the scope of protection of the present invention.
Claims
1. A blockchain-based food production traceability management system, comprising a blockchain platform, a data acquisition module, a traceability management module, and an intangible cultural heritage inheritor map module, characterized by: The blockchain platform is a consortium chain architecture that stores food production data, circulation data, and intangible cultural heritage inheritor data. The data is stored in a chain structure that includes the hash value of the previous block and a timestamp. Each block contains the Merkle tree root hash value of the transaction data. The data collection module is used to collect food production data and inheritor biometrics and certificate information, and generate production data and inheritor basic data including timestamp and device ID; The traceability management module is used to verify the validity of electronic signatures in food production data based on blockchain. If the verification fails, it triggers preset rules and pushes risk warnings to regulatory authorities, consumers, and brands. The intangible cultural heritage inheritor map module is used to generate a unique identification ID through hash operation for the inheritor's identity information, skill certification information and master-disciple relationship, and store it in the blockchain through smart contract association to form an unalterable digital identity file.
2. The blockchain-based food production traceability management system according to claim 1, characterized in that: The method for generating the unique identification ID includes concatenating the inheritor's ID number and the food production batch number, generating a cross-chain unique identification ID through the SHA-256 hash algorithm, and dynamically binding the ID to the Merkle tree root hash value of the production data block through a smart contract.
3. The blockchain-based food production traceability management system according to claim 1, characterized in that: The electronic signature verification method includes the traceability management module obtaining the corresponding public key from the blockchain, verifying the consistency of the signature data and the production data based on the digital signature algorithm of the secp256k1 elliptic curve parameters, and querying whether the inheritor status in the digital identity map is valid through the smart contract. If the inheritor status is "invalid" or the signature data does not match the production batch number or equipment number, it is determined that the verification has failed.
4. The blockchain-based food production traceability management system according to claim 1, characterized in that: The abnormal value filtering rules of the data acquisition module include setting a threshold range of -20°C to 50°C for temperature data collected by the sensor and a threshold range of 10% to 90% for humidity data, and marking data out of the range as invalid.
5. The blockchain-based food production traceability management system according to claim 1, characterized in that: The PBFT consensus algorithm of the blockchain platform specifically includes multiple rounds of voting by consensus nodes to verify the hash value, timestamp and electronic signature of transaction data. If more than 2 / 3 of the nodes reach a consensus, the transaction data is packaged into blocks and the global ledger is updated.
6. A blockchain-based food production traceability management system according to claim 1 or 5, characterized in that: The smart contract signing method for the master-disciple relationship confirmation document includes generating an on-chain transaction containing the teaching cycle, assessment standards, and the digital identity identifiers of the master, apprentice, and certification agency after the PBFT consensus node verification is passed. The Merkle tree root hash value of the transaction is calculated and generated using the SHA-512 hash algorithm and stored in association with the parent hash value of the inheritance graph node.
7. A food production traceability management method based on blockchain, comprising a food production traceability management system based on blockchain applied to any one of claims 1-6, characterized in that: The following steps are involved: S1. Data collection and preprocessing: The IoT acquisition unit of the data acquisition module acquires information about the entire food production process. This includes collecting raw material sources, processing time, equipment number, and temperature and humidity data through RFID sensors and environmental sensors. Temperature and humidity outliers are filtered using the Z-score algorithm, and timestamps are aligned using time series interpolation. The inheritor data entry unit collects the OCR identification information, fingerprint feature code, facial feature code and skill certification certificate image of the intangible cultural heritage inheritor's ID card, and generates structured production data and inheritor basic data including timestamp and device ID; S2. Constructing an intangible cultural heritage inheritor map. Using the intangible cultural heritage inheritor map module, perform a SHA-256 hash operation on the collected inheritor data to generate a unique identification ID. When a master-disciple relationship is established, the master, apprentice, and certification body sign a confirmation document containing the teaching cycle, assessment standards, and the three-party digital identity through a smart contract. After verification by the PBFT consensus node, an on-chain transaction containing the Merkle tree root hash value calculated by the SHA-512 hash is generated. The Merkle tree root hash value of the transaction is associated with the parent hash value of the inheritance map node and stored, forming a tree node structure with a timestamp. The node contains the digital signature of the certification body and PBFT consensus verification information. S3. Generate and write an electronic signature. The private key is called through the HSM based on the FIPS140-2 standard to encrypt and sign the composite field containing the production batch number, equipment number, and the inheritor's unique identification ID. At the same time, a mixed hash calculation is performed on the master-disciple relationship smart contract transaction ID and the hash value of the skill certification certificate to generate a dynamically updated Merkle tree root hash value. The 64-byte signature data, blockchain height, and the above-mentioned Merkle tree root hash value are used as the electronic signature field. These are associated with the Merkle tree root hash value of the food production block through the smart contract and written into the blockchain extension field. S4. Data verification and risk warning. The traceability management module obtains the electronic signature and corresponding public key from the blockchain, verifies the consistency of the signature data and the production data based on the secp256k1 elliptic curve parameters, and queries the inheritor status in the digital identity map through the smart contract. If the inheritor status is 'invalid' or the signature data does not match the production batch number or equipment number, it is determined that the verification has failed. When the verification fails, a blockchain transaction containing a risk identifier is generated, the product status field is updated, and the message is encapsulated into a JSON format message through the Apache Kafka message middleware according to the RESTful protocol API interface to achieve partitioned storage and asynchronous push of risk warnings.
8. The food production traceability management method based on blockchain according to claim 7 is characterized by: The step of generating the electronic signature described in step S4 includes performing a mixed hash calculation on the master-disciple relationship smart contract transaction ID and the hash value of the skill certification certificate to generate a dynamically updated Merkle tree root hash value, and associating the root hash value with the inheritor's unique identification ID and storing it in the blockchain digital identity map index.
9. The food production traceability management method based on blockchain according to claim 7 is characterized by: The asynchronous transmission method of the risk warning described in step S4 includes encapsulating the risk data into JSON format messages through the RESTful protocol API interface, and realizing partitioned storage and asynchronous push of messages based on the Apache Kafka architecture, ensuring that market supervision departments, consumers and brands can subscribe to and receive warning information in real time.
Citation Information
Cited By
Anti-quantum signature method and device, electronic equipment and storage medium
CN120856309A
LIMS report management method and device based on block chain and medium
CN121029765A
Food traceability method based on block chain
CN121146796A
A blockchain-based food traceability method
CN121146796B
Electronic component manufacturing production data traceability system based on block chain
CN121304198A
