Full-automatic medicine dispensing equipment and method based on artificial intelligence
The fully automated medication dispensing equipment based on artificial intelligence has solved the problems of inefficient path planning, insufficient positioning accuracy, and lack of information management in existing medication dispensing equipment, and has achieved an efficient, accurate and safe medication dispensing process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-03
AI Technical Summary
Existing medication dispensing equipment suffers from problems such as inefficient path planning, insufficient positioning accuracy, crude dosage control, and lack of information management, resulting in low medication dispensing efficiency, insufficient accuracy, and insufficient safety.
The system employs fully automated dispensing equipment based on artificial intelligence. It generates the optimal path by analyzing prescription information, performs real-time calibration using visual recognition technology, and achieves precise dispensing by combining a baffle control driven by a micro cylinder. It also performs real-time monitoring and information management.
It achieves high efficiency, accuracy and safety in the medication dispensing process, reduces the risk of drug residues and cross-contamination, and improves medication dispensing efficiency and traceability.
Smart Images

Figure CN121789942A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical device automation technology, and in particular to a fully automated drug dispensing device and method based on artificial intelligence. Background Technology
[0002] The traditional pharmaceutical dispensing field has long faced the core problems of heavy reliance on manual labor and insufficient automation. Existing pharmaceutical dispensing equipment generally suffers from the following technical bottlenecks: 1. Inefficient path planning: The robotic arm's drug retrieval path is mostly based on fixed programs or simple coordinate mapping, without dynamic optimization based on multi-dimensional data such as prescription priority and drug bottle location distribution. This results in a long time for a single drug dispensing, especially when handling multi-product dispensing tasks, where the robotic arm's motion path is significantly redundant, limiting efficiency improvement.
[0003] 2. Insufficient positioning accuracy: The alignment of the medicine bottle and the dispensing container relies on pre-calibration of the mechanical structure, lacking a real-time dynamic calibration mechanism. During the gripping and transfer process, mechanical vibration or gripping deviation can cause positional shifts in the medicine bottle, easily leading to misalignment between the bottle mouth and the dispensing cup, resulting in spillage or cross-contamination of the medicine and affecting the accuracy of dispensing.
[0004] 3. Inefficient Dosage Control: The dispensing process often relies on gravity flow or fixed-frequency opening and closing devices, making it impossible to finely adjust the dosage according to drug characteristics (such as particle size and flowability) and prescription dosage requirements. For drugs that need to be dispensed in multiple doses, traditional mechanical baffles or valve controls have response delays, making it difficult to achieve the operational requirements of "dispensing on demand and precise quantification".
[0005] 4. Lack of Information Management: Processes such as inventory updates and medication traceability rely on manual recording or independent system integration, which is prone to data lag or errors. Abnormal situations (such as drug shortages or equipment malfunctions) cannot be monitored and alerted in real time, resulting in insufficient safety and traceability in the medication dispensing process.
[0006] Therefore, a method is urgently needed to solve at least one of the above problems. Summary of the Invention
[0007] This application provides a fully automated dispensing device and method based on artificial intelligence, aiming to solve the problem that there is no fully automated solution in the existing technology that integrates prescription analysis, route planning, visual calibration and intelligent control through artificial intelligence algorithms, especially the lack of a dispensing method that deeply integrates AI dynamic optimization, real-time visual feedback and mechanical actuators.
[0008] In a first aspect, this application provides a fully automated drug dispensing device based on artificial intelligence, applied to a fully automated drug dispensing device, the method comprising: The prescription information of the medicine to be dispensed is analyzed to generate a dispensing task. Based on the matrix coordinates of the storage window in the medicine cabinet of the fully automated dispensing equipment and the motion parameters of the robotic arm, the optimal path for the robotic arm to grasp the target medicine bottle is planned. The robotic arm of the fully automated dispensing equipment moves to the target storage window according to the planned path, grabs the target medicine bottle with the cap facing outward through the end effector, and places the target medicine bottle upside down in the designated medicine placement slot of the first dispensing module of the fully automated dispensing equipment, so that the mouth of the target medicine bottle is facing downward. Visual recognition technology is used to obtain the position information of the target medicine bottle in the medicine dispensing tank, and the position of the corresponding cup in the material cup receiving tank in the second dispensing module of the fully automatic dispensing equipment is calibrated to ensure that the mouth of the target medicine bottle is vertically aligned with the opening of the material cup. According to the dosage requirements in the medication dispensing task, the opening and closing timing of the baffle is controlled by driving the miniature cylinder under the dispensing tank of the fully automatic medication dispensing equipment, so that the medicine in the target medicine bottle falls into the material cup below under the action of gravity in a quantitative manner; after the medication is dispensed, the inventory information of the corresponding medicine is updated, and a medication dispensing process traceability record is generated. At the same time, abnormal situations in the medication dispensing process are monitored and warned in real time.
[0009] Secondly, this application provides an artificial intelligence-based fully automated drug dispensing device, which can be applied to the artificial intelligence-based fully automated drug dispensing method provided in any embodiment of this application.
[0010] This invention relates to the field of medical device automation technology, specifically to a fully automated drug dispensing method based on artificial intelligence, which integrates robotic arm control, visual recognition, intelligent algorithms and information management, and is applicable to precise drug preparation in medical, elderly care and other scenarios.
[0011] The method uses AI algorithms to analyze prescriptions and optimize the robotic arm's movement path, reducing unnecessary movement distances and improving dispensing efficiency, making it particularly suitable for the rapid dispensing of multiple drug varieties. Visual recognition technology acquires real-time bottle position information and dynamically calibrates it to ensure the vertical alignment accuracy between the bottle opening and the dispensing cup, significantly reducing the risk of drug residue and cross-contamination. A baffle control mechanism driven by a micro-cylinder, combined with prescription dosage requirements, achieves "on-demand dispensing," keeping dosage errors within a preset range to meet high-precision dispensing needs. After dispensing, inventory is automatically updated, traceability records are generated, and anomalies are monitored in real time, reducing manual intervention, improving the safety and traceability of the dispensing process, and lowering the human error rate.
[0012] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0013] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a schematic diagram of the structure of a fully automated drug dispensing device based on artificial intelligence provided in an embodiment of this application; Figure 2 This is a schematic flowchart illustrating the steps of using a fully automated dispensing device based on artificial intelligence, according to an embodiment of this application. Figure 3 This is a schematic block diagram of the structure of a computer control device provided in an embodiment of this application.
[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0018] It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0019] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0020] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0021] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0022] The traditional pharmaceutical dispensing field has long faced the core problems of heavy reliance on manual labor and insufficient automation. Existing pharmaceutical dispensing equipment generally suffers from the following technical bottlenecks: 1. Inefficient path planning: The robotic arm's drug retrieval path is mostly based on fixed programs or simple coordinate mapping, without dynamic optimization based on multi-dimensional data such as prescription priority and drug bottle location distribution. This results in a long time for a single drug dispensing, especially when handling multi-product dispensing tasks, where the robotic arm's motion path is significantly redundant, limiting efficiency improvement.
[0023] 2. Insufficient positioning accuracy: The alignment of the medicine bottle and the dispensing container relies on pre-calibration of the mechanical structure, lacking a real-time dynamic calibration mechanism. During the gripping and transfer process, mechanical vibration or gripping deviation can cause positional shifts in the medicine bottle, easily leading to misalignment between the bottle mouth and the dispensing cup, resulting in spillage or cross-contamination of the medicine and affecting the accuracy of dispensing.
[0024] 3. Inefficient Dosage Control: The dispensing process often relies on gravity flow or fixed-frequency opening and closing devices, making it impossible to finely adjust the dosage according to drug characteristics (such as particle size and flowability) and prescription dosage requirements. For drugs that need to be dispensed in multiple doses, traditional mechanical baffles or valve controls have response delays, making it difficult to achieve the operational requirements of "dispensing on demand and precise quantification".
[0025] 4. Lack of Information Management: Processes such as inventory updates and medication traceability rely on manual recording or independent system integration, which is prone to data lag or errors. Abnormal situations (such as drug shortages or equipment malfunctions) cannot be monitored and alerted in real time, resulting in insufficient safety and traceability in the medication dispensing process.
[0026] Therefore, a method is urgently needed to solve at least one of the above problems.
[0027] Please refer to Figure 1This application provides a fully automated medication dispensing device based on artificial intelligence. The device includes a dispensing platform, a dispensing cabinet, and a robotic arm. The dispensing cabinet has multiple storage windows, each for storing a single medicine bottle with the bottle cap facing outwards. The robotic arm is mounted beside the dispensing cabinet and located on the dispensing platform, used to grasp the medicine bottle from the storage window and transfer it to a first dispensing module. The dispensing platform includes a first dispensing module and a second dispensing module, with the first dispensing module horizontally positioned beside the second dispensing module. The dispensing cabinet and the robotic arm are both mounted on the dispensing platform. The first dispensing module contains multiple dispensing slots, each for inverted placement of a single medicine bottle with the bottle opening facing downwards. The second dispensing module has corresponding cup receiving slots matching the number of dispensing slots, for placing cups with the cup openings vertically aligned with the bottle openings above.
[0028] Specifically, this equipment aims to solve a series of problems caused by excessive manual intervention, low efficiency, insufficient precision, and complex structure in traditional drug dispensing equipment. Its core design concept is structural integration, streamlined operation, and directional consistency. Through innovative layout and modular design, it achieves fully automated and precise operation from drug storage and retrieval to dispensing, and is especially suitable for the rapid and accurate dispensing of multiple types of drugs.
[0029] The medicine cabinet serves as the equipment's medicine storage unit, used to centrally store medicine bottles awaiting dispensing. The cabinet contains multiple independent storage windows. Each storage window is designed to hold a single medicine bottle, achieving fixed-volume and location-based management of the medication. All medicine bottles are stored within the storage windows with their caps facing outwards. This orientation design forms the basis for the subsequent automated grasping process, providing the robotic arm with a uniform and easy-to-operate grasping surface.
[0030] The robotic arm, acting as the actuator, is responsible for automatically transferring medicine bottles between the medicine cabinet and the first dispensing module. It is installed beside the medicine cabinet and positioned above the dispensing platform. This layout allows the robotic arm to cover the entire workspace from the medicine cabinet to the dispensing platform, with a direct and clear movement path. It picks up the target medicine bottle from the designated storage window and then transfers and places it into the designated dispensing slot of the first dispensing module.
[0031] The dispensing platform serves as the core carrier for drug preparation operations, housing the dispensing cabinet and robotic arm, and integrating two-level dispensing modules.
[0032] The first dispensing module is horizontally mounted on the platform and serves as a transition zone for drugs from "storage status" to "ready-to-dispense status".
[0033] The second dispensing module is horizontally aligned with the first dispensing module, but positioned relatively below it (as can be inferred from the description, the second module is typically located vertically below or adjacent to the first module). It is the final location for dissolving and mixing the medication. The dispensing cabinet and robotic arm are both directly mounted on this platform, forming a closed workstation structure integrating storage, retrieval, and dispensing.
[0034] The specific steps of the equipment's workflow are as follows: Manually or with auxiliary equipment, various medicine bottles are placed one by one into the storage windows of the medicine cabinet, with the caps facing outwards. Each storage window corresponds to a unique medicine number or location code. The control system determines the target medicine and its storage window location according to the prescription instructions. The robotic arm moves to the storage window, and its end effector (such as a gripper) directly grasps the outward-facing cap or bottle body. Because the medicine bottles are stored in a uniform direction (caps facing outwards) and the robotic arm is located to the side, the direction of the robotic arm's grasping action naturally aligns with the direction of the medicine bottles being placed and removed, eliminating the need for additional turning or flipping mechanisms, resulting in a simple medicine retrieval path. The robotic arm transports the grasped medicine bottles to the first dispensing module and places them upside down in a designated dispensing slot. At this point, the medicine bottles are in a bottle-mouth-down position. The first dispensing module has multiple independent dispensing slots inside for temporarily securing the upside-down medicine bottles. This "upside-down preparation" state is a prerequisite for accurate dispensing. The second dispensing module is equipped with cup receiving slots that correspond one-to-one with the number of dispensing slots in the first dispensing module and are aligned vertically. Each cup receiving slot contains one cup for receiving the medicine.
[0035] When the medicine bottle is placed upside down in the medicine dispensing trough of the first module, its mouth is precisely aligned vertically with the opening of the corresponding dispensing cup in the second module below. This vertical alignment of "one bottle, one trough, one cup" is the structural basis for ensuring that the medicine falls accurately into the designated dispensing cup and avoiding cross-contamination.
[0036] When medication is needed, the medicine falls directly from the inverted bottle opening into the container vertically below by controlling the bottle cap (such as an automatic cap opening device) or by using gravity.
[0037] Because the material is dropped vertically, there is no need for an inclined chute, which greatly reduces the residue and adhesion of medicine in the channel and ensures the accuracy of the dosage.
[0038] When multiple drugs need to be prepared, the robotic arm can sequentially grab and place multiple different medicine bottles into different medicine dispensing tanks. The medicines in these bottles can fall into their respective independent material cups below in sequence or simultaneously. Then, the subsequent mixing operation is completed in the second module, which effectively avoids confusion and cross-contamination of different medicines during intermediate transfer.
[0039] By building the medicine cabinet directly on the medicine dispensing platform and closely adjacent to the medicine dispensing module, the range of motion of the robotic arm is highly concentrated, and the path is short and straight, reducing positioning errors and time consumption caused by long-distance and cross-regional movements.
[0040] The storage orientation of the medicine bottles in the medicine cabinet with the caps facing outwards, the direction of the robotic arm's grasping motion from the side, and the final posture change of placing the medicine bottles upside down into the first dispensing tank form a coherent motion sequence that does not require intermediate turning, simplifying the mechanical structure and improving reliability.
[0041] The design of vertically aligning the first dispensing module (inverted medicine bottle) with the second dispensing module (material cup) replaces the traditional horizontal parallel arrangement with an inclined slide. This achieves direct vertical alignment between the medicine bottle opening and the material cup opening, ensuring accurate dispensing and essentially eliminating problems of drug residue and misalignment.
[0042] The matching design of multiple dispensing tanks and material cup receiving tanks allows the equipment to prepare for dispensing multiple medicine bottles at the same time, supporting efficient sequential or synchronous compounding of multiple medicines and improving the overall dispensing efficiency.
[0043] In summary, this fully automated dispensing equipment, through its unique structural layout and modular design, achieves efficient, accurate, and automated operation of the entire process of drug storage, dispensing, preparation, and dispensing, effectively solving the various problems mentioned in the background technology.
[0044] In some embodiments, the multiple storage windows in the medicine cabinet are arranged in a matrix-like, multi-layered, multi-column layout.
[0045] This embodiment defines the specific form of the core storage structure inside the medicine cabinet. The storage windows adopt a matrix-style multi-layer, multi-column distribution.
[0046] The interior space of the medicine cabinet is divided into a three-dimensional grid. It is divided into several layers vertically and several columns horizontally. Each grid unit is an independent storage window for storing a medicine bottle with the cap facing outwards.
[0047] Each storage window has unique spatial coordinates (e.g., layer X, column Y). This structure facilitates the construction of a precise drug location database, allowing the control system to quickly index and locate target medicine bottles using coordinates (X, Y).
[0048] Within a limited cabinet volume, the storage capacity of medicines is maximized. The matrix arrangement provides a clear and regular coordinate basis for the robotic arm's motion path planning (such as the optimal medicine retrieval sequence), facilitating the calculation of the most efficient grasping order. When combined with a vision system, the regular matrix layout makes image recognition and positioning calibration easier.
[0049] In some embodiments, the robotic arm is a multi-degree-of-freedom collaborative robotic arm, including a base, a rotatable upper arm, a telescopic lower arm, and an end effector.
[0050] This embodiment details the mechanical structure of the robotic arm. It employs a multi-degree-of-freedom collaborative robotic arm configuration comprising a base, a rotatable upper arm, a retractable lower arm, and an end effector. The base is fixed to the platform, providing overall support and horizontal rotational freedom. The upper arm connects to the base, enabling shoulder pitch or rotational movements and expanding the vertical working range. The retractable lower arm connects to the upper arm, changing its length via a linear telescopic mechanism (such as a lead screw or synchronous belt module) to achieve precise radial forward and backward movement. The end effector, mounted at the end of the lower arm, is responsible for directly grasping medicine bottles.
[0051] This type of robotic arm typically has multiple rotational and translational joints, enabling it to move flexibly in complex spaces with high safety, making it suitable for collaborative work with humans or delicate equipment in shared spaces. Through the combined movement of these joints, the robotic arm can precisely reach the front of any storage window in the matrix, perform a grasping action, and then smoothly transfer the medicine bottle to any medicine placement slot in the first dispensing module and complete the placement.
[0052] In some embodiments, the end effector is an electromagnetic gripper or a vacuum suction cup structure.
[0053] This embodiment clarifies the specific method by which the robotic arm grasps the medicine bottle, and provides two non-contact or flexible contact solutions: electromagnetic adsorption gripper or vacuum suction cup structure.
[0054] The electromagnetic gripper has an electromagnet inside. When it needs to grip medicine bottles with metal caps or containing metal parts, a strong magnetic force is generated when electricity is applied, firmly adhering the bottle to the gripper surface. The advantages are gentle gripping action, no pressure on the bottle, and suitability for fragile or specially packaged medicines.
[0055] The vacuum suction cup structure has a rubber or silicone suction cup at one end, which is connected to a vacuum generator via a pipe. After the suction cup is attached to the bottle cap or flattened bottle, a vacuum is activated, using atmospheric pressure difference to adsorb the bottle. Its advantages include high adaptability and low requirements for bottle material (plastic, glass); only a smooth and flat surface is needed.
[0056] Both methods avoid the instability or damage that traditional mechanical grippers may cause to irregularly shaped bottles, and are especially suitable for situations where the bottle cap faces outwards and the gripping surface is uniform.
[0057] In some embodiments, the base of the robotic arm is fixed to the mounting bracket of the dispensing platform by bolts.
[0058] This embodiment specifies the connection method between the robotic arm base and the drug dispensing platform, namely, fixing it to an independent mounting bracket by bolts.
[0059] A rigid mounting bracket is pre-welded or reinforced at a specific location on the dispensing platform (typically located next to the dispensing cabinet and close to the first dispensing module). This bracket has a high-precision, highly flat mounting surface.
[0060] The base plate of the robotic arm is tightly connected to the mounting bracket by multiple high-strength bolts. A level is required during installation to ensure the robotic arm's baseline posture is correct.
[0061] The rigid bolted connection ensures the stability of the robotic arm under high-speed, repetitive motion, which is the foundation of motion accuracy. The bolted connection method allows for relatively easy disassembly or replacement of the entire robotic arm during major equipment overhauls or upgrades.
[0062] In some embodiments, the movement trajectory of the robotic arm covers all storage windows and the dispensing area of the first dispensing module.
[0063] This embodiment defines the key performance indicators of the robotic arm's workspace: its movement trajectory must cover all storage windows and all drug dispensing slot areas of the first drug dispensing module.
[0064] During the equipment design phase, the required robot workspace envelope is calculated based on the dimensions of the dispensing cabinets (layer height and column width of the matrix), the size of the first dispensing module, and their relative positions. Based on the calculated workspace requirements, a multi-degree-of-freedom robotic arm with sufficient reach and joint range of motion is selected to ensure its end effector can reach, without blind spots, the storage windows at the farthest corners of the dispensing cabinet matrix (e.g., the top layer, the sidemost column) and the outermost dispensing slots in the first dispensing module.
[0065] In the control system, it is necessary to establish a complete equipment space coordinate system and accurately mark the position coordinates of all storage windows and dispensing tanks (derived from the matrix coordinates and module layout provided in the above embodiments) in this coordinate system so that the path planning algorithm can generate a collision-free optimized trajectory within the full coverage space.
[0066] In some embodiments, a baffle is provided below the through hole of the medicine dispensing trough. The baffle is driven by a micro cylinder to control the timing of dispensing the medicine bottle.
[0067] This embodiment improves the structure of the drug dispensing slot in the first drug dispensing module by adding a baffle driven by a miniature cylinder below each drug dispensing slot through hole to precisely control the timing of drug dispensing.
[0068] At the bottom of each medicine dispenser is a "through-hole" that allows the medicine to pass through. Directly below the through-hole is a movable baffle. The baffle is connected to the piston rod of a miniature cylinder.
[0069] After the robotic arm inverts the medicine bottle and places it into the dispensing trough, the baffle is closed, supporting the bottle opening and preventing premature spillage. When it is time to dispense medicine into the corresponding cup below, the control system sends a signal to the miniature cylinder of that specific dispensing trough. The miniature cylinder actuates, pulling the baffle quickly away, opening the bottle opening, and allowing the medicine to fall precisely and vertically into the cup below under gravity. After dispensing, the cylinder drives the baffle back to the closed position, ready for the next operation.
[0070] Enabling ready-to-use medicine bottles and allowing multiple medications to be dispensed in a strict order or according to formulation requirements is key to accurate drug mixing. At the same time, sealing the bottles prevents medications from getting damp, contaminated, or accidentally spilling outside of preparation times.
[0071] In some embodiments, the bottom of the dispensing platform is provided with an adjustable leveling support bracket, which includes a threaded adjustment column and an anti-slip pad, and the surface of the dispensing platform is covered with an anti-static coating.
[0072] This embodiment enhances the stability of the dispensing platform and the safety of the working environment, including adjustable leveling support legs and an anti-static coating.
[0073] Support legs are installed at the four corners (or more points) at the bottom of the platform. At the core of each leg is a threaded adjustment column, which can be rotated to change the height of the support point individually.
[0074] When installing the equipment, use a precision level to place on the platform surface. By adjusting the threaded columns of each leg, the entire dispensing platform (as well as the medicine cabinet, robotic arm, and dispensing module on it) can be adjusted to an absolutely level state.
[0075] The bottom of the threaded column is equipped with anti-slip pads to increase friction and prevent the equipment from shifting during operation.
[0076] A special anti-static coating is applied to the entire surface of the dispensing platform (especially the operating area). This coating rapidly conducts or dissipates any static charge that may be generated during operation, preventing the accumulation of static electricity that could attract dust, interfere with electronic equipment, or pose safety risks to certain sensitive medications. This ensures that the entire precision automated system operates on a stable, level, and safe physical foundation.
[0077] In some embodiments, the medicine cabinet and the medicine dispensing platform are connected by positioning pins and fastening bolts, and the side of the medicine cabinet is provided with an electronic tag display screen for identifying medicine information in the storage window.
[0078] This embodiment standardizes the connection method between the medicine cabinet and the platform, and adds an information management interface to it, namely, it is connected by positioning pins and bolts, and equipped with an electronic tag display screen.
[0079] Locating pin holes and bolt connection holes are provided at the bottom of the medicine cabinet and at corresponding positions on the medicine dispensing platform. During installation, the locating pins are first used for rough positioning and error prevention to ensure that the relative positional relationship between the medicine cabinet and the first medicine dispensing module and the robotic arm base on the platform is absolutely accurate. Then, the fastening bolts are used for final tightening to form a stable integrated structure.
[0080] On the side of the medicine cabinet (usually the front or an easily observable panel), a small electronic tag display screen (such as an e-ink screen or LED screen) is installed for each or each group of storage windows. This display screen is networked with the main control system and can dynamically display information such as the name, specifications, quantity in stock, and expiration date of the medicine in the corresponding storage window.
[0081] It enables operators to quickly and intuitively perform manual verification, medication replenishment, and management. The digitization and visualization of drug information forms the foundation for advanced functions such as batch tracking and first-in-first-out (FIFO) management. The displayed information is updated in real time when drugs are retrieved or their location changes.
[0082] This invention integrates a medicine cabinet and a robotic arm into a dispensing platform. A storage window and dispensing module are directly covered by the robotic arm, shortening the movement path and improving dispensing efficiency. With the bottle caps facing outwards in the storage window, the robotic arm's end effector (such as an electromagnetic gripper or vacuum suction cup) can directly grasp the medicine horizontally, avoiding the extra energy consumption and positioning errors associated with traditional vertical dispensing. The first dispensing module's medicine dispenser inverts the bottles, with the bottle openings vertically aligned with the lower feeding cup. Combined with a V-groove inclined design, this ensures residue-free dispensing. The positioning protrusion of the feeding cup ensures a fixed receiving position. The entire process requires no manual contact with the medicines, reducing the risk of cross-contamination. Furthermore, the modular design supports parallel dispensing of multiple medicines, significantly shortening the single dispensing cycle.
[0083] Please see Figure 2 , Figure 2 This is a schematic flowchart illustrating the usage method of a fully automated drug dispensing device based on artificial intelligence, provided in one embodiment of this application. The method is applied to the fully automated drug dispensing device as provided in any embodiment of this application. The fully automated drug dispensing device may be equipped with a computer device to execute the method provided in any embodiment of this application. The computer device may be deployed on a single server or a server cluster. It may also be deployed on a handheld terminal, laptop, wearable device, or robot, etc., to implement steps S101 to S104 and their corresponding embodiments.
[0084] It should be noted that the acquisition of any information mentioned in the provided methods is in compliance with relevant regulations and is carried out with the user's consent, and will not infringe on the user's privacy or violate relevant laws and regulations.
[0085] The method for using an AI-based fully automated dispensing device provided in this application deeply integrates prescription analysis, path planning, visual calibration, precise dispensing, and information management to construct a highly intelligent closed-loop dispensing process. This method aims to overcome the problems of manual reliance, low efficiency, and insufficient accuracy in traditional dispensing, such as… Figure 2 As shown, the provided method includes steps S101 to S104.
[0086] Step S101. Analyze the prescription information of the medicine to be dispensed, generate the dispensing task, and plan the optimal path for the robotic arm to grab the target medicine bottle based on the matrix coordinates of the storage window in the medicine cabinet of the fully automated dispensing equipment and the motion parameters of the robotic arm.
[0087] Specifically, this step is the scheduling and preparation stage of the medication dispensing operation, and its core is to transform prescription instructions into the optimal execution sequence.
[0088] The system receives electronic prescriptions from the Hospital Information System (HIS) or other management systems. Artificial intelligence algorithms analyze the prescription content, extracting key information such as drug name, specifications, dosage, mixing order, and contraindications. Combined with the equipment's drug inventory database, it verifies drug availability and location, and automatically generates one or more ordered dispensing task units. Each task unit specifies which drug to retrieve, from which location, in which slot, and in how much.
[0089] The coordinate data for the medicine bottles comes from the matrix storage window layout of the medicine cabinet, with each bottle having unique (layer, column) coordinates. The robotic arm parameters include the kinematic model of the robotic arm, joint velocities, acceleration limits, and workspace range. Task constraints include the compatibility priority of prescription drugs (e.g., solvent before solute) and drug stability requirements.
[0090] Based on the aforementioned multi-dimensional data, optimization algorithms (such as A* algorithm, Dijkstra's algorithm, or more advanced reinforcement learning algorithms) are used for dynamic path planning. The planning objective is to minimize the total motion path and optimize the time required for the robotic arm to complete the grasping and placement of all target medicine bottles within a single task cycle.
[0091] The algorithm achieves dynamic optimization by balancing the following factors: Spatial distance: Planning the grasping order to minimize the total Euclidean distance the robotic arm moves between the medicine cabinet and the first dispensing module. Motion efficiency: Considering the start-stop characteristics of the robotic arm joints, optimizing trajectory smoothness, and reducing unnecessary acceleration and deceleration. Task priority: The grasping order of urgent or special medicines can be assigned higher weight.
[0092] Step S102. Control the robotic arm of the fully automatic dispensing equipment to move to the target storage window according to the planned path, grab the target medicine bottle with the cap facing outward through the end effector, and place the target medicine bottle upside down in the designated medicine placement slot of the first dispensing module of the fully automatic dispensing equipment, so that the bottle mouth of the target medicine bottle is facing downward.
[0093] Specifically, this step is the core of the physical execution, ensuring that the medicine bottle is safely and accurately transferred from the storage state to the ready-to-dispense state.
[0094] The optimal path generated in step S101 is decomposed into a series of joint motion commands and sent to the controller of the multi-degree-of-freedom collaborative robotic arm. Based on these commands, the robotic arm drives its rotatable upper arm and retractable lower arm, causing the end effector to move precisely to the front of the target storage window in the medicine cabinet.
[0095] The flexible gripping operation is initiated by an end effector (electromagnetic gripper or vacuum chuck). For the electromagnetic gripper, a strong magnetic force is generated when energized to attract and secure the metal bottle cap. For the vacuum chuck, after it is placed against a flat area of the bottle cap or bottle body, a vacuum generator is activated to use negative pressure for a firm grip. This flexible gripping method avoids the bottle squeezing or slippage that can occur with traditional mechanical gripping. The robotic arm smoothly removes the medicine bottle from the storage window along an optimized path. The medicine bottle is then moved to a pre-assigned designated "powder placement slot" in the first dispensing module. A placement action is performed, inverting the medicine bottle into the placement slot so that the bottle opening is vertically downwards. The V-shaped or custom-designed structure of the placement slot ensures the stability of the medicine bottle's posture.
[0096] Step S103. Use visual recognition technology to obtain the position information of the target medicine bottle in the medicine dispensing tank, and calibrate it with the position of the corresponding material cup in the material cup receiving tank in the second dispensing module of the fully automatic dispensing equipment to ensure that the mouth of the target medicine bottle is vertically aligned with the opening of the material cup.
[0097] Specifically, this step uses machine vision technology to ensure final alignment accuracy before material placement, thus solving misalignment problems caused by mechanical vibration or placement deviation.
[0098] It is triggered by industrial cameras (such as top-view or side-view cameras) installed at key locations on the dispensing platform.
[0099] The camera captures images of the mouth of the target medicine bottle, which is inverted in the dispensing tank, and the opening of the corresponding dispensing cup in the receiving tank of the second dispensing module. Image processing algorithms (based on edge detection, template matching, etc.) identify and calculate the precise pixel coordinates of the center of the bottle mouth and the center of the dispensing cup in real time.
[0100] The image pixel coordinates are transformed to the same device world coordinate system as the robotic arm using calibration parameters. The positional deviation between the center of the bottle mouth and the center of the cup in the horizontal plane (XY direction) is calculated.
[0101] If the deviation exceeds the preset tolerance range (e.g., >0.5mm), the calibration mechanism is activated. Calibration methods may include: fine-tuning the robotic arm: controlling the end effector of the robotic arm to make a small translation, slightly adjusting the overall position of the vial in the dispensing tank (if the design allows). Adjusting the lower module: more commonly, compensating for the position of the dispensing cup by controlling the micro-motion platform of the second dispensing module, realigning it with the fixed bottle opening above. After calibration, the vision system re-verifies to ensure that the bottle opening and the dispensing cup opening are precisely vertically aligned, creating perfect conditions for gravity dispensing.
[0102] Step S104. According to the dosage requirements in the dispensing task, the opening and closing timing of the baffle is controlled by driving the micro cylinder under the dispensing tank of the fully automatic dispensing equipment, so that the medicine in the target medicine bottle falls quantitatively into the material cup below under the action of gravity; after the dispensing is completed, the inventory information of the corresponding medicine is updated, and a dispensing process traceability record is generated. At the same time, abnormal situations in the dispensing process are monitored and warned in real time.
[0103] Specifically, this step completes the final quantitative dispensing of medicines and achieves closed-loop information management of the entire process.
[0104] Based on the prescription dosage requirements parsed in step S101 and combined with the drug's characteristic database (such as particle flowability), the precise opening time of the baffle is calculated. Once visual calibration confirms correct alignment, the control system sends a command to the miniature cylinder below the target dispensing slot. The cylinder quickly pulls the baffle away, opening the bottle mouth.
[0105] The medicine falls vertically into the container directly below under the influence of gravity. By controlling the duration of the baffle opening or by using more precise weighing feedback (a high-precision weighing sensor can be integrated under the container), the quantitative and controllable dispensing of the medicine can be achieved.
[0106] Once a drug is dispensed, the system automatically deducts the corresponding dosage from its inventory record, ensuring real-time and accurate updates to inventory information and preventing data lag. The system automatically records a complete log of this dispensing task, including: prescription ID, operator, execution time, batch / unique code of the drug used, robotic arm path, vision calibration data, and actual dispensing weight / volume. This creates an immutable electronic traceability record.
[0107] The system continuously monitors key points throughout the entire medication dispensing process: Equipment status: robotic arm joint torque, motor temperature, vacuum pressure, etc. Process status: grasping success rate, visual alignment deviation, and the difference between the dispensed weight and the target value. Medication status: inventory below the safety threshold, and medication nearing its expiration date.
[0108] When the monitored data exceeds the normal range, the AI early warning model immediately triggers multi-level warnings (such as screen prompts, audible and visual alarms, and push messages to management personnel), and can suspend the current task according to preset strategies to prevent the error from escalating.
[0109] In some embodiments, parsing the prescription information of the drug to be dispensed and generating a dispensing task includes: performing semantic parsing on the prescription text using a natural language processing algorithm to extract key information, including the drug name, specifications, dosage, and compatibility requirements; matching the extracted drug information with the electronic tag database of the storage windows in the medicine cabinet to determine the unique matrix coordinates of the storage window corresponding to the target drug; and generating a dispensing task list containing the target storage window coordinates, drug retrieval order, and dosage parameters based on the drug compatibility order and dosage priority.
[0110] This embodiment focuses on the intelligent interpretation and task planning of prescription information—the starting point of the medication dispensing process. Its core is to use Natural Language Processing (NLP) algorithms to transform unstructured prescription text into structured, executable operational instructions. The key technologies lie in semantic parsing, data matching, and task scheduling, aiming to achieve accurate and efficient conversion from textual instructions to physical operations.
[0111] Intelligent prescription information extraction involves first performing deep parsing of the prescription text using NLP algorithms (such as named entity recognition and dependency parsing) when the device receives a prescription from the hospital information system.
[0112] The algorithm identifies and extracts "key information," including the drug name (e.g., "Ceftriaxone Sodium for Injection"), specifications (e.g., "1.0g"), dosage (e.g., "2.0g"), and compatibility requirements or priority order.
[0113] This process eliminates ambiguities or errors that may arise from manual identification, such as distinguishing between the generic name and brand name of a drug, and accurately understanding medical terms such as "bid" and "intravenous drip".
[0114] The system maintains an electronic tag database that records detailed information about the medicines in each storage window of the medicine cabinet (including name, specifications, and batch number) and their unique matrix coordinates (e.g., layer 3, column 5). The medicine information extracted by NLP is quickly matched and verified against this database to confirm the existence and availability of the medicine, and to precisely pinpoint the unique physical location (matrix coordinates) of the storage window containing that medicine.
[0115] After obtaining the location information of all required drugs, the system intelligently generates an optimal drug preparation task list by combining the drug preparation order (e.g., adding the solvent first and then the main drug to avoid incompatibilities) and dosage priority (e.g., prioritizing high-dose or specially managed drugs).
[0116] This list is a structured set of instructions that explicitly includes: "What to retrieve": the target drug; "From where to retrieve": the matrix coordinates of the target storage window; "When to retrieve / Which to retrieve first": the optimized drug retrieval order; and "How much to dispense": precise dosage parameters. This list provides a direct and clear operational blueprint for subsequent robotic arm path planning.
[0117] In some embodiments, the step of planning the optimal path for the robotic arm to grasp target medicine bottles based on the matrix coordinates of the storage windows in the medicine cabinet of the fully automated dispensing equipment and the motion parameters of the robotic arm includes: establishing a mapping relationship between the matrix coordinates of the medicine cabinet and the joint space of the robotic arm; obtaining the three-dimensional coordinates of each target storage window and the current position of the robotic arm; using a preset optimization algorithm with the shortest robotic arm movement distance and joint load balance as optimization objectives to generate a collision-free grasping sequence and movement trajectory; and combining the maximum movement speed and acceleration of each joint of the robotic arm to optimize the planned path in time, forming an execution instruction sequence containing the motion parameters of each joint.
[0118] This embodiment involves motion path planning for the robotic arm before it performs a grasping action. Its core lies in combining the physical layout of the equipment (the medicine cabinet) and the kinematic characteristics of the robotic arm to calculate the grasping path with the shortest time, smoothest motion, and lowest energy consumption. This requires solving problems related to spatial coordinate transformation, obstacle avoidance planning, and time optimization.
[0119] The system first establishes a precise mapping between the joint space of the robotic arm and the world coordinate system of the medicine cabinet. This means that when the matrix coordinates of a storage window are given, the system can immediately calculate the coordinates (such as X, Y, Z) of that position in the three-dimensional space that the robotic arm can understand. At the same time, the system obtains the current position of each joint of the robotic arm in real time, as the starting point for path planning.
[0120] Using the coordinates of multiple target storage windows in the task list as input, the system employs a pre-defined optimization algorithm (such as A algorithm, genetic algorithm, or heuristic search algorithm) for path planning. The optimization objectives are twofold: first, to minimize the total distance the robotic arm's end effector travels from one storage window to the next; and second, to distribute the load evenly across all joints as much as possible, avoiding excessive wear on any single joint. The planning process ensures that the generated trajectory is collision-free in physical space, meaning the robotic arm will not collide with the medicine cabinet frame, other medicine bottles, or the equipment itself during its movement.
[0121] Furthermore, considering the physical limitations such as the maximum speed and acceleration of each joint of the robotic arm, the aforementioned geometric path is optimized in time (e.g., using trapezoidal velocity planning or S-curve planning). This ensures that the robotic arm can operate in the fastest and smoothest way, reducing start-stop shocks. Finally, the system generates a set of execution instructions containing when, at what angle, and at what speed each joint will reach its position, and sends this set of instructions to the robotic arm controller. This set of instructions is accurate to the millisecond level, ensuring efficient and smooth grasping operations.
[0122] In some embodiments, the step of grasping the target medicine bottle with the cap facing outward using an end effector and placing the target medicine bottle upside down in the designated dispensing slot of the first dispensing module of the fully automated dispensing equipment includes: automatically selecting an electromagnetic adsorption gripper or a vacuum suction cup as the end effector according to the cap material of the target medicine bottle; controlling the end effector to move to the outside of the cap in a direction perpendicular to the storage window plane, adjusting the adsorption force through closed-loop feedback to ensure stable grasping; and translating and flipping the medicine bottle 180 degrees through the coordinated rotation and extension movements of the robotic arm's upper arm, lower arm, and base, accurately positioning it above the target dispensing slot, and releasing the medicine bottle with the bottle opening facing downward.
[0123] This embodiment illustrates the physical process of a robotic arm grasping medicine bottles. Its core lies in achieving adaptive and stable grasping of different bottle cap materials, and completing the posture transition from horizontal storage to vertical unloading. The key technologies are the intelligent selection and closed-loop force control of the end effector, as well as the precision of multi-joint coordinated motion.
[0124] The system automatically selects the most suitable end effector based on the cap material of the target medicine bottle: for metal caps, an electromagnetic gripper is used; for plastic, rubber, or other non-metallic caps, a vacuum suction cup is used. This adaptability ensures compatibility with various packaging types and reliable gripping.
[0125] The robotic arm's end effector is controlled to approach the bottle cap in a direction perpendicular to the storage window plane. Upon contact or approach to the cap, the system dynamically adjusts the electromagnetic adsorption force or vacuum negative pressure based on force sensor feedback, ensuring that the gripping force is sufficient to firmly hold the bottle, but without damaging the cap or the bottle due to excessive force. This is the key to achieving "flexible" gripping.
[0126] After successful grasping, the robotic arm's base, upper arm, and forearm joints begin to work together to perform rotational and telescopic movements. Its core action is to move and rotate the originally flat (cap facing outward) medicine bottle by 180 degrees, so that the bottle opening is vertically downward.
[0127] The robotic arm precisely positions the inverted medicine bottle directly above the designated medicine placement slot in the first dispensing module, and then releases the actuator to allow the medicine bottle to fall steadily into the slot in the correct orientation (mouth down), preparing for the next step of dispensing.
[0128] In some embodiments, the step of using visual recognition technology to obtain the position information of the target medicine bottle in the dispensing tank includes: setting an industrial camera above or to the side of the first dispensing module to acquire images of the medicine bottle in the dispensing tank; identifying the outline of the medicine bottle mouth and the reference mark of the dispensing tank through an image processing algorithm; calculating the offset between the actual position of the medicine bottle and the center of the dispensing tank, and generating position deviation data.
[0129] This embodiment describes the process of using machine vision to accurately capture positional information. Its core is to utilize industrial cameras and image algorithms to replace the human eye in determining whether a medicine bottle is properly placed in the dispensing tank. The key technologies lie in the timing and quality of image acquisition, the accuracy of marker recognition, and the calculation of coordinates from pixels to physical dimensions.
[0130] After the placement process is completed, the industrial camera mounted above or to the side of the first dispensing module is triggered. The camera acquires high-definition images of the area containing the target dispensing trough, ensuring that the images clearly show the bottle neck area and specific markings on the dispensing trough.
[0131] The acquired images are fed into an image processing algorithm (typically based on edge detection, Hough transform, or deep learning models). The algorithm first identifies the circular or specific shape contour of the bottle opening. Simultaneously, it identifies reference marks (such as crosshairs, specific patterns, or groove edges) machined onto the dispensing slot. This mark represents the theoretical center or standard position of the dispensing slot.
[0132] The algorithm calculates the coordinates (in the image pixel coordinate system) of the center point of the identified medicine bottle opening. Similarly, it obtains the coordinates of the center point of the medicine dispenser reference mark. Through pre-completed camera calibration, the pixel coordinate difference between the two centers is converted into the actual physical offset in the device's world coordinate system (e.g., the bottle opening is offset 0.8 mm eastward and 0.3 mm northward). This ultimately generates "positional deviation data" containing both X-direction and Y-direction deviations, providing a precise basis for the next calibration step.
[0133] In some embodiments, calibrating the position of the corresponding cup in the receiving slot of the second dispensing module of the fully automatic dispensing equipment to ensure that the mouth of the target medicine bottle is vertically aligned with the opening of the cup includes: converting the position deviation data of the medicine bottle obtained by visual recognition into adjustment instructions in the equipment coordinate system; driving the first dispensing module or the second dispensing module to perform horizontal micro-movement or rotation by a servo motor so that the coordinate error between the center of the medicine bottle mouth and the center of the opening of the cup below is less than a preset threshold; after calibration, locking the relative position of the dispensing module to form a stable vertical feeding channel.
[0134] This embodiment translates visually detected deviations into physical fine-tuning actions of the equipment, ultimately achieving precise alignment between the bottle opening and the container. Its core is precise displacement compensation via servo control, designed to create a completely vertical and unobstructed channel for gravity-fed material delivery, ensuring all medicine falls into the target container and preventing spillage.
[0135] The control system converts the positional deviation data calculated by the vision system into fine-tuning drive commands for either the first dispensing module (carrying the medicine bottle) or the second dispensing module (carrying the dispensing cup), based on the mechanical structure of the equipment. Adjusting the position of the lower dispensing cup is usually more convenient.
[0136] After receiving the fine-tuning command, the servo motor drives the corresponding dispensing module to make a slight translation (X / Y direction) or rotation in the horizontal plane. This fine-tuning process is performed dynamically, with real-time feedback from the vision system, until the coordinate error in three-dimensional space between the center of the bottle opening and the center of the corresponding dispensing cup opening below is less than a preset minimum threshold (e.g., <0.2 mm).
[0137] Once the calibration is successful, the system immediately locks the servo motor or mechanism that performs the fine-tuning, ensuring that the relative position between the first dispensing module (dispensing tank) and the second dispensing module (material cup receiving tank) remains stable and unchanged in the aligned state.
[0138] At this point, a stable and vertical material feeding channel is formed between the bottle mouth and the material cup opening, providing perfect physical preparation for the next step of quantitative material feeding.
[0139] In some embodiments, the step of controlling the opening and closing timing of the baffle by driving a micro-cylinder below the dispensing tank of the fully automatic dispensing equipment, according to the dosage requirements in the dispensing task, so that the medicine in the target medicine bottle falls quantitatively into the material cup below under the action of gravity, includes: calculating the mapping relationship between the baffle opening time and the amount of medicine falling based on the single dose volume and total dose requirements of the medicine; sending a pulse signal to the micro-cylinder of the corresponding dispensing tank when dispensing is required to control the duration of the baffle's translational opening; and for multi-drug dispensing scenarios, triggering the baffle action of each dispensing tank in sequence according to the prescription order to ensure that different medicines fall into the corresponding material cup in the correct order, avoiding mixing and contamination.
[0140] This embodiment details the final release process of the drug from the vial into the container. Its core principle is to achieve quantitative dispensing through time control and to avoid contamination through sequential control. The key technologies lie in the precise calculation and execution of the baffle opening and closing timing, and the faithful execution of the multi-drug compatibility logic.
[0141] For each drug, the system establishes a data model of the average amount of material dispensed per unit time (e.g., 1 second) based on its physical characteristics (such as particle size and flowability). When a prescription dosage requirement is received (e.g., "5g of a certain powder is needed"), the system can use this model to calculate the exact time when the baffle needs to be opened (e.g., if the drug flow rate is 2g / s, it needs to be opened for 2.5 seconds).
[0142] After visual calibration is complete and the feeding channel is ready, the system sends a precisely pulsed electrical signal to a miniature cylinder below the target drug dispensing trough. The cylinder pushes the baffle to move instantaneously, opening the bottle mouth, and the drug begins to fall under pure gravity. The duration of the pulse signal is strictly equal to the calculated opening time. When the time is up, the cylinder reverses its action, the baffle closes, and the drug flow is cut off. If equipped with a high-precision weighing sensor, closed-loop control is used: weighing is performed while dispensing, and the baffle closes instantly upon reaching the target weight, resulting in even higher accuracy.
[0143] In cases where multiple medications need to be placed in the same infusion bag (i.e., compatibility), the system strictly follows the prescription sequence (determined by step S101). It sequentially triggers the baffles of different dispensing troughs. The baffle for the next medication will only open after one medication has completely dispensed, the baffle is closed, and the container may undergo necessary shaking and mixing (if this function is available). This sequential control effectively prevents different powders from cross-mixing in the air during the dispensing process, thus avoiding contamination or inaccurate dosage.
[0144] In some embodiments, updating the inventory information of the corresponding medicine and generating a medication dispensing process traceability record includes: reading the current inventory quantity in the electronic tag of the target storage window, deducting the amount based on the actual amount used in the medication dispensing task, updating the inventory data in real time and synchronizing it to the main control system; collecting key data in the medication dispensing process, generating an immutable medication dispensing process log in the order of timestamps; and storing the inventory data and traceability record in a blockchain database or distributed storage system for subsequent auditing and traceability queries.
[0145] This embodiment handles the data loop of medication dispensing, enabling digital management of medicines and transparent tracking of processes. Its core is automatic data collection, real-time synchronization, and secure storage, aiming to ensure consistency between records and actual inventory, and to provide complete evidence for quality control and problem investigation.
[0146] After each successful dispensing, the system automatically reads the inventory quantity stored in the electronic tag corresponding to the dispensed medication. Based on the actual amount dispensed (dispensing weight), the system deducts the inventory data from the tag in real time. The deduction result is immediately synchronized to the equipment's main control system and the higher-level hospital information system (HIS), enabling pharmacy managers and clinical departments to keep track of the latest inventory in real time and avoid medication shortages or duplicate prescriptions caused by information delays.
[0147] Throughout the entire medication dispensing process, the system automatically collects and correlates data from all key nodes, such as start time, end time, operator ID, medication batch, robotic arm path points, visual calibration deviation values, and actual dispensing weight. This data is organized into a structured and complete medication dispensing process log in timestamp order. This log is locked after generation, forming an unalterable record of the operations.
[0148] To ensure data authenticity and security, updated inventory data and generated end-to-end traceability records are stored in a tamper-proof database. The preferred solution is storage in a blockchain database or distributed storage system. Utilizing the chain structure and consensus mechanism of blockchain, or the redundancy and encryption features of distributed storage, ensures that once a record is written, it cannot be unilaterally modified. This stored data provides a reliable foundation for subsequent medication audits, quality backtracking (e.g., quickly locating all prescriptions using a batch of drugs if a problem occurs), and efficiency analysis.
[0149] In some embodiments, the real-time monitoring and early warning of abnormal situations during the dispensing process includes: real-time monitoring of gripping force and motion trajectory deviation through robotic arm joint encoders and force sensors; triggering an emergency stop command when abnormal vibration, overtravel, or jamming is detected; real-time analysis of the residual amount after dispensing medicine via a vision system; generating a blockage or adhesion warning when the residual amount exceeds a preset threshold; monitoring electronic tag inventory data; automatically sending a replenishment reminder to the management terminal when the medicine inventory is found to be below a safety threshold or nearing its expiration date; and issuing an alarm via an audible and visual alarm when an abnormality occurs, and displaying the specific abnormality type and location on the equipment operation interface to facilitate quick troubleshooting and handling by operators.
[0150] This embodiment constructs a monitoring and defense system to ensure the safe, stable, and reliable operation of equipment. Its core is multi-sensor data fusion and intelligent diagnostics, enabling real-time monitoring, tiered early warning, and emergency response to mechanical failures, process anomalies, and inventory risks.
[0151] Mechanical condition monitoring and fault protection are implemented by reading encoder data from each joint of the robotic arm to monitor in real time whether the motion trajectory matches the planned path. Force sensors monitor the forces applied during grasping and movement.
[0152] Once the algorithm detects abnormal signals such as abnormal vibration, movement exceeding the range of travel (overtravel), joint jamming (stuck), or sudden increase in force, the system will immediately determine it as a serious fault and trigger the highest level emergency stop command to prevent equipment damage or safety hazards.
[0153] After the material is dispensed, the vision system quickly scans and analyzes the bottle opening or interior to estimate the amount of residual medicine. If the residual amount exceeds a preset threshold (indicating that the medicine may have failed to dispense completely due to moisture and clumping), a "blockage or adhesion warning" is immediately generated, prompting the operator to check or intervene with the medicine.
[0154] The system continuously monitors the inventory data of all electronic tags. When it detects that the inventory of a certain medicine is below the set safety stock level, it automatically sends a replenishment reminder to the pharmacy administrator or the purchasing system. At the same time, the system checks the expiration dates of medicines and sends an early warning to the management terminal for medicines that are about to expire (such as one month before their expiration date), so that they can be prioritized for use or disposal and the risk of expired medicines being issued is eliminated.
[0155] When any abnormality occurs, the equipment will issue a clear audible and visual alarm to attract the attention of on-site personnel. Simultaneously, the specific type of abnormality (e.g., "overheating of the No. 3 robotic arm joint," "incomplete drug dispensing in storage window A05") and its location will be clearly displayed on the equipment's touchscreen or operating interface. This intuitive prompt allows operators or maintenance personnel to quickly locate and troubleshoot problems, greatly improving equipment maintainability and problem-solving efficiency.
[0156] In some embodiments, deep reinforcement learning (DRL) is introduced to construct an "intelligent scheduler" that can make dynamic decisions based on real-time status. This scheduling not only considers the order of medication dispensing for the current prescription, but also comprehensively considers multi-dimensional information such as equipment mechanical load, task queue, and drug usage frequency (popularity) to achieve globally optimal long-term medication dispensing scheduling.
[0157] The state space includes the current position of the robotic arm, the status of medicine bottles in all storage windows (inventory, remaining expiration date, drug popularity), prescription queue, equipment energy consumption, joint load history, etc.
[0158] The action space includes decisions about which storage window to move to to retrieve the medicine, or which medicine dispenser to place the medicine bottle.
[0159] The reward function is designed as a composite reward function. Positive rewards include successfully completing a drug grabbing and releasing operation (the shorter the time, the higher the reward) and selecting frequently used drugs to reduce subsequent long-distance movements of the robotic arm. Negative penalties include path collisions, excessive joint load peaks, excessive energy consumption, and emergency shutdowns.
[0160] In a simulation environment, the DRL agent is trained offline using a large number of randomly generated prescription tasks, enabling it to learn complex scheduling strategies. The trained model is then deployed to an actual equipment control system, allowing for online fine-tuning to adapt it to real-world operating conditions.
[0161] A high-precision digital twin model of the device is constructed as the training environment for the DRL agent. This model accurately simulates the robotic arm dynamics, storage window layout, and medication dispensing process. Employing advanced DRL algorithms such as PPO (Proximal Policy Optimization), the agent learns to optimally balance task completion time, device wear and tear, energy efficiency, and the ability to respond to new prescriptions by simulating millions of dispensing tasks. The trained policy network is then loaded into the device's host computer. When a new prescription task arrives, this "intelligent scheduler" instantly calculates the optimal sequence of actions (medication dispensing order) based on the current device state (provided in real-time by sensors). Simultaneously, the system records the deviation between actual operational data and model predictions, periodically performing small-scale online retraining to adapt to the uncertainties of the physical world.
[0162] In some embodiments, by using natural language processing (NLP) and clustering algorithms, multiple prescriptions accumulated over a future period of time (such as a batch) are intelligently analyzed to identify "prescription groups" that can share drug dispensing paths, and the task order is reorganized accordingly to minimize the overall movement distance and idle time of the robotic arm.
[0163] Prescription feature extraction converts each prescription into a vector, with feature dimensions including drug name, required dosage, and storage window coordinates.
[0164] Prescription clustering uses unsupervised learning algorithms (such as K-means, DBSCAN) or graph-based community detection algorithms to cluster the prescription vectors. Prescriptions that are spatially close and have a high degree of drug overlap are grouped together.
[0165] For each "prescription group," the batch processing path planning system plans an optimal "circuit path" covering all drug retrieval points within the group. This is similar to the Traveling Salesman Problem (TSP), but the goal is to retrieve medication for all prescriptions within the group. The robotic arm moves along this path once to retrieve some or all of the medication for multiple prescriptions. The retrieved medications are categorized by prescription and temporarily stored in different preparation areas of the first dispensing module.
[0166] The pharmacy management system packages and sends prescriptions to be dispensed within the next 15 minutes to this device. The device's task management module runs a clustering algorithm to divide these prescriptions into several groups and generates a "collection medication list" for each group. Simultaneously, it updates the medication slot allocation plan of the first dispensing module, mapping slots associated with the same prescription to the same "preparation area." The robotic arm sequentially picks up all the required medications according to the planned "circuit path" for each group and places them one by one into the corresponding medication slots in the preparation area.
[0167] After the medications are placed, the system controls the bottles in each preparation area to be dispensed and prepared according to their respective prescriptions. In this way, the long-distance movement of the robotic arm is reduced to the medication dispensing stage, and multiple prescriptions can be served in a single movement, significantly improving the overall throughput.
[0168] In some embodiments, the problem of reliably grasping non-standard medicine bottles (of varying sizes, shapes, and cap materials) is addressed. Visual, depth, and force perception are combined to form a closed-loop feedback control. Simultaneously, a dynamic placement strategy is introduced to adapt to medicine bottles where the center of gravity shifts due to uneven distribution of medication within the bottle.
[0169] An RGB-D camera and a six-dimensional force / torque sensor are integrated into the end effector of the robotic arm. Before gripping, the RGB-D camera scans the target medicine bottle, analyzes the point cloud data using a deep neural network (such as PointNet), accurately identifies the bottle cap's geometry and position, and estimates the optimal gripping point and gripping posture (angle). During gripping, the six-dimensional force sensor monitors the magnitude and direction of the gripping force in real time, dynamically adjusting the pressure of the gripper or the vacuum level of the suction cup through feedback control to ensure a firm grip without slipping or damaging the medicine bottle.
[0170] During the placement of the medicine bottle into the dispensing trough, force / torque sensors continuously monitor the bottle's posture and the forces acting on it. For example, if loose granular medicine inside the bottle shifts, causing instability, the sensor will detect an abnormal torque. Based on this signal, the robotic arm fine-tunes the bottle's angle and release speed in real time during movement, ensuring it "rolls" or "slides" into the V-shaped dispensing trough more smoothly, preventing tipping or collisions.
[0171] When the robotic arm moves to the target storage window, the end effector RGB-D camera activates to perform a rapid 3D scan of the medicine bottle. Based on the scan results, the sensing module calculates the optimal gripping scheme (e.g., using electromagnetic adsorption for metal caps and vacuum suction cups for specific planes on plastic bottles, providing precise coordinates and angles for suction cup placement) and sends it to the robotic arm controller. The robotic arm executes the gripping action, and the force control module stabilizes the gripping force within a preset safety range based on sensor feedback. During transport, the force sensors remain active. If a tendency for the medicine bottle to tip over is detected, the controller immediately calculates a compensating torque, generating a reverse motion through the joint movement of the robotic arm to "righten" the bottle. Upon reaching the medicine dispenser, the robotic arm performs a placement action with "gentle contact" (guided by force sensing) to ensure the medicine bottle enters the inverted state accurately and smoothly.
[0172] In some embodiments, a real-time "virtual channel" calibration model is established through high-precision visual measurement. When an alignment deviation is detected, the system does not move the physical module, but calculates a compensation amount at the software level. Subsequently, this deviation is compensated by precisely controlling the timing of drug administration or micro-movements of the robotic arm, achieving true "soft calibration".
[0173] During equipment installation, a high-precision 3D scanner is used to perform a global calibration of the edges of all dispensing tanks in the first dispensing module and the edges of all cup openings in the second dispensing module, generating a high-precision "reference point cloud map".
[0174] Before each medicine bottle is placed and the medicine is prepared to be dispensed, a high-resolution industrial 3D camera or structured light scanner is used to quickly scan the target medicine dispensing area (including the mouth of the medicine bottle and the material cup below) to generate a "real-time point cloud map".
[0175] The system uses a point cloud registration algorithm (such as ICP) to match and align the "real-time point cloud map" with the "reference point cloud map." The calculated transformation matrix (including translation and rotation) directly reflects the pose deviation between the current bottle opening and the ideal cup opening. The system converts this deviation into compensation that needs to be made when dispensing the medicine. For example, if the deviation is a small vertical offset (such as the bottle opening being slightly higher), the opening time of the baffle is slightly extended to ensure that all the medicine falls (considering a partially parabolic trajectory). If the deviation is a small horizontal angular offset, and the deviation is within the adjustable range of the end effector, the robotic arm (while still holding the bottle cap) can be controlled to perform a very small "shake" or translation before dispensing the medicine to correct the bottle opening position. After the compensation action is completed, the system considers it to be "calibrated," rather than adjusting the physical structure to absolute alignment.
[0176] During the equipment initialization phase, the baseline point cloud map is acquired and stored. After each medication dispensing operation by the robotic arm, a visual scan is triggered. The system completes point cloud acquisition and registration calculations within milliseconds. If the calculated deviation is within a preset safety threshold (e.g., horizontal offset <0.5mm), the aforementioned compensation strategy is directly applied. If the deviation exceeds the safety threshold (potentially due to improper placement of the medication bottle), an alarm is triggered, and the robotic arm is instructed to re-grab and place the bottle. The advantages of this method are high speed, no wear, and adaptability to dynamic, minute deformations caused by medication filling, vibration, etc.
[0177] In some embodiments, this addresses the problem of insufficient dosage accuracy when relying solely on "baffle opening time," especially for drugs with uncertain flowability (such as those affected by moisture or clumping). The core of this approach is to integrate a high-precision miniature weighing sensor below the dispensing cup, forming a closed-loop feedback control during the dispensing process to achieve true "quantitative" dispensing, rather than "timed" dispensing.
[0178] A high-precision, fast-response weighing sensor is installed at the bottom of each container, directly contacting the bottom of the container. This sensor monitors the weight change of the container in real time as the medicine falls into it.
[0179] The control system sets a target dosage value (weight). When dispensing begins, the controller calculates the remaining amount of medication to be dispensed in real time based on the instantaneous weight value fed back by the weighing sensor. Coarse flow stage: When the remaining amount is large, the baffle opens fully, dispensing rapidly. Fine flow stage: When the remaining amount approaches the target value (e.g., reaching 90% of the target value), the system switches to fine flow mode. This may be achieved by controlling the baffle to open and close at high frequency and small amplitude, or through a separate precision micro-dispensing mechanism (such as a vibrating feeder integrated into the bottle neck).
[0180] Once the sensor detects that the weight has reached the target value (or entered the preset allowable range of deviation), it immediately sends a signal to close the baffle and stop feeding.
[0181] When a prescription requires dispensing 15g of a certain drug powder, the control system sends 15g as the target value to the corresponding dispensing control unit. The baffle opens, and the drug begins to fall. Weighing sensor data is transmitted back at a frequency of 100Hz or higher. The controller calculates the cumulative weight in real time. When the cumulative weight reaches 13.5g (90%), a command is issued to enter fine-flow mode, and the baffle begins to open and close in a "vibrating" manner at a frequency of 10 times per second. When the cumulative weight reaches 14.9g, it is considered almost complete, and a final jog is performed. Once the weight is detected to first reach or exceed 15.0g (considering sensor response delay), the baffle immediately closes completely. The system records the final actual dispensing weight (e.g., 15.02g) and writes it into the traceability record of this dispensing, achieving traceability of the "actual dosage".
[0182] In some embodiments, the system's monitoring and early warning are elevated to the level of prediction and intelligent diagnosis. It utilizes knowledge graphs to construct a network of relationships between devices, medicines, and processes, and combines edge computing to perform real-time analysis of massive operational data, transforming from passive alarms to proactive prediction and root cause analysis.
[0183] Construct a drug dispensing knowledge graph. The nodes of the graph include: equipment components (such as robotic arm joint J1, miniature cylinder C05, vacuum generator V2), drug properties (flowability, viscosity, particle size), operations (grabbing, placing, dispensing), historical failure cases, and environmental parameters (temperature, humidity). Edges represent the relationships between them, such as "Drug A - poor flowability - resulting in - cylinder C05 action delay", "Joint J2 - persistently high load - associated with - frequent drug dispensing in storage window area S3".
[0184] Edge computing units are deployed locally on the device to process time-series data (vibration, sound, current, images, weight, etc.) from all sensors in real time, extracting key features (such as mean, variance, and spectral features). Graph Neural Network (GNN) anomaly detection and root cause reasoning: The extracted features are used as dynamic attributes of corresponding nodes in the knowledge graph. The trained GNN model is then used to reason about the state of the entire knowledge graph.
[0185] The model can identify that "as the frequency of use of a certain drug increases, the corresponding grasping force curve shows a slow statistical shift", thus predicting that "the end effector corresponding to the drug may experience wear and tear failure after N operations in the future" and issuing maintenance reminders in advance.
[0186] When multiple sensors alarm simultaneously (such as robotic arm vibration + abnormal weighing in zone D), GNN can reason along the graph relationships to quickly locate the most likely root cause node (e.g., "inferring that the sensor below the material cup in zone D is contaminated by medicine, rather than a robotic arm malfunction") and provide diagnostic suggestions.
[0187] Equipment manufacturers can train a Generative Neural Network (GNN) model offline based on a large amount of historical data, enabling it to identify fault modes and early signs from complex correlation data. This model and knowledge graph are then deployed on the device's edge computing unit. During device operation, the edge computing unit continuously performs real-time analysis and knowledge graph updates. When the GNN model detects an abnormal pattern in a subgraph that matches a known early fault mode, it immediately generates a "predictive warning" message, including possible causes and confidence levels, and sends it to maintenance personnel.
[0188] When a specific error occurs, the system not only issues an alarm but also displays a reasoning path diagram on the user interface, intuitively telling the operator: "Based on the current data, the problem is likely due to a blockage at the mouth of drug A. It is recommended to clean the area around the mouth of drug dispenser #5 first."
[0189] Please see Figure 3 , Figure 3 This is a schematic block diagram of the structure of a computer control device provided in an embodiment of this application. The computer control device includes a processor, a memory, and a network interface connected via a device bus, wherein the memory may include a storage medium and internal memory.
[0190] The storage medium may store operating devices and computer programs. The computer program includes program instructions that, when executed, cause the processor to perform an embodiment of any method of using an artificial intelligence-based fully automated dispensing device.
[0191] The processor provides computing and control capabilities, supporting the operation of the entire computer control system.
[0192] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When executed by a processor, the computer program enables the processor to execute any fully automated dispensing device method based on artificial intelligence.
[0193] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the terminal to which the present application is applied. Specific computer control devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0194] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0195] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: The prescription information of the medicine to be dispensed is analyzed to generate a dispensing task. Based on the matrix coordinates of the storage window in the medicine cabinet of the fully automated dispensing equipment and the motion parameters of the robotic arm, the optimal path for the robotic arm to grasp the target medicine bottle is planned. The robotic arm of the fully automated dispensing equipment moves to the target storage window according to the planned path, grabs the target medicine bottle with the cap facing outward through the end effector, and places the target medicine bottle upside down in the designated medicine placement slot of the first dispensing module of the fully automated dispensing equipment, so that the mouth of the target medicine bottle is facing downward. Visual recognition technology is used to obtain the position information of the target medicine bottle in the medicine dispensing tank, and the position of the corresponding cup in the material cup receiving tank in the second dispensing module of the fully automatic dispensing equipment is calibrated to ensure that the mouth of the target medicine bottle is vertically aligned with the opening of the material cup. According to the dosage requirements in the medication dispensing task, the opening and closing timing of the baffle is controlled by driving the miniature cylinder under the dispensing tank of the fully automatic medication dispensing equipment, so that the medicine in the target medicine bottle falls into the material cup below under the action of gravity in a quantitative manner; after the medication is dispensed, the inventory information of the corresponding medicine is updated, and a medication dispensing process traceability record is generated. At the same time, abnormal situations in the medication dispensing process are monitored and warned in real time.
[0196] It should be noted that those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the processor described above can be referred to the corresponding process in the method embodiments described above, and will not be repeated here.
[0197] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement the steps of the method of using the artificial intelligence-based fully automated dispensing equipment provided in the above embodiments of this application.
[0198] The computer-readable storage medium can be an internal storage unit of the computer control device described in the foregoing embodiments, such as the hard disk or memory of the computer control device. Alternatively, the computer-readable storage medium can be an external storage device of the computer control device, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer control device.
[0199] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A fully automated medication dispensing method based on artificial intelligence, characterized in that, The method, applied to fully automated dispensing equipment, includes: The prescription information of the medicine to be dispensed is analyzed to generate a dispensing task. Based on the matrix coordinates of the storage window in the medicine cabinet of the fully automated dispensing equipment and the motion parameters of the robotic arm, the optimal path for the robotic arm to grasp the target medicine bottle is planned. The robotic arm of the fully automated dispensing equipment moves to the target storage window according to the planned path, grabs the target medicine bottle with the cap facing outward through the end effector, and places the target medicine bottle upside down in the designated medicine placement slot of the first dispensing module of the fully automated dispensing equipment, so that the mouth of the target medicine bottle is facing downward. Visual recognition technology is used to obtain the position information of the target medicine bottle in the medicine dispensing tank, and the position of the corresponding cup in the material cup receiving tank in the second dispensing module of the fully automatic dispensing equipment is calibrated to ensure that the mouth of the target medicine bottle is vertically aligned with the opening of the material cup. According to the dosage requirements in the medication dispensing task, the opening and closing timing of the baffle is controlled by driving the miniature cylinder under the dispensing tank of the fully automatic medication dispensing equipment, so that the medicine in the target medicine bottle falls into the material cup below under the action of gravity in a quantitative manner; after the medication is dispensed, the inventory information of the corresponding medicine is updated, and a medication dispensing process traceability record is generated. At the same time, abnormal situations in the medication dispensing process are monitored and warned in real time.
2. The method according to claim 1, characterized in that, The process of parsing the prescription information for the medication to be dispensed and generating a dispensing task includes: Semantic parsing of prescription text is performed using natural language processing algorithms to extract key information, including drug name, specifications, dosage, and compatibility requirements. The extracted drug information is matched with the electronic tag database of the storage window in the medicine cabinet to determine the unique matrix coordinates of the storage window corresponding to the target drug. Based on the drug compatibility order and dosage priority, a drug dispensing task list is generated, which includes the target storage window coordinates, drug retrieval order, and dosage parameters.
3. The method according to claim 1, characterized in that, The step of planning the optimal path for the robotic arm to grasp the target medicine bottle based on the matrix coordinates of the storage window in the dispensing cabinet of the fully automated dispensing equipment and the motion parameters of the robotic arm includes: Establish the mapping relationship between the matrix coordinates of the medicine cabinet and the joint space of the robotic arm, and obtain the three-dimensional coordinates of each target storage window and the current position of the robotic arm; Using a preset optimization algorithm, with the goal of minimizing the movement distance of the robotic arm and balancing the joint load, a collision-free grasping sequence and motion trajectory are generated. By combining the maximum movement speed and acceleration of each joint of the robotic arm, the planned path is optimized in time to form an execution instruction sequence that includes the motion parameters of each joint.
4. The method according to claim 1, characterized in that, The step of grasping the target medicine bottle with the cap facing outward using an end effector and placing the target medicine bottle upside down into the designated dispensing slot of the first dispensing module of the fully automated dispensing equipment includes: Based on the material of the target medicine bottle cap, the system automatically selects either an electromagnetic adsorption gripper or a vacuum suction cup as the end effector. The end effector is controlled to move to the outside of the bottle cap in a direction perpendicular to the storage window plane, and the adsorption force is adjusted through closed-loop feedback to ensure stable gripping; Through the coordinated rotation and extension of the robotic arm's upper arm, lower arm, and base, the medicine bottle is translated and rotated 180 degrees, precisely positioned above the target medicine dispenser, and released with the bottle opening facing downwards.
5. The method according to claim 1, characterized in that, The method of obtaining the position information of the target medicine bottle in the medicine dispensing slot using visual recognition technology includes: An industrial camera is installed above or to the side of the first drug dispensing module to capture images of the medicine bottles in the drug dispensing tank; Image processing algorithms are used to identify the outline of the medicine bottle opening and the reference mark of the medicine dispensing slot; the offset between the actual position of the medicine bottle and the center of the medicine dispensing slot is calculated to generate position deviation data.
6. The method according to claim 1, characterized in that, The calibration of the material cup position in the corresponding material cup receiving slot of the second dispensing module of the fully automatic dispensing equipment ensures that the mouth of the target medicine bottle is vertically aligned with the opening of the material cup, including: The positional deviation data of the medicine bottle obtained by visual recognition is converted into adjustment instructions in the device coordinate system; The first or second dispensing module is driven by a servo motor to perform horizontal micro-movement or rotation, so that the coordinate error between the center of the medicine bottle mouth and the center of the opening of the lower material cup is less than a preset threshold. After calibration, the relative position of the dispensing module is locked to form a stable vertical material drop channel.
7. The method according to claim 1, characterized in that, The process involves controlling the opening and closing timing of a baffle by driving a miniature cylinder below the dispensing tank of the fully automatic dispensing equipment, based on the dosage requirements of the dispensing task. This allows the medicine in the target vial to fall quantitatively into the material cup below under the influence of gravity. The process includes: Based on the single-dose volume and total dose requirements of the drug, calculate the mapping relationship between the baffle opening time and the amount of drug falling; When material needs to be discharged, a pulse signal is sent to the miniature cylinder of the corresponding dispensing tank to control the duration of the baffle's horizontal opening. In scenarios involving multiple drug combinations, the baffles of each dispensing tank are triggered sequentially according to the prescription order to ensure that different drugs fall into their corresponding cups in the correct order, thus avoiding mixing and contamination.
8. The method according to claim 1, characterized in that, The process of updating the corresponding drug inventory information and generating a medication dispensing process traceability record includes: Read the current inventory quantity from the electronic tag in the target storage window, deduct it according to the actual amount taken in the dispensing task, update the inventory data in real time and synchronize it to the main control system; Collect key data during the medication dispensing process and generate an unalterable medication dispensing process log in chronological order of timestamps; Inventory data and traceability records are stored in a blockchain database or distributed storage system for subsequent auditing and traceability queries.
9. The method according to claim 1, characterized in that, The real-time monitoring and early warning of abnormal situations during the medication preparation process includes: The robotic arm uses joint encoders and force sensors to monitor the gripping force and motion trajectory deviation in real time. When abnormal vibration, overtravel, or jamming is detected, an emergency stop command is triggered. The system uses a vision system to analyze the amount of residue after the medicine bottle is filled in real time. When the amount of medicine residue exceeds the preset threshold, an early warning of blockage or adhesion is generated. Monitor electronic tag inventory data and automatically send replenishment reminders to the management terminal when drug inventory is found to be below the safety threshold or nearing its expiration date; When an anomaly occurs, an alarm is triggered by sound and light, and the specific type and location of the anomaly are displayed on the equipment operation interface, making it easy for operators to quickly troubleshoot and handle the situation.
10. A fully automated medication dispensing device based on artificial intelligence, characterized in that, Used to perform the method as described in any one of claims 1-9.