An intelligent checking method and system for packaging and rechecking of traditional Chinese medicine decoction pieces medicine packs
By combining computer vision and QR code decoding into a closed-loop verification system, the problems of manual counting errors and inaccurate information matching in the packaging process of Chinese herbal medicine slices were solved, and the automated, real-time and efficient verification of the quantity and identity information of the medicine packages was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU TANGGU INFORMATION TECH CO LTD
- Filing Date
- 2026-04-10
- Publication Date
- 2026-07-10
AI Technical Summary
Existing technologies for packaging Chinese herbal medicine decoction pieces suffer from problems such as errors due to manual counting, inaccurate matching of medicine packs with patient information, fragmented verification processes, and delayed responses to anomalies. Furthermore, they lack a collaborative identification and tiered handling mechanism for multi-source anomalies.
A closed-loop verification system combining computer vision image counting and QR code decoding is adopted. The system identifies the quantity and location of medicine packages through the image acquisition module, and locates the medicine packages by combining a deep convolutional neural network model. This enables synchronous verification of the quantity and identity information of the medicine packages. The system also completes QR code decoding and status judgment within the same image frame, and combines anomaly handling strategies to ensure the accuracy of the verification.
It improves the efficiency and accuracy of packaging and verification of Chinese herbal medicine slices, reduces human error, realizes the automatic binding and real-time response of medicine package quantity and identity information, and significantly enhances the system's adaptability and robustness.
Smart Images

Figure CN122369840A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traditional Chinese medicine decoction piece packaging technology, and more specifically, relates to an intelligent verification method and system for the packaging and verification of traditional Chinese medicine decoction piece packages. Background Technology
[0002] Traditional Chinese medicine (TCM) decoction services are an important part of the modernization of TCM services, and their quality directly affects the safety and efficacy of medication for patients. In TCM decoction services, the decocted medicines need to be aseptically vacuum-packed into individual medicine bags and labeled with information such as patient information, decoction date, and method of administration, and then the packaging is verified.
[0003] The existing technology for automatically labeling, manually labeling, and manually scanning and verifying individual medicine packets has the following drawbacks: visual fatigue easily occurs when manually counting large numbers of medicine packets, leading to problems such as incorrect or missed labeling; the separation of QR code scanning and quantity verification operations may result in mismatches between medicine packets and patient information; taking a medicine packet filling and labeling device and its control method disclosed in Chinese invention patent literature (CN202211536667.4) as an example, this invention obtains medicine packet processing information, determines packaging and labeling parameters, and automatically completes the filling module to fill empty medicine packets and the printing module to print labels affixed to the surface of the medicine packets; however, this application does not solve core problems such as weak binding between medicine packets and identity information, fragmented verification processes, and delayed abnormal response, and lacks a collaborative judgment and hierarchical handling mechanism for multi-source anomalies such as QR code decoding failure, false detection, or missed detection.
[0004] Therefore, we need an intelligent verification method for the packaging and verification of Chinese herbal medicine packets. This method should be highly efficient, ensure that the quantity of Chinese herbal medicine packets matches the prescription requirements, and that the identity of each packet is clearly and accurately bound. It should also automate the verification process and reduce human error. Summary of the Invention
[0005] The purpose of this invention is to provide an intelligent verification method for the packaging and verification of Chinese herbal medicine decoction pieces. This method combines computer vision image counting with QR code decoding verification to form a closed-loop verification system. This improves verification efficiency while ensuring verification accuracy and real-time response capability, breaking through the limitations of traditional manual reliance and single-point verification. Another objective of this invention is to provide an intelligent verification system for the packaging and verification of Chinese herbal medicine decoction pieces.
[0006] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides an intelligent verification method for the packaging and verification of traditional Chinese medicine decoction pieces, comprising the following steps: S1. Acquire images; obtain the number and location of medicine packs in the image through the image acquisition module. S2. Medicine package scanning: After confirming the location of the medicine package, the identity information scanning module performs QR code scanning on a designated area of each medicine package to obtain the identity information corresponding to the medicine package; S3. Identity Decoding: When the identity information is successfully decoded, the data processing module marks the medicine package as "identified"; if decoding fails, the preset exception handling strategy is triggered. S4. Information comparison: After completing the quantity detection and identity decoding of the medicine packs, the data processing module compares the collected quantity and identity information of the medicine packs with the prescription information respectively. S5. Based on the comparison results, the data processing module automatically outputs the verification conclusion.
[0007] As a further improvement of the present invention, after acquiring the image of the medicine pack through the image acquisition module in step S1, the image is input into the data processing unit; the medicine pack in the image is identified and located by the pre-trained medicine pack detection model; the number of medicine packs obtained is used to initialize the verification process and determine the scope of the object for subsequent identity recognition, while the location information of each medicine pack is used as the input area for the QR code recognition stage, improving the cropping and focusing of the scanning area, thereby avoiding false scanning and missed scanning caused by background interference.
[0008] As a further improvement of the present invention, the medicine package detection model is based on a deep convolutional neural network structure. Through feature extraction, feature fusion and bounding box regression operations, it automatically outputs the number of bounding frames of all medicine packages in the image and the spatial coordinates of the scanning area of the medicine package.
[0009] As a further improvement of the present invention, the QR code scanning process and the medicine pack counting in step S2 are performed in the same frame image, so that the system can simultaneously complete the medicine pack quantity judgment and identification number extraction in the same frame image, and establish a corresponding independent identification processing task for each medicine pack during the recognition process, that is, to perform QR code positioning, decoding and status judgment of the medicine pack; the QR code is associated with the patient's prescription information, which includes the number of Chinese medicine liquid packs and the prescription number.
[0010] As a further improvement of the present invention, the exception handling strategy in step S3 includes: S31. Automatically retry several times to avoid misjudgment caused by momentary blur or lighting interference; S32. If it cannot be identified, mark the medicine package as "abnormal medicine package", trigger the alarm device and suspend the automatic verification line; if it is identified after several seconds of continuous identification, mark the medicine package as "identified"; if it is still not identified, mark it as "unidentified" and guide the medicine package to the manual verification area.
[0011] As a further improvement of the present invention, the identity information and prescription information comparison process in step S4 maintains a one-to-one correspondence, and each QR code is associated with the patient's prescription number; the comparison process is to compare the number of medicine packs in the prescription information with the number of medicine packs in the medicine pack image, and to compare the prescription number on each medicine pack with the patient's prescription number.
[0012] As a further improvement of the present invention, the comparison process adopts a "logical AND" judgment strategy, that is, the prescription drug pack is deemed to have passed the review only when the number of drug packs matches and all identity information is found in the prescription list; if the number is inconsistent, or the identity of a certain drug pack does not exist in the prescription, or the identity of a certain drug pack is duplicated beyond the limit, the review is deemed to have failed, triggering an alarm device and pausing the automatic review process, or the drug pack is redirected to the manual review area.
[0013] As a further improvement of the present invention, the comparison algorithm includes integer matching of quantities, set comparison of identity information, uniqueness verification, and quantity constraint verification; legality analysis of the QR code parsing results and consistency verification by hash or string comparison, respectively verifying whether the QR code content is consistent with the prescription information and whether the quantities are consistent between multiple parsings and multiple medicine packs.
[0014] As a further improvement of the present invention, if the review conclusion in step S5 is "pass", then normal information is recorded and the medicine package is allowed to enter the subsequent packaging process; if the review conclusion is "fail", then the alarm device immediately triggers an alarm, and the abnormal medicine package is automatically guided by the system to the waiting area for manual re-verification.
[0015] An intelligent verification system for the packaging and verification of Chinese herbal medicine decoction pieces, using the aforementioned intelligent verification method for the packaging and verification of Chinese herbal medicine decoction pieces, includes an image acquisition module, an identity information scanning module, a data processing unit, and an alarm device.
[0016] The image acquisition module is used to obtain a clear image of the surface of the medicine package.
[0017] The identity information scanning module is used to recognize and decode the QR code in a designated area of the medicine package.
[0018] The data processing unit is used to execute all the verification logic described in S1-S5, including calling the medicine package detection model, decoding the QR code, multi-dimensional comparison of prescription and medicine package, execution of exception handling strategy, and generation and reporting of error logs.
[0019] The alarm device is used to issue an alarm signal when decoding or verification fails, so that manual handling can be carried out.
[0020] Compared to existing technologies, the advantages of this invention are as follows: By combining computer vision image counting with QR code decoding verification, the results of the two mutually corroborate each other, forming a closed-loop verification system, effectively avoiding the inherent defects of single-modality verification and significantly enhancing the system's adaptability to different medicine packing conditions; by using a medicine pack detection model to identify and locate the number of medicine packs in the image, and outputting the bounding box and QR code coordinates of each medicine pack to support subsequent accurate scanning, the efficiency of scanning and recognition is improved; by simultaneously completing the medicine pack quantity judgment and identity number extraction within the same frame image, synchronous verification of medicine pack quantity and identity information is achieved, avoiding the spatiotemporal misalignment problem that may occur between frame-by-frame images and identity verification; by performing integer matching of prescription information and medicine pack quantity in the medicine pack image, set comparison of identity information, uniqueness verification, and quantity constraint verification, a parallel consistency verification mechanism is implemented, significantly improving the confidence and robustness of the verification results. Attached Figure Description
[0021] Figure 1 This is a schematic flowchart of an intelligent verification method for packaging and verifying traditional Chinese medicine decoction pieces according to the present invention. Detailed Implementation
[0022] Specific Implementation Example 1: Please refer to Figure 1 A smart verification method for the packaging and verification of traditional Chinese medicine decoction pieces includes the following steps: S1. Acquire images: Obtain the number and location of medicine packets within the image through the image acquisition module.
[0023] Specifically, in step S1, after acquiring the image of the medicine pack through the image acquisition module, the image is input into the data processing unit; the medicine pack in the image is identified and located by the pre-trained YOLO medicine pack detection model; the number of medicine packs obtained is used to initialize the verification process and determine the scope of the object for subsequent identity recognition, while the location information of each medicine pack is used as the input area for the QR code recognition stage to improve the cropping and focusing of the scanning area, thereby avoiding false scanning and missed scanning caused by background interference.
[0024] Specifically, the YOLO medicine package detection model is based on a deep convolutional neural network structure. Through feature extraction, feature fusion, and bounding box regression operations, it automatically outputs the number of bounding frames of all medicine packages in the image and the spatial coordinates of the scanning area of the medicine package.
[0025] S2. Medicine package scanning: After confirming the location of the medicine package, the identity information scanning module performs QR code scanning on a designated area of each medicine package to obtain the identity information corresponding to the medicine package.
[0026] Specifically, step S2, the QR code scanning process and the medicine pack counting are performed within the same frame of the image, enabling the system to simultaneously determine the number of medicine packs and extract their identification numbers within the same frame. During the recognition process, a corresponding independent recognition processing task is established for each medicine pack, which is used to perform QR code positioning, decoding, and status judgment for that medicine pack. The QR code is associated with the patient's prescription information, which includes the number of Chinese medicine liquid packs and the prescription number.
[0027] S3. Identity Decoding: When the identity information is successfully decoded, the data processing module marks the medicine package as "identified"; if decoding fails, the preset exception handling strategy is triggered.
[0028] Specifically, the exception handling strategy described in step S3 includes: S31. Automatically retry several times to avoid misjudgment caused by momentary blur or lighting interference; S32. If it cannot be identified, mark the medicine package as "abnormal medicine package", trigger the alarm device and suspend the automatic verification line; continue to identify for several seconds. If it is identified after 10 seconds, mark the medicine package as "identified". If it still cannot be identified, mark it as "unidentified" and guide the medicine package to the manual verification area.
[0029] S4. Information comparison: After completing the quantity detection and identity decoding of the medicine packs, the data processing module compares the collected quantity and identity information of the medicine packs with the prescription information.
[0030] Specifically, in step S4, the identity information and prescription information are compared in a one-to-one correspondence, with each QR code associated with the patient's prescription number. The comparison process involves comparing the number of medicine packs in the prescription information with the number of medicine packs in the medicine pack image, and comparing the prescription number on each medicine pack with the patient's prescription number.
[0031] Specifically, the comparison of identity information and prescription information falls into three categories: S41. The quantity and prescription number information of all medicine packs are consistent with this prescription, and the comparison is correct and the verification is passed. S42. If any medicine package is marked "unidentified", it shall be manually confirmed and then further checked. S43. If the information of a medicine package does not match the prescription, i.e., it is not the prescription number or the patient, the system will prompt the manual reviewer. After the manual reviewer removes the medicine package, the system will continue to review the remaining medicine packages.
[0032] Specifically, the comparison process adopts a "logical AND" judgment strategy, that is, the prescription drug pack is deemed to have passed the review only when the number of drug packs matches and all identity information is found in the prescription list; if the number is inconsistent, or the identity of a certain drug pack does not exist in the prescription, or the identity of a certain drug pack is duplicated beyond the limit, the review is deemed to have failed, triggering an alarm device and suspending the automatic review process, or the drug pack is redirected to the manual review area.
[0033] Specifically, the comparison algorithm includes integer matching for quantity, set comparison for identity information, uniqueness verification, and quantity constraint verification; it also performs legality analysis on the QR code parsing results and performs consistency verification by hash or string comparison, respectively verifying whether the QR code content is consistent with the prescription information and whether the quantity is consistent between multiple parsings and multiple medicine packs.
[0034] S5. Based on the comparison results, the data processing module automatically outputs the verification conclusion.
[0035] Specifically, if the review result in step S5 is "pass", then normal information is recorded and the medicine package is allowed to enter the subsequent packaging process; if the review result is "fail", then the alarm device will immediately trigger an alarm; the abnormal medicine package is automatically guided by the system to the waiting area for manual re-verification.
[0036] Example 2: This example is applied to the pre-packaging verification station of finished medicine packages in the pharmacy of Hospital A. A total of 14 decoction medicine packages with prescription number X are selected for verification. A special label is affixed to the front of each medicine package. The label contains text information such as the patient's name, the total number of prescription packages, and the prescription number. The prescription number is embedded in the QR code area. The system consists of an image acquisition module, an identity information scanning module, a data processing unit, and a manual verification terminal.
[0037] All medicine packs are placed under the image acquisition module. The high-definition camera of the image acquisition module captures single-frame panoramic images of 14 medicine packs on the verification table. The data processing unit simultaneously identifies the position of the medicine packs, locates the QR code area on the label of each medicine pack, outputs the total number of medicine packs and the spatial coordinates of the QR codes, removes background interference, and determines the scanning range.
[0038] Based on the positioning results, the identity information scanning module accurately scans the QR code area of each medicine package. The quantity identification, QR code scanning, and information verification of medicine packages are performed synchronously within the same image frame. The data processing unit establishes an independent thread for each medicine package to complete the QR code decoding and verification in parallel without step-by-step delay. After successful QR code decoding, the medicine package is immediately marked as identified. If a single decoding failure occurs, it will automatically retry 3 times to eliminate temporary interference. If it still fails after 3 retries, an alarm device will be triggered and the automatic verification pipeline will be paused. The identification continues for several seconds. If the medicine package is identified after 10 seconds, it will be marked as "identified". If it still cannot be identified, the medicine package will be directed to the manual verification area to remind manual inspection.
[0039] The data processing unit uses a "logical AND" strategy to synchronously compare the real-time acquired quantity of medicine packs and QR code identity information with the preset information of prescription number X. After the 14 medicine packs are verified to match in quantity, have the same prescription number, and have unique identity information, the verification is considered complete and a review approval conclusion is output. An electronic review log is generated, and the medicine packs are released to enter the subsequent packaging and logistics process.
[0040] Comparative Example 1: For the same prescription, prescription number X, containing 14 medicine packets, a purely manual verification method was used: the operator visually counted the number of medicine packets, checked the text information such as the name and prescription number on the label of each medicine packet one by one, and then manually checked the quantity against the prescription to ensure consistency with the information. If there were no errors, it was deemed to have passed. The entire process was without intelligent assistance, which was more time-consuming, prone to errors, and resulted in delayed detection of anomalies. There were also no electronic traceability records.
[0041] Example 3: An intelligent verification system for the packaging and verification of Chinese herbal medicine decoction pieces, using the above-mentioned intelligent verification method for the packaging and verification of Chinese herbal medicine decoction pieces, includes an image acquisition module, an identity information scanning module, a data processing unit, and an alarm device.
[0042] The image acquisition module is used to obtain a clear image of the surface of the medicine package.
[0043] The identity information scanning module is used to recognize and decode the QR code in a designated area of the medicine package.
[0044] The data processing unit is used to execute all the verification logic described in S1-S5, including YOLO model invocation, QR code decoding, multi-dimensional comparison of prescriptions and medicine packages, execution of anomaly handling strategies, and generation and reporting of error logs.
[0045] The alarm device is used to issue an alarm signal when decoding or verification fails, so that manual handling can be carried out.
[0046] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An intelligent verification method for the packaging and verification of traditional Chinese medicine decoction pieces, characterized in that: Includes the following steps: S1. Acquire images; obtain the number and location of medicine packs in the image through the image acquisition module. S2. Medicine package scanning: After confirming the location of the medicine package, the identity information scanning module performs QR code scanning on a designated area of each medicine package to obtain the identity information corresponding to the medicine package; S3. Identity Decoding: When the identity information is successfully decoded, the data processing module marks the medicine package as "identified"; if decoding fails, the preset exception handling strategy is triggered. S4. Information comparison: After completing the quantity detection and identity decoding of the medicine packs, the data processing module compares the collected quantity and identity information of the medicine packs with the prescription information respectively. S5. Based on the comparison results, the data processing module automatically outputs the verification conclusion.
2. The intelligent verification method for packaging and verifying traditional Chinese medicine decoction pieces according to claim 1, characterized in that: Step S1 involves acquiring images of medicine packs via an image acquisition module and inputting the images into a data processing unit. A pre-trained medicine pack detection model is used to identify and locate the medicine packs in the images. The number of medicine packs obtained is used to determine the number of medicine pack instances that need to be parsed for QR code in the subsequent identity recognition stage, while the location information of each medicine pack serves as the input area for the QR code recognition stage.
3. The intelligent verification method for packaging and verifying traditional Chinese medicine decoction pieces according to claim 2, characterized in that: The medicine package detection model is based on a deep convolutional neural network structure. Through feature extraction, feature fusion, and bounding box regression operations, it automatically outputs the number of bounding frames of all medicine packages in the image and the spatial coordinates of the scanning area of the medicine package.
4. The intelligent verification method for packaging and verifying traditional Chinese medicine decoction pieces according to claim 1, characterized in that: Step S2, the QR code scanning process and the medicine pack counting are performed in the same frame of the image. This is used to simultaneously determine the number of medicine packs and extract their identification numbers. During the recognition process, a corresponding independent recognition processing task is established for each medicine pack, which is used to perform QR code positioning, decoding, and status judgment for that medicine pack. The QR code is associated with the patient's prescription information, which includes the number of Chinese medicine liquid packs and the prescription number.
5. The intelligent verification method for packaging and verifying traditional Chinese medicine decoction pieces according to claim 1, characterized in that: The exception handling strategy described in step S3 includes: S31. Automatically retry several times to avoid misjudgment caused by momentary blur or lighting interference; S32. If it cannot be identified, mark the medicine package as "abnormal medicine package", trigger the alarm device and suspend the automatic verification line; if it is identified after several seconds of continuous identification, mark the medicine package as "identified"; if it is still not identified, mark it as "unidentified" and guide the medicine package to the manual verification area.
6. The intelligent verification method for packaging and verifying traditional Chinese medicine decoction pieces according to claim 1, characterized in that: Step S4 involves a one-to-one correspondence between the identity information and the prescription information. Each QR code is associated with the patient's prescription number. The comparison process involves comparing the number of medicine packs in the prescription information with the number of medicine packs in the medicine pack image, and comparing the prescription number on each medicine pack with the patient's prescription number.
7. The intelligent verification method for packaging and verifying traditional Chinese medicine decoction pieces according to claim 6, characterized in that: The comparison process uses a "logical AND" judgment strategy, that is, the prescription drug pack is deemed to have passed the review only when the number of drug packs matches and all identity information is found in the prescription list; if the number is inconsistent, or the identity of a drug pack does not exist in the prescription, or the duplicate identity of a drug pack exceeds the limit, the review is deemed to have failed, triggering an alarm device and suspending the automatic review process, or the drug pack is redirected to the manual review area.
8. The intelligent verification method for packaging and verifying traditional Chinese medicine decoction pieces according to claim 7, characterized in that: The comparison algorithm includes integer matching for quantity, set comparison for identity information, uniqueness verification, and quantity constraint verification; the legality analysis of the QR code parsing results is performed and consistency verification is performed by hash or string comparison, respectively verifying whether the QR code content is consistent with the prescription information and whether there is consistency between multiple parsings and multiple medicine packs.
9. The intelligent verification method for packaging and verifying traditional Chinese medicine decoction pieces according to claim 1, characterized in that: If the review result in step S5 is "pass", then the normal information is recorded and the medicine package is allowed to enter the subsequent packaging process; if the review result is "fail", then the alarm device will immediately trigger an alarm, and the abnormal medicine package will be automatically guided by the system to the waiting area for manual re-verification.
10. An intelligent verification system for packaging and verifying traditional Chinese medicine decoction pieces according to any one of claims 1-9, comprising an image acquisition module, an identity information scanning module, a data processing unit, and an alarm device; The image acquisition module is used to acquire clear images of the surface of the medicine pack; The identity information scanning module is used to recognize and decode the QR code in a designated area of the medicine package; The data processing unit is used to execute all the verification logic described in S1-S5, including calling the medicine package detection model, decoding the QR code, multi-dimensional comparison of prescription and medicine package, execution of anomaly handling strategy, and generation and reporting of error logs. The alarm device is used to issue an alarm signal when decoding or verification fails, so that manual handling can be carried out.