A traditional Chinese medicine decoction piece origin fresh processing intelligent traceability system
Patent Information
- Application Number
- CN202611020685.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-09
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2046-07-09
AI Technical Summary
传统破坏性取样检测方式无法实现对所有成品个体的品质评估,且检测结果无法与特定个体的加工过程历史直接关联
[0072]在成品环节,采用多光谱成像技术同步获取饮片的外部标识与内部品质特征数据。该技术方案将传统追溯止步于外部信息拓展至对产品内在化学成分分布、水分及潜在缺陷的无损检测与记录。由此,溯源档案的核心构成从过程流转标识转变为包含终端产品自身客观物质状态的完整证据,实现了过程信息与终端质量数据在同一体系下的原生融合。每一份饮片的溯源结论因此具备了表征其内在属性的直接依据,追溯的深度与可信度得以实质提升。
Smart Images

Figure CN122529771B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent manufacturing and traceability technology of traditional Chinese medicine, specifically an intelligent traceability system for processing fresh traditional Chinese medicine decoction pieces at their place of origin. Background Technology
[0002] Currently, most quality traceability systems for prepared Chinese medicinal herbs begin at the warehousing or factory exit stages, relying on manual recording of batch information and affixing of labels. Existing technologies focus on recording logistics and warehousing information, or conducting laboratory testing on samples of finished products, using the test reports as independent quality certification documents. This model leads to missing or distorted information at the source harvesting and key processing stages, creating traceability gaps. The harvesting stage only records the geographical location, lacking objective records of the specific environmental conditions and the initial state of the raw materials at the time of harvesting. In the processing stage, especially during fresh processing at the production site, parameter recording largely relies on manual entry, lacking visual evidence of morphological changes. Process data is fragmented and easily tampered with, failing to accurately and continuously reconstruct the dynamic transformation process of the medicinal materials' morphology and internal properties.
[0003] In the finished product stage of medicinal slices, conventional traceability information only includes external identifiers such as production date, batch number, and manufacturer, which are separate from the testing data characterizing their intrinsic quality. Traditional destructive sampling and testing methods cannot achieve quality assessment of all individual finished products, and the test results cannot be directly linked to the processing history of a specific individual. Therefore, the existing system is unable to cope with the internal quality differences of medicinal slices caused by process fluctuations during fresh processing, and cannot provide a complete and reliable chain of evidence that integrates all process parameters and the final intrinsic quality status from source to finished product. Summary of the Invention
[0004] This invention aims to solve at least one of the technical problems existing in the prior art;
[0005] Therefore, this invention proposes an intelligent traceability system for processing fresh Chinese medicinal herbs at their place of origin, comprising:
[0006] The harvesting sensing module is used to collect real-time environmental parameters of the harvesting site through environmental sensing equipment and to obtain initial appearance image data of the raw medicinal materials through image acquisition equipment.
[0007] The initial certificate generation module is used to generate an initial traceability digital certificate containing harvesting time and space information and visual characteristics of raw materials based on the real-time environmental parameters and initial appearance image data.
[0008] The processing perception module is used to collect processing parameters through sensors deployed at each processing station during the fresh processing stage, and to acquire image data of the morphological changes of medicinal materials at key processing nodes through industrial vision devices.
[0009] The chain-linking module is used to associate and bind the processing parameters and morphological change image data with the initial traceability digital certificate to form a traceability data chain for the processing links;
[0010] The finished product quality inspection module is used to perform multispectral imaging on the finished processed medicinal slices to obtain internal quality characteristic data and external identification information of the finished medicinal slices.
[0011] The traceability archiving module is used to integrate the initial traceability digital certificate, the traceability data chain of the processing stage, and the internal quality characteristic data and external identification information of the finished medicinal slices to construct a complete digital traceability archive of the finished medicinal slices from harvesting to processing, corresponding to the initial traceability digital certificate and the traceability data chain of the processing stage.
[0012] Furthermore, at the medicinal herb harvesting site, real-time environmental parameters of the harvesting area are collected using environmental sensing equipment, and initial appearance image data of the raw medicinal materials are obtained using image acquisition equipment. Specifically:
[0013] Within the planned harvesting plots, multiple soil moisture sensors and air temperature and humidity sensors are deployed to periodically read soil moisture content data and air temperature and humidity data.
[0014] The geographic coordinates of the harvesting operation are located using a global satellite navigation system receiver, and the system time is read as the harvesting timestamp.
[0015] High-definition camera devices are activated simultaneously to take multi-angle photos of the raw medicinal materials that have not been processed after harvesting, so as to obtain initial appearance image data that can clearly characterize the thickness of the roots and stems, the shape of the leaves, the color and the overall integrity of the medicinal materials.
[0016] The soil moisture content data, air temperature and humidity data, geographic coordinates, harvest timestamp, and initial appearance image data collected at the same time are packaged into a single original record of the harvest site.
[0017] Furthermore, based on the real-time environmental parameters and initial appearance image data, an initial traceability digital certificate containing harvesting spatiotemporal information and visual characteristics of the raw materials is generated, specifically as follows:
[0018] Receive the original records from the harvesting site, extract the geographic coordinates and harvesting timestamps from them, and combine them to generate a unique spatiotemporal code for the harvesting event;
[0019] The initial appearance image data is subjected to grayscale conversion and scale normalization processing to extract the texture feature vector and color histogram feature vector of the image.
[0020] The soil moisture content data and air temperature and humidity data are compared with the preset suitable harvesting threshold range of the medicinal materials to generate an environmental suitability assessment label.
[0021] The spatiotemporal encoding of the harvesting event, texture feature vector, color histogram feature vector, and environmental suitability assessment label are all encapsulated into a single data block.
[0022] A hash operation is performed on the data block to generate a unique digital fingerprint. This digital fingerprint, along with the data block, is then written into an immutable distributed ledger node. The record certificate generated by this operation is the initial traceability digital certificate.
[0023] Furthermore, in the fresh processing stage, processing parameters are collected by sensors deployed at each processing station, and image data of morphological changes of the medicinal materials at key processing nodes are acquired through industrial vision devices. Specifically:
[0024] At the cleaning station, the flow rate of the cleaning water and the turbidity of the water after cleaning are collected by flow meter and turbidity sensor.
[0025] At the cutting station, the thickness data of the sliced beverage is detected online by a thickness sensor, which triggers an industrial camera to capture microscopic images of the cut surface.
[0026] At the drying station, temperature distribution data at different depths of the medicinal material pile are collected by an infrared temperature sensor array, and real-time moisture content data of the medicinal material is collected by a moisture analyzer.
[0027] At each critical processing node, when a batch of medicinal materials enters, the initial traceability digital certificate identification code associated with its container is scanned to establish the relationship between processing data and the batch of medicinal materials.
[0028] The water volume data, turbidity data, thickness data, temperature distribution data, real-time moisture content data, and microscopic image data of the corresponding nodes are associated with the scanned initial traceability digital certificate identification code to form a set of original process data arranged in the processing time sequence.
[0029] Furthermore, the processing parameters and morphological change image data are associated and bound with the initial traceability digital certificate to form a processing traceability data chain, specifically as follows:
[0030] Sensor data and image data for each step are extracted from the original process data set in the order of workstations.
[0031] For the cleaning process, the water volume data is compared with the preset water-saving threshold, and the turbidity data is compared with the preset cleanliness standard to generate a cleaning effect evaluation code.
[0032] For the cutting process, the texture clarity and cell damage rate of the microscopic image data are analyzed, and the uniformity of the thickness data is combined to generate a cutting quality evaluation code.
[0033] For the drying process, a drying process evaluation code is generated based on the uniformity of temperature distribution data and the time required for real-time moisture content data to reach the target value.
[0034] The feature summaries of the cleaning effect evaluation code, cutting quality evaluation code, drying process evaluation code, and corresponding microscopic image data are concatenated in the order of processing time.
[0035] The concatenated data sequence is digitally signed and bound to the initial traceability digital certificate to ensure the integrity and non-repudiation of the sequence. The overall data structure after binding is the traceability data chain of the processing link.
[0036] Furthermore, the step of performing multispectral imaging on the processed medicinal slices to obtain internal quality characteristic data and external identification information of the finished medicinal slices specifically involves:
[0037] The finished medicinal slices are conveyed in a single layer through a multispectral imaging chamber on a conveyor belt;
[0038] Inside the multispectral imaging chamber, different wavelengths of light sources are used to sequentially illuminate the medicinal slices, and a high-sensitivity camera simultaneously acquires transmission and reflection image data of the medicinal slices at each wavelength.
[0039] The acquired multi-band image data is registered and fused to reconstruct a characteristic image that reflects the distribution of chemical components inside the medicinal slices;
[0040] Spectral indices related to the medicinal components are extracted from the feature images, and the average value and dispersion of the spectral indices of the finished medicinal slices are calculated as internal quality feature data.
[0041] Meanwhile, character recognition technology is used to read the pre-printed batch number, product name, specifications, and other textual information on the finished product packaging of the herbal medicine slices in the visible light band image, as external identification information.
[0042] Furthermore, by integrating the initial traceability digital certificate, the processing traceability data chain, and the internal quality characteristic data and external identification information of the finished medicinal slices, a complete digital traceability file for the finished medicinal slices from harvesting to processing, corresponding to the initial traceability digital certificate and the processing traceability data chain, is constructed. Specifically:
[0043] Create a structured database record containing the following fields: unique file number, associated initial traceability digital certificate, associated processing traceability data chain, internal quality characteristic data of finished medicinal slices, and external identification information of finished medicinal slices.
[0044] The spatiotemporal code of the harvesting event, the environmental suitability assessment label, and the visual feature vector of the raw materials contained in the initial traceability digital certificate are filled into the corresponding fields of the database record;
[0045] The evaluation codes and image feature summaries of each step in the traceability data chain of the processing steps, sorted by time, are parsed and stored in the database records in a tree structure according to the process steps.
[0046] The average value and dispersion of the spectral index in the internal quality characteristic data, as well as the batch number, product name, etc. in the external identification information, are stored in the quality and identification fields of the database record.
[0047] Perform integrity verification on the constructed database records and generate access hash values for the database records;
[0048] The access hash value is written into the blockchain network for evidence storage, and the database record is marked as read-only and stored in the central traceability server, thereby forming an immutable and complete digital traceability archive.
[0049] Furthermore, after the complete digital traceability archive is constructed, the process also includes a step of reverse verification of information based on the complete digital traceability archive:
[0050] Receive user requests to query traceability codes on finished herbal medicine packaging submitted via terminal devices;
[0051] The corresponding complete digital traceability file is located in the database of the central traceability server based on the traceability code.
[0052] Extract the processing traceability data chain from the complete digital traceability archive, and parse the microscopic image data feature summary of key processing nodes from it;
[0053] Retrieve the corresponding original high-resolution microscopic image data stored in the edge server;
[0054] The feature summary of the microscopic image data is matched and verified with the retrieved original high-resolution microscopic image data to confirm the authenticity and consistency of the summary data in the archive.
[0055] Once verified, the publicly available information in the complete digital traceability archive will be visualized and rendered according to the timeline of the process flow of harvesting, cleaning, cutting, drying, and quality inspection.
[0056] The rendered visual traceability information is pushed to the user's terminal device for display.
[0057] Furthermore, a hash operation is performed on the data block to generate a unique digital fingerprint, and this digital fingerprint, along with the data block, is written into an immutable distributed ledger node, specifically as follows:
[0058] The encapsulated data block containing spatiotemporal encoding of harvesting events, texture feature vectors, color histogram feature vectors, and environmental suitability assessment labels is converted into a binary data stream.
[0059] A secure hash algorithm is used to calculate the binary data stream, generating a fixed-length hash value as the digital fingerprint of the data block;
[0060] Create a new distributed ledger transaction, the contents of which include: the current timestamp, the hash value of the previous ledger block, and the data block to be written this time and its digital fingerprint;
[0061] The distributed ledger transaction is broadcast to a permissioned blockchain network consisting of multiple authoritative nodes;
[0062] Nodes in the network verify and confirm the distributed ledger transactions through a consensus mechanism;
[0063] Once verified, the distributed ledger transaction is packaged into a new block and linked to the existing blockchain, thereby completing the immutable notarization of data and digital fingerprints.
[0064] Furthermore, the feature summary of the microscopic image data is matched and verified with the retrieved original high-resolution microscopic image data, specifically as follows:
[0065] Receive microscopic image data feature summaries of key processing nodes parsed from complete digital traceability archives, as well as corresponding original high-resolution microscopic image data retrieved from the edge server;
[0066] The original high-resolution microscopic image data is processed by a feature point detection and descriptor extraction algorithm to generate a set of first feature descriptor vectors;
[0067] The microscopic image data feature summary is decoded and restored to a set of second feature descriptor vectors generated by the same feature extraction algorithm during data archiving.
[0068] Calculate the similarity metric between the first feature descriptor vector and the second feature descriptor vector;
[0069] The similarity metric is compared with a preset consistency threshold. If the similarity metric is greater than or equal to the preset consistency threshold, the feature matching is determined to be successful, confirming that the summary data in the file is authentic and consistent with the original image. If it is less than the preset consistency threshold, the matching is determined to be unsuccessful, and a data inconsistency alarm is triggered.
[0070] Generate a feature verification report that includes matching results, similarity metrics, verified processing node identifiers, and verification timestamps, and attach the feature verification report to the log record of this query.
[0071] Compared with the prior art, the beneficial effects of the present invention are:
[0072] In the finished product stage, multispectral imaging technology is used to simultaneously acquire external identification and internal quality characteristic data of the medicinal slices. This technical solution expands traditional traceability beyond external information to include non-destructive testing and recording of the product's internal chemical composition distribution, moisture content, and potential defects. As a result, the core structure of the traceability file shifts from process flow identification to complete evidence encompassing the objective material state of the final product itself, achieving native integration of process information and final quality data within the same system. The traceability conclusion for each medicinal slice thus possesses direct evidence characterizing its intrinsic attributes, substantially enhancing the depth and reliability of traceability.
[0073] During the fresh processing stage, sensors and industrial vision devices deployed at each workstation continuously collect processing parameters and images of changes in the morphology of the medicinal materials. The chain-linking module binds these dynamic data streams to the initial digital credentials at the source, constructing a structured traceability data chain for the processing stages. This solution transforms the processing process, which previously relied on manual recording and node control, into a transparent process precisely reproduced by time-series parameters and a continuous visual evidence chain. The process execution status and material morphology transformations during processing are objectively and continuously recorded and solidified, with the data locking together to form a verifiable and tamper-proof digital twin record of the processing process. Attached Figure Description
[0074] Figure 1 This is a timeline diagram of the intelligent traceability system for processing fresh Chinese medicinal herbs at the place of origin as described in this invention.
[0075] Figure 2 A flowchart for data collection at the harvesting site;
[0076] Figure 3 A flowchart for generating the initial traceability digital certificate;
[0077] Figure 4 A radar chart for multi-dimensional quality traceability of the entire process of processing fresh Chinese medicinal herbs;
[0078] Figure 5This is a correlation analysis diagram between environmental parameters and the quality of traceability certificates during the harvesting of Chinese medicinal herbs. Detailed Implementation
[0079] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0080] See Figure 1 This invention provides an intelligent traceability system for fresh processing of traditional Chinese medicine (TCM) decoction pieces. The system includes a harvesting sensing module, an initial certificate generation module, a processing sensing module, a chain structure association module, a finished product quality inspection module, and a traceability archiving module. The harvesting sensing module operates at the TCM harvesting site, collecting real-time environmental parameters such as soil moisture and air temperature and humidity from deployed environmental sensing devices. Simultaneously, it acquires initial appearance image data of the harvested raw materials using image acquisition devices. The initial certificate generation module processes and analyzes the collected real-time environmental parameters and initial appearance image data to generate an initial traceability digital certificate containing information such as harvesting time, location, and visual characteristics of the raw materials.
[0081] The processing sensing module is activated in the subsequent fresh processing stage. It collects processing parameters through a sensor network installed at various processing stations such as washing, cutting, and drying, and uses industrial vision devices to capture image data of morphological changes in the medicinal materials at key processing nodes. The chain-linking module associates the processing parameters and morphological change image data acquired by the processing sensing module with the initial traceability digital certificate generated by the initial certificate generation module, forming a processing stage traceability data chain according to the sequence of processes. The finished product quality inspection module performs multispectral imaging scanning on the final processed medicinal slices to obtain internal quality characteristic data reflecting the distribution of its internal chemical components, as well as external identification information on the packaging. The traceability archiving module integrates the initial traceability digital certificate, the processing stage traceability data chain, and the internal quality characteristic data and external identification information of the finished medicinal slices to construct a complete digital traceability archive covering the entire process from medicinal material harvesting to the completion of medicinal slice processing.
[0082] In one embodiment of the present invention, see [reference] Figure 2In practice, for the harvesting site of Chinese medicinal herbs, multiple soil moisture sensors and air temperature and humidity sensors are deployed within the planned harvesting plots. The soil moisture sensors periodically read the soil moisture content data, and the air temperature and humidity sensors periodically read the air temperature and humidity data. The precise geographical coordinates of the harvesting operation are located using a global satellite navigation system receiver, and the system time is read as the harvesting timestamp. At the same time, high-definition camera devices deployed at the harvesting site are activated to take multi-angle pictures of the raw medicinal materials after harvesting without any treatment, and to obtain initial appearance image data that can clearly characterize the thickness of the roots and stems, the shape of the leaves, the color, and the overall integrity of the medicinal materials. The soil moisture content data, air temperature and humidity data, geographical coordinates, harvesting timestamp, and initial appearance image data collected at the same time are packaged into a single original record of the harvesting site.
[0083] In practice, the density of soil moisture sensors is adjusted according to the area of the harvesting plot and the heterogeneity of the soil. The placement of air temperature and humidity sensors takes into account the height of the plant canopy and ventilation conditions. The global satellite navigation system receiver is activated at the start of the harvesting operation and continuously records the geographic coordinates until the end of the operation. The system timestamp is synchronized with the coordinate record. The high-definition camera device uses a combination of fixed bracket and mobile pan-tilt unit to capture images of the medicinal raw materials from top, side and bottom angles. The initial appearance image data includes color RGB images and near-infrared images.
[0084] In some embodiments, the soil moisture content data is read every minute, and the air temperature and humidity data are read every thirty seconds to ensure the real-time nature of environmental parameters. The global navigation satellite system receiver uses differential positioning technology to improve the accuracy of geographic coordinates. The harvest timestamp is based on Coordinated Universal Time (UTC). The shooting trigger of the high-definition camera is linked to the harvesting action, and a multi-angle shooting sequence is automatically started when the medicinal material is dug out of the soil. In some embodiments, the acquisition of initial appearance image data includes close-up shots of the roots, leaves, and overall morphology of the medicinal material. The image resolution is set to 4096 x 2160 pixels, and the color depth is 24 bits. Soil moisture content data, air temperature data, air humidity data, geographic coordinates, harvest timestamp, and initial appearance image data are synchronized and aligned before packaging, and the clocks of each device are calibrated using the Network Time Protocol (NTP).
[0085] Optionally, when packaging the original records from the harvest site, the soil moisture content data, air temperature data, and air humidity data are normalized. The original sensor readings are converted to values in standard units, geographic coordinate data is converted to latitude and longitude format, and the harvest timestamp is converted to a standard date and time string. The initial appearance image data is compressed and encoded to reduce storage space usage; a lossless compression algorithm is used. Optionally, the data packet structure of the original harvest site records includes header information and a data body. The header information records the data packet version, acquisition device identifier, and checksum. The data body stores the binary stream of soil moisture content data, air temperature data, air humidity data, geographic coordinates, harvest timestamp, and initial appearance image data. The checksum is used to verify the integrity of the data packet during transmission, and the checksum calculation uses a cyclic redundancy check algorithm. It can be understood that the periodic readings from the soil moisture sensor and air temperature and humidity sensor are sent to the local data aggregation unit via a wireless transmission module, while data from the global satellite navigation system receiver and high-definition camera device are transmitted via a wired interface. The local data aggregation unit is responsible for time synchronization and data packaging, generating the original harvest site records, and then uploading them to the central server. Understandably, multi-angle shooting of initial appearance image data ensures comprehensive capture of the visual characteristics of medicinal raw materials. The image data is subsequently used for feature extraction and comparison. Soil moisture content data, air temperature data, and air humidity data are compared with preset thresholds to assess the suitability of the harvesting environment. Geographic coordinates and harvesting timestamps provide a unique spatiotemporal identifier for the harvesting event.
[0086] To ensure data consistency, a formula is used to calculate the integrity check value of the data packet when packing the original records from the harvesting site. The formula is as follows:
[0087]
[0088] in: This represents the check value. Indicates the first in the data packet The value of each data unit, Indicates the corresponding to the first Key constants for each data unit, Indicates the total number of data units. This indicates a bitwise XOR operation. This represents the modulo operation. It is a large prime modulus. Check value An embedded data packet header is used for subsequent verification. In practice, data packets containing original records from the harvesting site are transmitted to the storage system via a secure channel. The storage system records the data packet reception time and source identifier. Data packets are stored using a distributed database to ensure high availability and durability. The original records from the harvesting site serve as the starting point of the traceability chain, linking data to subsequent processing stages. In practice, soil moisture sensors and air temperature and humidity sensors are calibrated regularly to maintain data accuracy. Position data from the global navigation satellite system receiver is corrected against the reference station to eliminate errors. Lens cleaning and focus adjustment of the high-definition camera device are performed before each harvesting operation to ensure image clarity.
[0089] In one embodiment of the present invention, see [reference] Figure 3 In practical implementation, the system receives raw records from the harvesting sensing module. It extracts the geographic coordinates from the global navigation satellite system receiver and the harvesting timestamp in the form of a system timestamp from these records. The latitude and longitude values of the geographic coordinates are concatenated with the date and time string of the harvesting timestamp in a fixed order. A hash function is used to process the concatenated string, generating a unique spatiotemporal code for the harvesting event. In practical implementation, the initial appearance image data in the raw records of the harvesting site undergoes grayscale conversion and scale normalization. Grayscale conversion converts the color image into a single-channel grayscale image, and scale normalization adjusts the image size to a uniform 512 x 512 pixels. The texture feature vector of the processed image is extracted using a local binary mode algorithm. The color histogram feature vector is then used to calculate a joint histogram of hue and saturation in the HSV color space for the normalized image. In practice, the soil moisture content data in the original records of the harvesting site is compared with the preset threshold range of suitable soil moisture content for medicinal materials. The air temperature and humidity data are also compared with the preset threshold range of suitable air temperature and humidity for medicinal materials. An environmental suitability assessment label is generated based on the comparison results. The environmental suitability assessment label is a classification identifier that includes the values of "suitable", "basically suitable" or "unsuitable".
[0090] In some embodiments, the spatiotemporal encoding of the harvesting event is generated using the SHA-256 hash algorithm. The input to the hash algorithm is a string in the format "latitude, longitude, year, month, day, hour, minute, second", and the output is a 64-bit hexadecimal string as the encoding. The texture feature vector is a 256-dimensional real number vector, and the color histogram feature vector is a 72-dimensional integer vector. In some embodiments, the generation logic of the environmental suitability assessment label is as follows: when the soil moisture content data, air temperature data, and air humidity data are all within the preset suitable harvesting threshold range, the label is "suitable"; when any data exceeds the suitable threshold range but is within the relaxed threshold range, the label is "basically suitable"; when any data exceeds the relaxed threshold range, the label is "unsuitable". The preset and relaxed threshold ranges are pre-set according to the specific medicinal herb species.
[0091] Optionally, when encapsulating the spatiotemporal code of the harvesting event, texture feature vector, color histogram feature vector, and environmental suitability assessment label into a single data block, the data block is structured using JSON format. The data block contains fixed field names: the spatiotemporal code of the harvesting event is stored in the "spatial_temporal_code" field, the texture feature vector is stored in the "texture_feature" field, the color histogram feature vector is stored in the "color_histogram" field, and the environmental suitability assessment label is stored in the "environment_fitness_label" field. Optionally, when performing hash operations on the encapsulated data block, the JSON-formatted data block string is converted into a UTF-8 encoded binary data stream. The SHA-256 secure hash algorithm is then used to calculate a 256-bit hash value as the digital fingerprint of the data block. The digital fingerprint is a 64-bit hexadecimal string.
[0092] It can be understood that the write operation of a data block and its digital fingerprint is associated with a distributed ledger transaction. The content of this transaction includes the current timestamp, the block hash of the previous ledger block, the JSON string of the data block, and the digital fingerprint of the data block. The current timestamp is taken from the system clock at the moment the write request was initiated, and the block hash of the previous ledger block is obtained from a locally maintained copy of the blockchain. The broadcast target of this distributed ledger transaction is a permissioned blockchain network composed of multiple authoritative nodes. Nodes in this network are pre-configured and authenticated. The broadcast is completed through a peer-to-peer network protocol, and the consensus mechanism employs a practical Byzantine fault-tolerant algorithm. Node verification of the distributed ledger transaction includes verifying the validity of the digital signature, the transaction format, and the correctness of the hash value.
[0093] The completion of a write operation is marked by the packaging of the transaction into a new block. This new block contains the verified distributed ledger transaction, its own hash value, and the hash value of the previous ledger block. The new block is added to the permissioned blockchain network via a consensus mechanism, forming an immutable record. The record certificate generated on-chain by this write operation is the initial traceability digital certificate. The unique identifier of the initial traceability digital certificate in the system is either the spatiotemporal code of the harvesting event or the digital fingerprint of the corresponding data block. The initial traceability digital certificate is associated with data in subsequent processing stages through this identifier.
[0094] In practical implementation, to enhance the structural consistency of data block encapsulation, the value of each field in the data block undergoes format verification before storage. This verification uses a validation function: for the spatiotemporal encoding of the harvesting event, it verifies whether it is a 64-bit hexadecimal string; for texture feature vectors and color histogram feature vectors, it verifies whether their dimensions conform to a preset value; and for environmental suitability assessment labels, it verifies whether their values are within the allowed set. The success or failure of format verification determines whether the data block is allowed to undergo subsequent hash operations and on-chain operations. The data block encapsulation and verification process involves the serialization of vector data. Serialization converts high-dimensional vectors into a storable and transmittable string format. The serialization method uses Base64 encoding, and the deserialization process occurs when the data needs to be read. The encapsulated data block serves as the core data carrier of the initial traceability digital certificate. Its integrity is guaranteed by a digital fingerprint. The binding relationship between the digital fingerprint and the data block is established by jointly writing both into a distributed ledger transaction. The storage of the distributed ledger transaction in a permissioned blockchain network ensures the immutability and traceability of the initial traceability digital certificate.
[0095] In one embodiment of the present invention, in specific implementation, a flow meter at the cleaning station collects water volume data during the cleaning process, a turbidity sensor collects turbidity data of the water after cleaning, a thickness sensor at the cutting station detects and outputs the thickness data of the cut medicinal slices online, an industrial camera simultaneously captures images when the cutting action is triggered to obtain microscopic image data of the cut surface, an infrared temperature sensor array at the drying station is arranged in a grid to collect temperature distribution data at different depths of the medicinal material pile, and a moisture analyzer collects real-time moisture content data of the medicinal materials in a contact or non-contact manner. At each key processing node, when the container carrying the medicinal material enters the station, an automatic scanning device reads the initial traceability digital certificate identification code attached to the container. After scanning, the system establishes a correlation between the processing parameters and morphological change image data to be generated at the current station and the initial traceability digital certificate identification code obtained by scanning. The original process data set is formed by combining and arranging the water volume and turbidity data collected at the cleaning station, the thickness and microscopic image data collected at the cutting station, the temperature distribution data and real-time moisture content data collected at the drying station, and the initial traceability digital certificate identification code corresponding to each node in the order of processing time.
[0096] In some embodiments, water volume data for the washing process is recorded as cumulative flow in liters, turbidity data is recorded as instantaneous values in NTUs, thickness data for the cutting process is recorded as measured values for each slice in millimeters, microscopic image data is a cross-sectional microscopic image magnified 100 times, temperature distribution data for the drying process is recorded as an array of temperature values from multiple monitoring points within the herb pile, and real-time moisture content data is recorded as a percentage. In some embodiments, the initial traceability digital certificate identification code is scanned using a fixed QR code reader or an RFID reader / writer. The scanning action is automatically triggered when the container enters the sensing area of the workstation. A successful scan signal serves as one of the logical conditions allowing the batch of herbs to begin processing in this stage. The obtained identification code is immediately indexed with the data streams of all sensors at this workstation.
[0097] From the original process data set, sensor and image data for each step—cleaning, cutting, and drying—are extracted in sequence. For the cleaning step, water volume data is compared to the system's preset water-saving threshold, and turbidity data is compared to the system's preset cleanliness standard. The comparison result is converted into a discrete score characterizing the cleaning effect, which is then encoded to generate a cleaning effect evaluation code. For the cutting step, image analysis algorithms are applied to the microscopic image data to calculate the mean image gradient characterizing texture sharpness and the percentage of pixels in the damaged area characterizing cell damage rate. Combined with the uniformity characterized by the standard deviation of the thickness data, a comprehensive evaluation function is used to generate a cutting quality evaluation code. (Comprehensive evaluation function) This function integrates multi-dimensional quantitative indicators of the cutting process into a single evaluation value, which is then mapped to a cutting quality evaluation code. The input to this function includes three core variables: thickness data and standard deviation. Image gradient mean and the percentage of pixels with cell damage Standard deviation of thickness data This reflects the uniformity of the thickness of the cut medicinal slices; the smaller the value, the more consistent the cutting thickness. (Image gradient mean) The value is calculated by performing Sobel edge detection on the microscopic image of the cut surface. A higher value indicates a clearer surface texture and more ideal tool sharpness and cutting action; the percentage of pixels with cell damage... The value, calculated after segmenting cell wall boundaries and performing morphological analysis on microscopic images, indicates that the smaller the value, the less mechanical damage to the cell structure of the medicinal material caused by the cutting process. (Comprehensive evaluation function) The expression is:
[0098]
[0099] in, , , Preset weighting coefficients are assigned to three dimensions: thickness uniformity, texture clarity, and structural integrity. The specific values are pre-calibrated based on the type of medicinal material and processing requirements, and must meet the following criteria: .function For the normalized scoring function of thickness uniformity, when Less than or equal to the preset excellent thickness uniformity threshold hour, ;when Greater than the preset thickness uniformity qualification threshold hour, ;when Between and In between, Calculated using linear interpolation. Function This is a normalized scoring function for texture sharpness, and its calculation method is similar to... Similarly, based on a preset gradient excellence threshold and qualified threshold Perform a piecewise linear mapping. Function For the normalized scoring function of structural integrity, when Less than or equal to the preset excellent threshold for cell damage hour, ;when Greater than the preset cell damage threshold hour, ;when Between and In between, Calculated using linear interpolation. Finally, the comprehensive evaluation function will be... The calculation result is multiplied by 100 and rounded to the nearest integer to obtain a quantitative base value between 0 and 100. This quantitative base value is then compared with a series of preset segmentation thresholds, mapping it to an 8-bit binary code, which is the segmentation quality evaluation code. For example, when the quantitative base value is in the range of 90 to 100, it is mapped to the binary code "00000001", representing "Excellent"; when it is in the range of 80 to 89, it is mapped to "00000010", representing "Good"; and so on, until it is below 60 points, which is mapped to "10000000", representing "Unacceptable".
[0100] For the drying process, the coefficient of variation of temperature values at all monitoring points in the temperature distribution data is analyzed to assess uniformity. The drying time taken for the real-time moisture content to decrease from its initial value to the target moisture content value is recorded. Based on the uniformity coefficient of variation and the degree of conformity between the drying time and the preset process standards, a drying process evaluation code is generated. The generation of the drying process evaluation code first involves calculating the coefficient of variation of the temperature distribution data. and drying time Temperature distribution data was collected by an array of infrared temperature sensors deployed at different depths within the medicinal herb pile, forming a comprehensive... Temperature value array of monitoring points Coefficient of variation for uniformity The calculation formula is:
[0101]
[0102] in, For the first Temperature values at each monitoring point The denominator is the arithmetic mean of the temperature values at all monitoring points, and the standard deviation of the temperature values at all monitoring points is the denominator. The smaller the value, the more uniform the temperature distribution inside the pile of medicinal materials during the drying process. Drying time Defined as the total time elapsed from the start of the drying process until the real-time moisture content data first drops to the preset target moisture content value, in minutes. Subsequently, and The results were compared with preset process standards. The system has a preset threshold for excellent temperature uniformity. and qualified threshold and excellent threshold for drying time and qualified threshold The generation logic of the drying process evaluation code is based on a two-dimensional decision table: when... and When the evaluation code is "00000001", it indicates that the drying process was executed excellently, and the temperature and time were controlled within the optimal range; when but When the evaluation code is "00000010", it indicates excellent temperature uniformity but slightly lower drying efficiency; when and When the evaluation code is "00000100", it indicates that the drying speed is fast but the temperature uniformity needs to be improved; when and When the evaluation code is "00001000", it means that the drying process is generally within the acceptable range; when or When the evaluation code is "10000000", it indicates that the drying process is unqualified, requiring process adjustment or an alarm to be triggered. Different segments of this 8-bit binary code correspond to different process evaluation conclusions.
[0103] Optionally, the generation logic of the cleaning effect evaluation code, cutting quality evaluation code, and drying process evaluation code can all be quantified as a decision tree model based on threshold comparison. The evaluation code itself is an 8-bit binary code, where different bit segments represent evaluation results for different dimensions such as water volume control, cleanliness, thickness uniformity, cell structure integrity, drying temperature uniformity, and drying efficiency. Optionally, the feature summary of the microscopic image data corresponding to the evaluation code refers to a fixed-dimensional feature vector extracted from the original high-resolution microscopic image. Feature extraction uses a scale-invariant feature transform algorithm, and the feature summary is stored in the form of a numerical array to represent the original image in subsequent verification. The scale-invariant feature transform algorithm is a computer vision algorithm used to detect and describe local features in an image. It is robust to image rotation, scale, and illumination changes. In specific implementation, the implementation of this algorithm includes the following steps: First, a Gaussian scale space is constructed for the input original high-resolution microscopic image data, and different scale parameters are used... A Gaussian kernel function is used to convolve the image, generating a series of blurred images with gradually varying scales. A Gaussian difference pyramid is then constructed based on this, used to detect stable extrema at different scales as candidate feature points. Next, each candidate feature point is precisely located by fitting a three-dimensional quadratic function to determine its precise position and scale, eliminating points with low contrast and unstable edge responses to select robust keypoints. Then, one or more principal directions are assigned to each keypoint. Based on the gradient direction histogram of pixels in the keypoint's neighborhood, the peak direction is selected as the keypoint's direction, thus making the descriptor rotation-invariant. Finally, within a specified neighborhood around each keypoint, the coordinate axes are rotated to the keypoint's principal direction, and gradient histograms of 8 directions in 4×4 sub-regions are calculated within this neighborhood, forming a 128-dimensional feature descriptor vector. For all detected features in an image... A key point will produce a A high-dimensional set of feature descriptor vectors. To form a feature summary for storage and subsequent validation, this high-dimensional set undergoes dimensionality reduction and quantization: First, the arithmetic mean of all feature descriptor vectors is calculated, resulting in a 128-dimensional average feature vector; then, each floating-point element in this average feature vector is multiplied by a preset scaling factor and rounded to a 16-bit unsigned integer, generating a fixed-length, 256-byte numerical array. This numerical array is the feature summary of the microscopic image data, representing the key visual features of the original image in a compact and irreversible form. In subsequent validation, the similarity between this feature summary and newly extracted feature summaries from other images is sufficient to determine whether the original image content is consistent, eliminating the need to store and transmit the massive original image data.
[0104] The cleaning effect evaluation code, cutting quality evaluation code, drying process evaluation code, and their corresponding microscopic image data feature summaries are concatenated according to the processing time sequence of cleaning, cutting, and drying, forming an ordered data chain. A digital signature operation is applied to the entire content of this data chain using an asymmetric encryption private key associated with the initial traceability digital certificate. Simultaneously, the unique identifier of the initial traceability digital certificate is embedded in the digital signature payload. The overall data structure completing the digital signature binding constitutes the processing stage traceability data chain. The integrity and authenticity of the processing stage traceability data chain can be verified using the corresponding public key.
[0105] It is understandable that the generation of the cutting quality evaluation code involves comprehensive calculation of thickness data and image data, and its evaluation function can be expressed as:
[0106]
[0107] in: This represents the quantitative baseline value of the cutting quality evaluation code. Based on the standard deviation of thickness data The input function is used to evaluate thickness uniformity. Based on the mean gradient of the image The input function is used to evaluate texture sharpness. Based on the percentage of pixels with cell damage The input function is used to evaluate structural integrity. , , These are the weighting coefficients for each evaluation dimension. It can be understood that the generation of the drying process evaluation code depends on the assessment of temperature uniformity and drying time. Temperature uniformity is determined by calculating the coefficient of variation of the temperature distribution data array. We obtain the coefficient of variation. A smaller value indicates better uniformity and drying time. The drying process evaluation code is calculated directly from the time series of real-time moisture content data. The generation logic is to... and Each value is compared with the preset upper limit of the process.
[0108] In practice, the original process data set is temporarily organized in memory or cache. The processing traceability data chain is finally generated after all preset processing steps are completed for the corresponding batch of medicinal materials. The generated processing traceability data chain, together with the initial traceability digital certificate, serves as a complete digital record of the processing steps for that batch of medicinal materials and is submitted to the traceability archiving module for further processing. The digital signature binding process ensures that once the processing traceability data chain is generated, any tampering with the evaluation code or feature digest within the chain will be detected by the digital signature verification, thus guaranteeing that the association from the processing data to the initial certificate is non-repudiable and tamper-proof.
[0109] In one embodiment of the present invention, the processed medicinal slices are placed on a conveyor belt. The conveyor belt runs at a constant speed, allowing the medicinal slices to pass through a sealed multispectral imaging chamber in a single layer. Inside the multispectral imaging chamber, multiple narrowband light sources of different wavelengths and a high-sensitivity camera are installed. The narrowband light sources sequentially illuminate the passing medicinal slices at specific wavelengths. The high-sensitivity camera flashes synchronously with the light sources, acquiring transmission and reflection image data of the medicinal slices at each wavelength. The acquired multiband image data is registered, aligning the pixel positions of the images acquired at different wavelengths. After alignment, the multiband image data is fused using a principal component analysis algorithm to reconstruct a characteristic image that reflects the spatial distribution of chemical components within the medicinal slices. The specific steps for multiband image data fusion using the principal component analysis algorithm are as follows: First, the aligned multiband image data is organized into a two-dimensional data matrix. Let there be a total of Each band contains five bands (e.g., 450 nm, 550 nm, 650 nm, 750 nm, and 850 nm). Each band image contains... If there are 100 pixels, then the matrix The dimension is OK Each column represents a vector of grayscale values for a band of image across all pixel locations. Then, the matrix... The centering process involves subtracting the arithmetic mean of the gray values in each column to obtain the centered matrix. Next, the centered matrix is calculated. covariance matrix Its dimensions are Covariance matrix elements in Indicates the first The band and the first The covariance between the gray values of an image in each band is calculated using the following formula:
[0110]
[0111] in, For a centralized matrix The Middle Line 1 Column elements, and The first Column and number The centered arithmetic mean of the columns, having already been centered, has a value of 0. Subsequently, the covariance matrix... Perform eigenvalue decomposition and solve for its eigenvalues. and its corresponding eigenvectors Each eigenvalue This represents the magnitude of the variance of the original data contained in the corresponding principal component. Before selection... The eigenvectors corresponding to the largest eigenvalues form a set. dimensional projection matrix ,in The value is usually taken as 1 or 2. Finally, the centered matrix... With projection matrix Multiplying them together yields a new product. dimensional score matrix Score matrix Each column in the image represents a principal component image, where the first principal component image (corresponding to the largest eigenvalue) is... This first principal component image contains information about the largest variance in the original multi-band data, typically reflecting the greatest differences in the absorption and reflection characteristics of different chemical components at different bands. By linearly stretching the pixel grayscale values of this first principal component image to the range of 0-255, a feature image that clearly reflects the spatial distribution differences of chemical components within the medicinal slices can be reconstructed. In this feature image, areas with higher grayscale values correspond to areas rich in chemical components that strongly respond to specific band combinations, while areas with lower grayscale values are the opposite, thus achieving a non-destructive and visual characterization of the internal quality of the medicinal slices.
[0112] From the reconstructed feature image, based on the absorption or reflection bands of the medicinal components of different medicinal materials, the corresponding spectral indices, such as the normalized difference index or ratio index, are calculated. The arithmetic mean and standard deviation of each spectral index of all finished medicinal slices in this batch are then calculated. The arithmetic mean and standard deviation of the spectral indices are used as the internal quality characteristic data of the finished medicinal slices.
[0113] In some embodiments, the multispectral imaging chamber uses light source wavelengths including five bands: 450 nm, 550 nm, 650 nm, 750 nm, and 850 nm. The high-sensitivity camera has an image acquisition resolution of 2048 x 2048 pixels, and the image acquisition interval for each wavelength is 0.5 seconds, ensuring that the finished herbal medicine slices are sequentially illuminated and imaged by light sources of all wavelengths as they pass completely through the imaging chamber. In some embodiments, the spectral index is calculated based on the pixel grayscale values of the feature image in a specific band. For example, for an index designed to characterize the distribution of flavonoid components, its calculation uses a ratio of the reflectance intensity value of the 750 nm band to the reflectance intensity value of the 850 nm band. The spectral index value of each finished herbal medicine slice is the average of the calculated results of all effective pixels within its image area.
[0114] Simultaneously, an optical character recognition (OCR) engine is deployed on the image data acquired in the visible light band. This engine reads pre-printed character information from the finished product packaging, including batch number, product name, specifications, and production date. Successfully recognized character information is used as external identification information. Internal quality characteristic data and external identification information are stored in association and logically linked to the initial traceability digital certificate and processing traceability data chain corresponding to that batch of finished products. Optionally, the recording format of the internal quality characteristic data of the finished products includes multiple fields to store the name, numerical unit, arithmetic mean, standard deviation, and the band formula used to calculate the index for different spectral indices. Optionally, the extraction process of external identification information includes image preprocessing, character region localization, character segmentation and recognition, and result correction steps. The OCR engine employs a recognition model based on a deep learning convolutional neural network, and the recognition result is output as a string.
[0115] Based on the acquired internal quality characteristic data and external identification information, the system creates a structured database record to construct a complete digital traceability archive. This database record includes a unique archive number field, an associated initial traceability digital certificate field, an associated processing stage traceability data chain field, an internal quality characteristic data field for the finished medicinal slices, and an external identification information field for the finished medicinal slices. The spatiotemporal encoding of the harvesting event, environmental suitability assessment label, texture feature vector, and color histogram feature vector encapsulated in the initial traceability digital certificate are parsed and filled into the corresponding fields of the database record. The evaluation codes and image feature summaries of each stage in the processing stage traceability data chain, sorted by time, are parsed, organized into a tree structure according to the processes of cleaning, cutting, and drying, and stored in the database record. The average and standard deviation of each spectral index in the internal quality characteristic data, as well as the batch number, product name, specifications, and production date strings in the external identification information, are stored in the quality and identification fields of the database record (see Table 1).
[0116] Flavonoid Index R750 / R850 ratio 1.23 0.08 Saponin Index (R850-R650) / (R850+R650) none 0.45 0.05 Moisture Index T950 / T1450 ratio 0.67 0.03
[0117] The completed database records undergo integrity verification. This verification checks for null values in all required fields, conformity of data format definitions, and the existence of associated initial traceability digital certificates and processing traceability data chain identifiers. If the verification passes, a hash operation is performed on the entire database record to generate a fixed-length access hash value. This access hash value is then written as part of a notarization transaction into a blockchain network composed of multiple nodes for distributed notarization. Simultaneously, this database record is marked as read-only in the central traceability server, prohibiting any subsequent modifications. This creates an immutable and complete digital traceability archive. The structured storage of the database records is implemented using relational database tables or document-oriented databases. The unique archive number is typically generated by combining a timestamp, origin code, and serial number. The access hash value is generated using the SHA-256 algorithm, and the input to the hash operation is the serialized binary data stream of the entire database record. It is understandable that the evidence transactions written into the blockchain network include not only the access hash value, but also the unique file number and the transaction submission timestamp. The consensus mechanism of the blockchain network ensures that the access hash value is recorded immutably, and the database records marked as read-only in the central traceability server and the access hash value on the chain form a double guarantee.
[0118] In practice, the arithmetic mean of the spectral indices is calculated using the following formula:
[0119]
[0120] in: The arithmetic mean of the spectral indices. This indicates the total number of finished herbal medicine samples included in the calculation for this batch. Indicates the first Calculated spectral index values for each finished product sample of medicinal slices. This represents the summation of spectral index values for all samples. Standard deviation. The calculation is based on the arithmetic mean. With each sample value Subsequent calculations yield the results. The internal quality characteristic data field ultimately stores data containing... and A complete data object with equal statistics.
[0121] See Figure 4This is a multi-dimensional quality traceability radar chart of the entire process of processing fresh Chinese herbal medicine slices, intuitively showing the comprehensive performance of this batch of slices from harvesting, processing to quality inspection. The traceability score of this batch of slices is at a high level in all dimensions (0.4–1.0 range), indicating stable overall quality and a complete and reliable traceability chain. Clearly identifying advantageous aspects such as environmental suitability and drying uniformity allows for the standardization of process parameters into standard operating procedures, improving production stability. The feature matching dimension visually verifies the consistency between image features from the processing stage and the traceability file, ensuring the authenticity and tamper-proof nature of the traceability data. Abnormal fluctuations in scores across various dimensions provide early warning of production risks. The complete multi-dimensional data serves as strong evidence of regulatory compliance, meeting the stringent requirements of traceability supervision for Chinese herbal medicine slices.
[0122] In one embodiment of the present invention, the system receives a query request submitted by a user via a mobile terminal or web terminal. The query request includes a traceability code printed on the finished product packaging of the herbal medicine. The traceability code is typically a one-dimensional barcode or a QR code. The system parses the traceability code to obtain its encoded unique file number or product batch identifier. Based on the parsed identifier, the system performs a retrieval operation in the database of the central traceability server, locating the complete digital traceability file record corresponding to the identifier. The complete digital traceability file record includes fields such as a unique file number, an initial traceability digital certificate, a traceability data chain for the processing stage, internal quality characteristic data, and external identification information. From the located complete digital traceability file, the content of the processing stage traceability data chain field is extracted. The processing stage traceability data chain is a digitally signed data sequence. From this, the microscopic image data feature summary corresponding to the key processing nodes is parsed out. The microscopic image data feature summary is a fixed-dimensional feature vector extracted from the original high-resolution microscopic image data when constructing the data chain.
[0123] In some embodiments, users submit query requests by scanning a QR code on the finished product packaging of the herbal medicine using a mobile terminal's camera. The query request is transmitted to the application programming interface of the central traceability server via an encrypted network channel. The central traceability server's database establishes an index with the unique file number as the primary key, enabling rapid record location. In some embodiments, parsing the microscopic image data feature summary from the traceability data chain of the processing stages requires verifying the digital signature of the data chain to ensure it has not been tampered with. After successful verification, the binary data blocks of feature summaries corresponding to the cleaning, cutting, and drying stages are parsed according to a predetermined data sequence structure. Based on the associated information or metadata recorded in the complete digital traceability archive, the system sends a data retrieval instruction to the edge server or object storage service storing the original high-resolution image. The instruction contains a unique storage identifier for the image data, and the edge server returns the corresponding original high-resolution microscopic image data. The retrieved original high-resolution microscopic image data and the image corresponding to the feature summary recorded in the archive are images of the same processing node, the same batch, and the same field of view.
[0124] Optionally, the feature matching verification process is performed on a central traceability server or a dedicated verification service node, with the original high-resolution microscopic image data loaded into memory as a binary stream. Optionally, the decoding process of the microscopic image data feature summary is the reverse of the serialization storage process, restoring the binary data blocks or encoded strings of the feature summary into a numerical array of feature descriptor vectors. The restoration process requires knowledge of the algorithm and parameters used during feature extraction.
[0125] Feature point detection and descriptor extraction algorithms are performed on the retrieved original high-resolution microscopic image data. Feature point detection uses the SIFT algorithm to locate key points in the image. Descriptor extraction calculates a feature descriptor vector for each key point. The feature descriptor vectors of all key points constitute the first feature descriptor vector set.
[0126] The feature summary of the microscopic image data parsed from the complete digital traceability archive is decoded. The decoding process follows the format and algorithm agreed upon during archiving to reconstruct the feature descriptor vector set generated during archiving, i.e., the second feature descriptor vector set. A similarity metric is calculated between the first and second feature descriptor vector sets. This similarity metric is obtained by comparing the number or distance of matching descriptor pairs in the two sets. It can be understood that the similarity metric for feature descriptor vectors can be calculated using various methods. One method is to use the nearest neighbor distance ratio method to find matching pairs between the two sets of vectors; the proportion of matching pairs to the total number of feature points can be used as the similarity metric. The preset consistency threshold is a value between 0 and 1, for example, 0.85. If the similarity metric is greater than or equal to the preset consistency threshold, the feature match is considered successful, confirming that the summary data stored in the archive is authentic and consistent with the original high-resolution microscopic image data retrieved from the edge server. If the similarity metric is less than the preset consistency threshold, the match is considered unsuccessful, the system triggers a data inconsistency alarm, and the alarm information is recorded in the audit log. (Similarity metric value) The calculation formula can be expressed as:
[0127]
[0128] in: This represents the similarity metric. This represents the number of feature point pairs that successfully match between the first feature descriptor vector set and the second feature descriptor vector set. This represents the total number of feature points in the first feature descriptor vector set. This represents the total number of feature points in the set of second feature descriptor vectors. Indicates taking and The smaller value in the range.
[0129] After successful feature matching verification, the system extracts publicly available traceability information from the complete digital traceability archive. This publicly available information includes harvesting time and location, environmental assessment labels, evaluation codes for each processing stage, internal quality statistics of the finished medicinal slices, and external identification information. This information is organized and visualized according to the natural process flow timeline of harvesting, cleaning, cutting, drying, and quality inspection. The visualization generates elements such as timeline charts, data cards, and image thumbnails. The rendered visual traceability information page or data package is then pushed back to the user's terminal device that submitted the query request via an encrypted network channel, where it is displayed in the terminal device's browser or dedicated application interface.
[0130] Generate a file containing feature matching verification results, which records the success or failure status of the match and the calculated similarity metric. The specific numerical values, the verified processing node identifier, and the timestamp of the verification occurrence are included in this file, which serves as the feature verification report. This report is appended to the complete log record of this query request. The query log record is stored in the log database of the central traceability server for subsequent auditing and analysis. In practice, after a data inconsistency alarm is triggered, the system can send a notification to the administrator via email or instant messaging. The feature matching verification process is transparent to the querying user; the user ultimately only sees either the visual traceability information after successful verification or a notification message indicating verification failure.
[0131] See Figure 5 This is a correlation analysis chart between environmental parameters and traceability certificate quality during the harvesting of traditional Chinese medicine (TCM) decoction pieces. It clearly shows the changes in traceability certificate quality scores of raw materials under different temperature and humidity combinations. It compares the values of soil moisture, air temperature, and air humidity under five typical environmental combinations. Curves reflect the traceability certificate quality corresponding to different environmental combinations, with a score range of 70-100 points. This is a comprehensive assessment of the completeness and reliability of traceability data, including visual characteristics of raw materials and environmental suitability. It can guide production to select "suitable temperature and humidity" or "low temperature and humidity" environments for harvesting, ensuring the quality of raw materials and traceability data from the source. When "high temperature and high humidity" or "high temperature and low humidity" environments are detected, the system can automatically issue warnings, prompting increased accuracy in raw material characteristic collection and reducing the risk of declining traceability certificate quality. It provides data support for setting environmental parameter thresholds during the harvesting of TCM decoction pieces, helping to build a more accurate traceability system.
[0132] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.
Claims
1. A smart traceability system for processing fresh Chinese medicinal herbs at their place of origin, characterized in that, include: The harvesting sensing module is used to collect real-time environmental parameters of the harvesting site through environmental sensing equipment and to obtain initial appearance image data of the raw medicinal materials through image acquisition equipment. The initial certificate generation module is used to generate an initial traceability digital certificate containing harvesting time and space information and visual characteristics of raw materials based on the real-time environmental parameters and initial appearance image data. The processing sensing module is used to collect processing parameters at each processing station during the fresh processing stage, and to acquire image data of morphological changes of medicinal materials at key processing nodes through an industrial vision device. Specifically: at the washing station, the module collects water volume data and turbidity data of the washing water through a flow meter and a turbidity sensor; at the cutting station, the module detects the thickness data of the cut medicinal slices online through a thickness sensor and triggers an industrial camera to capture microscopic image data of the cut surface; at the drying station, the module collects temperature distribution data at different depths of the medicinal material pile through an infrared temperature sensor array and collects real-time moisture content data of the medicinal materials through a moisture meter; at each key processing node, when a batch of raw medicinal materials enters, the module scans the initial traceability digital certificate identification code associated with its carrying container to establish the relationship between processing data and the batch of medicinal materials; the module associates the water volume data, turbidity data, thickness data, temperature distribution data, real-time moisture content data, and the corresponding node's microscopic image data with the scanned initial traceability digital certificate identification code to form a set of original process data arranged in the processing sequence; The chain-structured association module is used to associate and bind the processing parameters and morphological change image data with the initial traceability digital certificate to form a processing link traceability data chain. Specifically, it extracts sensor data and image data of each link from the original process data set according to the workstation sequence; for the cleaning link, it compares the water volume data with the preset water-saving threshold and the turbidity data with the preset cleanliness standard to generate a cleaning effect evaluation code. For the cutting stage, the texture clarity and cell damage rate of the microscopic image data are analyzed, and the uniformity of the thickness data is combined to generate a cutting quality evaluation code. For the drying stage, a drying process evaluation code is generated based on the uniformity of the temperature distribution data and the time required for the real-time moisture content data to reach the target value. The cleaning effect evaluation code, cutting quality evaluation code, drying process evaluation code, and the feature summary of the corresponding microscopic image data are concatenated in the order of processing time. The concatenated data sequence is digitally signed and bound to the initial traceability digital certificate to ensure the integrity and non-repudiation of the sequence. The overall data structure after binding is the processing stage traceability data chain. The finished product quality inspection module is used to perform multispectral imaging on the finished processed medicinal slices to obtain internal quality characteristic data and external identification information of the finished medicinal slices. The traceability archiving module is used to integrate the initial traceability digital certificate, the traceability data chain of the processing stage, and the internal quality characteristic data and external identification information of the finished medicinal slices to construct a complete digital traceability archive of the finished medicinal slices from harvesting to processing, corresponding to the initial traceability digital certificate and the traceability data chain of the processing stage.
2. The intelligent traceability system for processing fresh Chinese medicinal herbs according to claim 1, characterized in that, At the medicinal herb harvesting site, real-time environmental parameters of the harvesting area are collected using environmental sensing equipment, and initial appearance image data of the raw medicinal materials are obtained using image acquisition equipment. Specifically: Within the planned harvesting plots, multiple soil moisture sensors and air temperature and humidity sensors are deployed to periodically read soil moisture content data and air temperature and humidity data. The geographic coordinates of the harvesting operation are located using a global satellite navigation system receiver, and the system time is read as the harvesting timestamp. High-definition camera devices are activated simultaneously to take multi-angle photos of the raw medicinal materials that have not been processed after harvesting, so as to obtain initial appearance image data that can clearly characterize the thickness of the roots and stems, the shape of the leaves, the color and the overall integrity of the medicinal materials. The soil moisture content data, air temperature and humidity data, geographic coordinates, harvest timestamp, and initial appearance image data collected at the same time are packaged into a single original record of the harvest site.
3. The intelligent traceability system for processing fresh Chinese medicinal herbs according to claim 2, characterized in that, Based on the real-time environmental parameters and initial appearance image data, an initial traceability digital certificate containing harvesting spatiotemporal information and raw material visual characteristics is generated, specifically: Receive the original records from the harvesting site, extract the geographic coordinates and harvesting timestamps from them, and combine them to generate a unique spatiotemporal code for the harvesting event; The initial appearance image data is subjected to grayscale conversion and scale normalization processing to extract the texture feature vector and color histogram feature vector of the image. The soil moisture content data and air temperature and humidity data are compared with the preset suitable harvesting threshold range of the medicinal materials to generate an environmental suitability assessment label. The spatiotemporal encoding of the harvesting event, texture feature vector, color histogram feature vector, and environmental suitability assessment label are all encapsulated into a single data block. A hash operation is performed on the data block to generate a unique digital fingerprint. This digital fingerprint, along with the data block, is then written into an immutable distributed ledger node. The record certificate generated by this operation is the initial traceability digital certificate.
4. The intelligent traceability system for processing fresh Chinese medicinal herbs according to claim 1, characterized in that, The process of performing multispectral imaging on the finished processed medicinal slices to obtain internal quality characteristic data and external identification information specifically involves: The finished medicinal slices are conveyed in a single layer through a multispectral imaging chamber on a conveyor belt; Inside the multispectral imaging chamber, different wavelengths of light sources are used to sequentially illuminate the medicinal slices, and a high-sensitivity camera simultaneously acquires transmission and reflection image data of the medicinal slices at each wavelength. The acquired multi-band image data is registered and fused to reconstruct a characteristic image that reflects the distribution of chemical components inside the medicinal slices; Spectral indices related to the medicinal components are extracted from the feature images, and the average value and dispersion of the spectral indices of the finished medicinal slices are calculated as internal quality feature data. Meanwhile, character recognition technology is used to read the pre-printed batch number, product name, specifications, and other textual information on the finished product packaging of the herbal medicine slices in the visible light band image, as external identification information.
5. The intelligent traceability system for processing fresh Chinese medicinal herbs according to claim 1, characterized in that, By integrating the initial traceability digital certificate, the processing traceability data chain, and the internal quality characteristic data and external identification information of the finished medicinal slices, a complete digital traceability file for the finished medicinal slices from harvesting to processing, corresponding to the initial traceability digital certificate and the processing traceability data chain, is constructed. Specifically: Create a structured database record containing the following fields: unique file number, associated initial traceability digital certificate, associated processing traceability data chain, internal quality characteristic data of finished medicinal slices, and external identification information of finished medicinal slices. The spatiotemporal code of the harvesting event, the environmental suitability assessment label, and the visual feature vector of the raw materials contained in the initial traceability digital certificate are filled into the corresponding fields of the database record; The evaluation codes and image feature summaries of each step in the traceability data chain of the processing steps, sorted by time, are parsed and stored in the database records in a tree structure according to the process steps. The average value and dispersion of the spectral index in the internal quality characteristic data, as well as the batch number, product name, etc. in the external identification information, are stored in the quality and identification fields of the database record. Perform integrity verification on the constructed database records and generate access hash values for the database records; The access hash value is written into the blockchain network for evidence storage, and the database record is marked as read-only and stored in the central traceability server, thereby forming an immutable and complete digital traceability archive.
6. The intelligent traceability system for processing fresh Chinese medicinal herbs according to claim 5, characterized in that, After the complete digital traceability archive is constructed, the process also includes a step of reverse verification of information based on the complete digital traceability archive: Receive user requests to query traceability codes on finished herbal medicine packaging submitted via terminal devices; The corresponding complete digital traceability file is located in the database of the central traceability server based on the traceability code. Extract the processing traceability data chain from the complete digital traceability archive, and parse the microscopic image data feature summary of key processing nodes from it; Retrieve the corresponding original high-resolution microscopic image data stored in the edge server; The feature summary of the microscopic image data is matched and verified with the retrieved original high-resolution microscopic image data to confirm the authenticity and consistency of the summary data in the archive. Once verified, the publicly available information in the complete digital traceability archive will be visualized and rendered according to the timeline of the process flow of harvesting, cleaning, cutting, drying, and quality inspection. The rendered visual traceability information is pushed to the user's terminal device for display.
7. The intelligent traceability system for processing fresh Chinese medicinal herbs according to claim 3, characterized in that, A hash operation is performed on the data block to generate a unique digital fingerprint, and this digital fingerprint, along with the data block, is written to an immutable distributed ledger node, specifically as follows: The encapsulated data block containing spatiotemporal encoding of harvesting events, texture feature vectors, color histogram feature vectors, and environmental suitability assessment labels is converted into a binary data stream. A secure hash algorithm is used to calculate the binary data stream, generating a fixed-length hash value as the digital fingerprint of the data block; Create a new distributed ledger transaction, the contents of which include: the current timestamp, the hash value of the previous ledger block, and the data block to be written this time and its digital fingerprint; The distributed ledger transaction is broadcast to a permissioned blockchain network consisting of multiple authoritative nodes; Nodes in the network verify and confirm the distributed ledger transactions through a consensus mechanism; Once verified, the distributed ledger transaction is packaged into a new block and linked to the existing blockchain, thereby completing the immutable notarization of data and digital fingerprints.
8. The intelligent traceability system for processing fresh Chinese medicinal herbs according to claim 7, characterized in that, The feature summary of the microscopic image data is then matched and verified with the retrieved original high-resolution microscopic image data, specifically as follows: Receive microscopic image data feature summaries of key processing nodes parsed from complete digital traceability archives, as well as corresponding original high-resolution microscopic image data retrieved from the edge server; The original high-resolution microscopic image data is processed by a feature point detection and descriptor extraction algorithm to generate a set of first feature descriptor vectors; The microscopic image data feature summary is decoded and restored to a set of second feature descriptor vectors generated by the same feature extraction algorithm during data archiving. Calculate the similarity metric between the first feature descriptor vector and the second feature descriptor vector; The similarity metric is compared with a preset consistency threshold. If the similarity metric is greater than or equal to the preset consistency threshold, the feature matching is determined to be successful, confirming that the summary data in the file is authentic and consistent with the original image. If it is less than the preset consistency threshold, the matching is determined to be unsuccessful, and a data inconsistency alarm is triggered. Generate a feature verification report that includes matching results, similarity metrics, verified processing node identifiers, and verification timestamps, and attach the feature verification report to the log record of this query.
Citation Information
Patent Citations
Traditional Chinese medicinal material processing and production monitoring management system
CN119991149A
Traditional Chinese medicine decoction piece full life cycle data management system and method
CN120996834A
Large health food traceability system and method using plants as main raw materials
CN121481560A
Kitchen food safety tracing method and system
CN122288097A