System and method for multiple verification of correct medicine during automatic dispensing of medicine in a pharmacy

The multi-step verification system solves the problems of low efficiency and inaccuracy in the pharmacy dispensing process, realizes the full automation of drug sorting and dispensing, ensures the accuracy and safety of drugs, and improves dispensing efficiency and service capabilities.

CN121651041BActive Publication Date: 2026-07-10EASTCOMPEACE TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
EASTCOMPEACE TECH
Filing Date
2025-11-03
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

The existing pharmacy dispensing process suffers from low efficiency, difficulty in ensuring accuracy, and lack of traceability. Furthermore, the existing automated verification methods have a single verification dimension and cannot detect physical parameters such as the quantity, size, and weight of medicines, resulting in poor adaptability.

Method used

A multi-step verification system is adopted, including an online order system, an inventory management module, an automated dispensing device, and a multi-verification module. It uses barcode scanning, OCR recognition, visual sensors, and weight sensors to perform multiple verifications of the location, quantity, size, information, and weight of medicines, and triggers a three-level alarm mechanism through an alarm system.

Benefits of technology

It has achieved full automation of the drug sorting and dispensing process, improved dispensing accuracy, eliminated human error and safety hazards, enhanced dispensing efficiency and process continuity, reduced labor costs, extended service hours, and met the needs of 24-hour uninterrupted operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121651041B_ABST
    Figure CN121651041B_ABST
Patent Text Reader

Abstract

The application provides a system and method for multiple verification of the correctness of a pharmacy automatic dispensing medicine, which comprises an online order system, which analyzes received medicine order information to obtain detailed listed medicine names, quantities and other information in the order; an inventory management module, which is used for storing and managing comprehensive information of the medicine, while supporting querying of the medicine information according to the order demand and automatic updating of the inventory quantity after the medicine is delivered; an automatic dispensing equipment, which is integrated with a bar code scanning technology, an OCR identification technology, a visual sensor and a weight sensor, and automatically locates and sorts out the required medicine from the inventory according to the analyzed medicine information; and a multiple verification module, which is used for multiple verification in the whole process of medicine sorting. The application verifies the accuracy of the dispensing medicine through multiple progressive verification, effectively guarantees the accuracy of the dispensing, eliminates the safety hazards, realizes the full automatic dispensing of the medicine, and comprehensively controls the quality of the medicine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automated pharmacy equipment technology, specifically to a system and method for multiple verifications of drug correctness during automated dispensing in pharmacies. It is applicable to scenarios such as 24-hour unmanned pharmacies and hospital pharmacies, and realizes automated and precise control of the entire process of drug sorting, dispensing, and warehousing. Background Technology

[0002] Currently, there are two main technical solutions for the dispensing process in pharmacies:

[0003] Technical Solution 1: A method for manually dispensing and updating drug inventory

[0004] This method involves manually connecting orders, finding the medicines manually using the drug information in the orders, and then manually deducting the inventory from the inventory management module.

[0005] This solution has the following problems:

[0006] 1. Low work efficiency: It requires manual searching of medicines and then manual processing of outbound operations in the inventory management module. The process is cumbersome, time-consuming, and inefficient.

[0007] 2. Difficulty in guaranteeing accuracy: Manual drug retrieval is prone to human error, such as retrieving the wrong drug or taking the same product from a different manufacturer. Since drug information is very important, retrieving the wrong drug poses a significant risk.

[0008] 3. Untraceable: Lack of automated recording makes it difficult to trace data during the medication dispensing process.

[0009] Technical Solution 2: A method for verifying the accuracy of medicines by scanning barcodes.

[0010] This solution uses a single barcode scanning verification method for dispensing medicine: after the medicine is sorted by the automatic dispensing device, the correctness of the medicine is verified by scanning the barcode. The verification method is relatively simple and there will be blind spots in the verification.

[0011] This solution has the following problems:

[0012] The verification dimension is limited: it only verifies barcode information and cannot detect physical parameters such as the quantity, size, and weight of the medicine;

[0013] Blind spot risk: If the barcode is replaced or contaminated, the system cannot recognize it, which can easily lead to incorrect medication dispensing;

[0014] Poor adaptability: Weak ability to distinguish between similarly packaged drugs (such as the same drug in different specifications). Summary of the Invention

[0015] To address the various shortcomings of existing technologies, this invention provides a system and method for multi-factor verification of drug accuracy during automated dispensing in pharmacies. By employing multiple progressive verification methods to check the accuracy of dispensed drugs, the system effectively ensures precise dispensing and eliminates potential safety hazards. It achieves fully automated drug dispensing and provides comprehensive quality control for drugs, with significant advantages, particularly in preventing the use of similar or expired drugs.

[0016] The present invention achieves the above objectives through the following technical solutions:

[0017] A system for multiple verifications of drug correctness during automated dispensing in pharmacies includes:

[0018] The online order system is configured to receive drug order information submitted online by users and parse the order information to obtain the drug names, quantities and other relevant information listed in the order.

[0019] The inventory management module is connected to the online order system and is used to store and manage comprehensive information about the medicines, including at least the basic attributes, physical parameters, barcode information and the specific location of the medicines in the inventory. It also supports querying medicine information according to order requirements and automatically updating the inventory quantity after the medicines are shipped out.

[0020] The automated dispensing equipment integrates barcode scanning technology, OCR recognition technology, vision sensors, and weight sensors. It is used to automatically locate and sort the required medicines from the inventory based on the medicine information parsed by the online order system.

[0021] The multi-verification module is used to perform multiple verifications throughout the entire drug sorting process, including at least inventory information verification, drug quantity verification, drug size verification, drug information verification, and drug weight verification.

[0022] The alarm system, which is connected to the multi-verification module, is used to trigger a three-level alarm mechanism when a mismatch in drug information or other abnormalities are found at any verification stage.

[0023] A method for multiple verifications of drug correctness during automated dispensing in pharmacies, employing the aforementioned system for multiple verifications of drug correctness during automated dispensing in pharmacies, includes the following steps:

[0024] Receive online order information and obtain the drug information in the order through a parsing program;

[0025] Based on the product information in the inventory management module, determine the specific location of the medicines to be sorted in the inventory;

[0026] Start the automated dispensing equipment and automatically perform the sorting of medicines according to the order information;

[0027] Before drug sorting, an inventory information verification step is performed. By comparing the drug location information recorded in the inventory management module with the actual location of the automatic dispensing equipment, it is ensured that drugs are sorted from the correct location.

[0028] During the drug sorting process, a double verification step, namely drug quantity verification, is first performed sequentially. Visual sensors are used to identify and count the number of sorted drugs to verify whether it is completely consistent with the quantity required by the order.

[0029] After drug sorting, triple to five verification steps are performed in parallel:

[0030] The triple verification is for drug size verification. It measures the length, width and height of the drug through a visual sensor and compares them with the data pre-recorded in the inventory management module.

[0031] The four-fold verification is for drug information verification. It uses OCR recognition technology to read detailed information on the drug label and barcode recognition technology to read barcode information, and compares it with order information.

[0032] The five-fold verification is for drug weight verification. The actual weight of the drug is measured by a weight sensor and compared with the standard weight of the drug recorded in the inventory management module.

[0033] The drug outbound operation is completed only if all verification steps pass, and the corresponding inventory quantity of the outbound drugs is deducted from the inventory management module.

[0034] According to the present invention, a method for multiple verifications of drug correctness during automated dispensing in pharmacies includes a pre-sorting spatial positioning verification step before drug sorting:

[0035] In the inventory management module, each medicine is pre-set and stored with its unique location coordinates (X, Y, Z), where X and Y represent the specific location coordinates of the medicine on the horizontal plane, and Z represents the shelf height coordinates of the medicine.

[0036] A UWB positioning module is integrated into the robotic arm of the automated dispensing equipment. This module has a positioning accuracy of ±1cm and can obtain the current position information of the robotic arm in real time.

[0037] A unique QR code is affixed to the storage location of each medicine on the shelf. The QR code contains the medicine's location information or is associated with the medicine's location coordinates in the inventory management module.

[0038] When the online order system receives a drug order submitted by a user, it pushes the order information to the automated dispensing equipment. The automated dispensing equipment parses the order information and extracts the name and quantity of the drugs to be sorted.

[0039] The automated dispensing equipment retrieves the preset positioning coordinates (X, Y, Z) of the drug from the inventory management module based on the parsed drug name; then, it controls the robotic arm to move to the vicinity of the target coordinates and uses the UWB positioning module for positioning.

[0040] After the robotic arm is positioned in the target coordinate area, the automatic dispensing equipment controls the built-in scanning device to scan the QR code label on the medicine rack, and parse the medicine location information contained in the QR code label or interact with the inventory management module to obtain the location coordinates of the corresponding medicine.

[0041] The current position coordinates of the robotic arm obtained by the UWB positioning module, the drug positioning coordinates parsed from the QR code label, and the preset drug positioning coordinates (X, Y, Z) recorded in the inventory management module are compared in three directions.

[0042] If the results of the three-way comparison are all within the allowable deviation range, the spatial positioning verification is deemed to have passed; if the comparison result in any direction exceeds the allowable deviation range, a three-level alarm mechanism is immediately triggered, which sequentially issues a warning, suspends the current sorting operation, and notifies manual intervention for verification.

[0043] According to the present invention, a method for multiple verifications of drug correctness during automated dispensing in pharmacies includes performing a visual quantity verification step during drug sorting.

[0044] The automated dispensing equipment incorporates multiple high-resolution industrial cameras, which are mounted in a circular array or at a specific angle above the robotic arm's execution end or the sorting area.

[0045] When the robotic arm grabs the medicine and moves it to the preset sorting position, it triggers multiple cameras to simultaneously collect multiple frames of image data; the image processing unit built into the automatic dispensing equipment performs real-time preprocessing on the collected raw images to generate images of the medicine stacking status;

[0046] A drug quantity recognition model is trained based on a deep learning framework. The preprocessed image is input into the drug quantity recognition model, and the model outputs the predicted quantity value of the drugs.

[0047] Set a quantity error tolerance, meaning the system requires that the quantity of medicines visually identified must be exactly the same as the quantity of medicines specified in the online order; compare the predicted quantity value output by the quantity recognition model with the order quantity, and if the two values ​​are equal, the quantity visual verification is deemed to have passed;

[0048] If the quantity comparison results are inconsistent, a level 3 alarm mechanism will be triggered immediately.

[0049] According to the present invention, a method for multiple verifications of drug correctness during automated dispensing in pharmacies includes a post-sorting three-dimensional dimension verification step after drug sorting.

[0050] A three-dimensional vision acquisition module is installed at the sorting exit of the automatic dispensing equipment. This module includes at least two sets of industrial cameras and structured light projection devices arranged perpendicularly to each other, or a stereo vision sensor driven by deep learning, to acquire three-dimensional contour images of the drugs in real time after the drugs have been sorted.

[0051] While acquiring 3D images, the built-in OCR recognition unit of the automatic dispensing equipment quickly scans the identifiable areas on the drug packaging to extract the pre-printed basic data of the length, width, and height of the drug. If the packaging does not directly indicate the size, the OCR recognizes the drug name and specification information, and the theoretical size data is indirectly obtained based on the drug specification-size mapping table stored in the inventory management module.

[0052] The acquired 3D contour image is input into a pre-trained size analysis model, which is built on a deep learning framework. The model outputs the measured length L1, width W1, and height H1 values ​​of the drug.

[0053] The theoretical length L0, width W0, and height H0 data obtained by OCR recognition are cross-validated with the standard dimensions L2, W2, and H2 of the drug recorded in the inventory management module; then, the measured dimensions L1, W1, and H1 are compared with the theoretical dimensions L0, W0, and H0 or the standard inventory dimensions L2, W2, and H2, respectively.

[0054] If all dimensional comparison results are within the allowable error range, the 3D dimensional verification is deemed successful, and the system automatically triggers the next verification process; if any dimensional comparison fails, a three-level alarm mechanism is immediately activated.

[0055] According to the present invention, a method for multiple verifications of drug correctness during automated dispensing in pharmacies includes a post-sorting product information verification step after drug sorting.

[0056] A high-resolution multispectral imaging module is installed at the sorting exit of the automated dispensing equipment. This module includes at least a visible light camera, an infrared camera, and an ultraviolet fluorescence imaging unit. It is used to collect omnidirectional image data of the drug packaging and to preprocess the collected raw images to generate composite images.

[0057] A multilingual drug information recognition model is built based on a deep learning framework. The preprocessed composite image is input into the recognition model, and the model outputs structured text data, which includes at least the drug name, approval number, manufacturer, and specifications.

[0058] The registration information of the drug can be queried in real time from the inventory management module, including at least the standard drug name, unique approval number, registered manufacturer and specifications.

[0059] Perform strong matching of key fields, including approval number, drug name, manufacturer and specifications;

[0060] If the approval number matches perfectly, and the comparison results of key fields such as drug name, manufacturer, and specifications all meet the preset similarity threshold, the product information verification is deemed successful, and the system automatically triggers the next verification process; if any key field fails to match, a three-level alarm mechanism is immediately activated.

[0061] According to the present invention, a method for multiple verifications of drug correctness during automated dispensing in pharmacies includes a post-sorting-product weight verification step after drug sorting.

[0062] An electromagnetic force balance weight sensor is integrated below the sorting exit conveyor belt of the automatic dispensing equipment; the sensor surface is covered with an anti-slip silicone pad to ensure that the medicine remains stationary during the weighing process; at the same time, adjustable limit baffles are set on both sides of the conveyor belt to prevent the medicine from slipping or shifting, which would cause weighing errors.

[0063] As the medicine passes through the weighing area, the weight sensor continuously collects weight data at a sampling frequency of no less than 100Hz, and removes mechanical vibration noise through a low-pass filtering algorithm. The system automatically identifies the stable state of the medicine and extracts the average weight during the stable phase as the measured weight W1 of a single medicine. If multiple medicines are weighed in batches, the system automatically calculates the expected total weight W based on the order quantity N. 0_total = W 0_single × N, where W 0_single The system records the standard weight of a single medicine item and collects the measured value W of the total batch weight. 1_total ;

[0064] Single-item drug verification mode: Compare the measured single-item weight W1 with the standard weight W recorded in the system. 0_single Perform a comparison;

[0065] Batch drug verification mode: The measured total weight W of the batch 1_total With the expected total weight W 0_total Perform a comparison;

[0066] If the weight comparison result is within the allowable error range, the product weight verification is deemed successful, and the system automatically triggers the next verification process; if the weight comparison fails, a three-level alarm mechanism is immediately activated.

[0067] According to the present invention, a method for multiple verifications of the correctness of medicines during automatic dispensing in pharmacies is provided. For hygroscopic medicines, the system automatically calls the humidity-weight change curve of the medicine recorded in the inventory management module, and performs dynamic compensation and correction on the measured weight based on the current ambient humidity sensor data. If the weight still exceeds the allowable error range after correction, it is determined that the verification has failed.

[0068] If the weight verification fails, the system immediately initiates the traceability analysis process: retrieves the historical weighing data of the drug, generates a weight distribution chart, and determines whether it is a systematic deviation; and verifies the specification information on the drug packaging through the OCR recognition module to confirm whether the deviation in the expected weight value is due to incorrect specification labeling.

[0069] If the traceability analysis cannot rule out anomalies, the current batch of medicine will be locked, its release from the warehouse will be prohibited, and an alarm will be triggered.

[0070] According to the present invention, a method for multiple verifications of drug correctness during automated dispensing in pharmacies includes a multi-source coordinate real-time acquisition and preprocessing step during three-way comparison.

[0071] Real-time coordinate acquisition of robotic arm: A UWB positioning module is integrated on the end effector of the robotic arm. This module uses ultra-wideband pulse signals to measure distances with at least 4 fixed base stations and calculates the current spatial coordinates (X1, Y1, Z1) of the robotic arm in real time based on the trilateration algorithm.

[0072] Drug visual positioning coordinate analysis: A unique QR code label is set on each location of the drug storage shelf. The industrial camera mounted on the robotic arm scans the QR code label to analyze the preset positioning coordinates (X2, Y2, Z2) of the drug in the shelf coordinate system.

[0073] Inventory baseline coordinate retrieval: Retrieve the preset location coordinates (X0, Y0, Z0) of the drug in real time from the database of the inventory management module.

[0074] Coordinate system transformation: The robot arm coordinates (X1, Y1, Z1) obtained by the UWB positioning module and the cargo location coordinates (X2, Y2, Z2) obtained by QR code parsing are unified into the same global coordinate system. The transformation formula is as follows:

[0075]

[0076] Where θ is the rotation angle between the local coordinate system and the global coordinate system, and (ΔX, ΔY, ΔZ) are translation vectors, all of which are obtained through pre-calibration.

[0077] Specifically, to address the dynamic errors during the robotic arm's movement, a Kalman filter algorithm is introduced to smooth the real-time coordinates (X1, Y1, Z1), and the historical deformation data of the shelves recorded in the inventory management module is used to dynamically correct the reference coordinates (X0, Y0, Z0).

[0078] According to the method for multiple verifications of drug correctness during automated dispensing in pharmacies provided by the present invention, the following steps are also performed: three-dimensional coordinate comparison and allowable deviation determination:

[0079] Calculate the deviations of the robotic arm's real-time coordinates (X1, Y1, Z1), QR code parsing coordinates (X2, Y2, Z2), and inventory baseline coordinates (X0, Y0, Z0) along the X, Y, and Z axes, respectively, using the following formulas:

[0080]

[0081] Based on the drug grasping accuracy requirements, set the allowable deviation threshold (ΔX) for each axis. max , ΔY max , ΔZ max ),in:

[0082] High-precision pharmaceuticals: ΔX max = ΔY max = ΔZ max = ±1.5mm;

[0083] Common medicines: ΔX max = ΔY max = ΔZ max = ±3mm;

[0084] If the deviations between the robotic arm coordinates and the QR code coordinates in each axis satisfy the following:

[0085] Δ X 1≤Δ X max And Δ Y 1≤Δ Y max And Δ Z 1≤Δ Z max

[0086] Meanwhile, the deviation between the QR code coordinates and the inventory baseline coordinates satisfies:

[0087] Δ X 2≤Δ X max And Δ Y 2≤Δ Y max And Δ Z 2≤Δ Z max

[0088] If the spatial positioning verification passes, the error is considered to have passed; otherwise, the exception handling process is triggered.

[0089] Therefore, compared with existing technologies, the system and method for multiple verifications of drug correctness during automated dispensing in pharmacies proposed in this invention, by constructing a multi-level progressive verification system of location → quantity → size → information → weight, achieves precise control across all dimensions, from physical spatial positioning to drug attribute verification, and has the following beneficial effects:

[0090] 1. This invention constructs a multi-level progressive verification system that rigorously verifies medications comprehensively and at multiple levels, from location, quantity, size, information, to weight. In the medication sorting stage, location verification first ensures that medications are retrieved from the correct storage location, preventing dispensing errors caused by incorrect location at the source. Quantity verification precisely checks whether the quantity of medications retrieved matches the prescription requirements, preventing over- or under-delivery. Size verification further confirms that the physical specifications of the medications meet standards, eliminating errors caused by abnormal medication specifications. Information verification utilizes advanced information recognition technology to accurately compare key information such as the medication's name, specifications, and batch number, ensuring a complete match between the dispensed medication and the prescription information. Finally, weight verification serves as the last line of defense, accurately measuring the weight of the medication to verify its correctness again, effectively preventing dispensing errors caused by information recognition errors or other factors. Therefore, this multi-dimensional, progressive verification method greatly improves the accuracy of medication dispensing, minimizes the risk of dispensing the wrong medication, and provides a solid guarantee for patient medication safety.

[0091] 2. In traditional medication dispensing processes, manual operation is susceptible to various factors such as fatigue, negligence, and lack of experience, leading to dispensing errors. This invention achieves fully automated verification without human intervention, completely eliminating the interference of human factors on dispensing accuracy and effectively avoiding medical disputes and safety hazards caused by human error. This invention achieves close integration with automated dispensing equipment and inventory management modules. In the drug sorting stage, the automated dispensing equipment quickly and accurately selects the required drugs from the inventory according to system instructions and delivers them to the designated location. Subsequently, the system immediately initiates a five-level progressive verification process to comprehensively check the drugs. After verification, the drugs automatically enter the outbound stage, completing the entire dispensing process. This breaks down the information barriers and operational breakpoints between various stages in the traditional dispensing process, realizing one-stop automated processing of drugs from sorting, dispensing to outbound, greatly improving the continuity and smoothness of the dispensing process.

[0092] Thanks to full automation, pharmacies no longer need a large number of professionals for tasks such as drug sorting, verification, and dispensing. Only a few technicians are required for routine system maintenance and monitoring. This not only effectively solves the problem of manpower shortages in pharmacies but also significantly reduces labor costs. Furthermore, the freed-up human resources can be reallocated to more valuable service areas such as patient consultation and health management, further enhancing the pharmacy's service quality and overall competitiveness.

[0093] 3. The system and method of this invention are capable of operating 24 hours a day without human intervention. Regardless of day or night, the system can automatically complete medication dispensing tasks according to preset procedures and standards, significantly extending the service hours of pharmacies. For locations requiring round-the-clock operation, such as 24-hour pharmacies, this can meet patients' medication needs at different times, especially providing timely and convenient services for emergency patients and those needing medication at night, effectively enhancing the social service value and brand image of pharmacies.

[0094] Automated operation and a highly efficient multi-level verification system have greatly improved the speed of drug dispensing. The system can complete a series of operations such as drug sorting, verification, and warehousing in a short time. Compared with the traditional manual dispensing method, the dispensing efficiency is increased by several times or even dozens of times. This not only reduces patients' waiting time and improves their satisfaction, but also allows pharmacies to process more prescription orders in the same amount of time, increasing business volume and economic benefits.

[0095] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description

[0096] Figure 1 This is a schematic diagram of a system embodiment of the present invention for multiple verifications of the correctness of medicines during automatic dispensing in pharmacies.

[0097] Figure 2 This is a flowchart illustrating the multiple verification of drug correctness in an embodiment of a method for automatically dispensing medicines in a pharmacy according to the present invention. Detailed Implementation

[0098] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0099] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0100] An embodiment of a system for multiple verifications of drug correctness during automated dispensing in pharmacies

[0101] See Figure 1 This embodiment provides a system for multiple verifications of drug correctness during automated dispensing in pharmacies, including:

[0102] The online order system is configured to receive drug order information submitted online by users, parse the order information to obtain the drug names, quantities and other relevant information listed in the order, and push the drug order information to the automated dispensing equipment;

[0103] The inventory management module connects to the online order system to store and manage comprehensive information about medicines, including at least the basic attributes, physical parameters, barcode information, and the specific location of the medicine in the inventory, such as coordinates, weight, length, width, height, and basic information. It also supports querying medicine information based on order requirements and automatically updating the inventory quantity after the medicine is shipped out.

[0104] The automated dispensing equipment integrates barcode scanning technology, OCR recognition technology, vision sensors, and weight sensors. It is used to automatically locate and sort the required medicines from the inventory based on the medicine information parsed from the online order system.

[0105] The multi-verification module is used to perform multiple verifications throughout the entire drug sorting process, including at least inventory information verification, drug quantity verification, drug size verification, drug information verification, and drug weight verification.

[0106] The alarm system, connected to the multi-verification module, is used to trigger a three-level alarm mechanism when a mismatch in drug information or other abnormalities are detected at any verification stage.

[0107] An embodiment of a method for multiple verifications of drug correctness during automated dispensing in pharmacies

[0108] A method for multiple verifications of drug correctness during automated dispensing in pharmacies, wherein the method employs the aforementioned system for multiple verifications of drug correctness during automated dispensing in pharmacies, such as... Figure 2 As shown, it includes the following steps:

[0109] Receive online order information and obtain the drug information in the order through a parsing program;

[0110] Based on the product information in the inventory management module, determine the specific location of the medicines to be sorted in the inventory;

[0111] Start the automated dispensing equipment and automatically perform the sorting of medicines according to the order information;

[0112] Before drug sorting, an inventory information verification step is performed. By comparing the drug location information recorded in the inventory management module with the actual location of the automatic dispensing equipment, it is ensured that drugs are sorted from the correct location.

[0113] During the drug sorting process, a double verification step, namely drug quantity verification, is first performed sequentially. Visual sensors are used to identify and count the number of sorted drugs to verify whether it is completely consistent with the quantity required by the order.

[0114] After drug sorting, triple to five verification steps are performed in parallel:

[0115] The triple verification is for drug size verification. It measures the length, width and height of the drug through a visual sensor and compares them with the data pre-recorded in the inventory management module.

[0116] The four-fold verification is for drug information verification. It uses OCR recognition technology to read detailed information on the drug label and barcode recognition technology to read barcode information, and compares it with order information.

[0117] The five-fold verification is for drug weight verification. The actual weight of the drug is measured by a weight sensor and compared with the standard weight of the drug recorded in the inventory management module.

[0118] The drug outbound operation is completed only if all verification steps pass, and the corresponding inventory quantity of the outbound drugs is deducted from the inventory management module.

[0119] As can be seen, this embodiment adopts a serial-parallel hybrid verification mode, with position verification and quantity verification performed sequentially, and the latter three stages processed in parallel. The system has a built-in circuit breaker mechanism, which triggers a three-level alarm (early warning → pause → manual intervention) if any stage of verification fails.

[0120] Before sorting medicines, perform the pre-sorting spatial positioning verification step:

[0121] In the inventory management module, each medicine is pre-set and stored with its unique location coordinates (X, Y, Z), where X and Y represent the specific location coordinates of the medicine on the horizontal plane, and Z represents the shelf height coordinates of the medicine.

[0122] A UWB positioning module is integrated into the robotic arm of the automated dispensing equipment. This module has a positioning accuracy of ±1cm and can obtain the current position information of the robotic arm in real time.

[0123] A unique QR code is affixed to the storage location of each medicine on the shelf. The QR code contains the medicine's location information or is associated with the medicine's location coordinates in the inventory management module.

[0124] When the online order system receives a drug order submitted by a user, it pushes the order information to the automated dispensing equipment. The automated dispensing equipment parses the order information and extracts the name and quantity of the drugs to be sorted.

[0125] The automated dispensing equipment retrieves the preset positioning coordinates (X, Y, Z) of the drug from the inventory management module based on the parsed drug name; then, it controls the robotic arm to move to the vicinity of the target coordinates and uses the UWB positioning module for positioning.

[0126] After the robotic arm is positioned in the target coordinate area, the automatic dispensing equipment controls the built-in scanning device to scan the QR code positioning mark on the medicine rack, and parses the medicine positioning information contained in the QR code or interacts with the inventory management module to obtain the positioning coordinates of the corresponding medicine.

[0127] The current position coordinates of the robotic arm obtained by the UWB positioning module, the positioning coordinates of the medicine obtained by parsing the QR code, and the preset positioning coordinates (X, Y, Z) of the medicine recorded in the inventory management module are compared in three directions. When comparing, the allowable deviation range is set: the deviation of the planar position (X, Y direction) does not exceed ±2cm, and the deviation of the layer height (Z direction) does not exceed ±1cm.

[0128] If the results of the three-way comparison are all within the allowable deviation range, the spatial positioning verification is deemed to have passed, and the automatic dispensing equipment continues to execute the subsequent sorting process; if the comparison result in any direction exceeds the allowable deviation range, a three-level alarm mechanism is immediately triggered, which sequentially issues a warning, suspends the current sorting operation, and notifies a human to intervene for verification.

[0129] For example:

[0130] Scenario: The order requires "Amoxicillin Capsules (0.25g×24 capsules / box)", and the inventory management module records its coordinates as (X=1.2m, Y=0.8m, Z=1.5m) (Z is the shelf height).

[0131] Operating procedures:

[0132] The robotic arm moves to the target area via a UWB positioning module, acquiring its real-time coordinates as (1.18m, 0.81m, 1.49m). Simultaneously, it scans the QR code on the medicine shelf, resolving the standard coordinates of that location as (1.20m, 0.80m, 1.50m).

[0133] Comparison and calculation: XY plane deviation: √[(1.18-1.20)² + (0.81-0.80)²] = 7.1cm → out of tolerance (>2cm); Z-axis deviation: |1.49-1.50|=1cm → meets requirements (≤1cm)

[0134] Result: The XY plane deviation triggered a Level 1 warning, suspending sorting and notifying manual verification of whether the shelf had shifted.

[0135] During the drug sorting process, a visual quantity verification step is performed:

[0136] The automated dispensing equipment is equipped with eight 20-megapixel high-resolution industrial cameras. The cameras are installed in a circular array or at a specific angle above the robotic arm execution end or the sorting area to ensure full-view, blind-spot-free visual coverage of the drug sorting process. Each camera has an independent light source compensation module to adapt to the image acquisition needs under different lighting conditions.

[0137] When the robotic arm grabs the medicine and moves it to the preset sorting position, it triggers 8 cameras to simultaneously collect multiple frames of image data; the image processing unit built into the automatic dispensing equipment performs real-time preprocessing on the collected raw images, including but not limited to noise reduction, contrast enhancement, distortion correction and multi-frame fusion processing, to generate high-definition, low-interference images of the stacked medicines.

[0138] A drug quantity recognition model is trained based on a deep learning framework. This model is iteratively optimized through a large amount of labeled drug stacking image data and has the ability to accurately count drugs with different shapes, sizes, colors and packaging forms. The preprocessed image is input into the quantity recognition model, and the model outputs the predicted quantity value of the drugs. At the same time, traditional image processing techniques (such as edge detection and connected component analysis) are used as auxiliary verification methods to cross-validate the prediction results of the deep learning model, so as to improve the robustness of quantity recognition.

[0139] The tolerance for quantity error is set to 0%, meaning that the system requires that the quantity of medicines visually identified must be exactly the same as the quantity of medicines specified in the online order; the predicted quantity value output by the quantity recognition model is strictly compared with the order quantity, and if the two values ​​are equal, the quantity visual verification is deemed to have passed.

[0140] If the quantity comparison results are inconsistent, a three-level alarm mechanism will be triggered immediately. Specifically, the system will first issue a warning signal through an audible and visual alarm device to alert the operator. Then, the automatic dispensing equipment will automatically suspend the current sorting task to prevent the further circulation of incorrect medicines. Finally, the system will push the abnormal information to the back-end management system and notify relevant personnel to conduct manual intervention and processing in a timely manner. Sorting operations can only be resumed after the problem is resolved.

[0141] For example:

[0142] Scenario: The order requires 3 boxes of "Amoxicillin Capsules (system recorded dimensions: L=10cm, W=6cm, H=2cm)".

[0143] Operating procedures:

[0144] Image acquisition: Eight cameras capture images of the medicine-grabbing area from different angles, generating eight multi-view images.

[0145] Algorithm processing

[0146] Model Training: 100,000 labeled medicine box images (covering overlapping, tilted, and partially occluded scenes) were pre-trained as the basis for data recognition. Object Detection: The bounding boxes of the medicine boxes were identified using the YOLOv7 model (confidence threshold > 0.9), the center points of the bounding boxes were calculated, and finally the number of medicine boxes was obtained.

[0147] Result: Quantity statistics: Number of independent medicine boxes in 3D space = 3 → Verification passed.

[0148] Abnormal case: If 4 medicine boxes are detected, a level 2 pause is triggered, and the message "Quantity exceeded" is displayed.

[0149] After drug sorting, perform the following three-dimensional dimension verification step:

[0150] A high-precision three-dimensional vision acquisition module is installed at the sorting exit of the automatic dispensing equipment. This module includes at least two sets of industrial cameras and structured light projection devices arranged perpendicularly to each other, or a stereo vision sensor driven by deep learning, to acquire three-dimensional contour images of the drugs in real time after the drugs have been sorted.

[0151] While acquiring 3D images, the built-in OCR recognition unit of the automatic dispensing equipment quickly scans the identifiable areas on the drug packaging (such as the label and barcode marking area) to extract the pre-printed basic data of the length, width, and height of the drug. If the packaging does not directly mark the size, the OCR recognizes the drug name and specification information, and indirectly obtains the theoretical size data based on the drug specification-size mapping table stored in the inventory management module.

[0152] The collected 3D contour images are input into a pre-trained size analysis model. This model is built on a deep learning framework and is trained with a large amount of labeled 3D images of drugs and actual size data. It has the ability to automatically extract the maximum length, width and height contours of drugs from complex packaging shapes. The model outputs the measured length (L1), width (W1) and height (H1) values ​​of the drug.

[0153] The theoretical length (L0), width (W0), and height (H0) data obtained from OCR recognition are cross-validated with the standard dimensions (L2, W2, H2) of the drug recorded in the inventory management module to ensure consistency between the OCR data and the inventory data. Subsequently, the measured dimensions (L1, W1, H1) are compared with the theoretical dimensions (L0, W0, H0) or the standard inventory dimensions (L2, W2, H2) respectively, with an allowable error range of ±3% (i.e., satisfying the condition: |L1-L0| / L0≤3%, and the same applies to the width and height dimensions).

[0154] For medicines in flexible or irregularly shaped packaging, which may experience dimensional fluctuations due to compression or deformation, the system automatically retrieves historical dimensional fluctuation range data for the medicine recorded in the inventory management module and performs dynamic compensation and correction on the current measured size. If the corrected size still exceeds the allowable error range, the verification is deemed to have failed.

[0155] If all dimensional comparison results are within the allowable error range, the 3D dimensional verification is deemed successful, and the system automatically triggers the next verification process; if any dimensional comparison fails, a three-level alarm mechanism is immediately activated:

[0156] Level 1 warning: Sends an alert for abnormal dimensions to the operator through audio-visual prompts and interface pop-ups;

[0157] Level 2 Pause: The automated dispensing equipment pauses the current dispensing operation of medicines and locks the sorting channel to prevent accidental dispensing;

[0158] Level 3 manual intervention: The abnormal drug information (including measured size, theoretical size, and image data) is pushed to the back-end management system, the quality inspection personnel are notified to conduct on-site verification, and the abnormal event is recorded in the system log for traceability and analysis.

[0159] For example:

[0160] Scenario: Sorting "blood glucose test strip boxes" (system recorded dimensions: L=8cm, W=5cm, H=2cm).

[0161] Operating procedures:

[0162] The robotic arm moves the medicine to the structured light scanning area, emits a striped grating, and acquires the deformed pattern. 2. Reconstruction: Depth information is calculated using the phase shift method to generate a 3D point cloud model.

[0163] Size Extraction: Through size extraction, the minimum bounding box fit is obtained: L=8.1cm, W=4.9cm, H=2.05cm

[0164] Error calculation: Width error |4.9-5.0| / 5.0 = 2% → Meets requirements (≤3%)

[0165] Result: 3D dimension verification passed.

[0166] Abnormal case: If the detected H=2.5cm (error 25%), an alarm will be triggered to indicate "suspected foreign object mixed in".

[0167] After the medicines are sorted, perform the post-sorting product information verification step:

[0168] A high-resolution multi-spectral imaging module is set at the sorting outlet of the automatic drug dispensing equipment, which at least includes a visible light camera, an infrared camera and an ultraviolet fluorescence imaging unit, and is used to collect all-round image data of the drug packaging; the image preprocessing unit performs dynamic range adjustment, denoising, distortion correction and multi-spectral fusion processing on the collected original images to generate a high-definition and low-interference composite image, ensuring that key information can be clearly identified under different packaging materials (such as matte, reflective, transparent) and printing processes (such as laser engraving, ink jet coding).

[0169] A multi-language drug information recognition model is constructed based on a deep learning framework. This model is trained through a large number of labeled drug packaging images (covering different fonts, font sizes, colors, backgrounds and layout styles), and has the ability to accurately extract key fields such as drug names, approval numbers, manufacturers, and specifications; the preprocessed composite image is input into the recognition model, and the model outputs structured text data, including:

[0170] Drug names (supporting simultaneous recognition of Chinese and English, generic names and trade names);

[0171] Approval numbers (format verification:国药准字 H / Z / S + 8 digits, or the format of the import drug registration certificate);

[0172] Manufacturers (supporting full names, abbreviations and pinyin abbreviations for matching);

[0173] Specifications (unit standardization processing, such as converting "0.1g×12 tablets / box" to "0.1g / tablet×12 tablets").

[0174] Query the filing information of the drug in real time from the inventory management module, including the standard drug name, the only approval number, the registered manufacturer and the specification parameters;

[0175] Perform strong matching of key fields, including:

[0176] Approval number: Adopt a string exact matching algorithm, requiring that the OCR recognition result is 100% consistent with the approval number (including the verification digit) in the inventory record;

[0177] Drug name: Support fuzzy matching, allowing differences in synonyms, aliases and punctuation marks (such as "Amoxicillin Capsules" and "Amoxicillin Soft Capsules" need to be verified through the drug alias library);

[0178] Manufacturer and specification: Adopt a semantic similarity algorithm, and compare with the predefined synonym library (such as "tablet" and "jun" need to be recognized as the same specification unit), allowing reasonable expression differences.

[0179] Preferably, for high-risk drugs, an anti-counterfeiting feature recognition module is integrated. This module detects invisible fluorescent marks on drug packaging using an ultraviolet fluorescence imaging unit or identifies thermosensitive color-changing ink using an infrared camera. The anti-counterfeiting feature code is then compared with the anti-counterfeiting information database recorded in the inventory management module to ensure the legality of the drug's source.

[0180] If the approval number matches perfectly, and the comparison results of key fields such as drug name, manufacturer, and specifications all meet the preset similarity threshold (e.g., ≥95%), then the product information verification is deemed successful, and the system automatically triggers the next verification process.

[0181] If any key field fails to match, a three-level alert mechanism will be immediately activated:

[0182] Level 1 warning: Send "Abnormal product information" warnings to operators via audio-visual prompts, screen pop-ups, and mobile terminal push notifications;

[0183] Level 2 Pause: The automated dispensing equipment pauses the current dispensing operation of medicines and locks the sorting channel to prevent accidental dispensing.

[0184] Level 3 manual intervention: Abnormal drug images, OCR recognition results, and inventory registration information are automatically uploaded to the back-end management system, quality inspectors are notified to conduct on-site verification, and abnormal events are recorded in the blockchain traceability log for subsequent audit analysis.

[0185] For example:

[0186] Scenario: Verify "Atorvastatin Calcium Tablets (20mg×7 tablets / box)".

[0187] Operating procedures:

[0188] OCR recognition of medicine box label text:

[0189] Drug Name: Atorvastatin Calcium Tablets

[0190] Approval Number: National Drug Approval Number H20230301

[0191] Manufacturer: Beijing XX Pharmaceutical

[0192] Specifications: 20mg x 7 tablets

[0193] Key field comparison:

[0194] Approval number: National Drug Approval Number H20230301 vs System record H20230301 → Complete match

[0195] Drug Name: Cosine Similarity (Atorvastatin Calcium Tablets vs. Atorvastatin Calcium Tablets) = 1.0 → Match

[0196] Result: Information verification successful.

[0197] Abnormal case: If the approval number is identified as H20230302, a level 3 manual intervention is triggered.

[0198] After the medicines are sorted, perform the post-sorting - product weight verification step:

[0199] A high-precision electromagnetic force balance weight sensor is integrated below the sorting exit conveyor belt of the automated dispensing equipment. Its measuring range covers 0.1g to 5000g, with a resolution of 0.01g, and it has temperature compensation and anti-vibration interference functions. The sensor surface is covered with anti-slip silicone pads to ensure that the medicine remains stationary during the weighing process. At the same time, adjustable limit baffles are set on both sides of the conveyor belt to prevent medicine from slipping or shifting, which would cause weighing errors.

[0200] When the medicine passes through the weighing area, the weight sensor continuously collects weight data at a sampling frequency of no less than 100Hz, and removes mechanical vibration noise through a low-pass filtering algorithm. The system automatically identifies the stable state of the medicine (i.e., the weight fluctuation range is ≤ ±0.05g for more than 0.5 seconds) and extracts the average weight of the stable phase as the actual weight of a single medicine (W1). If multiple medicines are weighed in batches, the system automatically calculates the expected total weight based on the order quantity (N) (W0_total = W0_single × N, where W0_single is the standard weight of a single medicine recorded in the system) and collects the actual total weight of the batch (W1_total).

[0201] Single-item drug verification mode: Compare the measured single-item weight (W1) with the standard weight (W) recorded in the system. 0_single The comparison is performed, with an allowable error range of ±2% (i.e., meeting the condition: |W1-W) 0_single | / W 0_single ≤ 2%)

[0202] Batch drug verification mode: The actual measured value of the total batch weight (W) 1_total ) and expected total weight (W) 0_total The comparison is performed, with an allowable error range of ±2% (i.e., the condition |W is met). 1_total - W 0_total | / W 0_total ≤ 2%)

[0203] For hygroscopic medicines (such as granules and powders), the system automatically calls the humidity-weight change curve of the medicine recorded in the inventory management module and performs dynamic compensation and correction on the measured weight based on the current ambient humidity sensor data; if the weight still exceeds the allowable error range after correction, it is determined that the verification has failed.

[0204] If the weight verification fails, the system will immediately initiate the traceability analysis process:

[0205] Retrieve the historical weighing data of the drug (weight records of the same batch of drugs in the past 30 days), generate a weight distribution chart, and determine whether it is a systematic deviation (such as weight changes caused by changes in packaging materials).

[0206] The specification information on the drug packaging (such as "0.1g×12 tablets") is reviewed by the OCR recognition module to confirm whether the expected weight value is deviated due to incorrect specification labeling.

[0207] If the traceability analysis cannot rule out anomalies, the current batch of medicine will be locked, its release from the warehouse will be prohibited, and an alarm will be triggered.

[0208] If the weight comparison result is within the allowable error range, the product weight verification is deemed to have passed, and the system will automatically trigger the next verification process (such as packaging integrity verification).

[0209] If the weight comparison fails, a three-level alarm mechanism will be activated immediately:

[0210] Level 1 warning: Sends an "abnormal weight" warning to the operator through sound and light prompts, red flashing on the screen and push notifications on mobile terminals, and displays the difference between the measured weight and the expected weight;

[0211] Level 2 Suspension: The automated dispensing equipment suspends the current dispensing operation of medicines and controls the conveyor belt to transfer abnormal medicines to the isolation area to prevent them from being mixed with qualified medicines;

[0212] Level 3 manual intervention: The weight data of abnormal drugs, historical weighing records, environmental temperature and humidity data, and packaging images are automatically uploaded to the back-end management system. Quality inspectors are notified to carry a portable precision balance for on-site verification, and the abnormal event is recorded in the blockchain traceability log for subsequent audit analysis.

[0213] For example:

[0214] Scenario: Sorting 2 boxes of "blood glucose test strips" (system records each box weighs 25.5g)

[0215] Operating procedures:

[0216] The weight sensor reads a total weight of 51.2g.

[0217] Dynamic compensation calculation:

[0218] Theoretical weight: 2 × 25.5g = 51.0g

[0219] Error rate: |51.2-51.0| / 51.0 ≈ 0.39% → Meets requirements (≤2%)

[0220] Result: Weight verification passed.

[0221] Abnormal case: If the measured value is 55.0g (error 7.8%), an alarm will be triggered indicating "may be mixed with other drugs".

[0222] In the pre-sorting spatial positioning verification step, when performing three-way comparison, a multi-source coordinate real-time acquisition and preprocessing step is executed:

[0223] Real-time coordinate acquisition of robotic arm: A UWB positioning module is integrated on the end effector of the robotic arm. This module uses ultra-wideband pulse signals to measure distances with at least 4 fixed base stations and calculates the current spatial coordinates (X1, Y1, Z1) of the robotic arm in real time based on the trilateration algorithm, with a positioning accuracy of ≤±1mm.

[0224] Drug visual positioning coordinate analysis: A unique QR code label is set on each location of the drug storage shelf. The industrial camera mounted on the robotic arm scans the QR code to analyze the preset positioning coordinates (X2, Y2, Z2) of the drug in the shelf coordinate system. The analysis resolution is ≤ ±0.5mm.

[0225] Inventory baseline coordinate retrieval: The preset positioning coordinates (X0, Y0, Z0) of the drug are retrieved in real time from the database of the inventory management module. These coordinates are pre-calibrated based on the 3D model of the shelf and are dynamically updated to compensate for micro-deformations of the shelf (such as expansion / contraction caused by temperature changes).

[0226] Coordinate system transformation: Unify the robotic arm coordinates (X1, Y1, Z1) obtained by the UWB positioning module and the cargo location coordinates (X2, Y2, Z2) obtained by QR code parsing to the same global coordinate system (such as the world coordinate system). The transformation formula is as follows:

[0227]

[0228] Where θ is the rotation angle between the local coordinate system and the global coordinate system, and (ΔX, ΔY, ΔZ) are translation vectors, all of which are obtained through pre-calibration;

[0229] To address dynamic errors such as vibration and slight deformation of the shelving during the movement of the robotic arm, a Kalman filter algorithm is introduced to smooth the real-time coordinates (X1, Y1, Z1), and the historical deformation data of the shelving recorded in the inventory management module (such as the temperature-deformation curve in the past 24 hours) is called to dynamically correct the reference coordinates (X0, Y0, Z0).

[0230] In this embodiment, a three-dimensional coordinate comparison and allowable deviation determination step is also performed:

[0231] Calculate the deviations of the robotic arm's real-time coordinates (X1, Y1, Z1), QR code parsing coordinates (X2, Y2, Z2), and inventory baseline coordinates (X0, Y0, Z0) along the X, Y, and Z axes, respectively, using the following formulas:

[0232]

[0233] Based on the drug grasping accuracy requirements, set the allowable deviation threshold (ΔX) for each axis. max , ΔY max , ΔZ max ),in:

[0234] High-precision pharmaceuticals (such as expensive injectables): ΔX max = ΔY max = ΔZ max = ±1.5mm;

[0235] Common medicines (such as boxed oral medications): ΔX max = ΔY max = ΔZ max = ±3mm;

[0236] Judgment logic: If the deviations between the robotic arm coordinates and the QR code parsing coordinates in each axis satisfy the following:

[0237] Δ X 1≤Δ X max And Δ Y 1≤Δ Y max And Δ Z 1≤Δ Z max

[0238] Meanwhile, the deviation between the QR code parsing coordinates and the inventory baseline coordinates satisfies:

[0239] Δ X 2≤Δ X max And Δ Y 2≤Δ Y max And Δ Z 2≤Δ Z max

[0240] If the spatial positioning verification passes, the exception handling process is triggered.

[0241] Source tracing analysis: If the verification fails, the system will automatically retrieve the following data for analysis:

[0242] Historical trajectory data of the UWB positioning module (robotic arm movement trajectory in the past 5 seconds);

[0243] Statistics on the success rate of QR code label parsing (such as the error rate of the last 10 scans);

[0244] Shelf temperature and humidity sensor data (to determine whether shelf deformation is caused by environmental changes).

[0245] In summary, the system and method for multiple verifications of drug accuracy during automated dispensing in pharmacies of the present invention, through its advantages such as multi-level verification system, fully automated operation, and 24-hour uninterrupted operation, has achieved significant results in improving dispensing accuracy, reducing manpower, and increasing work efficiency, and has broad application prospects and huge market value.

[0246] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0247] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.

Claims

1. A system for multiple verifications of drug correctness during automated dispensing in pharmacies, characterized in that, include: The online order system is configured to receive drug order information submitted online by users and parse the order information to obtain the drug names, quantities and other relevant information listed in the order. The inventory management module is connected to the online order system and is used to store and manage comprehensive information about the medicines, including at least the basic attributes, physical parameters, barcode information and the specific location of the medicines in the inventory. It also supports querying medicine information according to order requirements and automatically updating the inventory quantity after the medicines are shipped out. The automated dispensing equipment integrates barcode scanning technology, OCR recognition technology, vision sensors, and weight sensors. It is used to automatically locate and sort the required medicines from the inventory based on the medicine information parsed by the online order system. The multi-verification module is used to perform multiple verifications throughout the entire drug sorting process, including at least inventory information verification, drug quantity verification, drug size verification, drug information verification, and drug weight verification. Before drug sorting, an inventory information verification step is performed. By comparing the drug location information recorded in the inventory management module with the actual location of the automatic dispensing equipment, it is ensured that drugs are sorted from the correct location. During the drug sorting process, a double verification step, namely drug quantity verification, is first performed sequentially. Visual sensors are used to identify and count the number of sorted drugs to verify whether it is completely consistent with the quantity required by the order. After drug sorting, triple to five verification steps are performed in parallel: The triple verification is for drug size verification. It measures the length, width and height of the drug through a visual sensor and compares them with the data pre-recorded in the inventory management module. The four-fold verification is for drug information verification. It uses OCR recognition technology to read detailed information on the drug label and barcode recognition technology to read barcode information, and compares it with order information. The five-fold verification is for drug weight verification. The actual weight of the drug is measured by a weight sensor and compared with the standard weight of the drug recorded in the inventory management module. The alarm system, which is connected to the multi-verification module, is used to trigger a three-level alarm mechanism when a mismatch in drug information or other abnormalities are found at any verification stage.

2. A method for multiple verifications of drug correctness during automated dispensing in pharmacies, characterized in that, This method employs the multi-factor verification system for drug correctness during automated dispensing in pharmacies as described in claim 1, and includes the following steps: Receive online order information and obtain the drug information in the order through a parsing program; Based on the product information in the inventory management module, determine the specific location of the medicines to be sorted in the inventory; Start the automated dispensing equipment and automatically perform the sorting of medicines according to the order information; A multi-verification module is used to perform multiple verifications throughout the entire drug sorting process; The drug outbound operation is completed only if all verification steps pass, and the corresponding inventory quantity of the outbound drugs is deducted from the inventory management module.

3. The method according to claim 2, characterized in that, Before sorting medicines, perform the pre-sorting spatial positioning verification step: In the inventory management module, each medicine is pre-set and stored with its unique location coordinates (X, Y, Z), where X and Y represent the specific location coordinates of the medicine on the horizontal plane, and Z represents the shelf height coordinates of the medicine. A UWB positioning module is integrated into the robotic arm of the automated dispensing equipment. This module has a positioning accuracy of ±1cm and can obtain the current position information of the robotic arm in real time. A unique QR code is affixed to the storage location of each medicine on the shelf. The QR code contains the medicine's location information or is associated with the medicine's location coordinates in the inventory management module. When the online order system receives a drug order submitted by a user, it pushes the order information to the automated dispensing equipment. The automated dispensing equipment parses the order information and extracts the name and quantity of the drugs to be sorted. The automated dispensing equipment retrieves the preset positioning coordinates (X, Y, Z) of the drug from the inventory management module based on the parsed drug name; then, it controls the robotic arm to move to the vicinity of the target coordinates and uses the UWB positioning module for positioning. After the robotic arm is positioned in the target coordinate area, the automatic dispensing equipment controls the built-in scanning device to scan the QR code label on the medicine rack, and parse the medicine location information contained in the QR code label or interact with the inventory management module to obtain the location coordinates of the corresponding medicine. The current position coordinates of the robotic arm obtained by the UWB positioning module, the drug positioning coordinates parsed from the QR code label, and the preset drug positioning coordinates (X, Y, Z) recorded in the inventory management module are compared in three directions. If the results of the three-way comparison are all within the allowable deviation range, the spatial positioning verification is deemed to have passed. If the comparison result in any direction exceeds the allowable deviation range, a three-level alarm mechanism will be immediately triggered, which will sequentially issue a warning, suspend the current sorting operation, and notify manual intervention for verification.

4. The method according to claim 3, characterized in that, During the drug sorting process, a visual quantity verification step is performed: The automated dispensing equipment incorporates multiple high-resolution industrial cameras, which are mounted in a circular array or at a specific angle above the robotic arm's execution end or the sorting area. When the robotic arm grabs the medicine and moves it to the preset sorting position, it triggers multiple cameras to simultaneously collect multiple frames of image data; The image processing unit built into the automated dispensing equipment performs real-time preprocessing on the acquired raw images to generate images of the stacked drugs. A drug quantity recognition model is trained based on a deep learning framework. The preprocessed image is input into the drug quantity recognition model, and the model outputs the predicted quantity value of the drugs. Set a quantity error tolerance, meaning the system requires that the quantity of medicines visually identified must be exactly the same as the quantity of medicines specified in the online order; compare the predicted quantity value output by the quantity recognition model with the order quantity, and if the two values ​​are equal, the quantity visual verification is deemed to have passed; If the quantity comparison results are inconsistent, a level 3 alarm mechanism will be triggered immediately.

5. The method according to claim 4, characterized in that, After drug sorting, perform the following three-dimensional dimension verification step: A three-dimensional vision acquisition module is installed at the sorting exit of the automatic dispensing equipment. This module includes at least two sets of industrial cameras and structured light projection devices arranged perpendicularly to each other, or a stereo vision sensor driven by deep learning, to acquire three-dimensional contour images of the drugs in real time after the drugs have been sorted. While acquiring 3D images, the built-in OCR recognition unit of the automatic dispensing equipment quickly scans the identifiable areas on the drug packaging to extract the pre-printed basic data of the length, width, and height of the drug. If the packaging does not directly indicate the size, the OCR recognizes the drug name and specification information, and the theoretical size data is indirectly obtained based on the drug specification-size mapping table stored in the inventory management module. The acquired 3D contour image is input into a pre-trained size analysis model, which is built on a deep learning framework. The model outputs the measured length L1, width W1, and height H1 values ​​of the drug. The theoretical length L0, width W0, and height H0 data obtained by OCR recognition are cross-validated with the standard dimensions L2, W2, and H2 of the drug recorded in the inventory management module; then, the measured dimensions L1, W1, and H1 are compared with the theoretical dimensions L0, W0, and H0 or the standard inventory dimensions L2, W2, and H2, respectively. If all dimensional comparison results are within the allowable error range, the 3D dimensional verification is deemed successful, and the system automatically triggers the next verification process; if any dimensional comparison fails, a three-level alarm mechanism is immediately activated.

6. The method according to claim 5, characterized in that, After the medicines are sorted, perform the post-sorting product information verification step: A high-resolution multispectral imaging module is installed at the sorting exit of the automated dispensing equipment. This module includes at least a visible light camera, an infrared camera, and an ultraviolet fluorescence imaging unit. It is used to collect omnidirectional image data of the drug packaging and to preprocess the collected raw images to generate composite images. A multilingual drug information recognition model is built based on a deep learning framework. The preprocessed composite image is input into the recognition model, and the model outputs structured text data, which includes at least the drug name, approval number, manufacturer, and specifications. The registration information of the drug can be queried in real time from the inventory management module, including at least the standard drug name, unique approval number, registered manufacturer and specifications. Perform strong matching of key fields, including approval number, drug name, manufacturer and specifications; If the approval number matches perfectly, and the comparison results of key fields such as drug name, manufacturer, and specifications all meet the preset similarity threshold, the product information verification is deemed successful, and the system automatically triggers the next verification process; if any key field fails to match, a three-level alarm mechanism is immediately activated.

7. The method according to claim 6, characterized in that, After the medicines are sorted, perform the post-sorting - product weight verification step: An electromagnetic force balance weight sensor is integrated below the sorting exit conveyor belt of the automatic dispensing equipment; the sensor surface is covered with an anti-slip silicone pad to ensure that the medicine remains stationary during the weighing process; at the same time, adjustable limit baffles are set on both sides of the conveyor belt to prevent the medicine from slipping or shifting, which would cause weighing errors. As the medicine passes through the weighing area, the weight sensor continuously collects weight data at a sampling frequency of no less than 100Hz, and removes mechanical vibration noise through a low-pass filtering algorithm. The system automatically identifies the stable state of the medicine and extracts the average weight during the stable phase as the measured weight W1 of a single medicine. If multiple medicines are weighed in batches, the system automatically calculates the expected total weight W based on the order quantity N. 0_total = W 0_single × N, where W 0_single The system records the standard weight of a single medicine item and collects the measured value W of the total batch weight. 1_total ; Single-item drug verification mode: Compare the measured single-item weight W1 with the standard weight W recorded in the system. 0_single Perform a comparison; Batch drug verification mode: The measured total weight W of the batch 1_total With the expected total weight W 0_total Perform a comparison; If the weight comparison result is within the allowable error range, the product weight verification is deemed successful, and the system automatically triggers the next verification process; if the weight comparison fails, a three-level alarm mechanism is immediately activated.

8. The method according to claim 7, characterized in that, For hygroscopic medicines, the system automatically calls the humidity-weight change curve of the medicine recorded in the inventory management module and performs dynamic compensation and correction on the measured weight based on the current ambient humidity sensor data; if the weight still exceeds the allowable error range after correction, it is judged as a verification failure. If the weight verification fails, the system immediately initiates the traceability analysis process: retrieves the historical weighing data of the drug, generates a weight distribution chart, and determines whether it is a systematic deviation; and verifies the specification information on the drug packaging through the OCR recognition module to confirm whether the deviation in the expected weight value is due to incorrect specification labeling. If the traceability analysis cannot rule out anomalies, the current batch of medicine will be locked, its release from the warehouse will be prohibited, and an alarm will be triggered.

9. The method according to claim 3, characterized in that, When performing three-way comparison, the following steps are executed: real-time acquisition and preprocessing of multi-source coordinates: Real-time coordinate acquisition of robotic arm: A UWB positioning module is integrated on the end effector of the robotic arm. This module uses ultra-wideband pulse signals to measure distances with at least 4 fixed base stations and calculates the current spatial coordinates (X1, Y1, Z1) of the robotic arm in real time based on the trilateration algorithm. Drug visual positioning coordinate analysis: A unique QR code label is set on each location of the drug storage shelf. The industrial camera mounted on the robotic arm scans the QR code label to analyze the preset positioning coordinates (X2, Y2, Z2) of the drug in the shelf coordinate system. Inventory baseline coordinate retrieval: Real-time query of the preset location coordinates (X0, Y0, Z0) of the drug from the database of the inventory management module. Coordinate system transformation: The robot arm coordinates (X1, Y1, Z1) obtained by the UWB positioning module and the cargo location coordinates (X2, Y2, Z2) obtained by QR code parsing are unified into the same global coordinate system. The transformation formula is as follows: Where θ is the rotation angle between the local coordinate system and the global coordinate system, and (ΔX, ΔY, ΔZ) are translation vectors, all of which are obtained through pre-calibration; Specifically, to address the dynamic errors during the movement of the robotic arm, a Kalman filter algorithm is introduced to smooth the real-time coordinates (X1, Y1, Z1), and the historical deformation data of the shelves recorded in the inventory management module is used to dynamically correct the reference coordinates (X0, Y0, Z0).

10. The method according to claim 9, characterized in that, It also performs the following steps: three-dimensional coordinate comparison and allowable deviation determination. Calculate the deviations of the robotic arm's real-time coordinates (X1, Y1, Z1), QR code parsing coordinates (X2, Y2, Z2), and inventory baseline coordinates (X0, Y0, Z0) along the X, Y, and Z axes, respectively, using the following formulas: Based on the drug grasping accuracy requirements, set the allowable deviation threshold (ΔX) for each axis. max , ΔY max , ΔZ max ),in: High-precision pharmaceuticals: ΔX max = ΔY max = ΔZ max = ±1.5mm; Common medicines: ΔX max = ΔY max = ΔZ max = ±3mm; If the deviations between the robotic arm coordinates and the QR code coordinates in each axis satisfy the following: D X 1≤Δ X max And D Y 1≤Δ Y max And D Z 1≤Δ Z max Meanwhile, the deviation between the QR code coordinates and the inventory baseline coordinates satisfies: D X 2≤Δ X max And D Y 2≤Δ Y max And D Z 2≤Δ Z max If the spatial positioning verification passes, the error is considered to have passed; otherwise, the exception handling process is triggered.