Health food quality safety tracing system based on block chain

By utilizing a blockchain-based traceability system for the quality and safety of health food, and employing AI-driven and smart contract modules, the system addresses issues of inaccurate data and regulatory loopholes in traditional traceability systems. It enables real-time data response and reliable prediction, thereby enhancing the system's security and transparency.

CN120952806AInactive Publication Date: 2025-11-14HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510661842.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-11-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional traceability systems for the quality and safety of health food products suffer from inaccurate and incomplete data, information asymmetry, management difficulties, regulatory loopholes, data security and privacy protection issues, and a lack of effective collaborative mechanisms.

Method used

The system adopts a blockchain-based traceability system for the quality and safety of health food, which includes an AI-driven module, a data acquisition layer module, a regional blockchain layer module, and an application layer module. It uses AI technology for data analysis and processing, combined with a smart contract-driven module to achieve real-time monitoring and traceability, and uses blockchain technology to ensure data security and transparency.

Benefits of technology

It has improved the effectiveness of the traceability system, reduced the difficulty of supervision, enhanced collaboration, enabled real-time data response and reliable prediction, ensured data security and privacy protection, and improved the transparency and compliance of the supply chain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120952806A_ABST
    Figure CN120952806A_ABST
Patent Text Reader

Abstract

The invention discloses a health food quality safety tracing system based on a block chain. According to the system, an optimization model taking health food quality risk assessment as a target is constructed; selecting the total number of bacterial colonies, the number of pathogenic bacteria, solvent residues, water activity, temperature, air pressure, granularity, mixing uniformity, effective component quantification, dissolution rate, residual oxygen amount and the like as core parameters, and constructing an optimized objective function; in addition, the system monitors and adjusts key parameters such as the temperature, the air pressure, the granularity and the residual oxygen content of the health-care food in real time through the AI driving module, and the food safety coefficient is improved; according to the invention, the conversion from passive supervision to active prevention is realized, the food qualification rate and the resource utilization rate are improved, and the method can be used for links of food production, transportation, sales and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a blockchain-based traceability system for the quality and safety of health food products. Background Technology

[0002] Traditional traceability systems for health food quality and safety face numerous challenges. Firstly, data collection and quality control are problematic: inaccurate or incomplete data collection can affect the effectiveness of the traceability system. Furthermore, the lack of standardized procedures for data quality control and authenticity assessment is also a current issue. Secondly, the health food supply chain involves multiple stages, including raw material procurement, production and processing, warehousing and logistics, and sales. Each stage presents information asymmetry and management difficulties, and existing regulatory systems and technologies may not fully cover all stages, leading to regulatory loopholes in some areas. Thirdly, data security and privacy protection are critical issues. Ensuring data security and consumer privacy during data collection and storage is paramount. Finally, collaborative cooperation is challenging; the lack of effective communication and collaboration mechanisms among the various participants in the supply chain hinders information sharing and collaborative management. Summary of the Invention

[0003] Purpose of the invention: The purpose of this invention is to provide a blockchain-based traceability system for the quality and safety of health food that increases the effectiveness of the traceability system, reduces the difficulty of supervision, and enhances collaborative cooperation.

[0004] The technical solution of the present invention is: a blockchain-based health food quality and safety traceability system, wherein the module is applied to the production line and includes an AI-driven module, a data acquisition layer module for real-time collection of production data, a regional blockchain layer module for processing production data, and an application layer module for consumer traceability and evaluation.

[0005] The AI-driven module includes a data modeling module, a dynamic monitoring module, a smart contract-driven module, and AI data analysis.

[0006] Furthermore, the data modeling module records, analyzes, and predicts quality risks from historical quality data;

[0007] The data records include records of microbial contamination, raw material batch test reports, consumer complaint records, and recall event-related data.

[0008] The process of analyzing data and predicting quality risks is as follows: processing missing data, correcting outlier format standardization, and generating composite features by combining raw material batches, production processes, and test results; using an LSTM model to analyze the above data and predict the risk of deviation of production parameters in the next 24 hours; and using 5-fold cross-validation to ensure that AUC > 0.92 and interpreting the model through SHAP values.

[0009] Furthermore, the dynamic monitoring module monitors and calculates production parameters in real time, including using a technology stack and edge-cloud collaboration to realize a real-time data stream processing architecture and AI to calculate production parameters;

[0010] First, data acquisition is performed: Apache Kafka receives sensor data and then performs real-time calculations;

[0011] Then, Flink window functions calculate the mean / variance of parameters to build the technology stack;

[0012] Finally, model reasoning and AI technology are used to calculate environmental parameters, process parameters and equipment status parameters.

[0013] The above results are summarized and fed into the AI ​​for data analysis to determine whether to include the data in the database; if the data is rejected, the smart contract driver module is activated.

[0014] Furthermore, the smart contract initiation module makes adjustments after inspecting and tracing the problematic products, including automated processing, root cause analysis and rectification closed loop, and collaboration between consumers and regulators;

[0015] When AI determines that a product poses a risk, the smart contract is automatically triggered. First, it freezes the circulation of the problematic batch in the supply chain, sends a recall order, and updates the product status on the blockchain. Then, it performs data tracing and correlation analysis, using the blockchain to trace the entire lifecycle data of the problematic product and combining it with the AI ​​model to identify the root cause. Next, it puts improvement measures on the blockchain: the rectification plan is written into the blockchain to ensure the compliance of subsequent production processes is verifiable. Finally, it provides transparent information disclosure: consumers can scan a code to view the product risk handling records; and it shares regulatory data: on-chain records are synchronized to the regulatory platform.

[0016] Furthermore, the feature is that the AI ​​data analysis integrates various data from the production line, including production environment data, raw material data, and production process data, and its implementation steps are as follows:

[0017] (1) Establish the objective function; with the health food safety coefficient as the optimization objective, the decision variables include health food production environment data, blockchain transportation environment data, health food process data, and raw material data uncertainty correction terms:

[0018]

[0019] In the formula, X represents production data; Φ k Ψ represents the output of the k-th modal-specific model; i (X) represents the activation value of a node in a causal rule network; C j (X) represents the economic cost item of health food; ω kIndicates the blockchain dynamic weight sustainability premium; λ i Indicates the control of loss rate of health food products; η j Represents the dynamic weighted blockchain volatility coefficient; e(X) represents the uncertainty propagation term of health food raw material data;

[0020] (2) Use the chaotic evolutionary optimization algorithm to read the basic parameters of active ingredients, total bacterial count, pathogenic bacteria count, water activity, temperature, air pressure, mixing uniformity, quantitative analysis of effective ingredients and dissolution rate in the production of health food; incorporate the parameters into the search space and use chaotic systems such as Tent mapping to generate chaotic sequences as initial solutions, introduce chaotic parameters to control the search step size, calculate the fitness of candidate solutions, update the global optimal solution, obtain the maximum value of food qualification rate, and determine whether the iteration termination condition is met. If it is met, output the current qualification rate as the maximum value. Otherwise, regenerate partial solutions through the ergodicity of chaotic mapping and jump out of the local optimum.

[0021] Furthermore, the process of establishing the objective function in step (1) is as follows:

[0022] (11) Data integration item for health food production environment w k :

[0023]

[0024] In the formula, Q global K represents the global production data of the blockchain. k V k This expression represents the key-value pair of the Kth mode. The formula calculates ω in the objective function. k value;

[0025] Q global =MLP θQ (Concat(S s ,P j ))

[0026] In the formula, S s P represents the real-time production status. j Indicates regulatory policy code, MLP θQ This represents a multilayer perceptron with output dimension d. q The formula calculates w. k China Q global value:

[0027] [K k V k ] = HyperNet φk (Q global )

[0028] In the formula, HyperNet φk Represents a hypernetwork, outputting dimensions. Split output representation This formula calculates w. k [K] k V k ]value:

[0029]

[0030] After normalization, we get:

[0031]

[0032] (12) Blockchain Transportation Environment Network Project

[0033]

[0034] In the formula, λ i rude Represents node V i The severity coefficient of blockchain rules, λ i This formula represents the control of the loss rate of health food products. The objective function is calculated using this formula. value;

[0035]

[0036] In the formula, θV j →V i It represents edge V j →V i The blockchain causal strength parameter is calculated by this formula. P(V) i =1|Pa(V i ))value;

[0037] (13) Optimization items for health food process data ∑n j C j (X):

[0038]

[0039] In the formula, τ represents the risk tolerance. The Sigmoid function restricts the output to (0,1). This formula calculates ∑n in the objective function. j C j (X) value;

[0040] (14) Raw material data uncertainty correction term e(X):

[0041]

[0042] In the formula, ω k Indicates the blockchain dynamic weight sustainability premium, λi Indicates the control of loss rate of health food products, η j The formula represents the dynamic weighted blockchain volatility coefficient, and is used to calculate the value of e(X) in the objective function.

[0043]

[0044] In the formula, Φ k (t) (X) represents the output of the t-th sample. Predict the mean; this formula calculates σ in e(X). k 2 (X) value;

[0045] σ 2 sensor (X)=tr(S t )

[0046] Taking the trace of the residual covariance matrix as the noise intensity, the formula calculates σ in e(X). 2 sensor value;

[0047]

[0048] In the formula, s represents the node state (0 / 1), and this formula calculates the Entropy(Ψ) in the function e(X). i (X) value;

[0049] After adding an uncertainty correction term to the final objective function;

[0050] F final (X)=F(X)+ò(X)

[0051] In the formula, F(X) represents value;

[0052] Furthermore, the implementation process of step (2) is as follows:

[0053] (21) Tent mapping initialization of the population: The basic parameters of the system, including total colony count, number of pathogenic bacteria, water activity, temperature, air pressure, mixing uniformity, quantification of effective ingredients, and dissolution rate, are represented by particles, and a mixed variable is added to the initial population; the Tent mapping is used to convert it into a chaotic sequence, which is suitable for high-dimensional optimization problems and avoids the periodic interference of the Logistic mapping; the Tent mapping is as follows:

[0054]

[0055] In the formula, v k This indicates the value at step k. This represents the total number of colonies;

[0056] The chaotic sequence generated by the Tent mapping is linearly mapped to the search space of each dimension; that is:

[0057] V i,j =a j +v k (i) ·(b j -a j )

[0058] In the formula, V i,j This represents the quantitative value of the effective component of the i-th individual in the j-th dimension;

[0059] (22) Function optimization: Introduce the NSGA-III+MOPO hybrid framework. In the first 30% of iterations, NSGA-III generates the initial population, and each individual in the population represents a health food safety coefficient; in the last 70% of iterations, the gradient update is introduced through the DRL strategy using MOPO; that is:

[0060]

[0061] In the formula, P t Let V represent the dominance function, j represent the water activity of the health food product, and V represent the water activity of the health food product. i Indicates the quantitative value of the effective ingredients in health food;

[0062] (23) Update the health food safety coefficient individuals: fitness calculation and elite retention. The fitness value of each health food safety coefficient individual is calculated and then constrained. The top 5% of individuals with the best fitness are selected and directly enter the next generation of the population.

[0063]

[0064] In the formula, Indicates the number of pathogenic bacteria;

[0065] (24) Global Optimal Guidance: By introducing chaotic dynamics, the chaotic fluctuations of α-convergence balance the attraction to the global optimal solution GB and the influence on the current solution X. i The retention of, that is:

[0066]

[0067] In the formula, Represents the chaotic parameters generated by the Logistic mapping. σ represents the disturbance amplitude, ò~N(0,1) represents Gaussian noise, and GB represents the health food safety coefficient;

[0068] (25) Optimize the function to construct the reward function: Transform the objective function into an immediate reward, update the individual position of the health food safety coefficient, and add an L2 regularization term to suppress oscillations:

[0069]

[0070] In the formula, λ represents the dissolution rate of health food products, and N... i MGi represents the local mean value, indicating the uniformity of the chemical structure mixing of health food products.

[0071] (26) Local mean guidance: The local mean MGi reflects the central trend of the local area, balances exploration and development, guides the search direction, and avoids complete reliance on the global optimum;

[0072]

[0073] V new =Λ·MGi+(1-Λ)·V i

[0074] In the formula, Λ is dynamically generated by the chaotic sequence, and N i Indicates the uniformity of the chemical structure of health food products;

[0075] (27) Random perturbations; providing exploration capabilities by generating unpredictable jumps in the search space:

[0076] V new =V i +e·(V rand -V i )

[0077] In the formula, X rand This represents a randomly selected individual, and e represents the perturbation coefficient;

[0078] (28) Utilize chaotic jumps to update the optimal safety factor position for health food products; enhance global exploration and focus on local optimization by leveraging the traversal properties of chaos:

[0079] V new =V i +δ·(v chaos -0.5)·(ba)

[0080] In the formula, x chaos The value represents the newly generated chaotic value, and δ represents the intensity of the disturbance that decreases with iteration.

[0081] (29) Scaling formula; The search range update formula is centered on GB and scaled down exponentially to avoid overfitting caused by a fixed range:

[0082] a j new =GB j -e (t) ·(b j -a j )

[0083] b j new =GB j +e (t) ·(b j -a j )

[0084] γ (t) =γ0·e -λ·t

[0085] In the formula, e (t) Represents an exponentially decaying function; a j Indicates the ambient temperature of the health food production environment; b j This indicates the air pressure in the production environment of health food products;

[0086] (210) The position of the health food safety coefficient is updated again, and the robustness of the algorithm is enhanced by combining absolute and relative changes through the chaotic rebirth function;

[0087] X reset,j =a j +x chaos ·(b j -a j )

[0088] In the formula, x chaos This indicates that a chaotic sequence is generated using a Tent mapping;

[0089] (211) Termination conditions and output; the convergence standard function is used to determine whether the algorithm has fully converged, avoiding premature termination. The reliability of the results is confirmed after long-term stability.

[0090]

[0091] In the formula; GB (t) This indicates that the updated optimal health food safety coefficient will be output.

[0092] (212) Obtain the health food safety coefficient corresponding to the optimal fitness value, that is, the optimal value of the health food safety coefficient under the blockchain-based health food quality and safety traceability system.

[0093] Furthermore, the production data collected by the data acquisition layer module includes the type, quantity, quality, purchase time, supplier information, batch number, production environment temperature, humidity, air pressure, microbial count, and production process.

[0094] Furthermore, the process by which the regional blockchain layer module processes production data is as follows: first, the TLS protocol is used to protect communication between nodes; then, sensitive data is encrypted using AES-256 before being uploaded to the chain; next, zero-knowledge proofs or homomorphic encryption technology are used; and finally, data verification and interaction between sub-chains are achieved through smart contracts or relay chains.

[0095] Furthermore, the application layer module includes a consumer query interface for consumer traceability and evaluation: consumers can scan codes to obtain information about the entire product process; consumers can access the query interface of the application layer by scanning the QR code or barcode on the product packaging to obtain detailed information about the product at each stage of the supply chain; consumers can verify the authenticity of the product by comparing the product information with the data stored on the blockchain.

[0096] The product's full-process information includes authenticity verification, testing certificates and safety ratings, and consumer feedback; the detailed information obtained includes basic product information, raw material information, production process information, quality testing information, and transportation and warehousing information.

[0097] Beneficial Effects: Compared with existing technologies, this invention has the following significant features: 1. Data Fusion: By integrating structured data (supplier ratings, process parameters), time-series data (sensor streams), visual data (packaging images), graph data (supply chain relationships), and text data (consumer feedback), a panoramic quality graph is constructed; Dynamic weight adaptation enhances scenario adaptability. Based on attention mechanisms and meta-learning, dynamic weight allocation enables the system to automatically perceive environmental changes and adjust data source priorities, building a trust chain blockchain with deep coupling with data fusion to ensure the auditability of the fusion process; Knowledge sharing under privacy protection promotes industry collaboration; Data fusion technology transforms fragmented data into high-value knowledge assets through six major advantages: full-dimensional integration, dynamic adaptation, real-time response, trusted evidence storage, privacy collaboration, and resource optimization; 2. Real-time Response System: Through edge AI computing and automatic execution of smart contracts, an emergency mechanism can be triggered instantly in the event of an anomaly, providing real-time data... 1. Flow-driven closed-loop control enables dynamic optimization of production parameters; second-level intervention in logistics anomalies ensures full compliance, and real-time monitoring combined with geofencing technology enables precise control of transportation risks; 2. Reliable prediction significantly improves the accuracy of quality risk identification through multimodal fusion models and dynamic uncertainty quantification; in terms of end-to-end traceability, a transparent trust system can be built by combining blockchain and AI to achieve full evidence chain storage of the prediction process; 3. Compliance adaptive system with built-in intelligent rule engine and global regulatory knowledge base automatically identifies target market standards and adjusts detection thresholds; in terms of real-time response to regulatory updates, legal risks can be avoided by monitoring regulatory dynamics through AI, automatically analyzing and internalizing new regulatory requirements; 4. Obtaining a 3D visualized data chain through QR code scanning; in terms of second-level positioning of supply chain risks, recall costs can be drastically reduced, and the immutability of blockchain evidence combined with spatiotemporal data fusion enables precise targeted recall of problematic products, promoting reliable data sharing between upstream and downstream of the supply chain. Attached Figure Description

[0098] Figure 1 This is a schematic diagram of the structure of the present invention;

[0099] Figure 2 This is a flowchart of the operation of the chaotic evolution optimization algorithm in this invention;

[0100] Figure 3 This is a diagram of the distributed transaction model of the virtual health food factory based on blockchain technology, as described in this invention. Detailed Implementation

[0101] The specific technical solution of the present invention will be further described in detail below with reference to specific examples.

[0102] like Figure 1As shown, the present invention discloses a blockchain-based traceability system for the quality and safety of health food, which includes a data acquisition layer module, a regional blockchain layer module, an application layer module, and an AI-driven module.

[0103] The data acquisition layer module is used to collect production data in real time. The production data includes the type, quantity, quality, purchase time, supplier information, batch number, production environment temperature, humidity, air pressure, microbial count, and production process.

[0104] The aforementioned regional blockchain layer module is used for processing production data, including using TLS (Transport Layer Security, a core technology that ensures the security of data acquisition layer, blockchain node communication, and consumer query interface) to protect inter-node communication and prevent man-in-the-middle attacks; encrypting sensitive data using AES-256 (AES-256 is a core technology for ensuring data storage security and transmission privacy, achieving full lifecycle data security protection in the food traceability system through high-strength encryption and high efficiency) before uploading it to the chain, with the key managed by the data owner; using zero-knowledge proofs or homomorphic encryption technology to achieve "data usable but invisible"; distributed storage of encrypted data to form an immutable chain structure covering multiple nodes such as manufacturers, testing institutions, and logistics providers; and using smart contracts or relay chains to achieve data verification and interaction between sub-chains, ensuring global data consistency; lightweight nodes, where sub-chain nodes only need to store local data, reducing hardware resource consumption; and edge computing integration: in IoT scenarios, data is pre-processed by edge devices before being uploaded to the chain, reducing transmission latency.

[0105] The application layer module is used for consumer traceability and evaluation, including a consumer query interface: consumers can scan the code to obtain information about the entire product process, including authenticity verification, testing certificates and safety scores, and consumer feedback; consumers can access the application layer query interface by scanning the QR code or barcode on the product packaging.

[0106] This interface connects to the blockchain network to obtain detailed information about the product at each stage of the supply chain in real time, including basic product information, raw material information, production process information, quality inspection information, transportation and warehousing information; consumers can verify the authenticity of the product by comparing the product information with the data stored on the blockchain.

[0107] The AI-driven module includes a data modeling module, a dynamic monitoring module, a smart contract-driven module, and an AI data analysis module; this module will collect information from the above modules and execute the corresponding programs.

[0108] The data modeling module is used to record, analyze and predict quality risks from historical quality data. The data records include records of microbial contamination, raw material batch test reports, production equipment failure logs, consumer complaint records, and recall event-related data, thereby constructing machine learning models such as algorithm and model training and validation.

[0109] The process of analyzing data and predicting quality risks is as follows: Gradient Boosting Tree (GBT is a machine learning algorithm based on ensemble learning that iteratively trains multiple weak learners) is used to process structured data, correct outlier format standardization, and then combined with raw material batches, production processes and test results to generate composite features and predict the probability of raw material deterioration.

[0110] We use an LSTM (Long Short-Term Memory) model to analyze sensor time-series data and predict the risk of deviation from production parameters in the next 24 hours. We employ 5-fold cross-validation to ensure that the AUC (Area Under the Curve, a core metric for evaluating the performance of classification models, is used to quantify the AI ​​model's ability to predict quality risks) is greater than 0.92, and interpret the model using the SHAP value.

[0111] The dynamic monitoring module is used for real-time monitoring and production parameter calculation. It includes a real-time data stream processing architecture implemented using a technology stack and edge-cloud collaboration, and AI calculation of production parameters. Data acquisition: Apache Kafka (an open-source distributed stream processing platform) receives sensor data. Real-time calculation: Flink window functions (functions used to process time or quantity windows in streaming data) calculate parameter mean / variance to build the technology stack. Model inference: TensorFlow Serving (a flexible, high-performance machine learning model service system designed for production environments, mainly used to handle the inference stage of machine learning models, responsible for managing the lifecycle of trained models, and providing versioned access to clients through a high-performance reference count lookup table) deploys online prediction service edge nodes to pre-filter noisy data to achieve edge-cloud collaboration. AI technology is used to calculate environmental parameters, process parameters, equipment status parameters, etc.

[0112] The above results are summarized and fed into the AI ​​for data analysis to determine whether to add the data to the database. If the data is rejected, the smart contract driver module is activated.

[0113] The smart contract activation module is used to make adjustments after inspecting and tracing problematic products, including automated processing, root cause analysis and rectification loop, and consumer and regulatory collaboration. When AI determines that a product has a risk, the smart contract is automatically triggered. First, it freezes the circulation rights of the problematic batch in the supply chain, sends recall instructions to distributors and retailers, updates the product status on the blockchain to "unsellable," and initiates a compliance investigation. Then, it performs data tracing and correlation analysis, tracing back the entire lifecycle data of the problematic product through the blockchain, and identifying the root cause in combination with the AI ​​model. Next, it puts improvement measures on the blockchain: the rectification plan (such as changing suppliers and equipment maintenance records) is written into the blockchain to ensure the compliance of subsequent production processes can be verified. Finally, it provides transparent information disclosure: consumers can scan a code to view product risk handling records (such as recall notices and re-inspection reports), enhancing trust. Regulatory data sharing: on-chain records are synchronized to the regulatory platform.

[0114] The AI ​​data analysis can integrate various data from the production line, including production environment data, raw material data, and production process data. It fully leverages AI technology's ability to integrate and analyze multi-source data, uncovering potential information within the data and providing comprehensive and accurate decision support for the quality management and risk control of health food products. It can respond promptly to changes and problems in the production process, enabling real-time monitoring and proactive control of health food quality, effectively reducing the risk of quality problems, and improving the stability and safety of product quality.

[0115] The implementation steps are as follows:

[0116] (1) Establish the objective function; with the health food safety coefficient as the optimization objective, the decision variables include health food production environment data, blockchain transportation environment data, health food process data, and raw material data uncertainty correction terms:

[0117]

[0118] In the formula, X represents production data; Φ k Ψ represents the output of the k-th modal-specific model (normalized to [0,1]); i (X) represents the activation value of a node in a causal rule network; C j (X) represents the economic cost item of health food; ω k Indicates the blockchain dynamic weight sustainability premium; λ i Indicates the control of loss rate of health food products; η j Represents the dynamic weighted blockchain volatility coefficient (satisfying ω) k +λ i +|η j |+|e|≤2); e(X) represents the uncertainty propagation term of raw material data for health food products;

[0119] (11) Data integration item for health food production environment w k :

[0120]

[0121] In the formula, Q global Represents global production data of the blockchain; K k V k This represents the key-value pair of the Kth mode; this formula calculates ω in the objective function. k value:

[0122] Q global =MLP θQ (Concat(S s ,P j ))

[0123] In the formula, S s Indicates real-time production status; P j Indicates regulatory policy code; MLP θQ This represents a multilayer perceptron with output dimension d. q The formula calculates w. k China Q global value:

[0124] [K k V k ] = HyperNet φk (Q global )

[0125] In the formula, HyperNet φk Represents a hypernetwork, outputting dimensions. Split output representation This formula calculates w. k [K] k V k ]value:

[0126]

[0127] After normalization, we get:

[0128]

[0129] (12) Blockchain Transportation Environment Network Project

[0130]

[0131] In the formula, λ i rude Represents node V i The severity coefficient of blockchain rules; λ iThis indicates the control of the loss rate of health food products; the formula is used to calculate the objective function. value:

[0132]

[0133] In the formula, θV j →V i Representing edge V j →V i The blockchain causal strength parameter; the formula is used to calculate P(V) i =1|Pa(V i ))value;

[0134] (13) Optimization items for health food process data ∑n j C j (X);

[0135]

[0136] In the formula, τ represents the risk tolerance. The Sigmoid function limits the output to (0,1) to prevent weight overshoot; this formula calculates ∑n in the objective function. j C j (X) value;

[0137] (14) Raw material data uncertainty correction term e(X):

[0138]

[0139] In the formula, ω k Indicates the blockchain dynamic weight sustainability premium; λ i Indicates the control of loss rate of health food products; η j This represents the dynamic weighted blockchain volatility coefficient; this formula is used to calculate the value of e(X) in the objective function.

[0140]

[0141] In the formula, Φ k (t) (X) represents the output of the t-th sample. Predict the mean; this formula calculates σ in e(X). k 2 (X) value;

[0142] σ 2 sensor (X)=tr(S t )

[0143] The trace of the residual covariance matrix is ​​taken as the noise intensity; this formula calculates σ in e(X). 2 sensor value:

[0144]

[0145] In the formula, s represents the node state (0 / 1), and this formula calculates the Entropy(Ψ) in the function e(X). i (X) value;

[0146] After adding an uncertainty correction term to the final objective function:

[0147] F final (X)=F(X)+ò(X)

[0148] In the formula, F(X) represents value;

[0149] (2) Using the Chaotic Evolution Optimization (CEO) algorithm, basic parameters of the algorithm are set based on data such as total bacterial count, pathogenic bacteria count, water activity, temperature, air pressure, mixing uniformity, quantification of active ingredients, and dissolution rate during the production of health food products. Figure 2 As shown;

[0150] The parameters are incorporated into the search space and a chaotic sequence is generated using chaotic systems such as the Tent mapping as the initial solution. Individual updates are guided based on the health food safety coefficient (GB) and local mean (MGi). Chaotic parameters are introduced to control the search step size to avoid premature convergence. The fitness of candidate solutions is calculated, the global optimal solution is updated, the maximum value of the food qualification rate is obtained, and it is determined whether the iteration termination condition is met. If it is met, the current qualification rate is output as the maximum value. Otherwise, a partial solution is regenerated through the ergodicity of the chaotic mapping to escape the local optimum.

[0151] (21) Initializing the population using Tent mapping: Basic parameters such as total colony count, pathogenic bacteria count, water activity, temperature, air pressure, mixing uniformity, effective ingredient quantification, and dissolution rate are represented by particles, and a mixed variable is added to the initial population; the population is mapped to a chaotic sequence through Tent mapping, which is suitable for high-dimensional optimization problems and avoids the periodic interference of Logistic mapping; the Tent mapping is as follows:

[0152]

[0153] In the formula, v k This indicates the value at step k. This represents the total number of colonies;

[0154] The chaotic sequence generated by the Tent mapping is linearly mapped to the search space of each dimension; that is:

[0155] V i,j =a j +v k(i) ·(b j -a j )

[0156] In the formula, V i,j This represents the quantitative value of the effective component of the i-th individual in the j-th dimension;

[0157] (22) Function optimization: Introduce the NSGA-III+MOPO hybrid framework. In the first 30% of iterations, NSGA-III generates the initial population, with each individual in the population representing a health food safety coefficient. In the latter 70% of iterations, the DRL strategy is introduced through MOPO for gradient updates; that is:

[0158]

[0159] In the formula, P t Let V represent the dominance function, j represent the water activity of the health food product, and V represent the water activity of the health food product. i Indicates the quantitative value of the effective ingredients in health food;

[0160] (23) Update the health food safety coefficient individuals: fitness calculation and elite retention. The fitness value of each health food safety coefficient individual is calculated and then constrained. The top 5% of individuals with the best fitness are selected and directly enter the next generation of the population.

[0161]

[0162] In the formula, The number of pathogenic bacteria;

[0163] (24) Global Optimal Guidance: By introducing chaotic dynamics, premature convergence caused by fixed step size is avoided; the chaotic fluctuations of α-convergence balance the attraction to the global optimal solution GB and the attraction to the current solution X. i The retention of; that is:

[0164]

[0165] In the formula, Represents the chaotic parameters generated by the Logistic mapping. σ represents the disturbance amplitude; ò~N(0,1) represents Gaussian noise; GB represents the health food safety coefficient;

[0166] (25) Optimize the function to construct the reward function: Transform the objective function into an immediate reward, update the individual position of the health food safety coefficient, and add an L2 regularization term to suppress oscillations:

[0167]

[0168] In the formula, λ represents the dissolution rate of health food; N iIndicates the uniformity of chemical structure mixing in health food products; MGi represents the local mean.

[0169] (26) Local mean guidance: The local mean MGi reflects the central trend of the local area, balances exploration and development, guides the search direction, and avoids complete reliance on the global optimum.

[0170]

[0171] V new =Λ·MGi+(1-Λ)·V i

[0172] In the formula, Λ is dynamically generated from a chaotic sequence; N i Indicates the uniformity of the chemical structure of health food products;

[0173] (27) Random perturbation; avoids pattern repetition by generating unpredictable jumps in the search space; provides more uniform exploration capability:

[0174] V new =V i +e·(V rand -V i )

[0175] In the formula, X rand This represents a randomly selected individual, and e represents the perturbation coefficient;

[0176] (28) Utilize chaotic jumps to update the optimal safety factor position for health food products; enhance global exploration and focus on local optimization by leveraging the traversal properties of chaos:

[0177] V new =V i +δ·(v chaos -0.5)·(ba)

[0178] In the formula, x chaos The value represents the newly generated chaotic value, and δ represents the intensity of the disturbance that decreases with iteration.

[0179] (29) Scaling formula; The search range update formula is centered on GB (health food safety coefficient) and scaled down exponentially to avoid overfitting caused by a fixed range:

[0180] a j new =GB j -e (t) ·(b j -a j )

[0181] b j new =GBj +e (t) ·(b j -a j )

[0182] γ (t) =γ0·e -λ·t

[0183] In the formula, e (t) Represents an exponentially decaying function; a j Indicates the ambient temperature of the health food production environment; b j This indicates the air pressure in the production environment of health food products;

[0184] (210) The position of the health food safety coefficient is updated again, and the robustness of the algorithm is enhanced by combining absolute and relative changes through the chaotic rebirth function;

[0185] X reset,j =a j +x chaos ·(b j -a j )

[0186] In the formula, x chaos This indicates that a chaotic sequence is generated using a Tent mapping;

[0187] (211) Termination conditions and output; the convergence standard function is used to determine whether the algorithm has fully converged, avoiding premature termination. The reliability of the results is confirmed after long-term stability.

[0188]

[0189] In the formula; GB (t) This indicates that the updated optimal health food safety coefficient will be output.

[0190] (212) Obtain the health food safety coefficient corresponding to the optimal fitness value, that is, the optimal value of the health food safety coefficient under the blockchain-based health food quality and safety traceability system.

[0191] This system ensures data trustworthiness and tamper-proof capabilities. It employs distributed storage, cryptography, and a multi-party consensus mechanism to build trustworthiness and tamper-proof capabilities throughout the data lifecycle. During data acquisition, hardware security modules are embedded in IoT devices to generate unique device IDs and sign data, preventing counterfeit devices from accessing the system. In the raw material procurement stage, anti-counterfeiting and traceability are implemented: supplier qualification certificates and raw material testing reports are hashed on the blockchain, allowing buyers to verify authenticity by scanning the code. In the production and processing stage, process compliance is ensured: sterilization temperature, time, and other parameters are recorded on the blockchain in real time. In the logistics and sales stages, temperature control and tamper-proof measures are implemented: in cold chain logistics, temperature and humidity sensor data are uploaded every 5 minutes. The blockchain is designed to freeze goods upon tampering with it via a smart contract. During data storage, a distributed ledger and multi-node consensus verification are used. Data is encrypted and stored on the blockchain. Asymmetric encryption is employed, with the uploader signing the information with their private key, and other nodes verifying the signature using their public key to ensure the data's authenticity. Edge computing preprocessing is used at edge nodes to denoise and aggregate the raw data, generating a digest hash value for on-chain storage, reducing on-chain load. Key data (such as batch numbers and quality inspection results) is directly stored on-chain using on-chain / off-chain collaborative storage. Large files are stored off-chain, with only hash indexes stored on-chain. Smart contracts automatically verify data logic according to preset rules, rejecting abnormal data from being uploaded to the blockchain.

[0192] The system also focuses on risk control, employing data-driven prediction and real-time dynamic monitoring to shift from passive response to proactive prevention. In the data-driven prediction phase, structured data collection is used to gather historical pass rates from raw material suppliers, production equipment maintenance records, and test reports including raw material sources, supplier information, production batches, processing techniques, inspection results, and sales channels. AI technology is used to construct risk assessment models for precise evaluation of the quality risks of health food products. These models, based on extensive historical and real-time data, are continuously optimized and adjusted through machine learning algorithms, enabling more accurate predictions of the likelihood and severity of risks. For example, by analyzing data on the raw material composition, production process, and market feedback of health food products, the AI ​​model can assess the quality risk level of different products at different stages. As health food products move through the supply chain and market feedback changes, the AI ​​system can promptly adjust the risk assessment results to provide timely updates. Enterprises and regulatory authorities provide the latest risk information; in the real-time dynamic monitoring phase, IoT devices are integrated, and by deploying IoT devices such as sensors and RFID tags at various stages of the health food supply chain, various data on products can be collected in real time, including data on the growth environment of raw materials, process parameters during production, and temperature and humidity during transportation; this data is uploaded and updated in real time through the blockchain network, ensuring the timeliness and accuracy of the data; multi-node data synchronization, the distributed nature of blockchain allows data to be synchronized in real time between multiple nodes; all participants in the supply chain, such as raw material suppliers, manufacturers, and distributors, can view and update relevant product information in real time; this multi-node data synchronization mechanism not only improves data transparency but also ensures data consistency; in the smart contract automated execution phase, the execution paradigm of health food quality and safety management is reconstructed through rule coding, execution automation, and process transparency.

[0193] The system also improves efficiency by using data on the blockchain and automated execution of smart contracts to enable automatic early warning and handling of quality and safety risks in health food products. For example, when data in a certain production stage becomes abnormal, the smart contract can automatically trigger an early warning mechanism, notifying relevant parties to take timely measures to prevent the problem from escalating. The smart contract can automatically coordinate various links in the health food supply chain based on real-time data. Through the automated execution of smart contracts, manual operations and intermediate links are reduced, lowering the operating costs of the health food supply chain. Regulatory authorities can view the operation of the health food supply chain in real time through smart contracts on the blockchain. This transparency and real-time nature can more effectively improve regulatory efficiency.

[0194] The system also focuses on consumer feedback; it employs feedback data analysis and processing technology to improve product quality, enhance service experience, and strengthen brand trust. Consumers can provide feedback through various channels such as QR code tracing, social media pages, and customer service systems, greatly increasing the ways to provide feedback. Natural language processing technology is used for sentiment analysis, employing the BERT model to determine the sentiment tendency of comments (positive / negative / neutral), identifying urgent complaints, and making process adjustments. AI technology is then used to train a data model based on historical feedback data (ratings, return rates) to predict potential complaint risks after new product launches. Its transparent processing rebuilds consumer trust, forming a positive cycle of "feedback-improvement-trust enhancement." Specifically, for example... Figure 3 As shown.

Claims

1. A blockchain-based traceability system for the quality and safety of health food, characterized in that: It includes an AI-driven module, a data acquisition layer module for real-time production data collection, a regional blockchain layer module for processing production data, and an application layer module for consumer traceability and evaluation. The AI-driven module includes a data modeling module, a dynamic monitoring module, a smart contract-driven module, and AI data analysis.

2. The blockchain-based traceability system for the quality and safety of health food products according to claim 1, characterized in that: The data modeling module records, analyzes, and predicts quality risks from historical quality data. The data records include records of microbial contamination, raw material batch test reports, consumer complaint records, and recall event-related data. The process of analyzing data and predicting quality risks is as follows: processing missing data, correcting outlier format standardization, and generating composite features by combining raw material batches, production processes, and test results; using an LSTM model to analyze the above data and predict the risk of deviation of production parameters in the next 24 hours; and using 5-fold cross-validation to ensure that AUC > 0.92 and interpreting the model through SHAP values.

3. The blockchain-based health food quality and safety traceability system according to claim 2, characterized in that: The dynamic monitoring module monitors and calculates production parameters in real time, including using a technology stack and edge-cloud collaboration to realize a real-time data stream processing architecture and AI to calculate production parameters. First, data acquisition is performed: Apache Kafka receives sensor data and then performs real-time calculations; Then, the Flink window function is used to calculate the mean / variance of the parameters to build the technology stack; Finally, model reasoning and AI technology are used to calculate environmental parameters, process parameters and equipment status parameters. The above results are aggregated and fed to the AI ​​for data analysis to determine whether to include them in the database; if inclusion is rejected, the smart contract driver module is activated.

4. The blockchain-based traceability system for the quality and safety of health food products according to claim 2, characterized in that: The smart contract startup module makes adjustments after inspecting and tracing the problematic products, including automated processing, root cause analysis and rectification loop, and collaboration between consumers and regulators. When AI determines that a product poses a risk, the smart contract is automatically triggered. First, it freezes the circulation of the problematic batch in the supply chain, sends a recall order, and updates the product status on the blockchain. Then, it performs data tracing and correlation analysis, using the blockchain to trace the entire lifecycle data of the problematic product and combining it with the AI ​​model to identify the root cause. Next, it puts improvement measures on the blockchain: the rectification plan is written into the blockchain to ensure the compliance of subsequent production processes is verifiable. Finally, it provides transparent information disclosure: consumers can scan a code to view the product risk handling records; and it shares regulatory data: on-chain records are synchronized to the regulatory platform.

5. The blockchain-based traceability system for the quality and safety of health food products according to claim 2, characterized in that: The AI ​​data analysis integrates various data from the production line, including production environment data, raw material data, and production process data. The implementation steps are as follows: (1) Establish the objective function; with the health food safety coefficient as the optimization objective, the decision variables include health food production environment data, blockchain transportation environment data, health food process data, and raw material data uncertainty correction terms: In the formula, X represents production data; Φ k Ψ represents the output of the k-th modal-specific model; i (X) represents the activation value of a node in a causal rule network; C j (X) represents the economic cost item of health food; ω k Indicates the blockchain dynamic weight sustainability premium; λ i Indicates the control of loss rate of health food products; η j Represents the dynamic weighted blockchain volatility coefficient; e(X) represents the uncertainty propagation term of health food raw material data; (2) Use the chaotic evolutionary optimization algorithm to read the basic parameters of active ingredients, total bacterial count, pathogenic bacteria count, water activity, temperature, air pressure, mixing uniformity, quantitative analysis of effective ingredients and dissolution rate in the production of health food; incorporate the parameters into the search space and use chaotic systems such as Tent mapping to generate chaotic sequences as initial solutions, introduce chaotic parameters to control the search step size, calculate the fitness of candidate solutions, update the global optimal solution, obtain the maximum value of food qualification rate, and determine whether the iteration termination condition is met. If it is met, output the current qualification rate as the maximum value. Otherwise, regenerate partial solutions through the ergodicity of chaotic mapping and jump out of the local optimum.

6. A blockchain-based traceability system for the quality and safety of health food products according to claim 5, characterized in that: The process of establishing the objective function in step (1) is as follows: (11) Data integration item for health food production environment w k : In the formula, Q global K represents the global production data of the blockchain. k V k This expression represents the key-value pair of the Kth mode. The formula calculates ω in the objective function. k value; Q global =MLP θQ (Concat(S s ,P j )) In the formula, S s P represents the real-time production status. j Indicates regulatory policy code, MLP θQ This represents a multilayer perceptron with output dimension d. q The formula calculates w. k China Q global value: [TO k ,IN k ]=HyperNet φk (Q global ) In the formula, HyperNet φk Represents a hypernetwork, outputting dimensions. Split output representation This formula calculates w. k [K] k V k ]value: After normalization, we get: (12) Blockchain Transportation Environment Network Project In the formula, λ i rude Represents node V i The severity coefficient of blockchain rules, λ i This formula represents the control of the loss rate of health food products. The objective function is calculated using this formula. value; In the formula, θV j →V i It represents edge V j →V i The blockchain causal strength parameter is calculated by this formula. P(V) i =1|Pa(V i ))value; (13) Optimization items for health food process data ∑n j C j (X): In the formula, τ represents the risk tolerance. The Sigmoid function restricts the output to (0,1). This formula calculates ∑n in the objective function. j C j (X) value; (14) Raw material data uncertainty correction term e(X): In the formula, ω k Indicates the blockchain dynamic weight sustainability premium, λ i Indicates the control of loss rate of health food products, η j The formula represents the dynamic weighted blockchain volatility coefficient, and is used to calculate the value of e(X) in the objective function. In the formula, Φ k (t) (X) represents the output of the t-th sample. Predict the mean; this formula calculates σ in e(X). k 2 (X) value; s 2 sensor (X)=tr(S t ) Taking the trace of the residual covariance matrix as the noise intensity, the formula calculates σ in e(X). 2 sensor value; In the formula, s represents the node state (0 / 1), and this formula calculates the Entropy(Ψ) in the function e(X). i (X) value; After adding an uncertainty correction term to the final objective function; F final (X)=F(X)+ò(X) In the formula, F(X) represents value.

7. A blockchain-based traceability system for the quality and safety of health food products according to claim 5, characterized in that: The implementation process of step (2) is as follows: (21) Tent mapping initialization of the population: The basic parameters of the system, including total colony count, pathogenic bacteria count, water activity, temperature, air pressure, mixing uniformity, quantification of active ingredients, and dissolution rate, are represented by particles, and a mixed variable is added to the initial population; the Tent mapping is used to convert it into a chaotic sequence, which is suitable for high-dimensional optimization problems and avoids the periodic interference of the Logistic mapping; the Tent mapping is as follows: In the formula, v k This indicates the value at step k. This represents the total number of colonies; The chaotic sequence generated by the Tent mapping is linearly mapped to the search space of each dimension; that is: In i,j =a j +in k (i) ·(b j -a j ) In the formula, V i,j This represents the quantitative value of the effective component of the i-th individual in the j-th dimension; (22) Function optimization: Introduce the NSGA-III+MOPO hybrid framework. The first 30% of iterations use NSGA-III to generate the initial population, and the next 70% of iterations use MOPO to introduce the DRL policy for gradient updates; that is: In the formula, P t Let V represent the dominance function, j represent the water activity of the health food product, and V represent the water activity of the health food product. i Indicates the quantitative value of the effective ingredients in health food; (23) Update the health food safety coefficient individuals: fitness calculation and elite retention. The fitness value of each health food safety coefficient individual is calculated and then constrained. The top 5% of individuals with the best fitness are selected and directly enter the next generation of the population. In the formula, Indicates the number of pathogenic bacteria; (24) Global Optimal Guidance: By introducing chaotic dynamics, the chaotic fluctuations of α-convergence balance the attraction to the global optimal solution GB and the influence on the current solution X. i The retention of, that is: In the formula, Represents the chaotic parameters generated by the Logistic mapping. σ represents the disturbance amplitude, ò~N(0,1) represents Gaussian noise, and GB represents the health food safety coefficient; (25) Optimize the function to construct the reward function: Transform the objective function into an immediate reward, update the individual position of the health food safety coefficient, and add an L2 regularization term to suppress oscillations: In the formula, λ represents the dissolution rate of health food products, and N... i MGi represents the local mean value, indicating the uniformity of the chemical structure mixing of health food products. (26) Local mean guidance: The local mean MGi reflects the central trend of the local area, balances exploration and development, guides the search direction, and avoids complete reliance on the global optimum; V new =Λ MGi+(1-Λ) V i In the formula, Λ is dynamically generated by the chaotic sequence, and N i Indicates the uniformity of the chemical structure of health food products; (27) Random perturbations; providing exploration capabilities by generating unpredictable jumps in the search space: V new =V i +e·(V rand -V i ) In the formula, X rand This represents a randomly selected individual, and e represents the perturbation coefficient; (28) Utilize chaotic jumps to update the optimal safety factor position for health food products; enhance global exploration and focus on local optimization by leveraging the traversal properties of chaos: V new =V i +δ·(v chaos -0.5)·(ba) In the formula, x chaos The value represents the newly generated chaotic value, and δ represents the intensity of the disturbance that decreases with iteration. (29) Scaling formula; The search range update formula is centered on GB and scaled down exponentially to avoid overfitting caused by a fixed range: the j new GB j -and (t) ·(b j -the j ) b j new =GB j +e (t) ·(b j -a j ) c (t) =γ0·e -λ·t In the formula, e (t) Represents an exponentially decaying function; a j Indicates the ambient temperature of the health food production environment; b j This indicates the air pressure in the production environment of health food products; (210) The position of the health food safety coefficient is updated again, and the robustness of the algorithm is enhanced by combining absolute and relative changes through the chaotic rebirth function; X reset,j =a j +x chaos ·(b j -a j ) In the formula, x chaos This indicates that a chaotic sequence is generated using a Tent mapping; (211) Termination conditions and output; determine whether the algorithm has converged by using the convergence standard function, and confirm the reliability of the results: In the formula; GB( t This indicates that the updated optimal health food safety coefficient is output. (212) Obtain the health food safety coefficient corresponding to the optimal fitness value, that is, the optimal value of the health food safety coefficient under the blockchain-based health food quality and safety traceability system.

8. The blockchain-based traceability system for the quality and safety of health food products according to claim 1, characterized in that: The production data collected by the data acquisition layer module includes the type, quantity, quality, purchase time, supplier information, batch number, production environment temperature, humidity, air pressure, microbial count, and production process of raw materials.

9. The blockchain-based traceability system for the quality and safety of health food products according to claim 1, characterized in that: The process by which the regional blockchain layer module processes production data is as follows: first, the TLS protocol is used to protect communication between nodes; then, sensitive data is encrypted using AES-256 before being uploaded to the chain; next, zero-knowledge proofs or homomorphic encryption technology are used; and finally, data verification and interaction between sub-chains are achieved through smart contracts or relay chains.

10. The blockchain-based traceability system for the quality and safety of health food products according to claim 1, characterized in that: The application layer module includes a consumer query interface for consumer traceability and evaluation: consumers can scan codes to obtain information about the entire product process; consumers can access the application layer query interface by scanning the QR code or barcode on the product packaging to obtain detailed information about the product at each stage of the supply chain; consumers can verify the authenticity of the product by comparing the product information with the data stored on the blockchain. The product's full-process information includes authenticity verification, testing certificates and safety ratings, and consumer feedback; the detailed information obtained includes basic product information, raw material information, production process information, quality testing information, and transportation and warehousing information.

Citation Information

Cited By

  • Real-time tracing quality control system for nutritional ingredients of yak milk powder based on NIR spectrum and AI

    CN121961344A