Food information tracing method and system based on Internet data

By obtaining dynamic external data related to food production in real time, adjusting batches dynamically and establishing tree-shaped associations, and using blockchain network storage and retrieval, the problem of traceability information fragmentation caused by changes in the external environment in the food production process is solved, and a complete traceability and accurate root cause analysis of the entire life cycle is achieved.

CN120218958BActive Publication Date: 2025-08-12TIANJIN SHENGXILIN ZHAOHUI TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510687936.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-08-12
Estimated Expiration
2045-05-27

AI Technical Summary

Technical Problem

The batch split caused by changes in the external environment in the food production process leads to the fragmentation of traceability information and the complete production decision chain cannot be restored.

Method used

By obtaining dynamic external data associated with food production in real time, dynamically adjusting batches and establishing tree-shaped associations, using blockchain network storage and retrieving batch topological relationships, we can realize traceability of the entire life cycle.

Benefits of technology

The problem of batch fragmentation is solved, the causal chain of batch adjustment is retained, the integrity and precise root cause analysis capabilities of traceability information are improved, and the blockchain storage and retrieval efficiency is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120218958B_ABST
    Figure CN120218958B_ABST
Patent Text Reader

Abstract

The present application provides a food information traceability method and system based on Internet data, which relates to the field of industrial Internet technology. The method includes the following steps: generating an initial batch identification of a product to be produced according to a product production plan, obtaining real-time external data of an associated area, and when determining that a batch adjustment event occurs during the production process of the product to be produced, making a dynamic batch decision based on the real-time status data of the production line and the real-time external data to generate at least two sub-batch identifications, and establishing a tree-like association relationship with the initial batch identification; receiving detailed sub-batch data of each sub-batch identification and uploading it to a blockchain network, storing the batch topology relationship in the blockchain main chain, and storing the detailed sub-batch data in the corresponding sub-chain node; and in response to a traceability request from a user terminal, retrieving the full life cycle data of the corresponding target batch in the blockchain network according to the tree-like association relationship. This method overcomes the problem of traceability information fragmentation caused by batch splitting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial Internet technology, and specifically to a food information traceability method and system based on Internet data. Background Art

[0002] The product quality traceability system assigns each product a unique traceability code, allowing users (such as consumers) to track and query relevant information about the product. However, production in the food industry is easily affected by external environmental factors (such as temperature and humidity, logistics delays, and power outages), which may lead to temporary adjustments to production plans.

[0003] In the prior art, for example, an invention patent with application number 202111498224.6 discloses a product quality traceability method, device, and equipment for the food and beverage industry. The solution forms a traceability chain by assigning an identification corresponding to the batch before production and associating the test data.

[0004] However, if the production plan is subject to batch splitting due to adjustments in the external environment, the static allocation of batch identifiers before production will cause the split batches to lose their association with the original batches, resulting in the inability to restore the complete production decision chain during tracing and the fragmentation of traceability information. Summary of the Invention

[0005] In view of the above-mentioned defects or deficiencies in the prior art, the present application aims to provide a food information traceability method and system based on Internet data to overcome the problem of traceability information fragmentation caused by batch splitting.

[0006] In the first aspect, the present application proposes a food information traceability method based on Internet data, comprising the following steps:

[0007] Generate initial batch identifications for products to be produced based on the product production plan, and acquire real-time external data of the associated area based on an Internet public data platform; the real-time external data is dynamic environmental data that has a temporal and spatial correlation with the products to be produced;

[0008] Determining, based on the real-time external data, 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 anomaly in the real-time external data;

[0009] If yes, perform 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;

[0010] Receive detailed sub-batch data corresponding to each sub-batch identifier and upload it to the blockchain network, wherein the sub-batch detailed data includes production process data and quality inspection results, wherein the batch topology relationship is stored in the blockchain main chain, and the sub-batch detailed data is stored in the corresponding sub-chain node;

[0011] In response to a traceability request from a user terminal, full life cycle data of a target batch corresponding to the traceability request is retrieved in the blockchain network according to the tree association relationship.

[0012] According to the technical solution provided in this application, the acquisition of real-time external data of the associated area based on the Internet public data platform includes the following steps:

[0013] Determine the geographical scope and time window of the associated area based on the raw material origin, relevant suppliers and logistics routes of the product to be produced;

[0014] Real-time acquisition of meteorological data within a geographical scope and time window, supply inventory of product accessories of each relevant supplier, and logistics information of each product accessory; the real-time external data includes meteorological data, supply inventory, and logistics information.

[0015] According to the technical solution provided by the present application, judging whether a batch adjustment event will occur in the production process of the product to be produced based on the real-time external data includes the following steps:

[0016] When the real-time external data satisfies at least one of the following conditions, it is determined that a batch adjustment event will occur in the production process of the product to be produced:

[0017] Environmental indicators in the meteorological data exceed corresponding preset safety thresholds, the environmental indicators including temperature, humidity, precipitation or disaster warning level;

[0018] The supply inventory of at least one of the relevant suppliers is lower than the minimum demand quantity of the corresponding product accessories in the product production plan;

[0019] The logistics information shows that the estimated arrival time of at least one of the product kits is later than the latest allowed arrival time in the product production plan.

[0020] According to the technical solution provided by the present application, the dynamic batch decision is performed based on the real-time status data of the production line and the real-time external data, at least two sub-batch identifiers are generated, and a tree-shaped association relationship is established with the initial batch identifier, including the following steps:

[0021] Extracting equipment availability, current process progress, and remaining capacity parameters from the real-time status data of the production line;

[0022] Calculating weight coefficients of affected raw materials or processes based on the abnormal event types in the real-time external data, and generating multiple alternative sub-batch division schemes in combination with the remaining capacity parameters;

[0023] Scoring each of the alternative sub-batch division schemes based on a preset optimization objective function, wherein the optimization objective function includes lead time deviation, production cost increment, and quality risk coefficient;

[0024] The alternative sub-batch division scheme with the lowest score is selected to generate sub-batch identifiers, and a unique hash value is assigned to each sub-batch identifier. The sub-hash value of the sub-batch identifier is cascaded with the parent hash value of the initial batch identifier to form a tree association relationship.

[0025] According to the technical solution provided by this application, the process of retrieving the full life cycle data of the target batch corresponding to the traceability request in the blockchain network based on the tree-shaped association relationship includes the following steps:

[0026] Parse the batch identifier in the traceability request and match the corresponding tree node path from the main chain index block;

[0027] Locating the associated sub-chain node according to the sub-chain data summary in the tree node path, and requesting sub-chain data blocks in multiple sub-chain nodes in parallel;

[0028] Verify the consistency of each sub-chain data block with the main chain data summary, merge the verified data blocks and sort them according to the production timeline to generate full life cycle data.

[0029] According to the technical solution provided in this application, the real-time external data also includes food safety incident data obtained from the Internet public opinion monitoring platform.

[0030] According to the technical solution provided by the present application, before scoring each of the candidate sub-batch division schemes based on the preset optimization objective function, the following steps are also included:

[0031] Extract negative event keywords involving the names of the raw materials involved, the names of the companies involved, and the geographical areas involved in food safety incident data;

[0032] Determining, based on the negative event keywords, whether the negative event involves the product to be produced;

[0033] Scoring each of the candidate sub-batch division schemes based on a preset optimization objective function includes the following steps:

[0034] If not, each of the alternative sub-batch division schemes is scored based on the preset optimization objective function; if so, each of the alternative sub-batch division schemes is scored based on the revised optimization objective function, wherein the weight of the quality risk coefficient in the revised optimization objective function is greater than the weight of the quality risk coefficient in the preset optimization objective function.

[0035] According to the technical solution provided by this application, judging whether a negative event involves the product to be produced based on the negative event keywords includes the following steps:

[0036] Cross-comparing the negative event keywords with the associated regional data of the product to be produced;

[0037] If the name of the raw material in question matches the list of raw materials of the product to be produced, or the name of the company in question is consistent with the registered name of the relevant supplier, or the geographical area in question falls within the geographical scope of the associated area, it is determined that the negative event involves the product to be produced.

[0038] According to the technical solution provided by the present application, after determining whether the negative event involves the product to be produced based on the negative event keywords, the following steps are further included:

[0039] If yes, generate a risk identification code containing the negative event keywords, related evidence involved and quality risk level, and bind the risk identification code to the corresponding sub-batch identification;

[0040] 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;

[0041] The process of retrieving the full life cycle data of the target batch corresponding to the traceability request in the blockchain network includes the following steps:

[0042] If a negative event involves the product to be produced, all risk identification codes associated with the target batch are extracted from the metadata of the main chain index block, and the corresponding negative event type and impact scope are analyzed and included in the full life cycle data.

[0043] In a second aspect, the present application proposes a food information traceability system based on Internet data, which is used to implement the above-mentioned food information traceability method based on Internet data, including:

[0044] A collection module configured to generate an initial batch identifier for the product to be produced based on the product production plan and to obtain real-time external data of the associated area based on an Internet public data platform; the real-time external data is dynamic environmental data that has a temporal and spatial correlation with the product to be produced;

[0045] a determination module configured to determine, based on the real-time external data, 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 anomaly in the real-time external data;

[0046] A decision module configured to, if yes, perform 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;

[0047] A receiving module configured to receive detailed sub-batch data corresponding to each sub-batch identifier and upload it to the blockchain network, wherein the detailed sub-batch data includes production process data and quality inspection results, wherein the batch topology relationship is stored in the blockchain main chain, and the detailed sub-batch data is stored in the corresponding sub-chain node;

[0048] A reporting module is configured to respond to a traceability request from a user terminal and retrieve, in the blockchain network, the full life cycle data of the target batch corresponding to the traceability request based on the tree-shaped association relationship.

[0049] Compared to existing technologies, the present invention offers the following advantages: This method utilizes real-time access to external data (such as meteorological and logistics data) to trigger batch adjustment decisions, generate sub-batch identifiers, and establish a tree-like association with the initial batch, documenting the adjustment logic. The main chain stores lightweight batch topology relationships, while the sub-chains store detailed production data. Main chain indexing enables rapid cross-batch retrieval, and external anomaly events are associated with sub-batch identifiers, forming a fully dimensional traceability context. This method firstly addresses batch fragmentation: the tree-like association preserves the causal chain of batch adjustments, allowing the complete production decision path to be restored during traceability. For example, when a user queries sub-batch M1, their parent batch M and the anomaly triggering event are simultaneously retrieved. Secondly, it improves the integrity of traceability information: by integrating external environmental data, quality anomalies are associated with specific events (such as temperature fluctuations), enabling precise root cause analysis. For example, exceeding the sterilization temperature limit for a dairy product can be traced back to an equipment failure caused by a power grid anomaly. Thirdly, it optimizes blockchain storage and retrieval efficiency: the main chain-sub-chain architecture reduces redundant storage, and the main chain topology indexing enables one-click cross-batch traceability. For example, by inputting the initial batch ID M, all associated sub-batches (M1, M2) and their data can be instantly obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 This is a flowchart of the steps of the food information traceability method based on Internet data provided in this application. DETAILED DESCRIPTION

[0051] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the invention are shown in the accompanying drawings.

[0052] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0053] Example 1

[0054] As mentioned in the background technology, in order to solve the problems in the prior art, this application proposes a food information traceability method based on Internet data, such as Figure 1 As shown, the following steps are included:

[0055] S1. Generate an initial batch identifier for the product to be produced based on the product production plan, and obtain real-time external data of the associated area based on an Internet public data platform; the real-time external data is dynamic environmental data that has a temporal and spatial correlation with the product to be produced;

[0056] Specifically, the initial batch identification is the first batch number assigned to the products to be produced based on the product production plan, which is used to uniquely determine the identity of the batch of products at the beginning of production. The real-time external data is dynamic environmental data that is related to the products to be produced in time and space, covering aspects such as meteorology, supply inventory, and logistics, reflecting the external related conditions during product production.

[0057] Furthermore, the acquisition of real-time external data of the associated area based on the Internet public data platform includes the following steps:

[0058] Determine the geographical scope and time window of the associated area based on the raw material origin, relevant suppliers and logistics routes of the product to be produced;

[0059] Specifically, the associated area is the geographic scope of the raw material production area, supplier location, and logistics route, such as: pasture in location A + factory in location A + highway B. The time window is the period related to the production plan, such as: 48 hours before raw milk collection to the completion of production.

[0060] Real-time acquisition of meteorological data within a geographical scope and time window, supply inventory of product accessories of each relevant supplier, and logistics information of each product accessory; the real-time external data includes meteorological data, supply inventory, and logistics information.

[0061] Specifically, we extract the coordinates of raw material origins and the supply and inventory levels of product components from the supplier database. We then filter weather data by geographic range using the weather API. Weather data is obtained by geographical range using the Meteorological Bureau API (JSON format, updated every 10 minutes). Logistics data is retrieved through the TMS system's RESTful interface, returning real-time location information, such as truck GPS coordinates. Logistics data fields include truck ID, GPS coordinates, and estimated time of arrival, and are synchronized in real time through the logistics company's TMS system interface.

[0062] S2. Determine, based on the real-time external data, 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 anomaly in the real-time external data;

[0063] Furthermore, judging whether a batch adjustment event will occur in the production process of the product to be produced based on the real-time external data includes the following steps:

[0064] When the real-time external data satisfies at least one of the following conditions, it is determined that a batch adjustment event will occur in the production process of the product to be produced:

[0065] Environmental indicators in the meteorological data exceed corresponding preset safety thresholds, the environmental indicators including temperature, humidity, precipitation or disaster warning level;

[0066] The supply inventory of at least one of the relevant suppliers is lower than the minimum demand quantity of the corresponding product accessories in the product production plan;

[0067] The logistics information shows that the estimated arrival time of at least one of the product kits is later than the latest allowed arrival time in the product production plan.

[0068] For example, XX Dairy Co., Ltd. plans to produce 6,000 cartons of whole-fat sterilized milk, with an initial batch identifier of MILK20230901 (the batch number format is "product type + year, month, and day"). The raw material origin is the ranch in Location A (supplying raw milk), and the supplier is XX Packaging Company in Location C (providing milk cartons, with a planned demand of 6,000 cartons). The logistics route is from Section D to Section E on Highway B (the packaging material transportation route). The production window is from 48 hours before raw milk collection (00:00 on September 1, 2023) to the completion of production (24:00 on September 3). The China Meteorological Administration API is used to filter the weather forecast for the next 48 hours in Location A and Section D to E on Highway B. For example, the forecast predicts continuous heavy rain (50 mm / hour, exceeding the preset safety threshold of 30 mm) starting at 8:00 on September 1 in Location A or Section D to E on Highway B. The packaging company in Location C uses its ERP system to retrieve the supplier's inventory. For example, the real-time inventory shows only 5,000 units (below the demand of 6,000 units). The logistics company's TMS system receives logistics information and obtains the truck's GPS location. For example, the truck transporting packaging materials is delayed due to heavy rain. In this case, three anomalies are triggered simultaneously (as long as at least one of the anomalies is present), and the system determines that a batch adjustment is required.

[0069] S3. If yes, 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;

[0070] Specifically, the tree-like association relationship is a hierarchical relationship constructed with the initial batch identifier as the root node and the sub-batch identifier as the branch node, which is used to clearly record the derivation and subordination relationships between batches.

[0071] Furthermore, the dynamic batch decision is performed 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, including the following steps:

[0072] Extracting equipment availability, current process progress, and remaining capacity parameters from the real-time status data of the production line;

[0073] Calculating weight coefficients of affected raw materials or processes based on the abnormal event types in the real-time external data, and generating multiple alternative sub-batch division schemes in combination with the remaining capacity parameters;

[0074] Each of the alternative sub-batch division schemes is scored based on a preset optimization objective function, where the optimization objective function includes delivery cycle deviation, production cost increment and quality risk coefficient; wherein 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%).

[0075] The alternative sub-batch division scheme with the lowest score is selected to generate sub-batch identifiers, and a unique hash value is assigned to each sub-batch identifier. The sub-hash value of the sub-batch identifier is cascaded with the parent hash value of the initial batch identifier to form a tree association relationship.

[0076] For example, real-time production line data is extracted: Equipment availability: Line A is down due to raw material non-arrival, but Line B is still operational (remaining capacity: 800 L / hour). Current process progress: The prepared culture raw material needs to be put into production within 4 hours. Remaining capacity parameter: Line B's idle time = 2 hours. Abnormal event type and weight calculation: External data anomaly: Heavy rain caused a 12-hour delay in raw milk delivery (abnormal type = logistics disruption). Affected raw material weight: Raw milk is a core raw material, and the weight coefficient is calculated as 0.9 (maximum score: 1.0). Alternative plans are generated: Plan 1: Split into two sub-batches: Sub-Batch 1 (ID: MILK20230901-A): Producing 4,000 cases using existing raw milk inventory (to meet urgent orders); Sub-Batch 2 (ID: MILK20230901-B): Delaying production of 2,000 cases until raw milk arrives. Plan 2: Producing 6,000 cases using raw milk from an alternative supplier (with a higher quality risk factor). After calculating the scores, Plan 1 is selected, and two corresponding sub-batch identifiers are generated. The initial batch hash value, i.e., the parent hash value H0, is SHA256(MILK20230901||Production plan data) = a1b2c3..., where || represents string concatenation. The hash value of each sub-batch must be concatenated with the parent hash value to ensure association. (It should be noted that the generated sub-batch hash value must include the parent hash value, sub-batch identifier, and key production parameters (such as raw material batch, production line number, and process timestamp) to ensure uniqueness and tamper resistance.) Sub-batch 1 hash value H1: H1 = SHA256(a1b2c3... || "MILK20230901-A||4000 cartons of raw milk in stock") = d4e5f6...; Sub-batch 2 hash value H2: H2 = SHA256(a1b2c3... || "MILK20230901-B||2000 cartons of production delayed") = g7h8i9.... The blockchain main chain records: The initial batch node contains the child batch hash chain [d4e5f6..., g7h8i9...]. The child batch 1 node contains the parent hash value a1b2c3...; the child batch 2 node contains the parent hash value a1b2c3.... Tree structures commonly used in blockchains, such as Merkle trees, are used to establish associations between batches. For example, the tree-like association is implemented using a Merkle tree, with the parent batch hash value as the root node and the child batch hash values as leaf nodes. Each leaf node contains a pointer to the child chain data, forming a tree structure. This way, any modification to a child batch will cause its hash value to change, which in turn affects the hash value of the parent node, ensuring data integrity.

[0077] S4. Receive detailed subbatch data corresponding to each subbatch identifier and upload it to the blockchain network. The detailed subbatch data includes production process data and quality inspection results. The batch topology relationship is stored in the blockchain main chain, and the detailed subbatch data is stored in the corresponding subchain node.

[0078] Specifically, the main chain stores lightweight index information, including batch identifiers, hash values, and associated relationships. Each sub-chain node stores detailed production data and quality inspection results for the corresponding sub-batch, which is bound to the main chain hash. The main chain stores data summaries of sub-chain nodes (such as sub-chain addresses or hash values of key fields) for rapid location and verification. The main chain utilizes a Proof of Authority (PoA) consensus mechanism and is jointly maintained by manufacturers and regulators. The sub-chains operate in a private chain model, independently operated by each production node. The main chain monitors uploads of sub-chain data summaries through smart contracts and regularly verifies the integrity of sub-chain data.

[0079] S5. In response to the traceability request from the user terminal, the full life cycle data of the target batch corresponding to the traceability request is retrieved in the blockchain network according to the tree association relationship.

[0080] Furthermore, the process of 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:

[0081] Parse the batch identifier in the traceability request and match the corresponding tree node path from the main chain index block;

[0082] Specifically, the batch identifier is the number or identification information used to specify the target batch product in the user traceability request, and the main chain index block is a specific block in the blockchain main chain used to store index information, which contains key index data such as tree-like association relationships.

[0083] Locating the associated sub-chain node according to the sub-chain data summary in the tree node path, and requesting sub-chain data blocks in multiple sub-chain nodes in parallel;

[0084] Verify the consistency of each sub-chain data block with the main chain data summary, merge the verified data blocks and sort them according to the production timeline to generate full life cycle data.

[0085] Exemplarily, the sub-chain node addresses include the production data sub-chain (node at location A), the quality inspection data sub-chain (node at location B), and the logistics data sub-chain (node at location C). Data is pulled from the sub-chain nodes at locations A, B, and C in parallel, and the data blocks are merged after verifying that the hash of each data block is consistent with the main chain summary.

[0086] Specifically, the batch identifier is extracted from the traceability request sent by the user terminal. Within the blockchain's main chain index block, a matching tree node path is searched for the batch identifier. Based on the subchain data summary in the tree node path, the associated subchain nodes are located and data requests are sent to them. Upon receiving the subchain data block, its consistency is verified against the main chain data summary. The verified data blocks are sorted according to production chronology, generating full lifecycle data covering all relevant data from the entire product process, from raw material procurement, production and processing, quality inspection, logistics, transportation, and sales.

[0087] Example user request: Querying the full lifecycle data for batch MILK20230901-A. The user submits the batch identifier MILK20230901-A. The main chain index block (Block#001) uses the sub-batch hash chain to find the sub-chain node address SubBlock#A001 corresponding to H1. Tracing back to the parent hash H0, the initial batch MILK20230901 is found and all associated sub-batches (H1 and H2) are listed. The system then concurrently requests the following sub-chain nodes: SubBlock#A001 (the target sub-batch) and SubBlock#B001 (an associated sub-batch, as users may need to check for homologous batches). The sub-chain data hash is compared with the hash value in the main chain summary to ensure consistency. Verified data blocks are sorted by production timeline, generating full lifecycle data including raw material sources, production processes, quality inspection results, logistics trajectory, and other information. This full lifecycle data is then displayed to consumers. (Batch: MILK20230901-A)

[0088] 1. Initial batch information

[0089] - Batch ID: MILK20230901

[0090] - Planned production capacity: 6,000 boxes

[0091] - Trigger adjustment event: 2023-09-01 Heavy rain caused a 12-hour delay in raw milk transportation

[0092] 2. Sub-batch production details

[0093] - Sub-lot ID: MILK20230901-A

[0094] - Production time: 2023-09-01 08:00-12:00

[0095] - Source of raw materials: Raw milk in stock (batch X)

[0096] Key process parameters:

[0097] - Sterilization temperature: 75℃

[0098] - Production line: B

[0099] - Quality test results:

[0100] - Total colony count: ≤100 CFU / g (qualified)

[0101] - Detection time: 2023-09-01 12:30

[0102] 3. Associate subbatches

[0103] - Sub-lot ID: MILK20230901-B

[0104] - Production time: 2023-09-02 14:00-18:00

[0105] - Status: Delayed production (to be completed after raw milk arrives).

[0106] At the same time, you can also generate a report on the full life cycle data of the target batch, for example:

[0107] [Full life cycle traceability of whole-fat sterilized milk MILK20230901-A]

[0108] Source of raw materials: Ranch C (XX Animal Husbandry)

[0109] Production Time: 2023-09-01 08:30 ~ 2023-09-01 14:00

[0110] Quality inspection: qualified (report number: SH-QC-20230901-001)

[0111] Logistics track: Factory A → Warehouse B (temperature ≤ 4°C throughout the process)

[0112] Abnormal record: Heavy rain caused the original plan to be adjusted, and the production was completed by using the stock of raw milk.

[0113] Blockchain verification: data integrity and credibility (hash chain verification passed).

[0114] In this implementation, the main chain index 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 trusted anchor point, and the full life cycle data integrates the initial plan, sub-batch details and external events to support in-depth quality analysis.

[0115] In a preferred embodiment, the real-time external data also includes food safety incident data obtained from an Internet public opinion monitoring platform.

[0116] Specifically, dynamic batch decision-making utilizes not only environmental data (such as weather and logistics) but also food safety incident data (such as a supplier's raw material contamination incident) from public opinion platforms to assess production risks. For example, monitoring news reports such as "Excessive antibiotic residues detected in raw milk from supplier X" constitutes a food safety incident. This public opinion data is pushed to the system in real time via an API, triggering batch adjustment decisions.

[0117] In a preferred embodiment, before scoring each of the candidate sub-batch division schemes based on a preset optimization objective function, the following steps are further included:

[0118] Extract negative event keywords involving the names of the raw materials involved, the names of the companies involved, and the geographical areas involved in food safety incident data;

[0119] Determining, based on the negative event keywords, whether the negative event involves the product to be produced;

[0120] Specifically, negative keywords (such as "antibiotic residues" and "Supplier X") are extracted from public opinion data and matched against the current production plan to determine whether they affect the product to be produced. Alternatively, natural language processing can be used to extract keywords. For example, if the public opinion text is "Supplier X's raw milk was found to contain antibiotic residues and the product has been recalled," the extracted negative keywords would be [Supplier X, raw milk, antibiotic residues]. Raw material matching: If the current product's raw material list includes raw milk, and the supplier of the product to be produced is Supplier X, then the match is successful and the negative event is determined to involve the product to be produced. Otherwise, the negative event is determined not to involve the product to be produced.

[0121] Scoring each of the candidate sub-batch division schemes based on a preset optimization objective function includes the following steps:

[0122] If not, each of the alternative sub-batch division schemes is scored based on the preset optimization objective function; if so, each of the alternative sub-batch division schemes is scored based on the revised optimization objective function, wherein the weight of the quality risk coefficient in the revised optimization objective function is greater than the weight of the quality risk coefficient in the preset optimization objective function.

[0123] In a preferred embodiment, the step of determining whether a negative event involves the product to be produced based on the negative event keywords includes the following steps:

[0124] Cross-comparing the negative event keywords with the associated regional data of the product to be produced;

[0125] If the name of the raw material in question matches the list of raw materials of the product to be produced, or the name of the company in question is consistent with the registered name of the relevant supplier, or the geographical area in question falls within the geographical scope of the associated area, it is determined that the negative event involves the product to be produced.

[0126] Specifically, if the negative event does not involve a product in the pipeline, the original objective function is used for scoring. If the negative event involves a product in the pipeline, the adjusted objective function is used for scoring. The original objective function: score = 0.4 × delivery deviation + 0.3 × cost increase + 0.3 × quality risk; the adjusted function: score = 0.3 × delivery deviation + 0.2 × cost increase + 0.5 × quality risk. Option 1: Change supplier (quality risk decreases 50%, cost increases 20%), score = 0.3 × 0 + 0.2 × 20 + 0.5 × 50 = 29; Option 2: Continue using supplier X (quality risk increases 80%), score = 0.3 × 10 + 0.2 × 0 + 0.5 × 80 = 43;

[0127] Selection result: Option 1 (lower score) is selected, and the sub-batch identifier MILK20231015-A is generated.

[0128] In a preferred embodiment, after determining whether the negative event involves the product to be produced based on the negative event keywords, the method further includes the following steps:

[0129] If yes, generate a risk identification code containing the negative event keywords, related evidence involved and quality risk level, and bind the risk identification code to the corresponding sub-batch identification;

[0130] The hash value of the risk identification code is written into the metadata of the main chain index block of the blockchain, and a risk warning label is added to the data block of the associated sub-chain node.

[0131] Specifically, if a negative event is associated with a production batch, a risk identification code is generated and linked to the sub-batch to ensure that risk information is traceable during tracing. For example, the risk identification code includes the risk ID, event type, relevant evidence (such as a news link), risk level, and associated sub-batches. The main chain metadata is written with the hash value of the risk identification code, and a warning label "Risk Warning" is added to the sub-chain node, such as "High Risk - Raw Material Contamination."

[0132] In a preferred embodiment, the process of retrieving the full life cycle data of the target batch corresponding to the traceability request in the blockchain network includes the following steps:

[0133] If a negative event involves the product to be produced, all risk identification codes associated with the target batch are extracted from the metadata of the main chain index block, and the corresponding negative event type and impact scope are analyzed and included in the full life cycle data.

[0134] Specifically, when tracing back, if a target batch is associated with a risk identification code, the incident details are analyzed and included in the report. For example, if a user queries subbatch MILK20231015-A and searches the main chain, the associated risk identification code RISK-20231015-001 is found. The incident analysis includes extracting the incident type (raw material contamination), evidence links, and risk level, all of which are included in the full lifecycle data.

[0135] Example 2

[0136] This embodiment provides a food information tracing system based on internet data, which is used to implement the food information tracing method based on internet data as described in Example 1, including:

[0137] A collection module configured to generate an initial batch identifier for the product to be produced based on the product production plan and to obtain real-time external data of the associated area based on an Internet public data platform; the real-time external data is dynamic environmental data that has a temporal and spatial correlation with the product to be produced;

[0138] a determination module configured to determine, based on the real-time external data, 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 anomaly in the real-time external data;

[0139] A decision module configured to, if yes, perform 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;

[0140] A receiving module configured to receive detailed sub-batch data corresponding to each sub-batch identifier and upload it to the blockchain network, wherein the detailed sub-batch data includes production process data and quality inspection results, wherein the batch topology relationship is stored in the blockchain main chain, and the detailed sub-batch data is stored in the corresponding sub-chain node;

[0141] A reporting module is configured to respond to a traceability request from a user terminal and retrieve, in the blockchain network, the full life cycle data of the target batch corresponding to the traceability request based on the tree-shaped association relationship.

[0142] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. The above is only the preferred implementation method of this application. It should be pointed out that due to the limitations of textual expression, there are objectively infinite specific structures. For ordinary technicians in this technical field, without departing from the principles of the present invention, they can also make several improvements, modifications or changes, and can also combine the above technical features in an appropriate manner; these improvements, modifications, changes or combinations, or the direct application of the inventive concept and technical solution to other occasions without improvement, should be regarded as the scope of protection of this application.

Claims

1. A food information tracing method based on Internet data, characterized in that: The following steps are involved: Generate initial batch identifications for products to be produced based on the product production plan, and acquire real-time external data of the associated area based on an Internet public data platform; the real-time external data is dynamic environmental data that has a temporal and spatial correlation with the products to be produced; Determining, based on the real-time external data, 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 anomalies in the real-time external data; If yes, perform 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; Receive detailed sub-batch data corresponding to each sub-batch identifier and upload it to the blockchain network, wherein the sub-batch detailed data includes production process data and quality inspection results, wherein the batch topology relationship is stored in the blockchain main chain, and the sub-batch detailed data is stored in the corresponding sub-chain node; In response to a traceability request from a user terminal, full life cycle data of a target batch corresponding to the traceability request is retrieved in the blockchain network according to the tree association relationship.

2. The food information tracing method based on Internet data according to claim 1, characterized in that: The method of obtaining real-time external data of the associated area based on the Internet public data platform includes the following steps: Determine the geographical scope and time window of the associated area based on the raw material origin, relevant suppliers and logistics routes of the product to be produced; Real-time acquisition of meteorological data within a geographical scope and time window, supply inventory of product accessories of each relevant supplier, and logistics information of each product accessory; the real-time external data includes meteorological data, supply inventory, and logistics information.

3. The food information tracing method based on Internet data according to claim 2, characterized in that: The step of determining, based on the real-time external data, whether a batch adjustment event will occur during the production process of the product to be produced comprises the following steps: When the real-time external data satisfies at least one of the following conditions, it is determined that a batch adjustment event will occur in the production process of the product to be produced: Environmental indicators in the meteorological data exceed corresponding preset safety thresholds, the environmental indicators including temperature, humidity, precipitation or disaster warning level; The supply inventory of at least one of the relevant suppliers is lower than the minimum demand quantity of the corresponding product accessories in the product production plan; The logistics information shows that the estimated arrival time of at least one of the product kits is later than the latest allowed arrival time in the product production plan.

4. The food information tracing method based on Internet data according to claim 1, characterized in that: The method of making dynamic batch decisions 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: Extracting equipment availability, current process progress, and remaining capacity parameters from the real-time status data of the production line; Calculating weight coefficients of affected raw materials or processes based on the abnormal event types in the real-time external data, and generating multiple alternative sub-batch division schemes in combination with the remaining capacity parameters; Scoring each of the alternative sub-batch division schemes based on a preset optimization objective function, wherein the optimization objective function includes lead time deviation, production cost increment, and quality risk coefficient; The alternative sub-batch division scheme with the lowest score is selected to generate sub-batch identifiers, and a unique hash value is assigned to each sub-batch identifier. The sub-hash value of the sub-batch identifier is cascaded with the parent hash value of the initial batch identifier to form a tree association relationship.

5. The food information tracing method based on Internet data according to claim 1, characterized in that: The method of retrieving the full life cycle data of the target batch corresponding to the traceability request in the blockchain network according to the tree association relationship includes the following steps: Parse the batch identifier in the traceability request and match the corresponding tree node path from the main chain index block; Locating the associated sub-chain node according to the sub-chain data summary in the tree node path, and requesting sub-chain data blocks in multiple sub-chain nodes in parallel; Verify the consistency of each sub-chain data block with the main chain data summary, merge the verified data blocks and sort them according to the production timeline to generate full life cycle data.

6. The food information tracing 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 tracing method based on Internet data according to claim 4, characterized in that: Before scoring each of the candidate sub-batch division schemes based on the preset optimization objective function, the following steps are also included: Extract negative event keywords involving the names of the raw materials involved, the names of the companies involved, and the geographical areas involved in food safety incident data; Determining, based on the negative event keywords, whether the negative event involves the product to be produced; Scoring each of the candidate sub-batch division schemes based on a preset optimization objective function includes the following steps: If not, each of the alternative sub-batch division schemes is scored based on the preset optimization objective function; if so, each of the alternative sub-batch division schemes is scored based on the revised optimization objective function, wherein the weight of the quality risk coefficient in the revised optimization objective function is greater than the weight of the quality risk coefficient in the preset optimization objective function.

8. The food information tracing method based on Internet data according to claim 7, characterized in that: The step of determining whether the negative event involves the product to be produced based on the negative event keywords includes the following steps: Cross-comparing the negative event keywords with the associated regional data of the product to be produced; If the name of the raw material in question matches the list of raw materials of the product to be produced, or the name of the company in question is consistent with the registered name of the relevant supplier, or the geographical area in question 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 tracing method based on Internet data according to claim 7, characterized in that: After determining whether the negative event involves the product to be produced based on the negative event keywords, the following steps are further included: If yes, generate a risk identification code containing the negative event keywords, related evidence involved 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 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; The process of retrieving the full life cycle data of the target batch corresponding to the traceability request in the blockchain network includes the following steps: If a negative event involves the product to be produced, all risk identification codes associated with the target batch are extracted from the metadata of the main chain index block, and the corresponding negative event type and impact scope are analyzed and included in the full life cycle data.

10. A food information tracing system based on internet data, for implementing the food information tracing method based on internet data according to any one of claims 1 to 9, characterized in that: include: A collection module configured to generate an initial batch identifier for the product to be produced based on the product production plan and to obtain real-time external data of the associated area based on an Internet public data platform; the real-time external data is dynamic environmental data that has a temporal and spatial correlation with the product to be produced; a determination module configured to determine, based on the real-time external data, 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 anomalies in the real-time external data; A decision module configured to, if yes, perform 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 detailed sub-batch data corresponding to each sub-batch identifier and upload it to the blockchain network, wherein the detailed sub-batch data includes production process data and quality inspection results, wherein the batch topology relationship is stored in the blockchain main chain, and the detailed sub-batch data is stored in the corresponding sub-chain node; A reporting module is configured to respond to a traceability request from a user terminal and retrieve, in the blockchain network, the full life cycle data of the target batch corresponding to the traceability request based on the tree-shaped association relationship.

Citation Information

Patent Citations

  • Product quality tracing method, device and equipment in food and beverage industry

    CN113888064A

  • Supply chain whole process node tracing system and method thereof

    CN114581108A

  • Plan-updating method capable of minimizing the number of places to be changed

    JP2001147711A