Traditional Chinese medicine whole industry chain quality tracing and supervision system and method based on block chain technology

By combining blockchain technology with the Internet of Things, a quality traceability and supervision system for the entire Chinese medicine industry chain has been built. This system solves the problems of data silos and shirking of quality responsibility in the Chinese medicine industry chain, realizes transparent sharing of data across the entire chain and accurate prediction of risks, and improves regulatory efficiency and security.

CN120996629APending Publication Date: 2025-11-21HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511003224.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

The traditional Chinese medicine industry chain suffers from data silos, lack of transparency, shirking of quality responsibility, regulatory gaps, and counterfeit and substandard products. Existing technologies are insufficient to achieve closed-loop traceability and dynamic risk warning across the entire chain.

Method used

By combining blockchain technology with IoT and AI, a quality traceability and supervision system for the entire Chinese medicine industry chain is constructed. Through distributed ledger and tamper-proof data storage, data from planting, processing and storage are collected in real time, and the LSTM-random forest hybrid model is used for quality prediction and risk assessment.

Benefits of technology

It has achieved transparent sharing and credibility of data across the entire Chinese medicine industry chain, improved the efficiency of quality and safety risk supervision and the ability to accurately trace back to the source, and ensured the immutability of data and the transparency of supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120996629A_ABST
    Figure CN120996629A_ABST
Patent Text Reader

Abstract

The invention discloses a block chain technology-based traditional Chinese medicine whole industry chain quality tracing and supervision system and method, and the system comprises an upper information supervision module, a traditional Chinese medicine production process module, a public information query module and a warehouse logistics management module, and builds a planting-processing-storage-circulation whole process block chain credible tracing system. Wherein each node data is encrypted and chained through a block chain node, an AI quality evaluation unit is combined to construct a traditional Chinese medicine quality prediction model, and a receiving unit and an analysis processing unit of an upper information supervision module are integrated through a cloud server to realize real-time monitoring of production data by a supervision department. Meanwhile, based on a terminal interface optimization and identity verification unit of the public information query module, a transparent tracing mechanism in which multiple parties participate is constructed. According to the invention, the non-tampering characteristic of the block chain is combined with the real-time acquisition technology of the Internet of Things, AI intelligent analysis is supplemented, the traditional Chinese medicine quality supervision efficiency is effectively improved, and the whole-chain quality safety of the traditional Chinese medicine industry is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a traditional Chinese medicine whole industry chain quality traceability and supervision system and method, and in particular to a traditional Chinese medicine whole industry chain quality traceability and supervision system and method based on blockchain technology. BACKGROUND

[0002] The traditional Chinese medicine industry chain covers planting, harvesting, processing, circulation, sales and other links, and its quality traceability and supervision faces severe challenges: multi-link data form information islands due to scattered collection subjects and standard differences, such as relying on manual paper records for planting, relying on only test reports for processing, and using independent sensor systems for storage, making it difficult to achieve closed-loop traceability throughout the chain. This not only causes key information to be broken, making it impossible to associate pesticide usage, abnormal storage temperature and humidity, and other issues, but also causes quality responsibility to be evaded; at the same time, risk detection relies too much on static sampling of finished products and fixed threshold early warning, which cannot capture the correlation between dynamic environmental fluctuations and historical trends, nor can it predict the risk of loss of effective ingredients or mold of medicinal materials, resulting in economic losses when problems are exposed; and centralized traceability systems are more likely to be tampered with, making it impossible for the public to verify the authenticity and lack of audit, which seriously undermines the credibility of supervision, leading to systematic failure, combined with the problems of counterfeit and substandard, pesticide residues and non-standard processing in the traditional Chinese medicine market, which directly threatens the safety of medication.

[0003] In this context, it is crucial to break down information barriers, achieve multi-party collaboration and ensure data authenticity, and blockchain technology has become a key breakthrough with its distributed ledger, tamper resistance and traceability. It allows growers, pharmaceutical companies, regulatory agencies and other parties to jointly maintain data, supports cross-subject collaboration, and can be combined with the Internet of Things (IoT), 5G and cloud computing to collect dynamic information such as planting environment and processing parameters in real time, automatically upload them to the chain through intelligent devices, and build a trusted and transparent whole-process traceability system to effectively support supervision. With the support of policies and the booming development of AI technology, blockchain combined with standardized dynamic monitoring has shown great potential in reshaping the traditional Chinese medicine quality assurance system. SUMMARY

[0004] The purpose of the present application is to provide a traditional Chinese medicine whole industry chain quality traceability and supervision system and method based on blockchain technology, to realize transparentization and credible sharing of whole-process data for traditional Chinese medicine planting, processing and circulation, to solve quality and safety risks, and to improve supervision efficiency and accurate traceability capabilities.

[0005] Technical solution: The traditional Chinese medicine whole industry chain quality traceability and supervision system based on blockchain technology comprises:

[0006] The traditional Chinese medicine production process module includes planting, processing and storage units, wherein the planting unit is used for collecting soil index data, photosynthesis parameters and air environment data and storing the data in a chain; the processing unit is used for identifying the processing technology standardization, morphological characteristics and chemical composition changes of medicinal materials; and the storage unit is used for ensuring the safety of storage through an environment and security monitoring system;

[0007] The upper information supervision module includes a blockchain node, a cloud server and an access port, is used for receiving the data collected by the traditional Chinese medicine production process module, pre-processing the data, obtaining structured data, storing the data in the cloud server, constructing a traditional Chinese medicine quality prediction model, and predicting and warning the quality risk of traditional Chinese medicine based on historical data and real-time parameters;

[0008] The public information query module is used for receiving a user query request, performing permission hierarchical verification on the identity of a query person, activating a terminal interaction interface after verification, calling encrypted traceability data stored in the blockchain node and rendering a visual graph in real time, and positioning the information of an industry chain node through a space-time axis filter by a user;

[0009] The warehouse logistics management module is used for verifying the compliance of a transportation process through GPS positioning and temperature and humidity sensor data, and synchronizing the data to the blockchain in real time.

[0010] Preferably, the planting unit collects data through soil temperature and humidity sensors, light sensors and environment sensors.

[0011] Preferably, the processing unit integrates an electronic nose, an electronic eye and electrochemical sensing technology, the processing technology standardization of medicinal materials includes the degree of fermentation and the degree of fermentation, the morphological characteristics include the thickness and color of medicinal material slices, and the chemical composition includes effective components and harmful substances.

[0012] Preferably, all query operations in the public information query module initiate verification requests to the blockchain node through an encrypted tunnel and return a non-tamperable record with a time stamp.

[0013] Preferably, the warehouse logistics management module tracks the position, path deviation and vehicle compartment environment parameters of a transportation vehicle in real time, and the data is encrypted and synchronized to the blockchain node.

[0014] The traditional Chinese medicine whole industry chain quality traceability and supervision method based on the blockchain technology comprises the following steps:

[0015] (1) obtaining real-time data and historical quality detection data of planting, processing and storage units, obtaining heterogeneous data including numerical values, images and time sequence signal data, and performing normalization processing on the heterogeneous data;

[0016] (2) According to the normalized historical soil pH value and the content of active ingredients, the authenticity of the data source is verified through the distributed ledger, the correlation coefficient is calculated, the storage risk factor is introduced, the storage standard temperature and humidity threshold is obtained from the block chain, the real-time monitoring of the storage temperature and humidity ratio data is realized through the sensor on-chain, the temperature and humidity fluctuation rate is calculated, and the stability of the storage environment is evaluated;

[0017] (3) A LSTM-random forest hybrid model is used to build a traditional Chinese medicine quality prediction model, the correlation coefficient and the temperature and humidity fluctuation rate are input into the model as key features, and the model is trained;

[0018] (4) According to the trained model, the real-time data is verified and dynamically fed back through the block chain, and the quality is accurately quantified;

[0019] (5) Risk warning threshold judgment.

[0020] Preferably, the correlation coefficient calculation formula of step (2) is as follows:

[0021]

[0022] Wherein, r is the correlation coefficient, x i is the pH value of the i-th block of soil, y i is the content of active ingredients in the i-th block of soil, is the arithmetic mean of variables x i and y i , each x i , y i carries a block chain timestamp;

[0023] The temperature and humidity fluctuation rate is calculated as follows:

[0024]

[0025] Wherein, ΔT / H is the storage temperature and humidity fluctuation rate, T / H rt is the real-time temperature and humidity ratio of the storage, T / H st is the standard temperature and humidity ratio of the storage.

[0026] Preferably, step (3) is specifically:

[0027] Let the time series data collected by the sensor be X={x1,x2,...,x T}, wherein represents the input vector of the t-th time step;

[0028] Divide the data into window length L and step S to generate training samples:

[0029]

[0030] wherein X batch is the batch data after sliding window segmentation, used for model input;

[0031] LSTM is used to process sensor time series data to capture dynamic changes in environmental parameters:

[0032]

[0033] wherein f t represents the forget gate of the LSTM network, i t is the input gate of the LSTM network, C t is the updated cell state, is the candidate cell state, o t is the output gate of the LSTM network, X t is real-time data of sensors or sliding window segmentation, W f , W i , W C , W o are weight matrices in their respective states, b f , b i , b C , b o are bias terms in their respective states, tanh is the hyperbolic tangent activation function, and is the hyperbolic tangent activation function, is the hidden state;

[0034] The hidden state of each time step {h1, h2,..., h L} is retained, and {h1, h2,..., h L} is time series pooled to generate fixed-length features The LSTM output features are concatenated with other structured features:

[0035] z=Concat(h pool ,f struct )

[0036] wherein z is the concatenated fusion feature vector, which is used as the input of the random forest, Concat is the vector concatenation operation, which connects two feature vectors at the beginning and end in the dimension, h pool is the vector after pooling the time series features, is the structured feature vector;

[0037] The concatenated hidden state output by the LSTM is input into the random forest model to predict the traditional Chinese medicine quality risk level or effective component deviation value:

[0038]

[0039] wherein y predThe model predicts the output value, denoted as a continuous numerical value of the quality risk level and the deviation value of the effective component of traditional Chinese medicine, w i The weight of the i-th decision tree, Tree i (h y ) is the prediction result of the i-th decision tree for the input feature h y .

[0040] Preferably, the step (4) calculates the fitness function as follows:

[0041] F module = β1·Plant score + β2·Process score + β3·Store score

[0042]

[0043] Wherein, F module represents the fitness value of the overall quality or performance quantization result of traditional Chinese medicine, β1, β2, β3 are weight coefficients, reflecting the importance of each module to the comprehensive score, Plant score , Process score , Store score are the scores of the planting, processing and storage modules, N soil-surface , N soil-deep , N light , N env are the effective data points of each sensor in the planting module, N total is the total number of data points that should be collected in theory, Corr growth is the absolute value of the correlation coefficient of the soil parameter pH and the growth index of medicinal materials, Acc odor is the recognition accuracy of the electronic nose for the compliance of traditional Chinese medicine processing technology, Acc vision is the machine vision detection accuracy of the electronic eye for the morphology of medicinal materials, Acc chem is the detection error rate of the electrochemical sensor for the content of the effective component of traditional Chinese medicine, EOC is the number of component over-standard, TSN is the total number of detections, Environment com is the compliance rate of traditional Chinese medicine environment, Security acc is the accuracy of traditional Chinese medicine safety alarm, T risk is the risk retention time of traditional Chinese medicine, and λ is the risk attenuation coefficient.

[0044] Preferably, the risk warning threshold is determined, specifically: the comprehensive fitness value F module is taken as the core basis for the production qualified rate y prod , and provides dynamic benchmark data for the real-time risk index R;

[0045] Definition of quality risk index:

[0046] R = a * y prod + b * DeltaT / H

[0047] Wherein, R is the quality risk index, which quantifies the risk level of the current production and storage link, a and b are weight coefficients, reflecting the contribution proportion of production qualified rate y prod and temperature and humidity fluctuation rate DeltaT / H to risk, y prod is the production qualified rate, indicating the proportion of products meeting quality standards;

[0048] Based on historical data distribution, the dynamic adjustment threshold is calculated:

[0049] R threshold = mu R + 3 * sigma R

[0050] Wherein R threshold is the dynamic threshold of traditional Chinese medicine risk warning, indicating the critical value of triggering alarm, mu R is the mean of traditional Chinese medicine historical quality risk index R, and sigma R is the standard deviation of traditional Chinese medicine historical quality risk index R;

[0051] When R>R threshold , the warning is triggered, and the unalterable audit log is generated based on the blockchain, which records the event timestamp, abnormal value and operation context, ensuring that the data is traceable throughout the chain.

[0052] Advantages: compared with the prior art, the present application has the following obvious advantages: the distributed data chain constructed based on the blockchain of the present application can real-time chain solidification of key quality indicators such as heavy metal content in planting soil, processing and processing fire parameter, storage environment fluctuation, etc., to ensure the unalterable nature of data from field to terminal. Relying on the mixed model of LSTM-random forest, dynamic modeling is carried out on multi-dimensional data, including storage temperature and humidity time series fluctuation, soil pH-effective component correlation, etc., to realize accurate prediction of traditional Chinese medicine industry chain quality risk. The present application combines the unalterable characteristics of blockchain with the real-time collection technology of Internet of Things, supplemented by AI intelligent analysis, which effectively improves the quality supervision efficiency of traditional Chinese medicine, and guarantees the quality and safety of traditional Chinese medicine industry throughout the chain. BRIEF DESCRIPTION OF DRAWINGS

[0053] Figure 1 The system structure diagram of the present application.

[0054] Figure 2 The correlation result graph of soil pH and effective component content.

[0055] Figure 3 The storage temperature and humidity fluctuation result graph.

[0056] Figure 4 Time series comparison chart for LSTM-Random Forest model prediction.

[0057] Figure 5 Dynamic early warning chart for important quality risks. DETAILED DESCRIPTION

[0058] The technical solutions of the application are further described below with reference to the drawings.

[0059] The application discloses a traditional Chinese medicine (TCM) whole industry chain quality tracing and supervision system based on a blockchain technology, which comprises an upper information supervision module, a TCM production process module, a public information query module and a warehouse logistics management module.

[0060] The TCM production process module comprises planting, processing and storage units, and the TCM whole industry chain quality tracing system based on the blockchain realizes whole-process management and control through the three units of planting, processing and storage. The planting unit adopts a soil temperature and humidity, light and environment sensor network to dynamically collect soil physical and chemical indexes, photosynthesis parameters and air environment data, and store the data in real time on the chain. The soil physical and chemical indexes include pH value, heavy metal content and the like. The processing unit integrates an electronic nose, an electronic eye and an electrochemical sensing technology to intelligently identify the standardization of processing technology, morphological characteristics and chemical composition changes of medicinal materials. The processing technology standardization includes fire and fermentation degree, and the morphological characteristics include slice thickness and color, and the chemical composition changes include effective components and harmful substances. The storage unit guarantees the safety of storage through an environment and security monitoring system, and the environment and security monitoring system comprises a temperature and humidity sensor, an infrared sensor and a smoke sensor. Abnormal data triggers a blockchain smart contract to give real-time alarms, and the whole-process data is encrypted and stored on the chain to ensure the integrity and credibility of the quality tracing chain.

[0061] The public information query module receives a user query request through an access unit, and verifies the identity of the inquirer through an identity authentication unit integrated with fingerprint recognition or facial biometric authentication. After verification, a terminal interaction interface is activated, which calls the encrypted tracing data stored by the blockchain node and renders a visual graph in real time. The visual graph comprises medicinal material planting environment parameters, processing detection results, storage environment records and logistics circulation tracks. The user positions the whole industry chain node information through a space-time axis filter, and the system automatically associates the batch quality rating generated by an AI quality evaluation unit in the upper information supervision module. All query operations initiate verification requests to the blockchain node through an encrypted tunnel and return a non-tamperable record with a time stamp, so that a transparent tracing system with traceable and verifiable data is realized.

[0062] The warehouse logistics management module integrates GPS positioning and temperature and humidity sensors through a logistics circulation unit, and real-time tracks the position, path deviation and vehicle compartment environment parameters of the transport vehicle, and the data is encrypted throughout and synchronized to the blockchain node, ensuring that the logistics process data cannot be tampered with, while the identity verification unit dynamically verifies the qualifications of the carrier to prevent illegal transportation behavior, and ultimately through the cloud server and the upper supervision module, realizing the whole-process compliance monitoring and risk early warning of traditional Chinese medicine circulation link.

[0063] The upper information supervision module is composed of a blockchain node, a cloud server and an access port, receives sensor data from the planting, processing and storage modules and GPS and temperature and humidity information from the logistics circulation unit through an acceptance unit, the sensor data includes soil temperature and humidity sensors, electrochemical sensors, environmental monitoring sensors, etc., the multi-source heterogeneous data is cleaned, integrated and standardized by an analysis processing unit, a structured database is formed and stored in the cloud server, and the machine learning model built in the AI quality evaluation unit is combined, the quality risk prediction and early warning are carried out based on historical data and real-time parameters, and the real-time parameters include the content of medicinal material effective components and storage environment indexes.

[0064] The application also discloses a traditional Chinese medicine whole industry chain quality tracing and supervision method based on a blockchain technology, and specifically comprises the following steps:

[0065] (1) obtaining real-time data and historical quality detection data of the planting, processing and storage units, obtaining heterogeneous data including numerical value, image and time sequence signal data, and normalizing the heterogeneous data;

[0066]

[0067] Wherein, x is the original data value of the sensor, mu is the mean of the original data set, sigma is the standard deviation of the original data set, x norm is the normalized data value.

[0068] (2) according to the normalized historical soil pH value and the content of effective components, the authenticity of the data source is verified through the distributed ledger, the correlation coefficient is calculated, the storage risk factor is introduced, the storage standard temperature and humidity threshold is obtained from the blockchain, the real-time monitoring of the storage temperature and humidity ratio data is realized through the sensor, the temperature and humidity fluctuation rate is calculated, and the storage environment stability is evaluated.

[0069] The correlation coefficient r of the soil pH value x i and the content of effective components y i in the planting stage is extracted:

[0070]

[0071] Wherein, x i is the pH value of the i-th soil, yi The content of the effective ingredient in the i th block of soil, For the variable x i And y i The arithmetic mean of,

[0072] The warehouse risk factor is introduced, the temperature and humidity fluctuation rate is calculated, the warehouse environment stability is evaluated, and the temperature and humidity fluctuation rate is as follows:

[0073]

[0074] Where, ΔT / H is the warehouse temperature and humidity fluctuation rate, T / H rt The real-time temperature and humidity ratio of the warehouse, T / H st The standard temperature and humidity ratio of the warehouse.

[0075] (3) Using LSTM-random forest hybrid model, build traditional Chinese medicine quality prediction model, put the correlation coefficient and temperature and humidity fluctuation rate as key features into the model, and train the model.

[0076] Let the time series data collected by the sensor be X={x1,x2,...,x T}, Where Xt represents the input vector of the t th time step, and D represents the dimension.

[0077] Divide the data by window length L and step S to generate training samples:

[0078]

[0079] Where, X batch Is the batch data after sliding window segmentation, which is used for model input.

[0080] Use long short-term memory network LSTM to process sensor time series data and capture dynamic changes of environmental parameters:

[0081]

[0082] Where, f t Represents the forget gate of the LSTM network, i t The input gate of the LSTM network, C t The updated cell state, The candidate cell state, o t The output gate of the LSTM network, X t The real-time data of the sensor or sliding window segmentation, such as temperature and humidity and soil value; W f , W i , W C , W o The weight matrix in its state, b f , bi , b C , b o are bias terms in their states, tanh is the hyperbolic tangent activation function, and is the hyperbolic tangent activation function, is the hidden state.

[0083] The hidden state of each time step {h1, h2,..., h L} is reserved, and the time sequence pooling is performed on {h1, h2,..., h L} to generate a fixed-length feature The LSTM output feature is spliced with other structured features including medicinal material types, processing technology, etc.:

[0084] z = Concat(h pool , f struct )

[0085] where z is the spliced fusion feature vector, which is used as the input of the random forest, Concat is the vector splicing operation, which connects two feature vectors at the beginning and end in the dimension, h pool is the vector after the time sequence feature is pooled, is the structured feature vector.

[0086] The spliced hidden state output by the LSTM is input into the random forest model to predict the quality risk level or effective component deviation value:

[0087]

[0088] where y pred is the model prediction output value, which is represented as a continuous numerical value of the traditional Chinese medicine quality risk level and effective component deviation value, w i is the weight of the i-th decision tree, Tree i (h y ) is the prediction result of the i-th decision tree for the input feature h y .

[0089] (4) According to the trained model, the real-time data is verified by the blockchain and the dynamic feedback mechanism to accurately quantify the quality; the fitness function is as follows:

[0090] F module = β1·Plant score + β2·Process score + β3·Store score

[0091]

[0092] where F moduleFitness value representing the overall quality or performance quantization result of traditional Chinese medicine, β1, β2, β3 are weight coefficients, reflecting the importance of each module to the comprehensive score, Plant score , Process score , Store score are the scores of planting, processing, and storage modules respectively, N soil-surface , N soil-deep , N light , N env are the effective data points of each sensor in the planting module, N total is the total number of data points that should be collected in theory, Corr growth is the absolute value of the correlation coefficient of the soil parameter pH value and the growth index of medicinal materials, Acc odor is the recognition accuracy of the electronic nose for the compliance of traditional Chinese medicine processing technology, Acc vision is the machine vision detection accuracy of the electronic eye for the thickness and color of medicinal material slices, Acc chem is the detection error rate of the electrochemical sensor for the content of effective components in traditional Chinese medicine, EOC is the number of component over-standard times, TSN is the total number of detection times, Environment com is the compliance rate of traditional Chinese medicine environment, Security acc is the accuracy of traditional Chinese medicine safety alarm, T risk is the risk retention time of traditional Chinese medicine, λ is the risk attenuation coefficient.

[0093] (5) Risk early warning threshold judgment is performed.

[0094] The comprehensive fitness value F module is the core basis for the production qualified rate y prod , and provides dynamic benchmark data for the real-time risk index R.

[0095] Define the quality risk index:

[0096] R=α·y prod +β·ΔT / H

[0097] Wherein, R is the quality risk index, which comprehensively quantifies the risk level of the current production and storage link, α, β are weight coefficients, reflecting the contribution proportion of production qualified rate y prod and temperature and humidity fluctuation rate ΔT / H to risk, y prod is the production qualified rate, indicating the proportion of products meeting the quality standards.

[0098] Dynamic threshold adjustment: based on historical data distribution calculation

[0099] R threshold =μ R +3σ R

[0100] Among them, R threshold The dynamic threshold for risk warning of traditional Chinese medicine represents the critical value that triggers the alarm, μ. R σ is the mean of the historical quality risk index R of traditional Chinese medicine. R R represents the standard deviation of the historical quality risk index of traditional Chinese medicine.

[0101] When R > R threshold When a warning is triggered, it automatically pushes alerts to regulatory agencies and enterprises. At the same time, it generates an immutable audit log based on blockchain, which fully records the event timestamp, abnormal values ​​and operation context, ensuring that the data is traceable throughout the entire chain, thereby enhancing the timeliness of risk response and regulatory transparency.

[0102] This invention verifies system performance through experiments. All data is generated based on real historical datasets stored on the blockchain and simulation parameters. In the planting stage, 100 sets of soil pH and effective component content data are collected and verified using blockchain timestamps to calculate correlation coefficients. In the storage stage, 100 days of dynamic temperature and humidity fluctuations are simulated, and the real-time deviation rate from the standard thresholds T_std = 25℃ and H_std = 60% is calculated. Model training uses 100 time steps of sensor time-series data, extracts environmental features using LSTM, and concatenates them with structured data such as processing technology data, inputting the data into a random forest to predict quality indicators. Risk warning analyzes the dynamic risk index of 50 production batches, calculated using the threshold formula R0. threshold =μ R +3σ R An alarm was triggered. The algorithm was reproduced using MATLAB 2022b in the experiment.

[0103] like Figure 2 The scatter plot shown visualizes 100 sets of blockchain-verified soil data. The blue scatter points represent measured values ​​from different plots, while the red regression line clearly reveals the positive correlation between pH and active ingredients, indicating a strong correlation between these soil parameters and medicinal herb growth indicators. All data carries a blockchain timestamp, such as the timestamp for plot i. i ,y i This ensures the authenticity of the traceability and provides crucial input for AI-based quality prediction in the planting process. For example... Figure 3 The graph shown simulates 100 days of warehouse environment data. The blue solid line represents temperature fluctuation (standard value 25℃), the red solid line represents humidity fluctuation (standard value 60%), and the dashed lines mark the thresholds. Calculations show that the temperature fluctuation rate is 9.2% with a standard deviation of ±2.3℃, and the humidity fluctuation rate is 6.8% with a standard deviation of ±4.1%. Anomalies automatically trigger blockchain smart contract alerts, indicating dual compliance verification of the GPS and sensors. Data is synchronized to blockchain nodes in real time, supporting dynamic assessment of warehouse risks.

[0104] like Figure 4The illustrated timing diagram compares the LSTM timing processing of the base hybrid model architecture: h t = o t ⊙ tanh(C t ); Random Forest Integration: The quality index prediction performance is shown for 100 time steps. The black solid line is the actual value, the red dashed line is the predicted value, and the blue scatter points highlight the key monitoring sites; the prediction error MAE = 0.062, which proves that the model accurately captures the environmental dynamics, with a window length L set to 10 and a step size S set to 1. The dynamic feedback mechanism activates the blockchain audit log at the deviation point, recording the timestamp and operation context, and achieving full-chain traceability.

[0105] Figure 5 The scatter plot shows the risk formula R = a · y prod + β · ΔT / H and the threshold value R threshold = μ R + 3σ R , analyzing 50 production batch data. The blue circle sequence is the risk index R, and the red dashed line is the dynamic threshold value μ R = 0.65, σ R = 0.12, and the threshold value R threshold = 1.01, with red filled points marking the over-standard batches. When R > 1.01, the system generates an unforgeable warning log containing environmental parameters and timestamps, such as batch #7 temperature and humidity fluctuation rate ΔT / H = 12.5%, indicating the risk response and regulatory transparency enhancement mechanism. All data sources are stored in blockchain encryption, ensuring audit reliability.

[0106] The part of the code for parameter initialization and blockchain storage data is as follows:

[0107] %% 1. Parameter initialization

[0108] alpha = 0.7; % Production pass rate weight coefficient

[0109] beta = 0.3; % Temperature and humidity fluctuation rate weight coefficient

[0110] mu_R = 0.65; % Historical risk index mean

[0111] sigma_R = 0.12; % Historical risk index standard deviation

[0112] R_threshold = mu_R + 3 * sigma_R; % Dynamic threshold value calculation (R_threshold = μ_R + 3σ_R)

[0113] %% 2. Generate blockchain storage data (50 production batches)

[0114] rng; % fixed random seed for reproducibility

[0115] batch = 1:50; % production batch number

[0116] % simulated production pass rate

[0117] y_prod = 0.8 + 0.1*randn(1,50);

[0118] % simulated temperature and humidity fluctuation rate (delta T / H)

[0119] delta_TH = 0.05 + 0.08*rand(1,50);

[0120] % calculate risk index (R = alpha*y_prod + beta*delta_TH)

[0121] R = alpha*y_prod + beta*delta_TH;

[0122] The application relies on the LSTM-random forest hybrid model to dynamically model multi-dimensional data and realize precise prediction of the quality risk of the whole industry chain of traditional Chinese medicine. The unalterable characteristics of the blockchain are combined with the real-time collection technology of the Internet of Things, supplemented by AI intelligent analysis, which effectively improves the quality supervision efficiency of traditional Chinese medicine and guarantees the quality and safety of the whole chain of the traditional Chinese medicine industry.

Claims

1. A quality traceability and supervision system for the entire traditional Chinese medicine industry chain based on blockchain technology, characterized in that, include: The traditional Chinese medicine production process module includes planting, processing, and storage units. The planting unit is used to collect soil index data, photosynthetic parameters, and air environment data for on-chain storage. The processing unit is used to identify the standardization of medicinal material processing techniques, morphological characteristics, and changes in chemical composition. The storage unit is used to ensure warehouse safety through an environmental and security monitoring system. The upper-level information supervision module includes blockchain nodes, cloud servers, and access ports. It is used to receive data collected by the traditional Chinese medicine production process module, preprocess the data, obtain structured data, store it on the cloud server, build a traditional Chinese medicine quality prediction model, and predict and warn of traditional Chinese medicine quality risks based on historical data and real-time parameters. Public information query module: It is used to receive user query requests, perform hierarchical verification of the queryer's identity, and activate the terminal interaction interface after successful verification. This interface calls the encrypted traceability data stored in the blockchain node and renders the visualization map in real time. Users can locate the node information of the entire industry chain through the spatiotemporal axis filter. Warehouse and logistics management module: Used to verify the compliance of the transportation process through GPS positioning and temperature and humidity sensor data, and synchronize the data to the blockchain in real time.

2. The traditional Chinese medicine whole-industry chain quality traceability and supervision system based on blockchain technology according to claim 1, characterized in that, The planting unit collects data through soil temperature and humidity sensors, light sensors, and environmental sensors.

3. The traditional Chinese medicine whole-industry chain quality traceability and supervision system based on blockchain technology according to claim 1, characterized in that, The processing unit integrates electronic nose, electronic eye and electrochemical sensing technology. The standardization of the medicinal material processing technology includes the temperature and degree of fermentation. The morphological characteristics include the thickness and color of the medicinal material slices. The chemical components include active ingredients and harmful substances.

4. The traditional Chinese medicine whole-industry chain quality traceability and supervision system based on blockchain technology according to claim 1, characterized in that, In the public information query module, all query operations send verification requests to the blockchain node through an encrypted tunnel and return an immutable record with a timestamp.

5. A traditional Chinese medicine whole-industry chain quality traceability and supervision system based on blockchain technology as described in claim 1, characterized in that, The warehousing and logistics management module tracks the location of transport vehicles, route deviations, and vehicle environment parameters in real time, with the data encrypted throughout the process and synchronized to the blockchain node.

6. A method for quality traceability and supervision of the entire traditional Chinese medicine industry chain based on blockchain technology, characterized in that, include: (1) Obtain real-time data and historical quality detection data from planting, processing and storage units to obtain heterogeneous data, including numerical, image and time-series signal data, and normalize the heterogeneous data. (2) Based on the normalized historical soil pH value and effective component content, the authenticity of the data source is verified by distributed ledger and the correlation coefficient is calculated; storage risk factors are introduced, storage standard temperature and humidity thresholds are obtained from the blockchain, and the storage temperature and humidity ratio data are monitored in real time and uploaded to the blockchain via sensors to calculate the temperature and humidity fluctuation rate and assess the stability of the storage environment. (3) The LSTM-random forest hybrid model was used to construct a Chinese medicine quality prediction model. The correlation coefficient and temperature and humidity fluctuation rate were used as key features to input into the model for model training. (4) Based on the trained model, the real-time data is verified through blockchain and a dynamic feedback mechanism to accurately quantify the quality; (5) Determine the risk warning threshold.

7. A method for quality traceability and supervision of the entire traditional Chinese medicine industry chain based on blockchain technology as described in claim 6, characterized in that, The formula for calculating the correlation coefficient in step (2) is as follows: Where r is the correlation coefficient, x i Let y be the pH value of the i-th soil sample. i The content of effective components in the i-th soil piece For variable x i and y i The arithmetic mean of each x i y i All carry a blockchain timestamp; The temperature and humidity fluctuation rate is calculated as follows: Where ΔT / H is the temperature and humidity fluctuation rate of the storage facility, T / H rt The real-time temperature and humidity ratio in the warehouse, T / H st This refers to the standard temperature and humidity ratio for warehousing.

8. A method for quality traceability and supervision of the entire traditional Chinese medicine industry chain based on blockchain technology as described in claim 6, characterized in that, Step (3) specifically involves: Let the time-series data collected by the sensor be X = {x1, x2, ..., x...} T },in This represents the input vector at time step t; Data is split using window length L and stride S to generate training samples: Among them, X batch The batch data after the sliding window is segmented is used as model input; LSTM is used to process sensor time-series data to capture dynamic changes in environmental parameters. Among them, f t This represents the forget gate in an LSTM network, i t C is the input gate of the LSTM network. t This represents the updated cell state. For candidate cell state, o t X is the output gate of the LSTM network. t W is a real-time data segmentation for sensors or sliding windows. f W i W C W o These are the weight matrices for each state, b f b i b C b o The terms in each state are the bias terms, tanh is the hyperbolic tangent activation function, and ⊙ is the hyperbolic tangent activation function. It is in a hidden state; Preserve the hidden state {h1,h2,...,h} at each time step. L }, for {h1,h2,...,h L Perform temporal pooling to generate fixed-length features. Concatenate the LSTM output features with other structured features: z=Concat(h pool ,f struct ) Here, the concatenated feature vector z serves as the input to the random forest. Concat is a vector concatenation operation that joins the two feature vectors end-to-end in the same dimension. h pool This is the vector of temporal features after pooling. These are structured feature vectors; The concatenated hidden states from the LSTM output are input into a random forest model to predict the quality risk level or deviation of effective components in traditional Chinese medicine. Where y pred The model's predicted output value is represented by continuous numerical values ​​for the quality risk level and deviation of effective components in traditional Chinese medicine, w. i The weight of the i-th decision tree, Tree i (h y ) represents the input feature h of the i-th decision tree. y The prediction results.

9. A method for quality traceability and supervision of the entire traditional Chinese medicine industry chain based on blockchain technology as described in claim 6, characterized in that, The fitness function is calculated in step (4) as follows: F module =β1·Plant score +β2·Process score +β3·Store score Among them, F module Plant represents the fitness value indicating the overall quality or performance quantification result of traditional Chinese medicine. β1, β2, and β3 are weighting coefficients reflecting the importance of each module to the overall score. score Process score Store score The scores for the planting, processing, and storage modules are N respectively. soil-surface N soil-deep N light N env N represents the number of valid data points for each sensor in the planting module. total The total number of data points that should theoretically be collected, Corr growth Acc represents the absolute value of the correlation coefficient between soil parameter pH and medicinal herb growth indicators. odor To improve the accuracy of electronic nose identification of compliance in traditional Chinese medicine processing techniques, Acc vision To improve the accuracy of machine vision inspection of medicinal material morphology by electronic eyes, Acc chem The detection error rate of the electrochemical sensor for the content of effective components in traditional Chinese medicine, where EOC is the number of times the component exceeded the standard, TSN is the total number of detections, and Environment. com To improve the environmental compliance rate of traditional Chinese medicine, Security acc To improve the accuracy of safety alerts for traditional Chinese medicine, T risk λ represents the residence time of risks associated with traditional Chinese medicine, and λ is the risk attenuation coefficient.

10. A method for quality traceability and supervision of the entire traditional Chinese medicine industry chain based on blockchain technology as described in claim 6, characterized in that, The risk warning threshold determination is specifically based on the comprehensive fitness value F. module As the production qualification rate y prod The core basis is to provide dynamic benchmark data for the real-time risk index R; Define the quality risk index: R=α·y prod +β·ΔT / H Where R is the quality risk index, which comprehensively quantifies the risk level of the current production and warehousing processes, and α and β are weighting coefficients reflecting the production pass rate y. prod The proportion of the contribution of temperature and humidity fluctuation rate ΔT / H to risk, y prod The production qualification rate represents the proportion of products that meet quality standards. Calculate and dynamically adjust the threshold based on historical data distribution: R threshold =μ R +3s R Among them, R threshold The dynamic threshold for risk warning of traditional Chinese medicine represents the critical value that triggers the alarm, μ. R σ is the mean of the historical quality risk index R of traditional Chinese medicine. R R represents the standard deviation of the historical quality risk index of traditional Chinese medicine. When R > R threshold Warnings are triggered in a timely manner, and an immutable audit log is generated based on the blockchain to fully record the event timestamp, abnormal values ​​and operation context, ensuring that the data is traceable throughout the entire chain.

Citation Information

Cited By

  • Integrity verification and quality evaluation method before agricultural Internet of Things data uplink

    CN121456920A

  • Asphalt mixture transportation and paving key parameter abnormity early warning and tracing system

    CN121660621A