A method and system for quality control management of traditional Chinese medicine solid preparations based on big data

By using a three-level collaborative detection system and adaptive feature trees, the problems of low efficiency and limitations of two-dimensional image analysis in the quality control of solid dosage forms of traditional Chinese medicine have been solved, achieving efficient and accurate quality control and process optimization.

CN121721031BActive Publication Date: 2026-05-22GUOJIAN PHARM (SHENZHEN) GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUOJIAN PHARM (SHENZHEN) GRP CO LTD
Filing Date
2026-02-25
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Traditional methods for quality control of solid Chinese medicine preparations are inefficient, have inconsistent standards, and are prone to fatigue, leading to missed detections. Existing two-dimensional image analysis methods have strong limitations and are difficult to achieve in-depth diagnosis and traceability.

Method used

A three-level collaborative detection system based on big data is adopted. The first level of detection screens surface defects, the second level of detection identifies associated defects, and the third level of detection verifies the components. By combining feature trees and adaptive feature weights, intelligent quality control of solid Chinese medicine preparations can be achieved.

Benefits of technology

It has achieved efficient and precise quality control for the mass production of solid Chinese medicine preparations, breaking through the limitations of traditional quality inspection, providing systematic, intelligent and precise capabilities, and providing direct data support for process optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121721031B_ABST
    Figure CN121721031B_ABST
Patent Text Reader

Abstract

The application provides a traditional Chinese medicine solid preparation quality control management method and system based on big data, and belongs to the technical field of data processing. The traditional Chinese medicine solid preparation quality control management method based on big data comprises the following steps: a processing device acquires a target image, and the target image comprises multiple traditional Chinese medicine solid preparation pieces distributed in an array form; the processing device analyzes the target image through primary detection to determine whether the surface of each of the multiple traditional Chinese medicine solid preparation pieces has a quality defect; if it is determined through the primary detection that the surface of at least two traditional Chinese medicine solid preparation pieces has a quality defect, the processing device determines whether the two traditional Chinese medicine solid preparation pieces with the defect association exist in the at least two traditional Chinese medicine solid preparation pieces through secondary detection; and if the two traditional Chinese medicine solid preparation pieces with the defect association exist, the processing device determines whether the composition of the traditional Chinese medicine solid preparation piece in the target region has a defect through tertiary detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method and system for quality control and management of solid dosage forms of traditional Chinese medicine based on big data. Background Technology

[0002] In the modern production of solid dosage forms of traditional Chinese medicine (such as pills, tablets, and plasters), quality control is the core link in ensuring the safety and efficacy of the drugs. Traditional quality inspection mainly relies on manual visual sampling, which suffers from problems such as low efficiency, inconsistent standards, and fatigue leading to missed detections. With the development of machine vision technology, automatic appearance inspection methods based on two-dimensional image analysis have emerged, which identify defects by acquiring surface images of individual embryo slices. However, these methods also have significant limitations. Summary of the Invention

[0003] This invention provides a method and system for quality control and management of solid dosage forms of traditional Chinese medicine based on big data.

[0004] To achieve the above objectives, the present invention adopts the following technical solution:

[0005] Firstly, a big data-based method for quality control management of solid Chinese medicine (TCM) preparations is provided. The method includes: a processing device acquiring a target image, which contains multiple TCM solid preparation flakes distributed in an array. These flakes are obtained by cutting initial TCM solid preparation flakes using a cutting machine and distributing them in an array on a detection plate. The target image is captured by an image acquisition device from above the detection plate. The processing device analyzes the target image through primary detection to determine whether quality defects exist on the surface of each of the multiple TCM solid preparation flakes. If the primary detection determines that at least two of the multiple TCM solid preparation flakes have quality defects on their surfaces... If there is a defect, the processing equipment will use secondary detection to determine whether there are two defect-related solid Chinese medicine (TCM) tablets among at least two TCM tablets. If there are two defect-related solid Chinese medicine tablets, the processing equipment will use tertiary detection to determine whether there are defects in the composition of the solid Chinese medicine tablets in the target area. The solid Chinese medicine tablets in the target area include the two defect-related solid Chinese medicine tablets. If the solid Chinese medicine tablets in the target area also include other solid Chinese medicine tablets besides the two defect-related solid Chinese medicine tablets, then the other solid Chinese medicine tablets are those whose positions are related to the two defect-related solid Chinese medicine tablets among the multiple solid Chinese medicine tablets.

[0006] Therefore, the above method constructs a three-tiered collaborative intelligent detection system encompassing "surface-related-component." Its core effect lies in overcoming the limitations of traditional quality inspection methods, which are often isolated and one-sided. Through progressive analysis, it achieves in-depth diagnosis and tracing of defects. Level 1 detection efficiently screens individual surface defects; Level 2 detection, based on multi-dimensional matching of defect type, location, and severity, intelligently identifies systemic and related defect clusters that may originate from the same equipment malfunction or process anomaly, achieving a leap from "screening out bad spots" to "early warning of production line risks"; Level 3 detection focuses on component verification in high-risk related areas, forming a complete closed-loop judgment from appearance to internal quality. This system significantly improves the systematicness, intelligence, and accuracy of quality control in the mass production of traditional Chinese medicine solid dosage forms, providing direct data support for process optimization.

[0007] Optionally, the processing device analyzes the target image through primary detection to determine whether there are quality defects on the surface of each of the multiple solid Chinese medicine embryo slices. This includes: the processing device performing the following operations based on the primary detection: the processing device divides the target image into multiple sub-images, each sub-image containing one corresponding solid Chinese medicine embryo slice from the multiple solid Chinese medicine embryo slices; for any target sub-image among the multiple sub-images, the target sub-image contains one corresponding target solid Chinese medicine embryo slice from the multiple solid Chinese medicine embryo slices; the processing device extracts a target point cloud from the target sub-image, the point cloud points in the target point cloud containing surface feature points of the target solid Chinese medicine embryo slice; the processing device determines whether there are quality defects on the surface of the target solid Chinese medicine embryo slice by analyzing the point cloud point position distribution; wherein, the point cloud points in the target point cloud represent at least one of the following features of the target solid Chinese medicine embryo slice: color features, texture features, crack features, features of raised positions, or features of recessed positions.

[0008] Therefore, by intelligently segmenting the array image and extracting the 3D point cloud data of each embryo slice, the detection object is upgraded from two-dimensional pixels to a 3D feature set containing rich information such as surface height and texture. The technical effect is that it provides a more accurate and complete data foundation for subsequent analysis, enabling detection to overcome the limitations of two-dimensional images and accurately capture minute 3D morphological anomalies on the surface, thus providing possibilities for subsequent depth quality analysis.

[0009] Optionally, the processing device determines whether there are quality defects on the surface of the target Chinese medicine solid embryo tablet by analyzing the point cloud position distribution. This includes: the processing device aggregating the target point cloud to obtain multiple point cloud points; the processing device constructing a feature tree based on the multiple point cloud points, wherein the feature tree is a recursive structure and the feature tree takes one of the target point cloud points as the root node; and the processing device determining whether there are quality defects on the surface of the target Chinese medicine solid embryo tablet by analyzing the branching trend of the feature tree.

[0010] Therefore, introducing a recursive feature tree to organize discrete point clouds in a structured way transforms disordered point cloud data into a hierarchical, multi-scale data structure. This allows the distribution patterns of surface features (such as undulations and textures) to be clearly represented and quantified through the branching morphology and trends of the tree, laying a crucial data structure foundation for subsequent automated and algorithmic surface quality assessment.

[0011] Optionally, the processing device constructs a feature tree based on multiple point cloud points, including: the processing device determines a multi-dimensional feature weight vector based on the preparation type of the target Chinese medicine solid embryo tablet, wherein the multi-dimensional feature weight vector includes spatial coordinate weight, color feature weight, texture feature weight, and density feature weight; the processing device calculates the adaptive feature distance between every two point cloud points based on the multi-dimensional feature weight vector; the processing device constructs a feature tree by recursively clustering based on the adaptive feature distance, with the point cloud point with the largest feature entropy as the root node, wherein the division of child nodes of each non-leaf node in the feature tree is determined based on the feature homogeneity index of the region represented by each non-leaf node;

[0012] Accordingly, the processing equipment determines whether there are quality defects on the surface of the target solid Chinese medicine (TCM) embryo tablet by analyzing the branching trend of the feature tree. This includes: the processing equipment extracting path feature vectors from the root node to each leaf node in the feature tree, where each path feature vector includes path length, branch angle variance, dimension switching frequency, and the number of similar subtrees; the processing equipment matching the extracted path feature vectors with a preset TCM defect feature library, which contains at least four feature patterns of defects specific to solid TCM embryo tablets: component layering defect pattern, deliquescence and adhesion defect pattern, cracking defect pattern, and uneven color defect pattern; if at least one path feature vector matches any defect pattern in the TCM defect feature library with a matching degree exceeding the matching threshold, the processing equipment determines that there are quality defects on the surface of the target solid TCM embryo tablet and identifies the defect type; if it is determined that there are quality defects on the surface of the target solid TCM embryo tablet, the processing equipment traces the corresponding abnormal subtree in the feature tree based on the defect type and analyzes the node distribution of the abnormal subtree to determine the location and severity level of the defect on the surface of the target solid TCM embryo tablet.

[0013] Therefore, we can see that, firstly, by using adaptive feature weights and distance calculations based on dosage form type, the model can focus on the core quality attributes of different dosage forms (such as the density of pills and the texture of tablets). Secondly, by extracting fractal path features such as path length and branch angle variance, the complex surface structure is accurately characterized. Finally, by matching with a predefined database of defects specific to traditional Chinese medicine (such as delamination, deliquescence, adhesion, and cracking patterns), high-precision classification and identification of defects is achieved, rather than simply determining their presence or absence. Furthermore, this method can also locate defect areas and assess their severity, outputting a refined diagnostic report, thus achieving a leap from "detection" to "diagnosis."

[0014] Optionally, based on the formulation type of the target Chinese herbal solid embryo tablet, a multidimensional feature weight vector is determined, including: if the target Chinese herbal solid embryo tablet is a pill, then the density feature weight is set to be greater than the texture feature weight; if the target Chinese herbal solid embryo tablet is a tablet, then the texture feature weight is set to be greater than the density feature weight; if the target Chinese herbal solid embryo tablet is a dried ointment tablet, then the color feature weight is set to be greater than the spatial coordinate weight.

[0015] This demonstrates that the detection model has achieved intelligent adaptive optimization for different types of solid Chinese medicine preparations. By assigning differentiated feature weights (such as density for pills and texture for tablets) to dried ointments, the system can flexibly and accurately handle products with different physical forms and quality control requirements. This adaptive capability avoids the problem of general algorithms performing poorly on specific dosage forms, significantly improving the system's practicality and detection accuracy in complex Chinese medicine product lines, and reflecting the depth of intelligent and segmented applications.

[0016] Optionally, the processing equipment determines, through secondary detection, whether there are two defect-related solid Chinese medicine (TCM) pellets among at least two TCM pellets. This includes: the processing equipment performing the following operations based on the secondary detection: the processing equipment determines whether there are two TCM pellets with the same defect type among at least two TCM pellets; if there are two TCM pellets with the same defect type, the processing equipment determines whether the two TCM pellets with the same defect type are defect-related based on the location area and severity level of the defects in each of the two TCM pellets with the same defect type.

[0017] Therefore, by first determining whether the defect types are the same, and then further conducting correlation analysis based on their location and severity level, this step transforms the abstract concept of "defect correlation" into a rigorous logical judgment process. Its effect is that it can systematically screen out "embryo pairs" from a batch of individual defects that are highly similar in defect characterization and most likely share a common root cause. This provides high-quality targets for subsequent focused analysis and process tracing, improving the accuracy and efficiency of correlation analysis.

[0018] Optionally, the two solid TCM tablets with the same defect type include a first solid TCM tablet and a second solid TCM tablet. The processing equipment determines whether the two solid TCM tablets with the same defect type are defect-related based on the location and severity level of their respective defects. This includes: the processing equipment determining the defect-derived area of ​​the first solid TCM tablet based on the location and severity level of its defect; the processing equipment further determines whether the two solid TCM tablets with the same defect type are defect-related. Based on the location and severity of the defects in the second batch of solid Chinese medicine (TCM) embryo tablets, the defect-derived areas of the second batch of solid TCM embryo tablets are determined. If the defect-derived areas of the first batch of solid TCM embryo tablets intersect or connect with the defect-derived areas of the second batch of solid TCM embryo tablets, the processing equipment determines that the first batch of solid TCM embryo tablets and the second batch of solid TCM embryo tablets are two batches of solid TCM embryo tablets with related defects. Otherwise, the processing equipment determines that the first batch of solid TCM embryo tablets and the second batch of solid TCM embryo tablets are two batches of solid TCM embryo tablets with unrelated defects.

[0019] Therefore, by dynamically determining the scope of influence (derived area) based on the severity level of a defect, this model transforms the physical severity of a defect into a spatial radius of influence. Its technical advantage lies in its ability to more scientifically and intuitively determine whether two defects are spatially correlated (e.g., whether they are consecutively generated from the same equipment flaw). Compared to simple distance-based judgments, this method incorporates defect intensity information, resulting in more accurate correlation determinations.

[0020] For example, the processing equipment determines the defect-derived region of the first batch of solid Chinese medicine (TCM) embryo tablets based on the location and severity level of the defects. This includes: the processing equipment determines a first circumscribed circle of the location area of ​​the defects in the first batch of solid TCM embryo tablets, and reuses the center of the first circumscribed circle to determine a second circumscribed circle with a first radius corresponding to the severity level of the defects in the first batch of solid TCM embryo tablets, wherein the severity level of the defects in the first batch of solid TCM embryo tablets is positively correlated with the size of the first radius; the processing equipment determines the defect-derived region of the second batch of solid TCM embryo tablets based on the location and severity level of the defects. This includes: the processing equipment determines a third circumscribed circle of the location area of ​​the defects in the second batch of solid TCM embryo tablets, and reuses the center of the third circumscribed circle to determine a fourth circumscribed circle with a second radius corresponding to the severity level of the defects in the second batch of solid TCM embryo tablets, wherein the severity level of the defects in the second batch of solid TCM embryo tablets is positively correlated with the size of the second radius.

[0021] Optionally, the two defect-associated solid TCM tablets include a first solid TCM tablet and a second solid TCM tablet. The processing equipment determines whether there are defects in the composition of the solid TCM tablets in the target area through three-level detection, including: the processing equipment performs the following operations based on the three-level detection: the processing equipment determines the solid TCM tablets in the target area based on the location of the first and second solid TCM tablets; the processing equipment determines whether there are defects in the composition of the solid TCM tablets in the target area.

[0022] This demonstrates that the system achieves precise regional location and initiation of three-level component detection. Once the second-level detection confirms the existence of associated defects, the system no longer performs a full-batch inspection but intelligently concentrates detection resources on the most risky target area (i.e., the area containing the embryo slice with associated defects). This directional and precise triggering mechanism based on the analysis results of the first two levels ensures in-depth verification of systemic component risks while significantly saving detection costs and time, achieving a balance between quality, efficiency, and cost.

[0023] Optionally, the processing device determines the solid Chinese medicine (TCM) embryo slices within the target area based on the locations of the first and second TCM solid embryo slices, including: if the locations of the first and second TCM solid embryo slices are in different rows or columns in an array-like distribution, the processing device determines the target area based on the respective rows and columns of the first and second TCM solid embryo slices; if the locations of the first and second TCM solid embryo slices are in the same row or column in an array-like distribution, the processing device determines the target area based on the column identifier of the first and second TCM solid embryo slices in the same row, or the row identifier of the first and second TCM solid embryo slices in the same column.

[0024] Therefore, two specific and clear rules for determining target areas are provided, ensuring the rigor and feasibility of the three-level detection logic. For the two typical positional relationships of associated defective embryos in the array—"same row / column" and "different row / different column"—methods for determining surrounding risk areas (such as defining rectangular regions or extending rows / columns) are given respectively. The effect is that it transforms the abstract "positional association" into programmable spatial logic, ensuring that the system can automatically and unambiguously delineate the range of high-risk samples requiring further component analysis, thus forming a complete closed loop in the entire three-level detection process.

[0025] In a second aspect, a big data-based quality control and management system for solid dosage forms of traditional Chinese medicine is provided. The system includes processing equipment and is configured to perform the method described in the first aspect.

[0026] Thirdly, a processing apparatus is provided, comprising: a processor and a memory; the memory is used to store a computer program, which, when executed by the processor, causes the processing apparatus to perform the method described in the first aspect.

[0027] In one possible design, the processing device described in the third aspect may further include a transceiver. This transceiver may be a transceiver circuit or an interface circuit. The transceiver can be used for communication between the processing device described in the third aspect and other processing devices.

[0028] In this embodiment of the invention, the processing device described in the third aspect may be a terminal, or a chip (system) or other component or assembly disposed in the terminal, or a system containing the terminal. Attached Figure Description

[0029] Figure 1 A schematic diagram of the architecture of a big data-based quality control and management system for solid dosage forms of traditional Chinese medicine provided in an embodiment of the present invention;

[0030] Figure 2 A schematic diagram illustrating an application scenario of a big data-based quality control and management system for solid dosage forms of traditional Chinese medicine, provided in an embodiment of the present invention.

[0031] Figure 3 A flowchart illustrating a big data-based quality control and management method for solid dosage forms of traditional Chinese medicine, provided as an embodiment of the present invention;

[0032] Figure 4 This is a schematic diagram of the processing device provided in an embodiment of the present invention. Detailed Implementation

[0033] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0034] In this embodiment of the invention, "instruction" can include direct and indirect instructions, as well as explicit and implicit instructions. The information indicated by a certain piece of information is called the information to be instructed. In specific implementation, there are many ways to instruct the information to be instructed, such as, but not limited to, directly instructing the information to be instructed, such as the information to be instructed itself or its index. It can also indirectly instruct the information to be instructed by instructing other information, where there is a correlation between the other information and the information to be instructed. It can also instruct only a part of the information to be instructed, while the other parts are known or pre-agreed upon. For example, the instruction of specific information can be achieved by using a pre-agreed (e.g., protocol-defined) arrangement of various pieces of information, thereby reducing instruction overhead to some extent. Simultaneously, common parts of various pieces of information can be identified and uniformly indicated to reduce the instruction overhead caused by individually indicating the same information.

[0035] Furthermore, the specific indication method can also be any existing indication method, such as, but not limited to, the above-mentioned indication methods and their various combinations. Specific details of various indication methods can be found in existing technologies, and will not be elaborated upon here. As described above, for example, when multiple pieces of information of the same type need to be indicated, the indication methods for different pieces of information may differ. In specific implementation, the required indication method can be selected according to specific needs. This embodiment of the invention does not limit the selected indication method; therefore, the indication methods involved in this embodiment of the invention should be understood to cover various methods that enable the party to be indicated to obtain the information to be indicated.

[0036] It should be understood that the information to be indicated can be sent as a whole or divided into multiple sub-information messages sent separately, and the sending period and / or timing of these sub-information messages can be the same or different. The specific sending method is not limited in this embodiment of the invention. The sending period and / or timing of these sub-information messages can be predefined, for example, according to a protocol, or configured by the sending device by sending configuration information to the receiving device.

[0037] "Predefined" or "pre-configured" can be achieved by pre-saving corresponding codes, tables, or other means that can be used to indicate relevant information in the device. This embodiment of the invention does not limit the specific implementation method. "Saving" can refer to saving in one or more memories. These memories can be separate installations or integrated into the encoder, decoder, processor, or processing device. Alternatively, some memories can be separately installed, while others are integrated into the decoder, processor, or processing device. The type of memory can be any form of storage medium, and this embodiment of the invention does not limit this.

[0038] In this embodiment of the invention, descriptions such as "when," "under the circumstances," "if," and "if" all refer to the device making corresponding processing under certain objective circumstances, and are not limited to a specific time. They do not require the device to make a judgment action during implementation, nor do they imply any other limitations.

[0039] In the description of the embodiments of the present invention, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. "And / or" in the embodiments of the present invention is merely a description of the relationship between the related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of the embodiments of the present invention, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. Additionally, to facilitate a clear description of the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or order of execution, and that "first," "second," etc., are not necessarily different. Furthermore, in the embodiments of this invention, words such as "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this invention should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner for ease of understanding.

[0040] To facilitate understanding of the embodiments of the present invention, firstly, using Figure 1 The following is a detailed explanation of the big data-based quality control and management method for solid Chinese medicine preparations applicable to embodiments of the present invention, using the big data-based quality control and management system for solid Chinese medicine preparations shown in the illustration.

[0041] For example, Figure 1 This is a schematic diagram illustrating the architecture of a big data-based quality control and management system for solid dosage forms of traditional Chinese medicine, provided as an embodiment of the present invention. Figure 1 As shown, the system may include: a processing device and an image acquisition device.

[0042] The processing device can be a terminal with processing capabilities or a chip or chip system that can be installed on the terminal. This terminal device can also be referred to as user equipment (UE), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent, or user device. In the embodiments of this application, the terminal device can be a mobile phone, tablet computer, computer with wireless transceiver capabilities, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal in industrial control, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, vehicle-mounted terminal, RSU with terminal functionality, etc. The terminal device of this application may also be an on-board module, on-board component, on-board chip, or on-board unit that is built into a vehicle as one or more components or units. The vehicle can implement the method provided in this application through the built-in on-board module, on-board component, on-board chip, or on-board unit.

[0043] Figure 2 This is a schematic diagram illustrating an application scenario of a big data-based quality control and management system for solid dosage forms of traditional Chinese medicine, provided as an embodiment of the present invention. For example... Figure 2As shown, the image acquisition device is an integrated optical inspection unit mounted on the inspection plate above the conveyor belt. The core function of the image acquisition device is to provide high-precision, multimodal image data for the subsequent three-level quality control methods. The image acquisition device mainly consists of three core modules: 1) A three-dimensional topography acquisition module, which uses two line laser profile sensors arranged at an angle, based on the principle of triangulation, to rapidly scan as the inspection plate passes by, generating a high-precision three-dimensional point cloud characterizing the microscopic undulations (depressions, protrusions, cracks) of the surface for each preform. 2) A two-dimensional color imaging module: composed of a high-resolution industrial color camera equipped with a telecentric lens and a ring LED light source, which captures images vertically to obtain a global high-definition color image containing all array preforms, serving as the basis for analyzing surface color, texture, and macroscopic defects. 3) (Optional) A spectral information acquisition module, which integrates a line-scanning hyperspectral camera to acquire the reflection spectrum of each spatial point in each narrow band through line-by-line scanning. The image acquisition device obtains the position of the inspection plate in real time through an encoder, and is uniformly scheduled by a programmable logic controller (PLC) to ensure strict synchronization of the acquisition actions of each module and spatial alignment of the data. When the inspection plate arrives at the workstation, 3D scanning continues, while the color camera captures a global image at a specific location, and the hyperspectral camera performs a line scan simultaneously. After processing, the system automatically and precisely registers the 3D point cloud corresponding to each embryo slice with the color image sub-region, and optionally fuses the spectral information of the corresponding region. Finally, for each embryo slice, a data object containing the registered 2D sub-image and 3D feature point cloud (and optional spectral data) is packaged and output, and sent to the processing equipment according to the array index, directly supporting the subsequent three-level inspection and analysis process.

[0044] Figure 3 This is a flowchart illustrating a big data-based quality control and management method for solid dosage forms of traditional Chinese medicine, provided as an embodiment of the present invention. This big data-based quality control and management method for solid dosage forms of traditional Chinese medicine is applicable to the aforementioned system, and the specific process is as follows:

[0045] S201, The processing device acquires the target image.

[0046] The target image contains multiple solid Chinese medicine embryo slices distributed in an array. These multiple solid Chinese medicine embryo slices are obtained by cutting the initial solid Chinese medicine embryo slices with a cutting machine and distributing them in an array on the detection plate. The target image is obtained by an image acquisition device taking pictures of multiple solid Chinese medicine embryo slices from above the detection plate, such as high-precision three-dimensional point clouds and global high-definition color images.

[0047] S202, the processing equipment analyzes the target image through primary detection to determine whether there are quality defects on the surface of each of the multiple solid Chinese medicine embryo slices.

[0048] It should be understood that S202 includes the following steps S1-S3.

[0049] Step S1: The processing device performs the following operations based on the first-level detection: The processing device divides the target image into multiple sub-images, and each sub-image contains one corresponding solid Chinese medicine embryo tablet from multiple sets of solid Chinese medicine embryo tablets. For any target sub-image among the multiple sub-images, the target sub-image contains one corresponding target solid Chinese medicine embryo tablet from multiple sets of solid Chinese medicine embryo tablets.

[0050] Step S2: The processing device extracts the target point cloud from the target sub-image. The point cloud in the target point cloud contains surface feature points of the target Chinese medicine solid embryo slice. The point cloud in the target point cloud represents at least one of the following features of the target Chinese medicine solid embryo slice: color feature, texture feature, crack feature, protrusion feature, or depression feature.

[0051] The target point cloud is the point cloud corresponding to the target sub-image in the high-precision 3D point cloud mentioned above.

[0052] Step S3: The processing equipment analyzes the point cloud location distribution of the target point cloud to determine whether there are quality defects on the surface of the target Chinese medicine solid embryo slice.

[0053] Therefore, by intelligently segmenting the array image and extracting the 3D point cloud data of each embryo slice, the detection object is upgraded from two-dimensional pixels to a 3D feature set containing rich information such as surface height and texture. The technical effect is that it provides a more accurate and complete data foundation for subsequent analysis, enabling detection to overcome the limitations of two-dimensional images and accurately capture minute 3D morphological anomalies on the surface, thus providing possibilities for subsequent depth quality analysis.

[0054] Step S3 is described in detail below.

[0055] First, the processing device aggregates the target point cloud to obtain multiple point cloud points.

[0056] Secondly, the processing device constructs a feature tree based on multiple point cloud points. The feature tree has a recursive structure, with one of the target point cloud points as the root node.

[0057] For example, the processing device determines a multi-dimensional feature weight vector based on the formulation type of the target traditional Chinese medicine solid embryo tablet. This multi-dimensional feature weight vector includes spatial coordinate weights, color feature weights, texture feature weights, and density feature weights. Based on this multi-dimensional feature weight vector, the processing device calculates the adaptive feature distance between every two point cloud points. Using the point cloud point with the largest feature entropy as the root node, the processing device constructs a feature tree through recursive clustering based on the adaptive feature distance. The child node partitioning of each non-leaf node in the feature tree is determined based on the feature homogeneity index of the region represented by each non-leaf node. Specifically, if the target traditional Chinese medicine solid embryo tablet is a pill, the density feature weight is set greater than the texture feature weight; if it is a tablet, the texture feature weight is set greater than the density feature weight; and if it is a dried ointment tablet, the color feature weight is set greater than the spatial coordinate weight. In this way, the detection model achieves intelligent adaptive optimization for different types of traditional Chinese medicine solid formulations. By assigning differentiated feature weights (such as density for pills and texture for tablets) to dried tablets and ointments, the system can flexibly and accurately handle products with different physical forms and quality control requirements. This adaptive capability avoids the problem of general algorithms performing poorly on specific dosage forms, significantly improving the system's practicality and accuracy in complex traditional Chinese medicine product lines, and demonstrating the depth of intelligent and segmented applications.

[0058] In one possible implementation, the processing device first assigns weights to a set of predefined feature dimensions based on the known formulation type of the target Chinese herbal medicine solid tablet (e.g., pills, tablets, or dried ointment tablets), forming a multidimensional feature weight vector W = (α, β, γ, δ). Here, α represents the weight of spatial coordinates (x, y, z), β represents the weight of color features (e.g., RGB values ​​and their gradients in the depth direction), γ represents the weight of texture features (e.g., Local Binary Pattern (LBP) or Histogram of Oriented Gradients), and δ represents the weight of local point cloud density features. The weight allocation is targeted: for pills where the uniformity of component mixing is a concern, δ > γ; for tablets where surface integrity is a concern, γ > δ; and for dried ointment tablets where color uniformity is a concern, β > α. Next, for any two points p_i and p_j in the point cloud, their adaptive feature distance D_adaptive is calculated as follows: D_adaptive(p_i, p_j) = α · ||p_i.spatial - p_j.spatial|| + β · ||p_i.color - p_j.color|| + γ · ||p_i.texture - p_j.texture|| + δ · |p_i.density - p_j.density|. Where ||.|| represents the Euclidean distance or a predefined metric in the corresponding feature space, and |.| represents the absolute value. D_adaptive(p_i, p_j) represents the adaptive feature distance between point cloud points p_i and p_j. This distance integrates the differences in four dimensions: space, color, texture, and density, rather than a simple geometric distance. p_i.spatial and p_j.spatial represent the spatial coordinate features of these two point cloud points, typically in three dimensions. `p_i.color` and `p_j.color` represent the color features of these two point cloud points. They can be values ​​in the RGB color space or other color features (such as grayscale gradients), used to characterize the color distribution on the surface of the embryo slice. `p_i.texture` and `p_j.texture` represent the local density features corresponding to these two point cloud points, usually obtained by calculating the number or sparseness of the distribution of points in the surrounding neighborhood, reflecting the aggregation state of the medicinal material components. Based on this, the processing device constructs a feature tree. In the feature tree construction, the root node is not randomly selected, but rather the point with the largest "feature entropy" is selected from all point cloud points. The feature entropy H of this point is quantified by calculating the sum of the standard deviations of all points in its neighborhood (e.g., within a sphere centered on this point with an initial distance threshold as its radius) across multiple feature dimensions such as color, texture, and density. The point with the largest entropy value means that the changes in its surrounding features are most significant and representative.After determining the root node p_root, the algorithm starts recursive construction: for the current node, points among the remaining points that satisfy D_adaptive(p_current, p_candidate) < T (T is a preset global distance threshold) are classified into its direct child node set. Then, for each newly generated child node, the above process is repeated within the subspace of the point set it belongs to, but the termination condition is that the "feature homogeneity index" of the point set represented by this child node exceeds the threshold. This homogeneity index I_homo is defined as the variance of the adaptive feature distances between all point pairs within the point set. The smaller the variance, the more uniform the area, and no further division is performed. In this way, an adaptive feature tree with different depths and a structure reflecting the internal non-uniform distribution of the embryo slices is constructed.

[0059] Finally, the processing device determines whether there are quality defects on the surface of the target traditional Chinese medicine solid preparation embryo slice by analyzing the branch trend of the feature tree. For example, the processing device extracts the path feature vectors from the root node to each leaf node in the feature tree. Each path feature vector includes path length, variance of branch angles, dimension switching frequency, and the number of similar subtrees; the processing device matches the extracted path feature vectors with a preset traditional Chinese medicine defect feature library, which contains at least four feature patterns of defects unique to traditional Chinese medicine solid preparation embryo slices: ingredient stratification defect pattern, deliquescence adhesion defect pattern, crack defect pattern, and uneven color defect pattern; if there is at least one path feature vector whose matching degree with any defect pattern in the traditional Chinese medicine defect feature library exceeds the matching threshold, the processing device determines that there are quality defects on the surface of the target traditional Chinese medicine solid preparation embryo slice and determines the defect type; if it is determined that there are quality defects on the surface of the target traditional Chinese medicine solid preparation embryo slice, the processing device traces the corresponding abnormal subtree in the feature tree based on the defect type and analyzes the node distribution of the abnormal subtree to determine the position area and severity level of the defect on the surface of the target traditional Chinese medicine solid preparation embryo slice. Thus, first, through the feature weight and distance calculation adaptive to the preparation type, the model can focus on the core quality attributes of different dosage forms (such as the density of pills and the texture of tablets). Second, by extracting fractal path features such as path length and variance of branch angles, the complex surface structure is accurately characterized. Finally, by matching with a predefined traditional Chinese medicine-specific defect feature library (such as stratification, deliquescence adhesion, crack, etc. patterns), high-precision classification and recognition of defects are achieved, rather than just judging whether there are defects. In addition, this method can also locate the defect area and evaluate the severity level, output a refined diagnostic report, and achieve the leap from "detection" to "diagnosis".

[0060] In one possible implementation, for a unique path from the root node to each leaf node, a four-dimensional path feature vector F_path = [L, B, D, S] is extracted. Where: L (path length): the sum of adaptive feature distances of all edges on the path, reflecting the intensity of cumulative feature changes from the surface to the region represented by the leaf node, which can be used to characterize the depth of depressions or convexities. B (branch angle variance): calculating the angles between the child node vectors at each non-leaf node on the path and obtaining the variance of these angles. Small variance indicates consistent texture direction, while large variance or abrupt changes may indicate cracks or boundaries. D (dimensionality switching frequency): counting the number of times the "dominant feature dimension" (i.e., the feature dimension contributing the most in this split, such as color, density, etc.) changes during each partition of the path. High-frequency switching suggests that the region traversed by the path has obvious compositional or feature stratification. S (number of similar subtrees): finding the number of subtrees in the entire tree with a structure similar to the terminal subtree of the path (the subtree rooted at the parent node of the leaf node). Structural similarity is determined by comparing the number of nodes, depth distribution, and branching patterns of two subtrees. A cluster of numerous similar subtrees may indicate the presence of periodic deliquescence adhesion or recurring imprinting defects.

[0061] Subsequently, the processing equipment matches all extracted F_path vectors with a pre-built "Traditional Chinese Medicine Defect Feature Library." This feature library defines at least four typical defect feature patterns in the form of vector templates or discrimination rules: Component stratification pattern: characterized by a D value significantly higher than the average level of qualified samples in the same batch. Deliquescence and adhesion pattern: characterized by abnormally high S values ​​on multiple paths corresponding to local spatial regions, and similar L values ​​for these paths. Cracking pattern: characterized by the presence of a series of nodes with very high B values, and the node numbers (or corresponding spatial coordinates) in the feature tree approximately forming a straight line. Uneven color pattern: characterized by an abnormal distribution of statistical features strongly correlated with the color dimension β in the F_path vector (such as color dimension switching occurring early in the path). Therefore, the matching process is completed by calculating the Mahalanobis distance between the F_path to be tested and each defect pattern template or by using a pre-trained classifier (such as a support vector machine). The matching sensitivity (threshold) is not fixed but dynamically fine-tuned according to the production process parameters of the batch of embryo slices. For example, when the pressing pressure is higher than the normal value, the D value threshold for determining "component stratification" will be lowered accordingly; when the ambient humidity is recorded as high, the S value threshold for determining "deliquescence and adhesion" will be lowered.

[0062] If the matching results confirm the presence of a defect, the processing device will perform further diagnostics. First, based on the feature vector of the successfully matched path, the processing device traces back to the corresponding nodes and subtrees in the feature tree. The original point cloud points corresponding to the leaf nodes of these "abnormal subtrees" are mapped back to 3D space. By calculating their bounding boxes or fitting planes, the precise location region of the defect can be marked on the embryo image (e.g., indicated by a rectangular or polygonal region). Then, to assess the severity of the defect, the processing device calculates two metrics: first, the defect region density, which is the proportion of leaf nodes contained in the abnormal subtree to the total number of leaf nodes in the entire tree; and second, the feature deviation, which is the normalized distance between the abnormal path feature vector F_path and the center of its matched defect pattern template. Combining these two metrics, the processing device classifies the defect severity into three levels: "mild," "moderate," and "severe," and generates a structured quality report containing the defect type, location coordinates, and severity level.

[0063] Therefore, it can be seen that introducing a recursive feature tree to organize discrete point clouds in a structured way can transform disordered point cloud data into a hierarchical, multi-scale data structure. This allows the distribution patterns of surface features (such as undulations and textures) to be clearly characterized and quantified through the branching morphology and trends of the tree, laying a key data structure foundation for the subsequent realization of automated and algorithmic surface quality assessment.

[0064] S203, if the primary inspection determines that at least two of the multiple samples of solid Chinese medicine embryo tablets have surface quality defects, the processing equipment shall use the secondary inspection to determine whether there are two samples of solid Chinese medicine embryo tablets with defects associated with each other.

[0065] Specifically, the processing equipment performs the following operations based on the secondary detection:

[0066] The processing equipment determines whether at least two samples of solid Chinese medicine embryo tablets have the same type of defect.

[0067] If there are two Chinese medicine solid embryo tablets with the same defect type, the processing equipment determines whether the two Chinese medicine solid embryo tablets with the same defect type are defect-related based on the location and severity level of the defects in each of the two Chinese medicine solid embryo tablets with the same defect type.

[0068] Therefore, by first determining whether the defect types are the same, and then further conducting correlation analysis based on their location and severity level, this step transforms the abstract concept of "defect correlation" into a rigorous logical judgment process. Its effect is that it can systematically screen out "embryo pairs" from a batch of individual defects that are highly similar in defect characterization and most likely share a common root cause. This provides high-quality targets for subsequent focused analysis and process tracing, improving the accuracy and efficiency of correlation analysis.

[0069] For example, two solid Chinese medicine embryo tablets with the same defect type include a first solid Chinese medicine embryo tablet and a second solid Chinese medicine embryo tablet. The processing equipment determines the defect-derived region of the first solid Chinese medicine embryo tablet based on the location area and severity level of the defect. For example, the processing equipment determines a first circumcircle of the location area of ​​the defect of the first solid Chinese medicine embryo tablet, and reuses the center of the first circumcircle. Using a first radius corresponding to the severity level of the defect of the first solid Chinese medicine embryo tablet, a second circumcircle is determined. The severity level of the defect of the first solid Chinese medicine embryo tablet is positively correlated with the size of the first radius. The processing equipment determines the defect-derived region of the second batch of solid Chinese medicine (TCM) embryo tablets based on the location and severity level of the defects. For example, the equipment determines a third circumcircle connecting the location of the defects in the second batch of solid TCM embryo tablets. Using the center of this third circumcircle and a second radius corresponding to the severity level of the defects in the second batch of solid TCM embryo tablets, a fourth circumcircle is determined. The severity level of the defects in the second batch of solid TCM embryo tablets is positively correlated with the size of the second radius. If the defect-derived region of the first batch of solid TCM embryo tablets intersects or connects with the defect-derived region of the second batch of solid TCM embryo tablets, the processing equipment determines that the first and second batches of solid TCM embryo tablets are defect-related. Otherwise, the processing equipment determines that the first and second batches of solid TCM embryo tablets are defect-unrelated.

[0070] Therefore, by dynamically determining the scope of influence (derived area) based on the severity level of a defect, this model transforms the physical severity of a defect into a spatial radius of influence. Its technical advantage lies in its ability to more scientifically and intuitively determine whether two defects are spatially correlated (e.g., whether they are consecutively generated from the same equipment flaw). Compared to simple distance-based judgments, this method incorporates defect intensity information, resulting in more accurate correlation determinations.

[0071] S204 If two Chinese herbal solid embryo tablets are associated with defects, the processing equipment will determine whether there are defects in the composition of the Chinese herbal solid embryo tablets in the target area through three-level detection.

[0072] The target area includes two solid Chinese medicine embryo tablets associated with the defect. If the target area also includes other solid Chinese medicine embryo tablets besides the two solid Chinese medicine embryo tablets associated with the defect, then the other solid Chinese medicine embryo tablets are those whose positions are associated with the two solid Chinese medicine embryo tablets associated with the defect among the multiple solid Chinese medicine embryo tablets.

[0073] For example, the two defect-associated traditional Chinese medicine solid embryo tablets mentioned above include a first traditional Chinese medicine solid embryo tablet and a second traditional Chinese medicine solid embryo tablet. The processing equipment performs the following operations according to the three-level detection:

[0074] The processing equipment determines the target area of ​​solid Chinese medicine (TCM) embryos based on the locations of the first and second TCM embryos. Specifically, if the first and second TCM embryos are located in different rows or columns of an array, the processing equipment determines the target area based on their respective rows and columns. For example, if the first TCM embryo is located in row 1, column 1, and the second TCM embryo is located in row 2, column 4, the target area is row 1 to row 2 and column 1 to column 4, containing 8 TCM embryos: 4 TCM embryos in column 1 of row 1 and 4 in column 4 of row 2. If the first and second pieces of solid Chinese medicine flakes are located in the same row or column in an array, the processing device determines the target area based on the column identifier of the first and second pieces of solid Chinese medicine flakes in the same row, or the row identifier of the first and second pieces of solid Chinese medicine flakes in the same column. For example, if the first solid herbal embryo tablet is located in row 1, column 1 of an array, and the second solid herbal embryo tablet is located in row 1, column 2, the target area is the first row, column 1 to column 2, containing two solid herbal embryo tablets: the first and the second. Alternatively, if the first solid herbal embryo tablet is located in row 1, column 1, and the second is located in row 1, column 3, the target area is the first row, column 1 to column 3, containing three solid herbal embryo tablets: the first, the second, and the first column, column 2. Thus, methods for determining the surrounding risk area (such as defining a rectangular area or extending rows / columns) are provided for the two typical positional relationships of associated defective embryo tablets in the array: "same row / column" and "different rows / columns". Its effect is to transform the abstract "location association" into programmable spatial logic, ensuring that the system can automatically and unambiguously delineate the range of high-risk samples that require further component analysis, thus forming a complete closed loop in the entire three-level detection process.

[0075] The processing equipment determines whether there are defects in the composition of solid Chinese medicine embryo slices within the target area.

[0076] For example, the processing device calls the data acquired by the optional hyperspectral imaging module in the image acquisition device, extracts the hyperspectral images of the corresponding areas of each embryo slice in the target area, and obtains its reflectance spectral curves under hundreds of continuous narrow bands to form a spectral feature vector. Subsequently, the processing device inputs the spectral feature vector of each embryo slice into a pre-trained deep convolutional neural network model. This model is trained on a large number of known qualified and unqualified Chinese medicine embryo slice samples (covering typical component defects such as abnormal ratios of different medicinal materials, uneven mixing, and mold contamination). It can automatically learn from complex spectra and extract deep abstract features that are strongly related to chemical components. The model finally outputs the "component abnormality probability value" and the most likely defect type for each embryo slice. At the same time, the device combines the defect correlation determined by the secondary detection (such as the spatial distribution pattern of associated defects) to perform spatial correlation analysis on the component abnormality results of all embryo slices in the target area. If the associated defective embryo slices and their surrounding embryo slices generally show similar component abnormality characteristics, it is comprehensively determined that there is a systematic component defect in the target area, and a diagnostic report containing the specific defective embryo slice location, abnormal component indicators, and possible causes (such as uneven mixing of raw materials) is generated. In this way, it achieves precise regional positioning and initiation of three-level component detection. When the second-level detection confirms the existence of associated defects, the system no longer performs a full-batch general inspection, but intelligently concentrates detection resources on the most risky target area (i.e., the area containing the embryo slice with associated defects). This directional and precise triggering mechanism based on the analysis results of the first two levels ensures in-depth verification of systemic component risks while greatly saving detection costs and time, achieving a balance between quality, efficiency, and cost.

[0077] In summary, the above method constructs a three-tiered collaborative intelligent detection system encompassing surface, correlation, and composition. Its core effect lies in overcoming the limitations of traditional quality inspection methods, which are often isolated and one-sided. Through progressive analysis, it achieves in-depth diagnosis and tracing of defects. Level 1 detection efficiently screens individual surface defects; Level 2 detection, based on multi-dimensional matching of defect type, location, and severity, intelligently identifies systemic and correlated defect clusters that may originate from the same equipment malfunction or process anomaly, achieving a leap from "screening out bad spots" to "early warning of production line risks"; Level 3 detection focuses on component verification in high-risk correlated areas, forming a complete closed loop of judgment from appearance to internal quality. This system significantly improves the systematicness, intelligence, and accuracy of quality control in the mass production of traditional Chinese medicine solid dosage forms, providing direct data support for process optimization.

[0078] Figure 4 This is a schematic diagram of the structure of a processing device provided in an embodiment of the present invention. Exemplarily, this processing device may be a network device, or a chip (system) or other component or assembly that can be disposed in a network device. Figure 4As shown, the processing device 400 may include a processor 401. Optionally, the processing device 400 may also include a memory 402 and / or a transceiver 403. The processor 401 is coupled to the memory 402 and the transceiver 403, for example, via a communication bus.

[0079] The following is combined with Figure 4 A detailed description of each component of the processing equipment 400 is provided below:

[0080] The processor 401 is the control center of the processing device 400. It can be a single processor or a collective term for multiple processing elements. For example, the processor 401 can be one or more central processing units (CPUs), application-specific integrated circuits (ASICs), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0081] Optionally, the processor 401 can perform various functions of the processing device 400 by running or executing software programs stored in the memory 402 and calling data stored in the memory 402, such as performing the above-mentioned functions. Figure 3 This paper presents a quality control and management method for solid dosage forms of traditional Chinese medicine based on big data.

[0082] In a specific implementation, as one example, processor 401 may include one or more CPUs, for example... Figure 4 CPU0 and CPU1 are shown in the diagram.

[0083] In a specific implementation, as one example, the processing device 400 may also include multiple processors. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). Here, a processor may refer to one or more devices, circuits, and / or processing cores used for processing data (e.g., computer program instructions).

[0084] The memory 402 is used to store the software program that executes the solution of the present invention, and is controlled by the processor 401 to execute it. The specific implementation method can be referred to the above method embodiment, and will not be repeated here.

[0085] Optionally, the memory 402 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 402 may be integrated with the processor 401 or exist independently, and may be connected via the interface circuit of the processing device 400. Figure 4 (Not shown in the image) is coupled to processor 401, and this embodiment of the invention does not specifically limit this.

[0086] Transceiver 403 is used for communication with other processing devices. For example, if processing device 400 is a terminal, transceiver 403 can be used to communicate with a network device or with another terminal device. As another example, if processing device 400 is a network device, transceiver 403 can be used to communicate with a terminal or with another network device.

[0087] Alternatively, transceiver 403 may include a receiver and a transmitter. Figure 4 (Not shown separately). The receiver is used to implement the receiving function, and the transmitter is used to implement the transmitting function.

[0088] Alternatively, the transceiver 403 can be integrated with the processor 401, or it can exist independently and be connected via the interface circuit of the processing device 400. Figure 4 (Not shown in the image) is coupled to processor 401, and this embodiment of the invention does not specifically limit this.

[0089] Understandable Figure 4 The structure of the processing device 400 shown does not constitute a limitation on the processing device. Actual processing devices may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0090] Furthermore, the technical effects of the processing device 400 can be referred to the technical effects of the method described in the above method embodiments, and will not be repeated here.

[0091] It should be understood that the processor in the embodiments of the present invention can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0092] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0093] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0094] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0095] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0096] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0097] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0098] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0099] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0100] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0101] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for quality control and management of solid dosage forms of traditional Chinese medicine based on big data, characterized in that, Applied to a processing device, the method includes: The processing device acquires a target image, which includes multiple solid Chinese medicine embryo slices distributed in an array. These multiple solid Chinese medicine embryo slices are obtained by cutting initial solid Chinese medicine embryo slices with a cutting machine and distributing them in an array on a detection plate. The target image is obtained by an image acquisition device taking pictures of these multiple solid Chinese medicine embryo slices from above the detection plate. The image acquisition device consists of three core modules: a three-dimensional shape acquisition module, which uses two line laser contour sensors arranged at an angle to each other, based on the principle of triangulation, to quickly scan as the detection plate passes by, generating a high-precision three-dimensional point cloud characterizing the micro-undulations of the surface for each embryo slice; a two-dimensional color imaging module, which consists of a high-resolution industrial color camera equipped with a telecentric lens and a ring LED light source, which captures images vertically to obtain a global high-definition color image containing all arrayed embryo slices, serving as the basis for analyzing surface color, texture, and macroscopic defects; and a spectral information acquisition module, which integrates a line-scanning hyperspectral camera to acquire the reflectance spectrum of each spatial point in each narrow band by scanning line by line. The processing equipment analyzes the target image through primary detection to determine whether there are quality defects on the surface of each of the multiple solid Chinese medicine embryo slices. If the primary detection determines that at least two of the multiple samples of solid Chinese medicine (TCM) embryo tablets have surface quality defects, the processing equipment then uses secondary detection to determine whether there are two TCM embryo tablets with related defects, including: The processing equipment performs the following operations based on the secondary detection: The processing equipment determines whether the at least two samples of solid Chinese medicine embryo tablets have two samples of solid Chinese medicine embryo tablets with the same defect type; If there are two Chinese medicine solid embryo tablets with the same defect type, the processing equipment determines whether the two Chinese medicine solid embryo tablets with the same defect type are two Chinese medicine solid embryo tablets with the same defect type that are associated with the defect based on the location area and severity level of the defect of each of the two Chinese medicine solid embryo tablets with the same defect type. If two Chinese herbal solid embryo tablets are associated with defects, the processing equipment determines whether there are defects in the composition of the Chinese herbal solid embryo tablets in the target area through three-level detection. The Chinese herbal solid embryo tablets in the target area include the two Chinese herbal solid embryo tablets associated with defects. If the Chinese herbal solid embryo tablets in the target area also include other Chinese herbal solid embryo tablets besides the two Chinese herbal solid embryo tablets associated with defects, then the other Chinese herbal solid embryo tablets are the Chinese herbal solid embryo tablets whose positions are associated with the two Chinese herbal solid embryo tablets associated with defects among the multiple Chinese herbal solid embryo tablets. The processing equipment analyzes the target image through primary detection to determine whether there are quality defects on the surface of each of the multiple solid Chinese medicine flakes, including: The processing equipment performs the following operations based on the first-level detection: The processing device divides the target image into multiple sub-images, and each sub-image contains one corresponding solid Chinese medicine embryo tablet from the multiple portions of solid Chinese medicine embryo tablets. For any one of the plurality of sub-images, the target sub-image contains a corresponding target solid Chinese medicine (TCM) embryo slice from the plurality of TCM solid embryo slices: the processing device extracts a target point cloud from the target sub-image, the point cloud in the target point cloud contains surface feature points of the target TCM solid embryo slice, and the processing device determines whether there are quality defects on the surface of the target TCM solid embryo slice by analyzing the position distribution of the point cloud in the target point cloud; wherein, the point cloud in the target point cloud characterizes at least one of the following features of the target TCM solid embryo slice: color features, texture features, crack features, features of raised positions, or features of recessed positions. The processing equipment determines whether there are quality defects on the surface of the target traditional Chinese medicine solid embryo tablet by analyzing the point cloud point position distribution, including: The processing device aggregates the target point cloud to obtain multiple point cloud points; The processing device constructs a feature tree based on the plurality of point cloud points. The feature tree is a recursive structure, with one of the target point cloud points as the root node. The processing device determines whether there are quality defects on the surface of the target Chinese medicine solid embryo tablet by analyzing the branching trend of the feature tree.

2. The method according to claim 1, characterized in that, The processing device constructs a feature tree based on the plurality of point cloud points, including: The processing device determines a multidimensional feature weight vector based on the formulation type of the target Chinese herbal solid embryo tablet, wherein the multidimensional feature weight vector includes spatial coordinate weight, color feature weight, texture feature weight and density feature weight; The processing device calculates the adaptive feature distance between every two point cloud points in the plurality of point cloud points based on the multidimensional feature weight vector; The processing device uses the point cloud point with the largest feature entropy as the root node, and constructs the feature tree through recursive clustering based on the adaptive feature distance. The child node division of each non-leaf node in the feature tree is determined based on the feature homogeneity index of the region represented by each non-leaf node. Accordingly, the processing device determines whether there are quality defects on the surface of the target traditional Chinese medicine solid embryo tablet by analyzing the branching trend of the feature tree, including: The processing device extracts path feature vectors from the root node to each leaf node in the feature tree. Each path feature vector includes path length, branch angle variance, dimension switching frequency, and number of similar subtrees. The processing device matches the extracted path feature vector with a preset Chinese medicine defect feature library, which contains at least four feature patterns of defects unique to solid Chinese medicine embryo slices: component layering defect pattern, deliquescence and adhesion defect pattern, cracking defect pattern, and uneven color defect pattern. If at least one path feature vector matches any defect pattern in the Chinese medicine defect feature library with a degree exceeding the matching threshold, the processing device determines that there is a quality defect on the surface of the target Chinese medicine solid embryo slice and determines the defect type. If it is determined that there is a quality defect on the surface of the target Chinese medicine solid embryo tablet, the processing equipment traces the corresponding abnormal subtree in the feature tree based on the defect type, analyzes the node distribution of the abnormal subtree, and determines the location area and severity level of the defect on the surface of the target Chinese medicine solid embryo tablet.

3. The method according to claim 2, characterized in that, The determination of the multidimensional feature weight vector based on the formulation type of the target traditional Chinese medicine solid embryo tablets includes: If the target Chinese medicine solid embryo tablet is a pill, then the density feature weight is set to be greater than the texture feature weight; If the target Chinese medicine solid embryo tablet is a tablet, then the texture feature weight is set to be greater than the density feature weight; If the target Chinese medicine solid embryo tablet is a dried ointment tablet, then the weight of the color feature is set to be greater than the weight of the spatial coordinate.

4. The method according to claim 3, characterized in that, The two traditional Chinese medicine solid embryo tablets with the same defect type include a first traditional Chinese medicine solid embryo tablet and a second traditional Chinese medicine solid embryo tablet. The processing equipment determines whether the two traditional Chinese medicine solid embryo tablets with the same defect type are two traditional Chinese medicine solid embryo tablets associated with the defect based on the location area and severity level of the defect in each of the two traditional Chinese medicine solid embryo tablets with the same defect type, including: The processing equipment determines the defect-derived area of ​​the first batch of solid Chinese medicine embryo tablets based on the location and severity level of the defects. The processing equipment determines the defect-derived area of ​​the second batch of solid Chinese medicine embryo tablets based on the location and severity level of the defects. If the defect-derived region of the first solid Chinese medicine embryo tablet intersects or connects with the defect-derived region of the second solid Chinese medicine embryo tablet, the processing device determines that the first solid Chinese medicine embryo tablet and the second solid Chinese medicine embryo tablet are two solid Chinese medicine embryo tablets with the defect associated; otherwise, the processing device determines that the first solid Chinese medicine embryo tablet and the second solid Chinese medicine embryo tablet are two solid Chinese medicine embryo tablets with unassociated defects.

5. The method according to any one of claims 1-4, characterized in that, The two defect-associated solid TCM tablets include a first solid TCM tablet and a second solid TCM tablet. The processing equipment determines whether there are defects in the composition of the solid TCM tablets within the target area through three-level detection, including: The processing device performs the following operations based on the three-level detection: The processing equipment determines the solid Chinese medicine embryos within the target area based on the locations of the first and second portions of solid Chinese medicine embryos. The processing equipment determines whether there are defects in the composition of the solid herbal embryo tablets within the target area.

6. The method according to claim 5, characterized in that, The processing equipment determines the solid Chinese medicine flakes within the target area based on the locations of the first and second portions of solid Chinese medicine flakes, including: If the first and second portions of solid Chinese medicine embryo tablets are located in different rows or columns of the array, the processing device determines the target area based on the respective rows and columns of the first and second portions of solid Chinese medicine embryo tablets. If the first and second portions of solid Chinese medicine embryo tablets are located in the same row or column in the array, the processing device determines the target area based on the column identifier of the first and second portions of solid Chinese medicine embryo tablets in the same row, or the row identifier of the first and second portions of solid Chinese medicine embryo tablets in the same column.

7. A quality control and management system for solid dosage forms of traditional Chinese medicine based on big data, characterized in that, The system includes a processing device, and the system is configured to implement the method as described in any one of claims 1-6 when executed.

Citation Information

Patent Citations

  • Traditional Chinese medicine detection device based on visual analysis

    CN121347407A

  • Defect detection method and device for optical element, computer equipment and storage medium

    CN121505340A