Food information tracing method and system based on Internet data
By obtaining external data in real time, we can judge batch adjustment events, dynamically generate sub-batch identification and establish tree-shaped association relationships, and upload them to the blockchain network, solving the problem of traceability information splitting caused by batch splitting in the food industry, and achieving complete restoration of production decision paths and improving information integrity.
Patent Information
- Application Number
- CN202510687936.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-05-27
AI Technical Summary
The existing technology cannot restore the complete production decision chain due to batch splitting in the food industry.
Through the food information traceability method based on Internet data, external data of the associated area can be obtained in real time, batch adjustment events will occur, sub-batch identification will be generated dynamically, and tree-shaped association relationships will be established, and uploaded to the blockchain network for storage and retrieval.
The problem of batch fragmentation is solved, the causal chain of batch adjustment is retained, and the complete production decision path recovery is realized during traceability, which improves the integrity of traceability information and blockchain storage and retrieval efficiency.
Smart Images

Figure CN120218958A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of industrial Internet, and specifically relates to a food information traceability method and system based on Internet data. Background Art
[0002] The product quality traceability system assigns a unique traceability code to each product, allowing users (such as consumers) to track and query relevant information of the product. However, the production in the food industry is vulnerable to external environments (such as temperature and humidity, logistics delays, power outages), resulting in temporary adjustments to the production plan.
[0003] In the prior art, such as a patent for invention with the application number 202111498224.6, a product quality traceability method, device and equipment in the food and beverage industry are disclosed. Among them, this solution forms a traceability chain by allocating the corresponding identifier for this batch before production and associating detection data.
[0004] However, if the production plan is split into batches due to external environment adjustments, the static allocation of batch identifiers before production in this solution will result in the loss of the association between the split batches and the original batches, leading to the inability to restore the complete production decision chain during traceability and fragmented traceability information. Summary of the Invention
[0005] In view of the above-mentioned defects or deficiencies in the prior art, this application aims to provide a food information traceability method and system based on Internet data to overcome the problem of fragmented traceability information caused by batch splitting.
[0006] In a first aspect, this application proposes a food information traceability method based on Internet data, including the following steps: According to the product production plan, generate an initial batch identifier for the product to be produced, and based on the Internet public data platform, obtain real-time external data of the associated area; the real-time external data is dynamic environment data that has spatio-temporal relevance to the product to be produced; According to the real-time external data, determine whether a batch adjustment event will occur during the production process of the product to be produced; the batch adjustment event is a production plan change event caused by the abnormality of the real-time external data; If so, based on the real-time state data of the production line and the real-time external data, perform dynamic batch decision-making, generate at least two sub-batch identifiers, and establish a tree-shaped association relationship with the initial batch identifier; Receive the detailed sub-batch data corresponding to each sub-batch identifier and upload it to the blockchain network. The detailed sub-batch data includes production process data and quality inspection results. Among them, the batch topological relationship is stored in the main chain of the blockchain, and the detailed sub-batch data is stored in the corresponding sub-chain nodes; In response to a traceability request from a user terminal, according to the tree - shaped association relationship, retrieve the full - life - cycle data of the target batch corresponding to the traceability request in the blockchain network.
[0007] According to the technical solution provided by the present application, for obtaining real - time external data of an associated area based on the Internet public data platform, the following steps are included: Determine the geographical scope and time window of the associated area according to the raw material origin, relevant suppliers, and logistics path of the product to be produced; Obtain in real - time the meteorological data, the supply inventory of product accessories of each of the relevant suppliers, and the logistics information of each of the product accessories within the geographical scope and time window; the real - time external data includes meteorological data, supply inventory, and logistics information.
[0008] According to the technical solution provided by the present application, for determining whether a batch adjustment event will occur during the production process of the product to be produced based on the real - time external data, the following steps are included: When the real - time external data meets at least one of the following, it is determined that a batch adjustment event will occur during the production process of the product to be produced: The environmental indicators in the meteorological data exceed the corresponding preset safety thresholds, and the environmental indicators include temperature, humidity, precipitation, or disaster warning level; The supply inventory of at least one of the relevant suppliers is lower than the minimum demand of the corresponding product accessories in the product production plan; The logistics information shows that the expected arrival time of at least one of the product accessories is later than the latest allowable arrival time in the product production plan.
[0009] According to the technical solution provided by the present application, for making a dynamic batch decision based on the real - time status data of the production line and the real - time external data, generating at least two sub - batch identifiers, and establishing a tree - shaped association relationship with the initial batch identifier, the following steps are included: Extract the equipment availability rate, current process progress, and remaining production capacity parameters from the real - time status data of the production line; According to the type of abnormal event in the real - time external data, calculate the weight coefficient of the affected raw materials or processes, and generate multiple alternative sub - batch division plans in combination with the remaining production capacity parameters; Score each of the alternative sub - batch division plans based on a preset optimization objective function, and the optimization objective function includes delivery cycle deviation, production cost increment, and quality risk coefficient; Generate a sub-batch identifier by selecting the alternative sub-batch division scheme with the lowest score, assign a unique hash value to each sub-batch identifier, and concatenate the sub-hash value of the sub-batch identifier with the parent hash value of the initial batch identifier to form a tree-like association relationship.
[0010] According to the technical solution provided by the present application, retrieving the full life cycle data of the target batch corresponding to the traceability request in the blockchain network according to the tree-like association relationship includes the following steps: Parse the batch identifier in the traceability request and match the corresponding tree node path in the main chain index block; Locate the associated sub-chain nodes according to the sub-chain data digest in the tree node path, and parallelly request the sub-chain data blocks in multiple sub-chain nodes; Verify the consistency between each sub-chain data block and the main chain data digest, merge the data blocks that pass the verification and sort them according to the production time axis to generate the full life cycle data.
[0011] According to the technical solution provided by the present application, the real-time external data further includes food safety incident data obtained from an Internet public opinion monitoring platform.
[0012] According to the technical solution provided by the present application, before scoring each alternative sub-batch division scheme based on a preset optimization objective function, the following steps are further included: Extract negative event keywords related to the names of involved raw materials, names of involved enterprises, and involved geographical regions from the food safety incident data; Judge whether the negative event involves the product to be produced according to the negative event keywords; Scoring each alternative sub-batch division scheme based on a preset optimization objective function includes the following steps: If not, score each alternative sub-batch division scheme based on a preset optimization objective function; if so, score each alternative sub-batch division scheme based on a corrected optimization objective function, where the weight of the quality risk coefficient in the corrected optimization objective function is greater than the weight of the quality risk coefficient in the preset optimization objective function.
[0013] According to the technical solution provided by the present application, judging whether the negative event involves the product to be produced according to the negative event keywords includes the following steps: Cross-compare the negative event keywords with the associated area data of the product to be produced; If the name of the involved raw material matches the raw material list of the product to be produced, or the name of the involved enterprise is the same as the registered name of the relevant supplier, or the involved geographical region falls within the geographical scope of the associated area, it is determined that the negative event involves the product to be produced.
[0014] According to the technical solution provided by the present application, after determining whether the negative event involves the product to be produced according to the negative event keyword, the following steps are further included: If so, generate a risk identification code including the negative event keyword, the involved associated evidence, and the quality risk level, and bind the risk identification code to the corresponding sub-batch identification; Write the hash value of the risk identification code into the metadata of the main chain index block of the blockchain, and add a risk warning label to the data block of the associated sub-chain node; Retrieving the full life cycle data of the target batch corresponding to the traceability request in the blockchain network includes the following steps: If the negative event involves the product to be produced, extract all risk identification codes associated with the target batch from the metadata of the main chain index block, analyze the corresponding negative event types and influence ranges, and incorporate them into the full life cycle data.
[0015] In a second aspect, the present application proposes a food information traceability system based on Internet data for implementing the food information traceability method based on Internet data as described above, including: An acquisition module configured to generate an initial batch identification of the product to be produced according to the product production plan, and obtain real-time external data of the associated area based on the Internet public data platform; the real-time external data is dynamic environment data having spatio-temporal correlation with the product to be produced; A judgment module configured to judge whether a batch adjustment event will occur during the production process of the product to be produced according to the real-time external data; the batch adjustment event is a production plan change event caused by an abnormality in the real-time external data; A decision-making module configured to, if so, perform dynamic batch decision-making based on the real-time state data of the production line and the real-time external data, generate at least two sub-batch identifications, and establish a tree-shaped association relationship with the initial batch identification; A receiving module configured to receive the detailed sub-batch data corresponding to each sub-batch identification and upload it to the blockchain network, where the detailed sub-batch data includes production process data and quality inspection results, and the batch topological relationship is stored in the main chain of the blockchain, and the detailed sub-batch data is stored in the corresponding sub-chain node; A reporting module configured to, in response to a traceability request from a user terminal, retrieve the full life cycle data of the target batch corresponding to the traceability request in the blockchain network according to the tree-shaped association relationship.
[0016] Compared with the prior art, the beneficial effects of the present application are as follows: By obtaining external data (such as meteorology, logistics) in real time, this method triggers batch adjustment decisions, generates sub-batch identifiers, establishes a tree-like association relationship with the initial batch, records the adjustment logic, stores the lightweight batch topology relationship in the main chain, and stores the detailed production data in the sub-chain. Fast cross-batch retrieval is achieved through the main chain index. The external abnormal events are bound to the sub-batch identifiers to form a full-dimensional traceability context. Firstly, through this method, the problem of batch fragmentation can be solved: the tree-like association retains the causal chain of batch adjustment, and the complete production decision path can be restored during tracing. For example, when a user queries sub-batch M1, the parent batch M and the abnormal trigger event can be obtained synchronously. Secondly, the integrity of traceability information can be improved: by integrating external environment data, quality anomalies are associated with specific events (such as temperature fluctuations) to support accurate root cause analysis. For example, the excessive sterilization temperature of a certain dairy product can be traced back to the equipment failure caused by the abnormal power grid. Thirdly, the storage and retrieval efficiency of the blockchain can be optimized: the main chain-sub chain architecture reduces redundant storage, and the main chain topology index enables one-key cross-batch traceability. For example, by inputting the initial batch identifier M, all associated sub-batches (M1, M2) and their data can be obtained instantaneously. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of the steps of the food information traceability method based on Internet data provided by the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] The present application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. In addition, it should be noted that for the sake of description, only the parts related to the invention are shown in the drawings.
[0019] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the drawings and embodiments.
[0020] Embodiment 1 As mentioned in the background art, in view of the problems in the prior art, the present application proposes a food information traceability method based on Internet data, as Figure 1 shown, including the following steps: S1. According to the product production plan, generate the initial batch identifier of the product to be produced, and based on the Internet public data platform, obtain the real-time external data of the associated area; the real-time external data is dynamic environmental data that has spatio-temporal relevance to the product to be produced; Specifically, the initial batch identification is the first batch number assigned to the product to be produced according to the product production plan, which is used to uniquely determine the identity of the batch of products at the initial stage of production. The real-time external data is the dynamic environmental data related to the product to be produced in terms of time and space, covering aspects such as meteorology, supply inventory, logistics, etc., and reflecting the external associated conditions during product production.
[0021] Furthermore, based on the Internet public data platform, obtaining the real-time external data of the associated area includes the following steps: Determine the geographical scope and time window of the associated area according to the raw material origin, relevant suppliers and logistics path of the product to be produced; Specifically, the associated area is the geographical scope covered by the raw material origin, the location of the supplier and the logistics path, such as: Ranch in Area A + Factory in Area A + Along Highway B. The time window is the time period related to the production plan, such as: 48 hours before raw milk collection to production completion.
[0022] Obtain the meteorological data, the supply inventory of the product accessories of each relevant supplier, and the logistics information of each product accessory within the geographical scope and time window in real time; the real-time external data includes meteorological data, supply inventory, and logistics information.
[0023] Specifically, extract the raw material origin coordinates and the supply inventory of the product accessories from the supplier database, screen the meteorological data according to the geographical scope through the meteorological API, the meteorological data is screened according to the geographical scope through the meteorological bureau API (in JSON format, updated every 10 minutes), and the logistics data is obtained through the RESTful interface of the TMS system, and the real-time location is returned as the logistics information, such as: truck GPS coordinates. The logistics data fields include truck ID, GPS coordinates, and estimated arrival time, and are synchronized in real time through the logistics company TMS system interface.
[0024] S2. According to the real-time external data, judge whether a batch adjustment event will occur during the production process of the product to be produced; the batch adjustment event is a production plan change event caused by the abnormality of the real-time external data; Furthermore, the judging whether a batch adjustment event will occur during the production process of the product to be produced according to the real-time external data includes the following steps: When the real-time external data meets at least one of the following conditions, it is determined that a batch adjustment event will occur during the production process of the product to be produced: The environmental indicators in the meteorological data exceed the corresponding preset safety thresholds, and the environmental indicators include temperature, humidity, precipitation or disaster warning level; The supply inventory of at least one of the relevant suppliers is lower than the minimum demand of the corresponding product accessories in the product production plan; The logistics information shows that the expected arrival time of at least one of the product accessories is later than the latest allowable arrival time in the product production plan.
[0025] Exemplarily: The product to be produced by XX Dairy Co., Ltd. is whole milk sterilized milk, with a planned production of 6,000 cases and an initial batch identification of MILK20230901 (batch number format: "product type + year, month, day"); raw material origin: Ranch A (raw milk supply), relevant supplier: XX Packaging Company in Area C (providing 6,000 sets of milk cartons as planned), logistics route: Section D to E of Highway B (packaging material transportation route), production time window: 48 hours before raw milk collection (0:00 on September 1, 2023) to production completion (24:00 on September 3). Call the API of the China Meteorological Administration to screen the weather in Area A and the section from D to E of Highway B in the next 48 hours. For example, the result: It is forecasted that continuous heavy rain will occur in Area A or the section from D to E of Highway B starting at 8:00 on September 1 (precipitation of 50 mm / hour, exceeding the preset safety threshold of 30 mm). Retrieve the supplier inventory through the ERP system interface of the packaging company in Area C. For example, the result: The real-time inventory is only 5,000 sets (lower than the demand of 6,000 sets). Receive logistics information through the TMS system interface of the logistics company to obtain the GPS location of the truck. For example, the result: The truck transporting packaging materials is delayed due to heavy rain. At this time, three anomalies are triggered simultaneously (as long as at least one result is abnormal, it is triggered), and the system determines that batch adjustment is required.
[0026] S3. If so, based on the real-time status data of the production line and the real-time external data, make a dynamic batch decision, generate at least two sub-batch identifications, and establish a tree-like association relationship with the initial batch identification; Specifically, the tree-like association relationship is a hierarchical relationship constructed with the initial batch identification as the root node and the sub-batch identifications as the branch nodes, used to clearly record the derivation and subordination relationships between batches.
[0027] Furthermore, the making of a dynamic batch decision based on the real-time status data of the production line and the real-time external data, generating at least two sub-batch identifications, and establishing a tree-like association relationship with the initial batch identification includes the following steps: Extract the equipment availability rate, current process progress, and remaining production capacity parameters in the real-time status data of the production line; According to the types of abnormal events in the real-time external data, calculate the weight coefficients of the affected raw materials or processes, and generate multiple alternative sub-batch division plans in combination with the remaining production capacity parameters; Score each of the alternative sub-batch division schemes based on a preset optimization objective function, where the optimization objective function includes delivery cycle deviation, production cost increment, and quality risk coefficient; among them, the quality risk coefficient can be obtained based on the following factors: historical raw material qualification rate (weight 30%), production line equipment failure rate (weight 20%), and external event severity level (weight 50%).
[0028] Select the alternative sub-batch division scheme with the lowest score to generate a sub-batch identifier, assign a unique hash value to each sub-batch identifier, and cascade the sub-hash value of the sub-batch identifier with the parent hash value of the initial batch identifier to form a tree-like association relationship.
[0029] Exemplarily, extract the real-time data of the production line: Equipment availability: Production line A is down due to the raw materials not arriving, but production line B can still operate (remaining production capacity of 800 L / hour). Current process progress: The allocated strain raw materials need to be put into production within 4 hours. Remaining production capacity parameters: Idle time of production line B = 2 hours; Abnormal event type and weight calculation: External data anomaly: Heavy rain caused a 12-hour delay in the transportation of raw milk (anomaly type = logistics interruption). Weight of affected raw materials: Raw milk is a core raw material, and the weight coefficient is calculated as 0.9 (full score 1.0). Generate alternative solutions: Solution 1: Split into two sub-batches, namely sub-batch 1 (ID: MILK20230901-A): Produce 4000 cases with the existing inventory of raw milk (to meet urgent orders). Sub-batch 2 (ID: MILK20230901-B): Delay production until the arrival of raw milk and produce 2000 cases. Solution 2: Enable an alternative supplier to produce 6000 cases of raw milk (higher quality risk coefficient). After calculating the scores, select Solution 1 and generate two sub-batch identifiers accordingly. Initial batch hash value, i.e., the parent hash value H0 = SHA256(MILK20230901||production plan data)= a1b2c3..., where || represents string concatenation. The hash value of each sub-batch needs to be concatenated with the parent hash value to ensure relevance (it should be noted that the generation of the sub-batch hash value needs to include the parent hash value, sub-batch identifier, and key production parameters (such as raw material batch, production line number, process timestamp) to ensure uniqueness and anti-tampering). Hash value of sub-batch 1 H1: H1 = SHA256(a1b2c3... || "MILK20230901-A||4000 cases of inventory raw milk") = d4e5f6...; Hash value of sub-batch 2 H2: H2 = SHA256(a1b2c3... || "MILK20230901-B||2000 cases of delayed production") = g7h8i9.... Blockchain main chain record: The initial batch node contains the sub-batch hash chain [d4e5f6..., g7h8i9...]. The sub-batch 1 node contains the parent hash value a1b2c3...; The sub-batch 2 node contains the parent hash value a1b2c3.... Combine common tree structures in the blockchain, such as the Merkle tree, to build the association between batches. For example, the tree-shaped association relationship is implemented through the Merkle tree. The parent batch hash value is the root node, and the sub-batch hash values are the leaf nodes. Each leaf node contains a pointer to the sub-chain data, forming a tree structure. In this way, any modification to a sub-batch will cause its hash value to change, which in turn affects the hash value of the parent node, ensuring data integrity.
[0030] S4. Receive the sub-batch detailed data corresponding to each of the sub-batch identifiers and upload it to the blockchain network. The sub-batch detailed data includes production process data and quality inspection results. Among them, the batch topological relationship is stored in the main chain of the blockchain, and the sub-batch detailed data is stored in the corresponding sub-chain nodes; Specifically, the main chain stores lightweight index information, including batch identifiers, hash values, and association relationships. Each sub-chain node stores the detailed production data and quality inspection results of the corresponding sub-batch and is hash-bound to the main chain. The data summary of the sub-chain nodes (such as the sub-chain address or the hash value of the key field) is stored in the main chain for quick positioning and verification. The main chain adopts the PoA (Proof of Authority) consensus mechanism and is jointly maintained by the production enterprise and the regulatory agency; the sub-chain adopts the private chain mode and is independently operated by each production node. The main chain listens for the upload of the sub-chain data summary through a smart contract and regularly checks the integrity of the sub-chain data.
[0031] S5. In response to the traceability request from the user terminal, retrieve the full life cycle data of the target batch corresponding to the traceability request in the blockchain network according to the tree-shaped association relationship.
[0032] Further, the retrieving the full life cycle data of the target batch corresponding to the traceability request in the blockchain network according to the tree-shaped association relationship includes the following steps: Parse the batch identifier in the traceability request and match the corresponding tree-shaped node path in the main chain index block; Specifically, the batch identifier is the number or identification information used in the user's traceability request to specify the target batch product, and the main chain index block is a specific block in the blockchain main chain used to store index information, including key index data such as the tree-shaped association relationship.
[0033] Locate the associated sub-chain nodes according to the sub-chain data summary in the tree-shaped node path and concurrently request the sub-chain data blocks in multiple of the sub-chain nodes; Verify the consistency between each of the sub-chain data blocks and the main chain data summary, merge the data blocks that pass the verification, and sort them according to the production time axis to generate the full life cycle data.
[0034] Exemplarily, the sub-chain node addresses include the production data sub-chain (Node in Area A), the quality inspection data sub-chain (Node in Area B), and the logistics data sub-chain (Node in Area C). Pull data concurrently from the sub-chain nodes in Area A, Area B, and Area C, and merge them after verifying that the hash of each data block is consistent with the main chain summary.
[0035] Specifically, the batch identifier is extracted from the traceability request sent by the user terminal. In the main chain index block of the blockchain, the corresponding tree node path is found according to the batch identifier. Based on the sub-chain data digest in the tree node path, the associated sub-chain nodes are located, and a data request is sent to these sub-chain nodes. After receiving the sub-chain data block, it is verified for consistency with the main chain data digest, and the verified data blocks are sorted in the order of production time to generate the full life cycle data covering all relevant data in the entire process of the product from raw material procurement, production processing, quality inspection to logistics transportation, sales, etc.
[0036] Example of user request: Query the full life cycle data of batch MILK20230901-A. The user submits the batch identifier MILK20230901-A. The main chain index block (Block#001) finds the address of the sub-chain node SubBlock#A001 corresponding to H1 through the sub-batch hash chain. By tracing back the parent hash H0, the initial batch MILK20230901 is found, and all associated sub-batches (H1, H2) are listed. The system parallelly requests the following sub-chain nodes: SubBlock#A001 (target sub-batch), SubBlock#B001 (associated sub-batch, because the user may need to view the same-source batches). Compare whether the hash value in the sub-chain data hash is consistent with the hash value in the main chain digest. Sort the verified data blocks according to the production time axis to generate the full life cycle data including information such as raw material source, production process, quality inspection results, and logistics track, and display the full life cycle data to consumers. (Batch: MILK20230901-A) 1. Initial batch information - Batch ID: MILK20230901 - Planned production capacity: 6000 cases - Trigger adjustment event: The transportation of raw milk was delayed by 12 hours due to heavy rain on September 1, 2023 2. Sub-batch production details - Sub-batch ID: MILK20230901-A - Production time: 08:00-12:00 on September 1, 2023 - Raw material source: Stock raw milk (batch X) Key process parameters: - Sterilization temperature: 75°C - Production line: B - Quality inspection results: - Total number of colonies: ≤100 CFU / g (qualified) - Detection time: 12:30 on September 1, 2023 3. Associated sub-batches - Sub-batch ID: MILK20230901-B - Production time: 2023-09-02 14:00-18:00 - Status: Delayed production (completed after raw milk arrival).
[0037] Meanwhile, it is also possible to generate only a report on the full life-cycle data of the target batch, for example:
Full-life cycle traceability of whole milk sterilized milk MILK20230901-A
[0038] Blockchain verification: The data is complete and trustworthy (hash chain verification passed).
[0039] The main chain index of this embodiment directly locates the sub-chain nodes through the hash chain, avoiding full-chain traversal. Hash verification ensures that the sub-chain data has not been tampered with. The main chain summary serves as a trustworthy anchor point. The full life-cycle data integrates the initial plan, sub-batch details, and external events, supporting in-depth quality analysis.
[0040] In a preferred embodiment, the real-time external data further includes food safety event data obtained from an Internet public opinion monitoring platform.
[0041] Specifically, in dynamic batch decision-making, in addition to environmental data (such as meteorology, logistics), food safety event data (such as a raw material pollution event of a certain supplier) is also obtained from the public opinion platform for evaluating production risks. Exemplarily, public opinion data: It is monitored that the news "antibiotic residue exceeded the standard in the raw milk of Supplier X", which serves as a food safety event data. The public opinion data is pushed to the system in real time through the API, triggering batch adjustment decisions.
[0042] In a preferred embodiment, before scoring each of the alternative sub-batch partitioning schemes based on the preset optimization objective function, the following steps are further included: Extract negative event keywords in the food safety event data that involve the names of the raw materials involved, the names of the enterprises involved, and the geographical regions involved; Based on the negative event keywords, determine whether the negative event involves the product to be produced; Specifically, negative keywords (such as "antibiotic residue", "Supplier X") are extracted from the public opinion data and matched with the current production plan to determine whether the products to be produced are affected. Optionally, keywords are extracted through natural language processing. The public opinion text is "Antibiotic residues were detected in the raw milk of Supplier X, and the products have been recalled". The extracted negative keywords = [Supplier X, raw milk, antibiotic residue]. Raw material matching: If the current product raw material list contains raw milk and the supplier of the product to be produced is indeed Supplier X, the matching is successful, and it is determined that the negative event involves the product to be produced. Otherwise, it is determined that the negative event does not involve the product to be produced.
[0043] The scoring of each of the alternative sub-batch division schemes based on the preset optimization objective function includes the following steps: If not, score each of the alternative sub-batch division schemes based on the preset optimization objective function; if so, score each of the alternative sub-batch division schemes based on the corrected optimization objective function, where the weight of the quality risk coefficient in the corrected optimization objective function is greater than the weight of the quality risk coefficient in the preset optimization objective function.
[0044] In a preferred embodiment, the determination of whether the negative event involves the product to be produced according to the negative event keywords includes the following steps: Cross-compare the negative event keywords with the associated area data of the product to be produced; If the name of the involved raw material matches the raw material list of the product to be produced, or the name of the involved enterprise is the same as the registered name of the relevant supplier, or the involved geographical area falls within the geographical scope of the associated area, it is determined that the negative event involves the product to be produced.
[0045] Specifically, if the negative event does not involve the product to be produced, the original objective function is used for scoring. If the negative event involves the product to be produced, the adjusted objective function is used for scoring. Original objective function: Score = 0.4×delivery deviation + 0.3×cost increment + 0.3×quality risk; Adjusted function: Score = 0.3×delivery deviation + 0.2×cost increment + 0.5×quality risk. Option 1: Replace the supplier (quality risk drops by 50%, cost rises by 20%), Score = 0.3×0 + 0.2×20 + 0.5×50 = 29; Option 2: Continue to use Supplier X (quality risk rises by 80%), Score = 0.3×10 + 0.2×0 + 0.5×80 = 43; Selection result: Option 1 (lower score) is selected, and the sub-batch identifier MILK20231015-A is generated.
[0046] In a preferred embodiment, after determining whether the negative event involves the product to be produced according to the negative event keyword, the following steps are further included: If so, generate a risk identification code including the negative event keyword, related evidence, and quality risk level, and bind the risk identification code to the corresponding sub-batch identification; Write the hash value of the risk identification code into the main chain index block metadata of the blockchain, and add a risk warning label to the data block of the associated sub-chain node.
[0047] Specifically, if the negative event is associated with the production batch, generate a risk identification code and bind it to the sub-batch to ensure that the risk information is traceable during tracing. Exemplarily, the risk identification code includes a risk ID, event type, related evidence (such as a news link), risk level, and associated sub-batch. Write the hash value of the risk identification code into the main chain metadata, and add a warning label "Risk Warning" to the sub-chain node, such as: "High Risk - Raw Material Pollution".
[0048] In a preferred embodiment, the retrieving the full life cycle data of the target batch corresponding to the tracing request in the blockchain network includes the following steps: If the negative event involves the product to be produced, extract all risk identification codes associated with the target batch from the main chain index block metadata, analyze the corresponding negative event type and influence range, and incorporate them into the full life cycle data.
[0049] Specifically, when the user traces, if the target batch is associated with a risk identification code, analyze the event details and incorporate them into the report. When the user queries the sub-batch MILK20231015-A, the main chain retrieves: it is found that the associated risk identification code is RISK-20231015-001. Analyze the event: including extracting the event type (raw material pollution), evidence link, and risk level, all of which are incorporated into the full life cycle data.
[0050] Embodiment 2 This embodiment proposes a food information tracing system based on Internet data for implementing the food information tracing method based on Internet data as described in Embodiment 1, including: A collection module configured to generate an initial batch identification of the product to be produced according to the product production plan and obtain real-time external data of the associated area based on the Internet public data platform; the real-time external data is dynamic environmental data having spatio-temporal relevance to the product to be produced; A judgment module configured to judge whether a batch adjustment event will occur during the production process of the product to be produced according to the real-time external data; the batch adjustment event is a production plan change event caused by the abnormality of the real-time external data; A decision-making module, configured to, if so, make a dynamic batch decision based on the real-time status data of the production line and the real-time external data, generate at least two sub-batch identifiers, and establish a tree-like association relationship with the initial batch identifier; A receiving module, configured to receive the detailed sub-batch data corresponding to each of the sub-batch identifiers and upload it to the blockchain network. The detailed sub-batch data includes production process data and quality inspection results. Among them, the batch topology relationship is stored in the main chain of the blockchain, and the detailed sub-batch data is stored in the corresponding sub-chain node; A reporting module, configured to, in response to a traceability request from a user terminal, retrieve the full life-cycle data of the target batch corresponding to the traceability request in the blockchain network according to the tree-like association relationship.
[0051] In this article, specific examples are used to elaborate on the principles and implementation manners of the present application. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present application. The above are only the preferred implementation manners of the present application. It should be noted that due to the limited nature of written expression and the objectively infinite specific structures, for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements, refinements or changes can also be made, or the above technical features can be combined in an appropriate manner; these improvements, refinements, changes or combinations, or directly applying the concept and technical solution of the invention to other occasions without improvement, shall all be regarded as the protection scope of the present application.
Claims
1. A food information traceability method based on Internet data, characterized in that, Including the following steps: According to the product production plan, generate an initial batch identifier for the product to be produced, and based on the Internet public data platform, obtain real-time external data for the associated area; the real-time external data is dynamic environmental data that has spatio-temporal relevance to the product to be produced; According to the real-time external data, determine whether a batch adjustment event will occur during the production process of the product to be produced; The batch adjustment event is a production plan change event caused by an abnormality in the real-time external data; If so, based on the real-time status data of the production line and the real-time external data, perform dynamic batch decision-making, generate at least two sub-batch identifiers, and establish a tree-like association relationship with the initial batch identifier; Receive the sub-batch detailed data corresponding to each sub-batch identifier and upload it to the blockchain network. The sub-batch detailed data includes production process data and quality inspection results. Among them, the batch topological relationship is stored in the main chain of the blockchain, and the sub-batch detailed data is stored in the corresponding sub-chain node; In response to a traceability request from a user terminal, according to the tree-like association relationship, retrieve the full life cycle data of the target batch corresponding to the traceability request in the blockchain network.
2. The food information traceability method based on Internet data according to claim 1, wherein: The step of obtaining real-time external data for the associated area based on the Internet public data platform includes the following steps: According to the raw material origin, relevant suppliers, and logistics path of the product to be produced, determine the geographical scope and time window of the associated area; Obtain real-time meteorological data, the supply inventory of product components of each relevant supplier, and the logistics information of each product component within the geographical scope and time window; the real-time external data includes meteorological data, supply inventory, and logistics information.
3. The food information traceability method based on Internet data according to claim 2, wherein: The step of determining whether a batch adjustment event will occur during the production process of the product to be produced according to the real-time external data includes the following steps: When the real-time external data meets at least one of the following, it is determined that a batch adjustment event will occur during the production process of the product to be produced: The environmental indicators in the meteorological data exceed the corresponding preset safety thresholds, and the environmental indicators include temperature, humidity, precipitation, or disaster warning level; The supply inventory of at least one of the relevant suppliers is lower than the minimum demand for the corresponding product components in the product production plan; The logistics information shows that the expected arrival time of at least one of the product components is later than the latest allowable arrival time in the product production plan.
4. The food information traceability method based on Internet data according to claim 1, characterized in that: The step of performing dynamic batch decision-making based on the real-time status data of the production line and the real-time external data, generating at least two sub-batch identifiers, and establishing a tree-like association relationship with the initial batch identifier includes the following steps: Extract the equipment availability rate, current process progress, and remaining production capacity parameters from the real-time status data of the production line; According to the type of abnormal event in the real-time external data, calculate the weight coefficient of the affected raw materials or processes, and generate multiple alternative sub-batch division plans in combination with the remaining production capacity parameters; Score each alternative sub-batch division plan based on a preset optimization objective function, and the optimization objective function includes delivery cycle deviation, production cost increment, and quality risk coefficient; Generate sub-batch identifiers by selecting the alternative sub-batch division scheme with the lowest score, assign a unique hash value to each sub-batch identifier, and concatenate the sub-hash value of the sub-batch identifier with the parent hash value of the initial batch identifier to form a tree-like association relationship.
5. The food information traceability method based on Internet data according to claim 1, wherein: According to the tree-like association relationship, retrieve the full life cycle data of the target batch corresponding to the traceability request in the blockchain network, including the following steps: Parse the batch identifier in the traceability request and match the corresponding tree node path from the main chain index block; Locate the associated sub-chain nodes based on the sub-chain data digest in the tree node path and concurrently request the sub-chain data blocks in multiple sub-chain nodes; Verify the consistency between each sub-chain data block and the main chain data digest, merge the data blocks that pass the verification and sort them according to the production timeline to generate the full life cycle data.
6. The food information traceability method based on Internet data according to claim 2, characterized in that: The real-time external data also includes food safety incident data obtained from the Internet public opinion monitoring platform.
7. The food information traceability method based on Internet data according to claim 4, wherein: Before scoring each alternative sub-batch division scheme based on the preset optimization objective function, the following steps are also included: Extract the negative event keywords related to the names of involved raw materials, involved enterprise names, and involved geographical regions from the food safety incident data; Judge whether the negative event involves the product to be produced according to the negative event keywords; Scoring each alternative sub-batch division scheme based on the preset optimization objective function includes the following steps: If not, score each alternative sub-batch division scheme based on the preset optimization objective function; if so, score each alternative sub-batch division scheme based on the corrected optimization objective function, where the weight of the quality risk coefficient in the corrected optimization objective function is greater than the weight of the quality risk coefficient in the preset optimization objective function.
8. The food information traceability method based on Internet data according to claim 7, characterized in that: Judging whether the negative event involves the product to be produced according to the negative event keywords includes the following steps: Cross-compare the negative event keywords with the associated area data of the product to be produced; If the name of the involved raw material matches the raw material list of the product to be produced, or the name of the involved enterprise is the same as the registered name of the relevant supplier, or the involved geographical region falls within the geographical scope of the associated area, it is determined that the negative event involves the product to be produced.
9. The food information traceability method based on Internet data according to claim 7, wherein: After judging whether the negative event involves the product to be produced according to the negative event keywords, the following steps are also included: If so, generate a risk identification code including negative event keywords, involved association evidence, and quality risk level, and bind the risk identification code to the corresponding sub-batch identifier; Write the hash value of the risk identification code into the metadata of the main chain index block of the blockchain and add a risk warning label to the data block of the associated sub-chain node; Retrieving the full life cycle data of the target batch corresponding to the traceability request in the blockchain network includes the following steps: If the negative event involves the product to be produced, extract all risk identification codes associated with the target batch from the metadata of the main chain index block, analyze the corresponding negative event types and influence ranges, and include them in the full life cycle data.
10. A food information traceability system based on Internet data, which is used to implement the food information traceability method based on Internet data as described in any one of claims 1-9, and is characterized in that: Include: Collection module, the collection module is configured to generate an initial batch identifier for the product to be produced according to the product production plan, and obtain real-time external data of the associated area based on the Internet public data platform; the real-time external data is dynamic environmental data that has spatio-temporal relevance to the product to be produced. Judgment module, the judgment module is configured to judge whether a batch adjustment event will occur during the production process of the product to be produced according to the real-time external data. The batch adjustment event is a production plan change event caused by an abnormality in the real-time external data. Decision-making module, the decision-making module is configured to, if so, perform dynamic batch decision-making based on the real-time status data of the production line and the real-time external data, generate at least two sub-batch identifiers, and establish a tree-like association relationship with the initial batch identifier. Receiving module, the receiving module is configured to receive the sub-batch detailed data corresponding to each of the sub-batch identifiers and upload it to the blockchain network. The sub-batch detailed data includes production process data and quality inspection results. Among them, the batch topological relationship is stored in the main chain of the blockchain, and the sub-batch detailed data is stored in the corresponding sub-chain node. Reporting module, the reporting module is configured to respond to a traceability request from a user terminal, and retrieve the full life cycle data of the target batch corresponding to the traceability request in the blockchain network according to the tree-like association relationship.
Citation Information
Patent Citations
Product quality tracing method, device and equipment in food and beverage industry
CN113888064A
Batch information recording method and device based on hierarchical tracing of block chain
CN112632060A
Supply chain whole process node tracing system and method thereof
CN114581108A
Product fault tracing method and device, electronic equipment and storage medium
CN117171270A
Garment production quality tracing system
CN118607884A
Cited By
Copper pipe quality tracing data storage method and system
CN120631904A
A copper pipe quality traceability data storage method and system
CN120631904B
Agricultural product quality safety traceability method
CN121052710A
Material tracing system, method, equipment and medium in chip production and manufacturing process
CN121258552A
Preserved egg production whole process tracing method and system based on block chain
CN121581885A