Medicine distribution device based on Internet of Things

Through the Internet of Things drug distribution device, combined with multimodal data fusion and artificial intelligence, it solves the problems of inaccurate drug distribution, complex morphology and data privacy and security, and realizes automatic identification, precise capture and efficient distribution of drugs, ensuring that Data privacy and security.

CN119262627AInactive Publication Date: 2025-01-07SHANDONG FIRST MEDICAL UNIVERSITY FIRST AFFILIATED HOSPITAL (QIANFO MOUNTAIN HOSPITAL OF SHANDONG PROVINCE)
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411626189.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-01-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing drug distribution system is difficult to achieve automatic and accurate distribution of multiple drugs, especially for drugs without packaging or complex shapes, and lacks multimodal analysis capabilities, resulting in identification and classification errors, inflexible path planning, and insufficient data privacy and security. .

Method used

Adopt a drug distribution device based on the Internet of Things, combining robotic arms, multi-functional grabbers, force feedback sensors, high-precision weight sensors, high-definition cameras, 3D scanners and near-infrared spectral analysis equipment, through multimodal data fusion and artificial intelligence Algorithms and intelligent control systems realize automated identification, precise capture and efficient distribution of drugs, and optimize personalized distribution strategy and data privacy protection through data processing and optimization layers.

Benefits of technology

It realizes the accuracy and automation of drug distribution, improves the processing capacity of complex drugs, optimizes path planning, ensures data privacy and security, and meets the high requirements of modern drug management and distribution systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119262627A_ABST
    Figure CN119262627A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of internet of things and intelligent control, and provides a medicine distribution device based on the internet of things. An existing medicine distribution system mainly depends on manual operation or single automatic equipment, so that the efficiency and precision in the distribution process are low, the medicine identification technology bureau is limited to simple package bar code scanning, and identification and distribution of unpackaged medicines are difficult to process. According to the multi-modal data fusion technology, two-dimensional images, three-dimensional forms and spectral data are combined, medicine is accurately recognized, and automatic grabbing and accurate distribution are achieved through the mechanical arm and the force feedback control device. And the control layer adopts an inverse kinematics algorithm, a path planning algorithm and fuzzy logic control to ensure accurate operation and safe grabbing of the mechanical arm. The system also utilizes a reinforcement learning algorithm to dynamically optimize a drug distribution strategy, and improves the accuracy and flexibility of the distribution process through a real-time feedback mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of drug management, and in particular to a drug dispensing device based on the Internet of Things. Background Art

[0002] With the rapid development of the Internet of Things (IoT) and intelligent control technology, the field of drug management is gradually shifting towards automation and intelligence. Especially in medical, pharmaceutical and drug supply chain management, how to safely and efficiently distribute and manage drugs has become an important research topic. Traditional drug management and distribution systems often rely on manual operation and supervision, which not only increases labor costs, but also easily leads to human errors, which in turn affects the accurate distribution and use of drugs. Especially when there are many types of drugs and complex forms, manual operation is difficult to ensure the accuracy and efficiency of distribution.

[0003] At present, most of the traditional drug dispensing devices on the market only have basic classification and distribution functions, and it is difficult to achieve automatic and accurate distribution of multiple drugs, especially for unpackaged drugs (such as traditional Chinese medicine) or drugs with complex shapes, their grasping, identification and distribution still need to rely on manual operation. In addition, most of these devices use a single sensor or a basic visual system, lacking the ability to analyze the characteristics of drug morphology, chemical composition and other characteristics, resulting in errors in the process of drug identification and classification. At the same time, the traditional drug management system also has insufficient path planning and operation accuracy when dealing with complex environments (such as obstacles and changes in drug position), making it difficult to meet the needs of accurate and safe drug distribution. Existing drug distribution systems usually lack the ability to deeply analyze data and cannot optimize personalized drug distribution strategies based on the historical use of drugs and the health data of patients. In addition, data privacy and security issues in the drug management process are also an important challenge facing the current intelligent drug distribution system. The high sensitivity of drug data and patient health data requires the system to not only have efficient data processing capabilities, but also to ensure data privacy and security during data transmission and processing.

[0004] Therefore, there is an urgent need for an intelligent drug dispensing device that can realize multimodal drug data fusion and has path optimization and adaptive control capabilities to ensure the accuracy and automation of drug dispensing. At the same time, it can conduct in-depth analysis of drug data and patient health data and provide data privacy protection to meet the high requirements of modern drug management and distribution systems. Summary of the invention

[0005] The purpose of the present invention is to provide a drug dispensing device based on the Internet of Things, which aims to achieve automatic identification, accurate grabbing and efficient distribution of drugs through multimodal data fusion technology, artificial intelligence algorithms and intelligent control systems, and solve the problems of inaccurate distribution, difficult processing of complex drug forms, inflexible path planning and insufficient data privacy and security protection in the prior art. To achieve the above purpose, the drug dispensing device provided by the present invention includes:

[0006] Robotic arms, multifunctional gripping devices, force feedback sensors, high-precision weight sensors, high-definition cameras, 3D scanners, near-infrared spectroscopy (NIR) analysis equipment;

[0007] The robot arm is composed of joints and connecting rods. Each joint is independently controlled by a servo motor, and its motion path is controlled by a stepper motor. A multifunctional grasping device is installed at the end of the robot arm, and the multifunctional grasping device includes a flexible gripper and a vacuum absorber. A force feedback sensor is installed at the end of the robot arm, located in the center of the multifunctional grasping device. When grasping an object, the force feedback sensor keeps in contact with the object. A high-precision weight sensor is located on the robot arm housing. A high-definition camera is located on the robot arm housing. A 3D scanner is located on the robot arm housing. A near-infrared spectroscopy (NIR) analysis device is located on the robot arm housing.

[0008] A medicine dispensing device based on the Internet of Things includes a three-layer architecture, wherein the first layer of the device is a hardware layer, including:

[0009] A robotic arm, the robotic arm comprises a plurality of joints and connecting rods, each joint is independently controlled by a servo motor, and its motion path is controlled by a stepper motor, and the step angle accuracy of the stepper motor is 1.8°, which ensures high-precision operation of the robotic arm in three-dimensional space. The working range of the robotic arm can cover an operating radius of 500 mm in diameter, and is suitable for grabbing and dispensing medicines of different sizes;

[0010] A multifunctional gripping device, comprising a flexible gripper and a vacuum absorber, wherein the flexible gripper is composed of a plurality of adjustable mechanical fingers and can be adaptively adjusted according to the shape and size of the drug; the vacuum absorber is equipped with a microporous adsorption head, and its adsorption pressure is adjustable, which is suitable for grasping drugs with smooth surfaces and light weight. The gripping device can handle drugs with a weight range of 0.1g to 500g;

[0011] The force feedback sensor is installed at the end of the robotic arm to detect the gripping force of the gripper in real time. The resolution of the force feedback sensor is 0.01N, ensuring accurate force feedback when grasping medicines of different weights and shapes.

[0012] High-precision weight sensor, which is used to detect the weight of medicines. The measurement range is 0.1g to 500g. The accuracy of the weight sensor is ±0.005g. It can detect the weight change of medicines in real time and perform automatic calibration to ensure the accuracy of medicine distribution;

[0013] High-definition camera, equipped with a 5-megapixel sensor, is used to collect two-dimensional image data of drugs, supporting real-time image processing at up to 60 frames per second to ensure the accuracy of capturing drug images in high-dynamic scenes;

[0014] 3D scanner, which uses laser ranging technology to obtain the three-dimensional shape information of drugs with a scanning accuracy of 0.1mm. It can capture the volume, surface geometry and structural changes of drugs and is suitable for scanning drugs with complex shapes;

[0015] Near-infrared spectroscopy (NIR) analysis equipment, with an operating wavelength range of 800nm ​​to 2500nm, is used to detect the chemical composition of drugs and obtain the molecular structure information of drugs through spectral reflection characteristics. The spectral resolution reaches 1nm, ensuring high-precision chemical composition analysis.

[0016] The second layer of the device is a control layer, including:

[0017] The control module controls the movement of the robot arm through an inverse kinematics algorithm. The inverse kinematics algorithm is based on the recursive Newton-Euler method to plan and control the movement of the robot arm joints. The system calculates the movement angle of the robot arm joints according to the spatial position of the drug, and the stepper motor is precisely adjusted according to the angle to ensure that the movement accuracy of the robot arm when grasping the drug reaches ±0.5mm;

[0018] Adaptive force control algorithm: The gripping force can be adjusted in real time through the fuzzy logic control algorithm. The force feedback sensor detects the gripping force in real time, and the force control algorithm generates gripping force adjustment instructions based on the weight and shape of the medicine through fuzzy control rules to ensure that the gripping force is dynamically adjusted between 0.1N and 50N to meet the gripping requirements of different medicines.

[0019] Path planning and visual feedback mechanism: The system uses a motion path planning algorithm based on the A* algorithm, combined with the DWA (dynamic window method) algorithm to optimize the motion path, ensuring that the robot arm avoids obstacles in complex environments and achieves optimal path grabbing and placement operations. Combined with the real-time visual feedback control mechanism, the system uses image data collected by high-definition cameras and 3D scanners to adjust the posture and position of the medicine. Visual feedback uses the Kalman filter to filter noise and smooth the image to ensure that the position deviation of the medicine is within ±0.2mm;

[0020] Spectral data control: The system obtains the spectral reflectance data of drugs through real-time interaction with NIR spectral analysis equipment. The control module uses principal component analysis (PCA) to reduce the dimension of spectral data and classifies it through support vector machine (SVM) to ensure the accuracy of chemical composition analysis, and uses the spectral analysis results for subsequent drug classification and identification operations;

[0021] Weight calibration: After the medicine is grabbed, the system interacts with the high-precision weight sensor to detect the weight of the medicine in real time. The system uses an adaptive Kalman filter algorithm to calibrate the data of the weight sensor to ensure that the weight error is less than ±0.005g. If a weight deviation is detected, the system automatically adjusts the quantity or quality of the medicine through the control module to ensure the accuracy of the medicine distribution.

[0022] The third layer of the device is a data processing and optimization layer, including:

[0023] A drug identification and analysis module, used to identify and analyze a variety of drugs, including packaged and unpackaged drugs;

[0024] For unpackaged drugs, the two-dimensional image data of the drugs is collected by high-definition cameras, and the three-dimensional morphological information of the drugs is obtained by 3D scanners. Combined with near-infrared spectroscopy (NIR) analysis technology, multi-modal data fusion processing is performed, including:

[0025] Two-dimensional image processing: The two-dimensional image data of the drug is obtained through a high-definition camera. The image data is processed by the Vision Transformer (ViT) model. The ViT model uses the self-attention mechanism to extract the local details and global features of the drug, capture the color, shape and texture features of the drug, and generate a high-dimensional feature vector;

[0026] 3D morphology processing: The 3D morphology information of the drug is obtained through a 3D scanner. The 3D data is processed through the PointNet network. PointNet processes the 3D point cloud data of the drug, extracts its spatial structure features, captures the volume, surface geometry, and structural changes of the drug, and generates a 3D feature vector;

[0027] Spectral analysis: Combined with near-infrared spectroscopy (NIR) analysis technology, the chemical composition of the drug is detected through the spectral analysis module. The spectral data is input into the support vector machine (SVM) classifier. The SVM is used to compare the spectral reflectance characteristics with the standard spectral database to identify the chemical composition of the drug and ensure the distinction between drugs with similar appearance but different ingredients;

[0028] Multimodal fusion: The two-dimensional image features, three-dimensional morphological features and spectral features are fused through a multimodal fusion network. The fusion network adopts a multi-task learning mechanism to integrate the feature vectors of different modalities into a comprehensive feature representation, and generates a multi-dimensional feature vector of the drug for the final classification and identification of the drug type;

[0029] Capsule Networks: The fused multimodal features are further processed by capsule networks, which can capture the spatial hierarchical relationship and morphological changes of drugs, ensuring that the system can still accurately identify the drug category when facing complex shapes, rotations or tilts of drugs;

[0030] For packaged drugs, the drug identification information is extracted through a barcode scanner or RFID reader. The identification information includes the type, dosage and expiration date of the drug. The system performs redundant data check and consistency check on the extracted identification information through a data verification module to ensure the accuracy of the drug information, and uploads the information to the system database;

[0031] A medicine dispensing module for automatically dispensing medicines. The module includes a robotic arm, the precise position of which is controlled by a stepper motor. The stepper motor has a high-precision positioning capability of 1.8° step angle, and is combined with a force feedback sensor to detect the grasping force in real time to ensure the accuracy of medicine grasping and placement. The module also includes a high-precision weight sensor for calibrating the weight of the dispensed medicine to ensure that the dispensing accuracy reaches ±0.01g;

[0032] The data acquisition module is used to monitor the drug storage environment. The module includes a temperature and humidity sensor. The accuracy of the temperature sensor is ±0.05°C, and the accuracy of the humidity sensor is ±1%RH. The system dynamically adjusts the sampling frequency of the sensor through an adaptive sampling algorithm to ensure the timeliness of environmental data. The data is uploaded to the control module through the Internet of Things interface, and the system generates an environmental adjustment strategy based on the collected data;

[0033] A control module is used to manage drug storage, identification and distribution operations. The control module communicates with user terminals and cloud servers through the Internet of Things, supports asynchronous task scheduling algorithms to process multiple user instructions, and the algorithm performs concurrent task scheduling based on an event-driven mechanism. The system can dynamically adjust the execution order of tasks according to task priorities to ensure the processing of at least 1,000 concurrent requests;

[0034] A data analysis module is used to generate a personalized drug distribution strategy. The module uses a reinforcement learning algorithm to dynamically optimize the drug distribution strategy based on the patient's historical medication records and health data. The reinforcement learning algorithm adopts an epsilon-greedy strategy. The system dynamically adjusts the epsilon value between exploring new strategies and using existing optimal strategies to control the probability of exploration. The system optimizes the drug distribution strategy through a Q value update function Q(s,a). During the Q value update process, the priority of the future distribution strategy is adjusted according to the immediate reward and discount factor to ensure the effectiveness of the personalized drug distribution plan;

[0035] The security protection module is used to ensure data security during the drug distribution process. The module uses the AES-256 encryption algorithm to encrypt drug distribution data and patient privacy. The system protects patient data privacy through differential privacy technology. The differential privacy module ensures a balance between privacy protection and data analysis by controlling the intensity of noise injection. The system supports the federated learning framework to ensure that drug identification and distribution models can be locally trained on multiple devices. The federated learning module achieves global model updates by aggregating local model weights while ensuring data privacy.

[0036] Each joint of the robotic arm is controlled by angle feedback through a position encoder with an angle accuracy of 0.01 degrees, and error correction is performed through a proportional integral differential control (PID) algorithm; the adjustment range of the flexible gripper is 2mm to 100mm, and its mechanical fingers adopt a control mode that combines force feedback and displacement perception, and the flexibility of the gripper is adjusted in real time through an adaptive fuzzy control algorithm. The suction head of the vacuum adsorber is pressure-regulated by a negative pressure control module, and the negative pressure range is 10kPa to 100kPa. The adsorption pressure is monitored in real time by a pressure feedback sensor with a feedback accuracy of 0.01kPa.

[0037] The real-time interaction between the force feedback sensor and the control module is achieved through a fuzzy logic control algorithm, where the input variables of the fuzzy logic include force feedback errors and drug morphological characteristics, and the system generates control instructions through a fuzzy rule base.

[0038] The 3D scanner captures the surface morphology of the drug through a laser ranging module and uses a point cloud sparsification algorithm for data processing to reduce the computing load and improve the efficiency of three-dimensional data processing.

[0039] The fuzzy logic control algorithm updates the fuzzy rule base in real time. The input includes the grasping force error and the object morphology parameters, and the output is the torque adjustment instruction. The torque adjustment is learned online through the neural network optimization module, and the fuzzy control rules are optimized in multiple operations.

[0040] The motion path planning based on the A* algorithm calculates the path cost through f(n)=g(n)+h(n), where g(n) is the current path length and h(n) is the heuristic function of the estimated path. The system adjusts the path in real time through the dynamic window algorithm (DWA) to ensure obstacle avoidance path planning in complex dynamic environments.

[0041] The spectral data control module combines the support vector machine (SVM) classifier to classify the spectral reflectance data, where the SVM uses the radial basis kernel function (RBF) and ensures high accuracy of spectral classification by adjusting the parameters C and gamma.

[0042] The two-dimensional image processing module performs multi-layer feature extraction on the image through a convolutional neural network (CNN) model. The input image size of the CNN model is 224x224, and the maximum pooling layer and the fully connected layer are used to analyze the high-dimensional features of the image.

[0043] The three-dimensional morphology processing module of drugs uses the PointNet network for data processing. The input point cloud data of the PointNet network is initially segmented using the K-nearest neighbor algorithm (KNN), and the global feature pooling layer is used to extract the global features of the three-dimensional morphology. The generated three-dimensional feature vector is used for subsequent classification.

[0044] The capsule network includes multiple capsule layers with dynamic routing mechanisms. The vector relationship between capsules captures the spatial hierarchical information of drugs. The network uses a dynamic routing algorithm to adjust the weights between capsules.

[0045] The epsilon-greedy strategy in the reinforcement learning algorithm adopts an adaptive epsilon adjustment mechanism. By setting the epsilon(min) and epsilon(max) values, the system automatically adjusts the balance point between exploration and utilization.

[0046] The control module supports remote updating of the control algorithm through remote cloud services. The system performs online training of the control model through convolutional neural network (CNN) model optimization and back propagation algorithm to ensure continuous optimization of the drug distribution strategy.

[0047] The differential privacy module uses a Laplace noise injection mechanism to control the noise intensity through the parameter epsilon and maximize the availability of retained data during data analysis.

[0048] The federated learning framework aggregates model weights through a gradient descent optimization algorithm and uses a gradient averaging mechanism to dynamically update local model weights.

[0049] The environmental data monitoring module combines temperature and humidity sensors with fuzzy control algorithms to adjust the drug storage environment in real time through an adaptive fuzzy logic system. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments or exemplary embodiments of the present invention, the drawings required for use in the embodiments or exemplary descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained according to the drawings without paying creative work.

[0051] Figure 1 A left-side stereoscopic image of a drug dispensing device based on the Internet of Things

[0052] Figure 2 A side view of the multifunctional gripping device

[0053] Figure 3 Schematic diagram of the three-layer architecture of the system

[0054] Figure 4 Diagram of the interaction between the control layer and the hardware

[0055] Figure 5 Flowchart of multimodal data fusion

[0056] Figure 6 System Context Diagram

[0057] Legend:

[0058] 1. Robotic arm; 2. Multifunctional grasping device; 21. Flexible gripper; 22. Vacuum absorber; 3. Force feedback sensor; 4. High-precision weight sensor; 5. High-definition camera; 6. 3D scanner; 7. Near-infrared spectroscopy (NIR) analysis equipment.

[0059] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0060] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0061] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0062] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0063] Figure 1 It is a schematic diagram of the three-layer architecture of the system, showing a three-layer architecture of a drug dispensing device based on the Internet of Things: hardware layer, control layer, and data processing and optimization layer. The system collects drug information through hardware devices, and performs real-time optimization through a variety of algorithms in the control layer, and finally passes the results to the data processing layer for analysis and decision-making. In this embodiment, the hardware layer collects multimodal data such as two-dimensional images, three-dimensional shapes, and gripping forces of drugs in real time through cameras, force feedback sensors, 3D scanners and other devices, and transmits these data to the control layer for processing and real-time optimization. Its specific architecture is:

[0064] (1) Hardware layer: As the basic data source of the system, the hardware layer is responsible for physically interacting with drugs and providing multimodal data for the control layer and data processing and optimization layer. The operation of each device works in conjunction with the algorithm in the control layer to ensure the accuracy of each operation.

[0065] The robot arm is composed of multiple joints and links, each joint is independently controlled by a servo motor, and the motion path is controlled by a stepper motor with a step angle accuracy of 1.8°. The movement of the robot arm is managed by the inverse kinematics algorithm of the control layer, which is based on the recursive Newton-Euler method (RNEA) and calculates the angular velocity and acceleration of each joint of the robot arm in real time to ensure that its end effector can accurately reach the specified position.

[0066] At the data flow level, the hardware layer collects the physical state information of the drug (such as shape, size, position, etc.) through force feedback sensors, high-definition cameras and 3D scanners, and this information will be passed to the inverse kinematics algorithm in the control layer. The algorithm calculates the joint angle using the following formula:

[0067]

[0068] Among them, T i (θ i ) is the transformation matrix of each joint. The control layer sends adjustment signals to the stepper motor of the robot arm based on the calculation results to ensure that the robot arm's grasping action is accurate and correct.

[0069] The multifunctional gripping device combines a flexible gripper and a vacuum absorber to grasp medicines of different shapes and weights. The gripping device cooperates with the fuzzy logic control algorithm of the control layer to ensure that during the grasping process, the system adjusts the grasping force according to the real-time sensor feedback data. The data of the force feedback sensor is transmitted to the control layer, and the adjustment instructions are generated through the input variables of the fuzzy control system (force feedback error and medicine morphology parameters). These instructions are eventually sent back to the gripping device to ensure that its gripping force is moderate and does not cause damage to the medicine.

[0070] The reasoning process of fuzzy logic control is based on the following rule base:

[0071] The reasoning process of fuzzy logic control is based on the grasping force error and the drug morphological characteristics as inputs. Through fuzzification processing, the grasping force error ΔF and the morphological characteristic parameter θ are converted into corresponding fuzzy sets. The system generates control instructions based on the pre-set fuzzy rule base. The definition of the fuzzy rule base is based on the state combination of input variables. The system generates adjustment outputs according to the current grasping state through the fuzzy reasoning mechanism. The specific rules are as follows: When ΔF indicates that the grasping force is large and θ indicates that the drug morphology is complex, the system automatically adjusts the output grasping force and generates instructions to reduce the grasping force. The system executes the fuzzy reasoning process, evaluates the activation degree of each rule through set operations, and calculates the output value based on all activated rules. The results of fuzzy reasoning will be converted into specific grasping adjustment actions through the defuzzification step. The defuzzification adopts the center of gravity method to output the optimal grasping force adjustment value according to the weight of the activated rules to ensure that the drug will neither be over-stressed nor slip during the grasping process.

[0072] The equipment is responsible for collecting the 2D and 3D morphological data of the drug. The high-definition camera obtains the 2D image of the drug, while the 3D scanner captures the surface geometry of the drug. These data are passed to the control layer for path planning. During the path planning process, the system uses the A* algorithm combined with the dynamic window method (DWA) to optimize the motion path of the robot arm in real time.

[0073] The data flow transmission logic is as follows: the image data collected by the camera and scanner will be transmitted to the control layer. The system calculates the optimal path through the A* algorithm and adjusts the motion trajectory in real time in combination with the dynamic window method to ensure that the robot arm can avoid obstacles and accurately reach the target position. The path planning formula is:

[0074] f(n)=g(n)+b(n)

[0075] Where g(n) is the current path length and h(n) is the estimated path cost. The dynamic window rule makes real-time path adjustments based on the current environmental status to ensure correct grabbing and placement operations. The device is responsible for detecting the chemical composition of drugs, especially for unpackaged drugs. The spectral data is processed using near-infrared spectral reflectance technology and passed to the data processing and optimization layer for drug component analysis and classification. In the hardware layer, the spectral data is preliminarily analyzed using a support vector machine (SVM) classifier to ensure that the chemical composition of the drug can be accurately identified.

[0076] After receiving the multimodal data from the hardware layer, the control layer controls the motion path and grasping force of the robot arm in real time through algorithms such as inverse kinematics, path planning, and fuzzy logic control. This layer not only realizes the precise operation of hardware equipment, but also improves the efficiency and accuracy of drug identification and grasping through interaction with the data processing and optimization layer.

[0077] (2) Control layer: As the core processing unit of the system, the control layer is responsible for managing the actions of hardware devices and performing path optimization, gripping force adjustment, and visual feedback through algorithms. Specifically, it includes:

[0078] Inverse kinematics and control module: The control module performs inverse kinematics calculations through the recursive Newton-Euler method (RNEA), and calculates the angular velocity and angle changes of each joint of the robot arm in real time. This process combines visual data from the camera and 3D scanner to ensure that the robot arm can accurately perform grasping operations. The system will pass the adjustment instructions of each joint to the robot arm through the control module to ensure that its end can reach the specified position according to the inverse kinematics algorithm.

[0079] Path planning algorithm: The control layer combines the A algorithm with the dynamic window method (DWA) to plan the motion path for the robot. During the path planning process, the A algorithm is responsible for calculating the shortest path from the starting point to the end point, while the dynamic window method is responsible for optimizing the path in real time to ensure that the robot can avoid obstacles. In terms of data flow, the visual data in the hardware layer is transmitted to the control layer. After receiving the data, the path planning module generates an optimized motion path, and then returns the path information to the robot to perform corresponding adjustment operations.

[0080] Fuzzy logic control mechanism: This algorithm uses real-time feedback of force sensing data and the characteristics of the gripping device to adaptively adjust the gripping force. Fuzzy logic control generates adjustment instructions through fuzzy reasoning of force feedback data, which are transmitted back to the gripping device to ensure that the gripping force can be automatically adjusted according to the shape and weight of the medicine.

[0081] Visual feedback mechanism: The system processes image data through the visual data provided by the camera and 3D scanner combined with the Kalman filter. The role of the Kalman filter is to denoise and smooth the collected image data, ensuring that the system can still obtain accurate visual information in complex environments and adjust the movement path of the robot arm based on this information.

[0082] (3) Data processing and optimization layer: The data processing and optimization layer receives the data results transmitted by the control layer, combines multimodal data fusion and capsule network classification algorithm, and conducts in-depth analysis and optimization of drugs. By continuously updating the recognition and allocation strategies, this layer provides feedback to the control layer, and finally completes the entire drug recognition, grabbing and allocation operation.

[0083] Drug recognition and analysis module: The drug recognition module receives 2D images, 3D morphology and spectral data from the hardware layer, and analyzes and recognizes drugs through multimodal data fusion. The 2D image is processed by the Vision Transformer (ViT) model to extract local and global features of the image, while the 3D morphology data is processed by the PointNet network to extract the spatial structure features of the drug.

[0084] Multimodal data fusion and capsule network classification: The system uses multimodal data fusion technology to integrate two-dimensional images, three-dimensional morphology and spectral data, and realizes multimodal fusion through the following formula:

[0085] f fusion =W 1 ·f 2D +W 2 ·f 3D +W 3 ·f NIR

[0086] The fused features are passed to the capsule network for classification. The capsule network classifies drugs with complex forms through a dynamic routing mechanism to ensure the accuracy of the classification results.

[0087] During the drug distribution process, the system optimizes the distribution strategy through the Q-learning algorithm. After each drug distribution operation, the system updates the Q value based on the immediate reward, and controls the balance point between exploration and utilization through the epsilon-greedy strategy to ensure that the system can continuously optimize the distribution strategy. The core formula is:

[0088]

[0089] The data processing layer continuously improves the allocation plan through continuous feedback and learning to ensure that the system can meet the personalized needs of different users.

[0090] in accordance with Figure 2 The control layer and hardware interaction diagram, in this embodiment, shows in detail the collaborative relationship between the control layer and the hardware layer in the system. In this embodiment, the hardware and control layers communicate efficiently through the underlying computer architecture, and the data flow and control signal generation involve specific computing resource scheduling, instruction set execution and real-time control. In the entire system, the hardware layer and the control layer collaborate through standard computer hardware interfaces to ensure that the equipment can respond to the control of the software algorithm in a timely manner and complete accurate drug capture, identification and distribution. Specifically:

[0091] The underlying computation and interaction between the hardware layer and the control layer: Each device in the hardware layer (such as a robotic arm, camera, sensor, etc.) communicates with the central processing unit (CPU) of the control layer through a specific bus protocol (such as I2C, SPI, CAN, or PCIe). The CPU of the control layer is based on the RISC (Reduced Instruction Set Computing) architecture and processes complex control signals and data streams. After receiving data from the hardware layer, the control layer converts the data into a format compatible with high-level control algorithms through the hardware abstraction layer (HAL). Each hardware device has a corresponding driver to manage low-level device operations, and the device driver interacts with the user-mode control module through the kernel-mode API.

[0092] In the operation of the robot arm, the CPU first calculates the angle and angular velocity of each joint of the robot arm through the inverse kinematics algorithm. This algorithm is executed by the stepper motor driver at the hardware layer. In the process of generating control signals, the calculation of the inverse kinematics algorithm is completed under the RISC architecture through pipeline operation. The pipeline is divided into five stages: instruction fetch (IF), decoding (ID), execution (EX), memory access (MEM) and write back (WB). Each instruction will be completed within five stages, and the parallel design of the pipeline ensures the execution efficiency of the algorithm at a higher frequency. The CPU takes out multiple instructions from the memory per cycle, processes the motion calculation of each joint in turn, writes the results to the robot arm control register, and transmits them to the stepper motor driver module through the bus. The driver module controls the angle and speed of the motor based on the pulse width modulation (PWM) signal.

[0093] The force feedback sensor monitors the gripping force of the gripper in real time. The sensor converts the analog electrical signal into a digital signal through an analog-to-digital converter (ADC) and transmits it to the CPU through the I2C bus. After the data stream passes through the controller, the force feedback signal is stored in the controller's buffer, waiting to be processed by the fuzzy logic control algorithm. When processing the force feedback signal, the fuzzy logic controller calculates the corresponding adjustment output based on the fuzzy value of the sensor input. The system handles the calculation of fuzzy sets at the bottom level through the displacement operation instructions (SHIFT) and logical operation instructions (AND / OR) in the instruction set. Subsequently, the defuzzification process generates the final precise adjustment instructions through addition and shift operations, and sends them to the flexible gripper through PWM signals to adjust its gripping force.

[0094] Collaboration between the control layer and the hardware layer in visual and spectral analysis: The operation of high-definition cameras and 3D scanners involves real-time image acquisition and processing. These devices perform preliminary image processing through parallel image processing units (IPUs). The IPU uses the SSE (Streaming SIMD Extension) instruction set to process the pixel data of the image in parallel to increase the image processing speed. The camera works with the robotic arm through the visual feedback mechanism of the control layer. Each frame of image data is transmitted to the CPU through the PCIe interface and enters the image processing algorithm module in the instruction pipeline. The image data undergoes edge detection and morphological processing, and generates the current location information of the drug. The controller processes the data through the control integrated circuit (CIC) and generates a motion correction signal, which is passed back to the joint control module of the robotic arm.

[0095] The 3D scanner generates the three-dimensional shape of the medicine through laser ranging and point cloud data. The processing of point cloud data is completed through efficient parallel computing units. The PointNet algorithm in the control layer processes the point cloud data and calculates the geometric features of the medicine. In order to improve data transmission efficiency, the 3D scanner writes the point cloud data directly into the memory through DMA (direct memory access) and processes this data in parallel through the SSE instruction set to ensure that the robot arm can quickly adjust the grasping posture.

[0096] NIR spectroscopy equipment is used to detect the chemical composition of unpackaged drugs. At the hardware operation level, the spectral equipment converts near-infrared spectral data into digital signals through ADC, and these signals are directly transmitted to the control layer through the PCIe interface. The SVM (support vector machine) classifier in the control layer efficiently classifies the spectral data through vectorization operations. The results of each spectral data analysis are compared with the standard spectral database of drugs, and the database entries are quickly accessed through memory mapping, and the classification results are returned to the control module.

[0097] Real-time control mechanism of software and hardware collaboration: The core control logic of the entire system relies on the real-time operating system (RTOS) to schedule efficient collaboration between the hardware layer and the control layer. RTOS is responsible for managing hardware interrupts, timed tasks, and priority scheduling. Each computing task in the controller, such as path planning, fuzzy control, visual feedback, etc., is assigned a different priority and executed in the CPU through the scheduler according to strict real-time requirements. The task scheduling mechanism of RTOS relies on a preemptive kernel. When a high-priority task (such as robot arm path correction) needs to be executed, the low-priority task will be suspended immediately to ensure the real-time response of the high-priority task.

[0098] During the path planning process, the controller calculates the best path through the A* algorithm, which accesses the heuristic function table in the system memory and uses the lookup table instruction (LUT) in the instruction set to accelerate the path calculation. After the path calculation is completed, the result will be written directly to the robot joint register to control the movement of the servo motor. The real-time optimization of the path planning algorithm is performed through the dynamic window method (DWA). The system dynamically adjusts the movement path of the robot according to the real-time environmental data to ensure both obstacle avoidance and efficiency.

[0099] In-depth analysis of the data processing and optimization layer: In the data processing and optimization layer, the system receives multimodal data from the hardware layer and classifies and identifies drugs through a multi-task learning model. Capsule Networks process the fused two-dimensional image, three-dimensional morphology and spectral data, and classify drugs through a dynamic routing mechanism. The processing of capsule networks relies on the hardware accelerator of deep neural networks, using GPUs to parallelize the vector relationship between capsules at each layer. During the dynamic routing process, the weight update between capsules is accelerated by CUDA (universal computing architecture) to ensure that each classification can be completed in milliseconds.

[0100] The drug distribution strategy is driven by a reinforcement learning algorithm (Q-learning), and the control layer continuously updates the Q value based on the drug identification results. The immediate reward after each operation is determined by the data fed back by the sensor. The control module parallelizes the Q value update function through the instruction pipeline to improve the update efficiency. The execution of the Q-learning algorithm depends on the strategy selection mechanism of reinforcement learning. The system adjusts the balance between exploration and utilization through an adaptive epsilon-greedy strategy to ensure the continuous optimization of the distribution strategy.

Claims

1. A medicine dispensing device based on the Internet of Things, characterized in that: The device comprises a three-layer architecture, the first layer being a hardware layer, comprising: a mechanical arm (1), a multifunctional grasping device (2), a force feedback sensor (3), a high-precision weight sensor (4), a high-definition camera (5), a 3D scanner (6), and a near-infrared spectroscopy (NIR) analysis device (7); The mechanical arm (1) is composed of joints and connecting rods, each joint is independently controlled by a servo motor, and its motion path is controlled by a stepper motor; The multifunctional grasping device (2) is installed at the end of the mechanical arm (1), and the multifunctional grasping device (2) comprises a flexible gripper (21) and a vacuum absorber (22); The force feedback sensor (3) is installed at the end of the mechanical arm and is located in the center of the multifunctional grasping device (2). When grasping an object, the force feedback sensor (3) maintains contact with the object. The high-precision weight sensor (4) is located on the housing of the mechanical arm (1); The high-definition camera (5) is located on the housing of the robotic arm (1); The 3D scanner (6) is located on the housing of the robotic arm (1); The near infrared spectroscopy (NIR) analysis device (7) is located on the housing of the robotic arm (1); The second layer of the device is a control layer, including: Control module: The control module uses an inverse kinematics algorithm to control the movement of the robot arm; the inverse kinematics algorithm is based on the recursive Newton-Euler Algorithm (RNEA) to plan and control the movement of the joints of the robot arm. The system calculates the movement angle of the robot arm joint according to the spatial position of the drug, and the stepper motor is precisely adjusted according to the angle; Adaptive force control algorithm: The real-time adjustment of the grasping force is achieved through the fuzzy logic control algorithm. The algorithm reasoning process is based on the grasping force error and the drug morphological characteristics as input. Through fuzzification processing, the grasping force error ΔF and the morphological characteristic parameter θ are converted into corresponding fuzzy sets; the system executes the fuzzy reasoning process, uses set operations to evaluate the activation degree of each rule, calculates the output value based on all activated rules, and generates adjustment output according to the current grasping state; Path planning and visual feedback mechanism: The system uses a motion path planning algorithm based on the A* algorithm (A-star algorithm) and combines it with the DWA (dynamic window method) algorithm to optimize the motion path, ensuring that the robot arm avoids obstacles in complex environments and achieves optimal path grabbing and placement operations; combined with the real-time visual feedback control mechanism, the system uses the image data collected by the high-definition camera and 3D scanner to adjust the posture and position of the medicine; visual feedback uses the Kalman filter to filter noise and smooth the image; Spectral data control mechanism: The system obtains the spectral reflectance data of drugs through real-time interaction with NIR spectral analysis equipment; the control module uses principal component analysis (PCA) to reduce the dimension of spectral data and classifies it through support vector machine (SVM), and uses the spectral analysis results for subsequent drug classification and identification operations; Weight calibration mechanism: After the medicine is grabbed, the system interacts with the high-precision weight sensor to detect the weight of the medicine in real time. The system uses an adaptive Kalman filter algorithm to calibrate the data of the weight sensor to ensure that the weight error is less than ±0.005g. The system automatically adjusts the quantity or quality of the medicine through the control module to ensure the accuracy of drug distribution. The third layer of the device is a data processing and optimization layer, including: A drug identification and analysis module, used to identify and analyze a variety of drugs, including packaged and unpackaged drugs; For unpackaged drugs, the two-dimensional image data of the drugs is collected by high-definition cameras, and the three-dimensional morphological information of the drugs is obtained by 3D scanners. Combined with near-infrared spectroscopy (NIR) analysis technology, multi-modal data fusion processing is performed, including: Two-dimensional image processing: The two-dimensional image data of the drug is obtained through a high-definition camera. The image data is processed by the VisionTransformer (ViT) model. The ViT model uses the self-attention mechanism to extract the local details and global features of the drug, capture the color, shape and texture features of the drug, and generate a high-dimensional feature vector; 3D morphology processing: The 3D morphology information of the drug is obtained through a 3D scanner. The 3D data is processed through the PointNet network. PointNet processes the 3D point cloud data of the drug, extracts its spatial structure features, captures the volume, surface geometry, and structural changes of the drug, and generates a 3D feature vector; Spectral analysis: Combined with near infrared spectroscopy (NIR) analysis technology, the spectral data is input into a support vector machine (SVM) classifier, which is used to compare the spectral reflectance characteristics with a standard spectral database to identify the chemical composition of the drug; Multimodal fusion: The two-dimensional image features, three-dimensional morphological features and spectral features are fused through a multimodal fusion network. The fusion network adopts a multi-task learning mechanism to integrate the feature vectors of different modalities into a comprehensive feature representation to generate a multi-dimensional feature vector of the drug; Capsule Networks: The fused multimodal features are further processed by capsule networks. The capsule network can capture the spatial hierarchical relationship and morphological changes of drugs. The system can accurately identify the drug category when faced with complex shapes, rotations, or tilts of drugs. For packaged drugs, the identification information of the drugs is extracted through a barcode scanner or RFID reader. The identification information includes the type, dosage and expiration date of the drugs. The system performs redundant data check and consistency check on the extracted identification information through a data verification module, and the information is uploaded to the system database; A medicine dispensing module for automatically dispensing medicines, the module comprising a robotic arm, the precise position of which is controlled by a stepper motor, the stepper motor having a high-precision positioning capability of 1.8° step angle, and a force feedback sensor for real-time detection of the grasping force to ensure the accuracy of grasping and placing the medicines, the module also comprising a high-precision weight sensor for calibrating the weight of the dispensed medicines; The data acquisition module is used to monitor the drug storage environment. The module includes a temperature and humidity sensor with an accuracy of ±0.05°C and a humidity sensor with an accuracy of ±1%RH. The system's adaptive sampling algorithm dynamically adjusts the sampling frequency of the sensor to ensure the timeliness of environmental data. The data is uploaded to the control module through the Internet of Things interface, and the system generates an environmental adjustment strategy based on the collected data. A control module is used to manage drug storage, identification and distribution operations. The control module communicates with user terminals and cloud servers through the Internet of Things, supports asynchronous task scheduling algorithms to process multiple user instructions, and the algorithm performs concurrent task scheduling based on an event-driven mechanism. The system dynamically adjusts the execution order of tasks according to task priorities and processes concurrent requests; A data analysis module is used to generate a personalized drug distribution strategy. The module uses a reinforcement learning algorithm to dynamically optimize the drug distribution strategy based on the patient's historical medication records and health data. The reinforcement learning algorithm adopts an epsilon-greedy strategy. The system dynamically adjusts the epsilon value between exploring new strategies and using existing optimal strategies to control the probability of exploration. The system optimizes the drug distribution strategy through a Q value update function Q(s,a). During the Q value update process, the priority of the future distribution strategy is adjusted according to the immediate reward and discount factor; The security protection module is used to ensure data security during the drug distribution process. The module uses the AES-256 encryption algorithm to encrypt drug distribution data and patient privacy. The system protects patient data privacy through differential privacy technology. The differential privacy module controls the intensity of noise injection. The system supports the federated learning framework; the federated learning module aggregates local model weights.

2. The Internet of Things-based medicine dispensing device according to claim 1, characterized in that: Each joint of the robotic arm is subjected to angle feedback control via a position encoder; The angular accuracy of the encoder is 0.01 degrees, and error correction is performed through a proportional integral differential (PID) control algorithm; the adjustment range of the flexible gripper is 2 mm to 100 mm, and its mechanical fingers adopt a control mode that combines force feedback with displacement sensing, and the flexibility of the gripper is adjusted in real time through an adaptive fuzzy control algorithm. The suction head of the vacuum adsorber adjusts the pressure through a negative pressure control module, and the negative pressure range is 10 kPa to 100 kPa. The adsorption pressure is monitored in real time by a pressure feedback sensor with a feedback accuracy of 0.01 kPa.

3. The Internet of Things-based medicine dispensing device according to claim 1, characterized in that: The real-time interaction between the force feedback sensor and the control module is achieved through a fuzzy logic control algorithm, wherein the input variables of the fuzzy logic include force feedback errors and drug morphological characteristics, and the system generates control instructions through a fuzzy rule base.

4. The Internet of Things-based medicine dispensing device according to claim 1, characterized in that: The 3D scanner captures the surface morphology of the drug through a laser ranging module and uses a point cloud sparse algorithm for data processing to reduce the computing load and improve the efficiency of three-dimensional data processing.

5. The Internet of Things-based medicine dispensing device according to claim 1, characterized in that: The fuzzy logic control algorithm updates the fuzzy rule base in real time. The input includes the grasping force error and the object morphology parameters, and the output is the torque adjustment instruction. The torque adjustment is learned online through the neural network optimization module, and the fuzzy control rules are optimized in multiple operations.

6. The Internet of Things-based medicine dispensing device according to claim 1, characterized in that: The motion path planning based on the A* algorithm calculates the path cost through f(n)=g(n)+h(n), where g(n) is the current path length and h(n) is the heuristic function of the estimated path. The system adjusts the path in real time through the dynamic window method (DWA) to ensure obstacle avoidance path planning in complex dynamic environments.

7. The Internet of Things-based medicine dispensing device according to claim 1, characterized in that: The spectral data control module combines a support vector machine (SVM) classifier to classify the spectral reflectance data, wherein the SVM uses a radial basis kernel function (RBF) and ensures high accuracy of spectral classification by adjusting parameters C and gamma.

8. The Internet of Things-based medicine dispensing device according to claim 1, characterized in that: The two-dimensional image processing module performs multi-layer feature extraction on the image through a convolutional neural network (CNN) model. The input image size of the CNN model is 224x224, and the maximum pooling layer and the fully connected layer are used to analyze the high-dimensional features of the image.

9. The Internet of Things-based medicine dispensing device according to claim 1, characterized in that: The three-dimensional morphology processing module of the drug uses the PointNet network for data processing. The input point cloud data of the PointNet network is initially segmented using the K nearest neighbor algorithm (KNN), and the global feature pooling layer is used to extract the global features of the three-dimensional morphology. The generated three-dimensional feature vector is used for subsequent classification.

10. The Internet of Things-based medicine dispensing device according to claim 1, characterized in that: The epsilon-greedy strategy in the reinforcement learning algorithm adopts an adaptive epsilon adjustment mechanism to set epsilon (min) and epsilon (max) values, and the system automatically adjusts the balance point between exploration and exploitation.

Citation Information

Cited By

  • Intelligent identifying and sorting method and system for traditional Chinese medicinal materials

    CN120599426A

  • Intelligent identification and sorting method and system for traditional Chinese medicinal materials

    CN120599426B

  • AGV (Automatic Guided Vehicle) cargo clamping and transporting system and method based on multi-modal perception and intelligent decision

    CN120922015A