Robot medicine dispensing and recycling method and system
Through deep convolutional neural networks, capsule networks, reinforcement learning and simulated annealing algorithms and other technologies, combined with game theory and blockchain, the path planning and task scheduling of the pharmacy system are optimized, and the path planning efficiency and task scheduling intelligence in the pharmacy system are solved. The problem of sexual inadequacy improves the efficiency and accuracy of drug distribution and recycling.
Patent Information
- Application Number
- CN202410904226.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-01
AI Technical Summary
The existing automated pharmacy systems have problems such as low path planning efficiency, lack of intelligence in task scheduling, poor drug identification accuracy, and path conflicts when dealing with complex environments and dynamic tasks, which are difficult to meet the needs of efficient pharmacies.
Deep convolutional neural network and capsule network are used for drug image recognition, combined with reinforcement learning algorithms and simulated annealing algorithms for path planning and task scheduling optimization, and ensure complete drug distribution and recycling through game theory multi-robot collaboration algorithms and blockchain technology. Process recording and contract execution.
It realizes dynamic optimization of robot path planning and task scheduling in the pharmacy, improves the efficiency and accuracy of drug distribution and recycling, and ensures the flexibility and collaborative working ability of the system.
Smart Images

Figure CN118886643A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent pharmacy robot medicine dispensing and recycling, and in particular to a robot medicine dispensing and recycling method and system. Background Art
[0002] In modern pharmacy management systems, robotic automation technology is gradually being applied to the distribution and inventory management of medicines. This technology can improve work efficiency and reduce human errors.
[0003] However, existing automation systems still have many problems when dealing with complex environments and dynamic tasks. For example, traditional path planning algorithms often have difficulty coping with the dynamic changes in personnel flow, resulting in low efficiency of robot movement within the pharmacy. At the same time, the existing task scheduling methods lack intelligence and cannot adjust the priority and schedule of drug distribution in real time according to actual conditions. Generally, the existing technology adopts simple rule-based algorithms or fixed path planning, which cannot meet the complex and changeable needs of pharmacies, resulting in limited system flexibility and efficiency. There are still many shortcomings: barcodes are easily affected by factors such as contamination and occlusion, resulting in recognition failure or errors, affecting the accuracy of drug management; manual operation is time-consuming and labor-intensive, prone to omissions and errors, and cannot meet the needs of efficient operation of pharmacies; the preset fixed path cannot adapt to real-time changes in the pharmacy, resulting in path conflicts and low efficiency when the robot performs tasks. Summary of the invention
[0004] The purpose of the present invention is to provide a robot medicine dispensing and recycling method and system to improve the above problems. In order to achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0005] In a first aspect, the present application provides a robot medicine dispensing and recycling method, characterized by comprising:
[0006] Obtaining personnel flow data, drug inventory data, and drug image data within the pharmacy, where personnel flow data includes the location and movement trajectory of staff and customers, drug inventory data includes drug types, quantities, and storage locations, and drug image data includes images of drug packaging;
[0007] The drug image data is processed using deep convolutional neural networks and capsule networks. After image recognition processing, the appearance features of the drug packaging, shape and color are obtained, and then the drug recognition and classification results are obtained. The drug recognition and classification results include the type, quantity and location of the drug in the warehouse. The deep convolutional neural network is used to extract low-level features of the drug image, and the capsule network is used to capture the spatial relationship and subtle features of the drug packaging.
[0008] The personnel flow data, drug inventory data and drug identification and classification results are used as input items and input into the preset reinforcement learning algorithm model for training. Through iterative calculation and optimization, the path planning and task scheduling scheme are obtained. The path planning is optimized in combination with the simulated annealing algorithm. Finally, the optimal walking route of the robot in the pharmacy and the task scheduling scheme of drug distribution priority and time arrangement are obtained.
[0009] According to the final optimized path planning and task scheduling scheme, a multi-robot collaborative algorithm based on game theory is used to obtain collaborative task allocation and navigation strategies;
[0010] Based on collaborative task allocation and navigation strategies, combined with blockchain technology, it ensures that the entire process of drug distribution and recovery is recorded and smart contract execution is realized.
[0011] Preferably, the drug image data is processed using a deep convolutional neural network and a capsule network, and after image recognition processing, the appearance features of the drug including packaging, shape and color are obtained through processing, and then the drug recognition and classification results are obtained, including:
[0012] Use the deep convolutional neural network architecture to extract image features from drug packaging image data inside the pharmacy to obtain low-level features of drug images, where low-level features include texture and basic shape, and image feature extraction includes basic texture, shape and color of drugs;
[0013] Based on low-level features, a capsule network is used to capture the three-dimensional spatial structural features of drug packaging, where the three-dimensional spatial structural features include the three-dimensional shape, logo and other space-related features of the drug packaging;
[0014] By integrating low-level features and three-dimensional spatial structure features, the support vector machine method is used to classify drugs to obtain drug identification and classification results, which include drug type, quantity and specific location information in the warehouse.
[0015] Preferably, the personnel flow data, drug inventory data and drug identification and classification results are used as input items and input into a preset reinforcement learning algorithm model for training, and a path planning and task scheduling scheme is obtained through iterative calculation and optimization, which includes:
[0016] Select a suitable deep reinforcement learning algorithm and model the environment inside the pharmacy as a reinforcement learning environment, where the reinforcement learning environment includes a state space and an action space. The state space is composed of the location of personnel, the status of drug inventory, and the results of drug identification and classification, and the action space includes the movement of the robot, drug distribution, and recycling operations;
[0017] Based on the deep Q network algorithm, the personnel flow data and drug image data are feature extracted, and the location information and the appearance features of the drug are extracted as the low-level features of the state; a suitable reward function is designed, and its calculation formula is as follows:
[0018] R(s,a,s′)=f(s,a,s′)
[0019] Where s is the current state, a is the action performed, s′ is the new state after the action is performed, and f is the reward function;
[0020] The low-level features and reward function are input into the DQN algorithm for training. The Q-value network is optimized by minimizing the following loss function. The calculation is iterated until the training is completed, and the path planning for determining the best walking route of the robot in the pharmacy and the task scheduling plan for the priority sorting and time arrangement of drug distribution are obtained.
[0021] Preferably, the simulated annealing algorithm is combined to optimize the path planning, and finally the optimal walking route of the robot in the pharmacy and the task scheduling scheme of the priority sorting and time arrangement of drug distribution are obtained, which includes:
[0022] The path planning and task scheduling scheme are used as the initial solution of the simulated annealing algorithm, and the initial temperature and cooling rate are set to obtain the initial state of the simulated annealing algorithm, which includes the initial path and the initial scheduling scheme;
[0023] According to the initial state of the simulated annealing algorithm, a new path and task scheduling scheme is obtained through the path perturbation operation and cost function evaluation of the simulated annealing algorithm. The path perturbation operation includes exchanging two nodes in the path or adjusting the task order in a certain time period. The cost function evaluation is used to evaluate the advantages and disadvantages of the new path and task scheduling scheme by calculating the path length, time cost and task completion degree.
[0024] Based on the new path and task scheduling scheme, the optimized robot's optimal walking route in the pharmacy and the priority sorting and time arrangement of drug distribution are obtained through temperature update and iterative optimization processing of simulated annealing algorithm. The temperature update strategy adopts linear cooling or exponential cooling, and the iterative optimization process is used to gradually approach the global optimal solution through repeated path perturbations and cost function evaluation.
[0025] Preferably, the finally optimized path planning and task scheduling scheme are processed using a multi-robot collaborative algorithm based on game theory to obtain collaborative task allocation and navigation strategies, including:
[0026] Select a suitable game theory model and formulate the action strategy for each robot. The calculation formula for generating the action strategy is as follows:
[0027]
[0028] In the formula, si is the strategy of robot i, si is the set of strategies of other robots, Ui is the utility function of robot i, which represents the benefit of robot i when adopting strategy si;
[0029] According to the specific tasks and priorities assigned to each robot in the action strategy, the navigation path of each robot is optimized based on the collaborative task allocation scheme using the A* algorithm;
[0030] The navigation strategy of each robot is generated according to the optimized path, where the navigation strategy includes the robot's movement instructions and task execution sequence.
[0031] In a second aspect, the present application also provides a robot medicine dispensing and recycling system, comprising:
[0032] Acquisition module: used to acquire personnel flow data, drug inventory data and drug image data within the pharmacy, where personnel flow data includes the location and movement trajectory of staff and customers, drug inventory data includes drug types, quantities and storage locations, and drug image data includes images of drug packaging;
[0033] Classification module: used to process drug image data using deep convolutional neural networks and capsule networks. After image recognition processing, the appearance features of the drug including packaging, shape and color are obtained, and then the drug recognition and classification results are obtained. The drug recognition and classification results include the type, quantity and location of the drug in the warehouse. The deep convolutional neural network is used to extract low-level features of drug images, and the capsule network is used to capture the spatial relationship and subtle features of drug packaging.
[0034] Training Optimization Module: It is used to input personnel flow data, drug inventory data and drug identification and classification results as input items to the preset reinforcement learning algorithm model for training. Through iterative calculation and optimization, the path planning and task scheduling scheme are obtained. The path planning is optimized in combination with the simulated annealing algorithm. Finally, the optimal walking route of the optimized robot in the pharmacy and the task scheduling scheme of drug distribution priority sorting and time arrangement are obtained.
[0035] Processing module: used to process the final optimized path planning and task scheduling scheme using a multi-robot collaborative algorithm based on game theory to obtain collaborative task allocation and navigation strategies;
[0036] Recycling module: It is used to process based on collaborative task allocation and navigation strategies, combined with blockchain technology, to ensure the full process recording and smart contract execution of drug distribution and recycling.
[0037] In a third aspect, the present application also provides a robot medicine dispensing and recycling device, comprising:
[0038] Memory for storing computer programs;
[0039] A processor is used to implement the steps of the robot medicine dispensing and recycling method when executing the computer program.
[0040] In a fourth aspect, the present application further provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned robot-based drug dispensing and recovery method are implemented.
[0041] The beneficial effects of the present invention are:
[0042] The present invention introduces a deep reinforcement learning algorithm to train the personnel flow data, drug inventory data and drug identification and classification results in the pharmacy, so as to dynamically adapt to the complex environment in the pharmacy and realize efficient path planning and task scheduling; combines the simulated annealing algorithm to further optimize the path planning, avoid local optimality, and ensure the global optimal path and task scheduling scheme; utilizes the multi-robot collaboration algorithm based on game theory to ensure that the task allocation between robots is reasonable and the collaborative work is efficient, and finally realizes the optimal walking route of the robot in the pharmacy and the priority sorting and time arrangement of drug distribution, thereby improving the efficiency and accuracy of drug distribution and recovery.
[0043] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 This is a schematic diagram of the process flow of the robot medicine dispensing and recycling method described in an embodiment of the present invention;
[0046] Figure 2 It is a schematic diagram of the structure of the robot medicine dispensing and recycling system described in an embodiment of the present invention;
[0047] Figure 3 It is a schematic diagram of the structure of the robot medicine dispensing and recycling equipment described in an embodiment of the present invention.
[0048] In the figure: 701, acquisition module; 702, classification module; 7021, extraction unit; 7022, capture unit; 7023, classification unit; 703, training optimization module; 7031, modeling unit; 7032, design unit; 7033, training unit; 7034, first acquisition unit; 7035, second acquisition unit; 7036, processing unit; 704, processing module; 7041, selection unit; 7042, optimization unit; 7043, generation unit; 705, recovery module; 800, robot medicine dispensing and recovery equipment; 801, processor; 802, memory; 803, multimedia component; 804, I / O interface; 805, communication component. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0050] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0051] Embodiment 1:
[0052] This embodiment provides a robot medicine dispensing and recycling method.
[0053] See also Figure 1 , the figure shows that the method includes step S100, step S200, step S300, step S400 and step S500.
[0054] S100. Acquire personnel flow data, drug inventory data, and drug image data within the pharmacy, wherein the personnel flow data includes the locations and movement trajectories of staff and customers, the drug inventory data includes the types, quantities, and storage locations of drugs, and the drug image data includes images of drug packaging.
[0055] It can be understood that in this step, in the pharmacy environment, the personnel flow data records the positions and movement trajectories of staff and customers in the space. These data are acquired in real time through various sensors (such as cameras, location tracking devices). The analysis of personnel flow data can help understand the personnel activity patterns and flow distribution in the drug distribution process, and help optimize the robot's path planning and task scheduling.
[0056] Specifically, drug inventory data includes the types, quantities, and storage locations of drugs. These data are usually monitored and recorded in real time through IoT devices or barcode scanners. Accurate inventory data is the basis for ensuring timely supply and effective drug distribution. It is necessary to combine machine learning algorithms to analyze historical data, predict future drug demand, and adjust inventory storage strategies through optimization algorithms to achieve more accurate inventory management. Drug image data includes images of drug packaging, which are used to identify the appearance characteristics of drugs, such as packaging, shape, and color. The image data can be collected through high-resolution cameras or mobile applications. Combined with augmented reality technology, the real-time captured drug images are compared with the existing database through mobile applications or smart glasses to improve the real-time and accuracy of drug identification.
[0057] Therefore, through the above detailed explanation and technical derivation of personnel flow data, drug inventory data and drug image data, the important role and depth of practical application of these data in the robotic drug dispensing and recovery method are demonstrated. It is not only the collection and processing of data, but also an innovative application that combines modern technology with the actual needs of pharmacy management.
[0058] S200. Use a deep convolutional neural network and a capsule network to process the drug image data. After image recognition processing, the appearance features of the drug including packaging, shape and color are obtained, and then the drug recognition and classification results are obtained. The drug recognition and classification results include the type and quantity of the drug and its location in the warehouse. The deep convolutional neural network is used to extract low-level features of the drug image, and the capsule network is used to capture the spatial relationship and subtle features of the drug packaging.
[0059] It can be understood that in this step, the deep convolutional neural network is used to extract low-level features of the drug image, such as texture and basic shape; the capsule network is used to capture the spatial relationship and subtle features of the drug packaging, such as the three-dimensional shape and logo of the packaging; the drug recognition and classification results include the type and quantity of the drug and its location in the warehouse.
[0060] It should be noted that step S200 includes S201, S202 and S203, wherein:
[0061] S201, using a deep convolutional neural network architecture to perform image feature extraction on drug packaging image data inside a pharmacy to obtain low-level features of the drug image, wherein the low-level features include texture and basic shape, wherein the image feature extraction includes basic texture, shape and color of the drug;
[0062] In this step, the input data is an image dataset of drug packaging, which includes visual information of various drugs, such as packaging images from various angles. CNN extracts low-level features of drug images through a series of convolutional layers, pooling layers, and activation function layers. These features include but are not limited to edge, texture, and color information. For example, the first convolutional layer may detect edges, and subsequent layers gradually extract more complex features, such as texture patterns and color changes. The last few layers are fully connected layers, which are used to map the features extracted from the feature map to the final output classification. These layers map high-level features to the output of the final drug classification through learning.
[0063] S202, based on the low-level features, using a capsule network to capture the three-dimensional spatial structural features of the drug package, wherein the three-dimensional spatial structural features include the three-dimensional shape, logo and other space-related features of the drug package;
[0064] In this step, the capsule network is composed of capsules, each of which represents a specific entity (such as a drug package). Each capsule outputs a vector representing the probability of existence of the entity and its characteristics. The capsule network dynamically assigns connection weights between different capsules based on the features output by the underlying convolutional layer through a dynamic routing mechanism. This allows the network to effectively learn and retain the spatial relationship of objects in the image. Among them, each capsule is responsible for identifying and reconstructing part of the objects in the image, such as the three-dimensional structure and logo of the drug package. Through vector output, the capsule network can represent multiple perspectives and features of the drug package, including its spatial position and rotation. Compared with traditional CNN, the capsule network can more accurately capture the changes and deformations of objects in three-dimensional space, which is particularly important for complex objects such as drug packaging.
[0065] S203. Integrate low-level features and three-dimensional spatial structure features, use support vector machine method to classify drugs, and obtain drug identification and classification results, wherein the drug identification and classification results include drug types, quantities and specific location information in the warehouse.
[0066] Through the above detailed description, we can clearly understand the respective methods and advantages of deep convolutional neural networks and capsule networks in processing drug image data, and how they are combined to achieve drug appearance feature extraction and recognition classification.
[0067] S300. The personnel flow data, drug inventory data and drug identification and classification results are used as input items and input into the preset reinforcement learning algorithm model for training. Through iterative calculation and optimization, the path planning and task scheduling scheme are obtained. The path planning is optimized in combination with the simulated annealing algorithm. Finally, the optimal walking route of the optimized robot in the pharmacy and the task scheduling scheme of the priority sorting and time arrangement of drug distribution are obtained.
[0068] It can be understood that in this step, path planning covers the optimal walking route of the robot in the pharmacy to minimize transportation time and resource consumption, and task scheduling includes the prioritization and timing of drug distribution to ensure high efficiency and satisfaction of customer needs.
[0069] It should be noted that step S300 includes S301, S302 and S303, wherein:
[0070] S301, selecting a suitable deep reinforcement learning algorithm, and modeling the environment inside the pharmacy as a reinforcement learning environment, wherein the reinforcement learning environment includes a state space and an action space, the state space is composed of personnel positions, drug inventory status, and drug identification and classification results, and the action space includes robot movement, drug distribution, and recovery operations;
[0071] S302, based on the deep Q network algorithm, feature extraction is performed on the personnel flow data and the drug image data, and the location information and the appearance features of the drug are extracted as the low-level features of the state; a suitable reward function is designed, and its calculation formula is as follows:
[0072] R(s,a,s′)=f(s,a,s′)
[0073] Where s is the current state, a is the action performed, s′ is the new state after the action is performed, and f is the reward function;
[0074] It should be noted that CNN is used to extract dynamic features such as the location information and movement trajectory of staff and customers; CNN is used to extract the appearance features of drugs, including static features such as packaging, shape and color. Among them, the reward function is used to evaluate the change in the state of the environment after the robot performs an action. Designing a suitable reward function is the key. The reward function should include the following aspects: a positive reward is given for each successful distribution or recovery of drugs by the robot; a positive reward is given for each optimized path completed by the robot to avoid unnecessary movement and repeated paths; and a positive reward is given for each collision avoided by the robot, and a negative reward is given for collisions or other bad behaviors.
[0075] S303. Input the low-level features and reward function into the DQN algorithm for training, optimize the Q value network by minimizing the following loss function, iterate the calculation until the training is completed, and obtain the path planning for determining the best walking route of the robot in the pharmacy and the task scheduling plan for the priority sorting and time arrangement of drug distribution.
[0076] It should be noted that the extracted low-level features and the designed reward function are input into the DQN algorithm for training. The specific steps are as follows: the personnel location, drug inventory status and drug identification and classification results are used as input features, and the designed reward function is used as the evaluation standard to input the DQN algorithm; the loss function is optimized, and the Q value network parameters are optimized by the back propagation algorithm, and the state-action-reward-new state iterative training is repeated until convergence and the optimal strategy is obtained. That is, the DQN model obtained through training can generate the following two main results: determine the best walking route for the robot in the pharmacy to minimize the cost and time of movement and ensure the efficient execution of distribution and recovery tasks; including the priority sorting and time scheduling of drug distribution, ensuring that the distribution and recovery of drugs are completed at the appropriate time and order to avoid delays and errors.
[0077] Therefore, the robot can autonomously plan the best path, reduce unnecessary movement, save time and energy; the task scheduling scheme ensures that the priority and time arrangement of drug distribution and recovery are reasonable, and improves the operational efficiency of the pharmacy; the design of a suitable reward function enables the robot to avoid bad behaviors such as collisions, ensuring the safety and reliability of the drug distribution and recovery process.
[0078] It should be noted that step S300 includes S304, S305 and S306, wherein:
[0079] S304, taking the path planning and task scheduling scheme as the initial solution of the simulated annealing algorithm, setting the initial temperature and the cooling rate, and obtaining the initial state of the simulated annealing algorithm, which includes the initial path and the initial scheduling scheme;
[0080] In this step, the initial solution here comes from the path planning and task scheduling scheme obtained by the deep reinforcement learning algorithm. These initial solutions include the initial walking route of the robot in the pharmacy and the initial priority sorting and time arrangement of drug distribution and recovery. Among them, the initial temperature determines the probability of the initial state accepting a new solution, and the cooling rate determines the speed of the temperature drop. Generally speaking, the initial temperature is set to a higher value so that the algorithm can explore more solution space in the early stage, and the cooling rate controls the temperature to gradually decrease, so that the algorithm gradually converges. After setting the initial temperature and cooling rate, the algorithm enters the initial state, which includes the initial path and initial scheduling scheme, as the starting point of the simulated annealing process.
[0081] S305, according to the initial state of the simulated annealing algorithm, a new path and task scheduling scheme is obtained through path perturbation operation and cost function evaluation of the simulated annealing algorithm, wherein the path perturbation operation includes exchanging two nodes in the path or adjusting the task sequence in a certain time period, and the cost function evaluation is used to evaluate the pros and cons of the new path and task scheduling scheme by calculating the path length, time cost and task completion degree;
[0082] Through path perturbation and cost function evaluation, the algorithm can continuously explore in the solution space and find better paths and task scheduling solutions, allowing the algorithm to search for better solutions globally and avoid falling into local optimal solutions.
[0083] S306. Based on the new path and task scheduling scheme, after temperature update and iterative optimization processing of the simulated annealing algorithm, the optimal walking route of the robot in the pharmacy and the priority sorting and time arrangement of drug distribution are obtained. The temperature update strategy adopts linear cooling or exponential cooling, and the iterative optimization process is used to gradually approach the global optimal solution through repeated path perturbations and cost function evaluation.
[0084] It is understandable that during each iteration, the algorithm performs path perturbation operations according to the current temperature and evaluates the new solution through the cost function; the Metropolis criterion is used to decide whether to accept the new solution: if the cost of the new solution is lower than the current solution, it is directly accepted; if the cost of the new solution is higher than the current solution, it is accepted with a certain probability, which is related to the current temperature, and then the iteration process continues until the temperature drops to the preset minimum temperature or the set number of iterations is reached. Therefore, through gradual cooling and repeated optimization, the robot's path planning and task scheduling solutions in the pharmacy are more efficient and reasonable, which can minimize the cost and time of movement and improve the efficiency of drug distribution and recovery.
[0085] S400: According to the final optimized path planning and task scheduling scheme, a multi-robot collaborative algorithm based on game theory is used for processing to obtain collaborative task allocation and navigation strategy.
[0086] It can be understood that in this step, the collaborative task allocation effectively distributes tasks to each robot to maximize overall efficiency; the navigation strategy enables the robots to coordinate movements in the pharmacy, avoid collisions and optimize path selection.
[0087] It should be noted that step S400 includes S401, S402 and S403, wherein:
[0088] S401. Select an appropriate game theory model and formulate an action strategy for each robot. The calculation formula for generating the action strategy is as follows:
[0089]
[0090] In the formula, si is the strategy of robot i, si is the set of strategies of other robots, Ui is the utility function of robot i, which represents the benefit of robot i when adopting strategy si;
[0091] S402, according to the specific tasks and priorities assigned to each robot in the action strategy, using the A* algorithm to optimize the navigation path of each robot based on the collaborative task allocation scheme;
[0092] S403: Generate a navigation strategy for each robot according to the optimized path, wherein the navigation strategy includes the robot's movement instructions and task execution sequence.
[0093] In this step, specifically, the optimized path planning and task scheduling schemes obtained in the previous step by deep reinforcement learning and simulated annealing algorithms are used. These schemes include the walking routes of each robot in the pharmacy, the priority sorting and time arrangement of drug distribution. Among them, it is necessary to select appropriate game theory models, such as Nash equilibrium, cooperative game, etc., for task collaboration among multiple robots. Through the strategy generation of the game theory model, tasks can be reasonably allocated, resource conflicts can be avoided, and the overall efficiency of the multi-robot system can be improved.
[0094] In steps S402-403, through the optimization of navigation strategies, efficient and conflict-free path planning and task execution can be achieved in the multi-robot system, ensuring that each robot completes the task according to the optimal path, and improving the overall performance of the system. In practical applications, there may be multiple robots in the pharmacy that perform drug distribution and recovery tasks at the same time, so efficient collaboration strategies and navigation strategies are required to avoid conflicts between robots. Through the game theory model, tasks can be reasonably allocated to ensure smooth collaboration between robots. Combined with the path optimization algorithm, efficient path planning can be achieved in complex environments, further improving the overall performance of the multi-robot system. In other words, through these extensions and applications, the intelligence and efficiency of the robot system in the pharmacy can be further improved, and a more intelligent drug management and distribution system can be realized.
[0095] S500, based on collaborative task allocation and navigation strategies, combined with blockchain technology for processing, ensures that the entire process of drug distribution and recovery is recorded and smart contract execution is realized.
[0096] It can be understood that in this step, blockchain is used to record the distribution and recovery history of each drug to ensure that the data cannot be tampered with and is traceable; smart contract execution ensures that drug distribution and recovery are carried out in accordance with pre-set rules and conditions, thereby improving security and transparency.
[0097] Embodiment 2:
[0098] like Figure 2 As shown, this embodiment provides a robot medicine dispensing and recycling system, see Figure 2 The system comprises:
[0099] Acquisition module 701: used to acquire personnel flow data, drug inventory data and drug image data within the pharmacy, wherein the personnel flow data includes the positions and movement tracks of staff and customers, the drug inventory data includes the types, quantities and storage locations of drugs, and the drug image data includes images of drug packaging;
[0100] Classification module 702: used to process drug image data using a deep convolutional neural network and a capsule network. After image recognition processing, the appearance features of the drug including packaging, shape and color are obtained through processing, and then the drug recognition and classification results are obtained, wherein the drug recognition and classification results include the type and quantity of the drug and its location in the warehouse. The deep convolutional neural network is used to extract low-level features of the drug image, and the capsule network is used to capture the spatial relationship and subtle features of the drug packaging;
[0101] Training optimization module 703: used to input personnel flow data, drug inventory data and drug identification and classification results as input items to a preset reinforcement learning algorithm model for training, obtain path planning and task scheduling solutions through iterative calculation and optimization, and optimize the path planning in combination with the simulated annealing algorithm, and finally obtain the optimal walking route of the optimized robot in the pharmacy and the task scheduling solution of drug distribution priority sorting and time arrangement;
[0102] Processing module 704: used to process the finally optimized path planning and task scheduling scheme using a multi-robot collaborative algorithm based on game theory to obtain collaborative task allocation and navigation strategies;
[0103] Recycling module 705: used to process based on collaborative task allocation and navigation strategies, combined with blockchain technology, to ensure the full process recording and smart contract execution of drug distribution and recycling.
[0104] Specifically, the classification module 702 includes:
[0105] Extraction unit 7021: used to perform image feature extraction on drug packaging image data inside the pharmacy using a deep convolutional neural network architecture to obtain low-level features of the drug image, wherein the low-level features include texture and basic shape, wherein the image feature extraction includes basic texture, shape and color of the drug;
[0106] Capturing unit 7022: used to capture the three-dimensional spatial structural features of the drug package using a capsule network based on low-level features, wherein the three-dimensional spatial structural features include the three-dimensional shape, logo and other space-related features of the drug package;
[0107] Classification unit 7023: used to integrate low-level features and three-dimensional spatial structure features, use the support vector machine method to classify drugs, and obtain drug identification and classification results, where the drug identification and classification results include drug types, quantities and their specific location information in the warehouse.
[0108] Specifically, the training optimization module 703 includes:
[0109] Modeling unit 7031: used to select a suitable deep reinforcement learning algorithm to model the environment inside the pharmacy as a reinforcement learning environment, wherein the reinforcement learning environment includes a state space and an action space, the state space is composed of personnel positions, drug inventory status and drug identification and classification results, and the action space includes robot movement, drug distribution and recovery operations;
[0110] Design unit 7032: used to extract features from personnel flow data and drug image data based on the deep Q network algorithm, extract location information and drug appearance features as low-level features of the state; design a suitable reward function, the calculation formula of which is as follows:
[0111] R(s,a,s′)=f(s,a,s′)
[0112] Where s is the current state, a is the action performed, s′ is the new state after the action is performed, and f is the reward function;
[0113] Training unit 7033: used to input low-level features and reward functions into the DQN algorithm for training, optimize the Q value network by minimizing the following loss function, iterate until the training is completed, and obtain the path planning for determining the best walking route of the robot in the pharmacy and the task scheduling plan for the priority sorting and time arrangement of drug distribution.
[0114] Specifically, the training optimization module 703 includes:
[0115] The first obtaining unit 7034 is used to use the path planning and task scheduling scheme as the initial solution of the simulated annealing algorithm, set the initial temperature and the cooling rate, and obtain the initial state of the simulated annealing algorithm, including the initial path and the initial scheduling scheme;
[0116] The second obtaining unit 7035 is used to obtain a new path and task scheduling scheme according to the initial state of the simulated annealing algorithm through the path perturbation operation and cost function evaluation of the simulated annealing algorithm, wherein the path perturbation operation includes exchanging two nodes in the path or adjusting the task sequence in a certain time period, and the cost function evaluation is used to evaluate the advantages and disadvantages of the new path and task scheduling scheme by calculating the path length, time cost and task completion degree;
[0117] Processing unit 7036: used to obtain the optimal walking route of the robot in the pharmacy and the priority sorting and time arrangement of drug distribution based on the new path and task scheduling scheme through temperature update and iterative optimization processing of simulated annealing algorithm, wherein the temperature update strategy adopts linear cooling or exponential cooling, and the iterative optimization process is used to gradually approach the global optimal solution through repeated path perturbations and cost function evaluation.
[0118] Specifically, the processing module 704 includes:
[0119] Selection unit 7041: used to select a suitable game theory model and formulate an action strategy for each robot, wherein the calculation formula for generating the action strategy is as follows:
[0120]
[0121] In the formula, si is the strategy of robot i, si is the set of strategies of other robots, Ui is the utility function of robot i, which represents the benefit of robot i when adopting strategy si;
[0122] Optimization unit 7042: used for optimizing the navigation path of each robot based on the collaborative task allocation scheme using the A* algorithm according to the specific tasks and priorities assigned to each robot in the action strategy;
[0123] Generating unit 7043: used to generate a navigation strategy for each robot according to the optimized path, wherein the navigation strategy includes the robot's movement instructions and task execution sequence.
[0124] It should be noted that, regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0125] Embodiment 3:
[0126] Corresponding to the above method embodiment, a robot medicine dispensing and recovery device is also provided in this embodiment. The robot medicine dispensing and recovery device described below and the robot medicine dispensing and recovery method described above can refer to each other.
[0127] Figure 3 FIG. 8 is a block diagram of a robot medicine dispensing and recycling device 800 according to an exemplary embodiment. Figure 3 As shown, the robot medicine dispensing and recovering device 800 includes: a processor 801 and a memory 802. The robot medicine dispensing and recovering device 800 also includes one or more of a multimedia component 803, an I / O interface 804, and a communication component 805.
[0128] The processor 801 is used to control the overall operation of the robot medicine dispensing and recovery device 800 to complete all or part of the steps in the above-mentioned robot medicine dispensing and recovery method. The memory 802 is used to store various types of data to support the operation of the robot medicine dispensing and recovery device 800. These data may include, for example, instructions for any application or method operating on the robot medicine dispensing and recovery device 800, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 802 or sent via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, and the above-mentioned other interface modules can be a keyboard, a mouse or buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the robot medicine dispensing and recovery device 800 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 can include: a Wi-Fi module, a Bluetooth module or an NFC module.
[0129] In an exemplary embodiment, the robotic medicine dispensing and recovery device 800 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned robotic medicine dispensing and recovery method.
[0130] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned robot medicine dispensing and recovery method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 802 including program instructions, and the above-mentioned program instructions can be executed by the processor 801 of the robot medicine dispensing and recovery device 800 to complete the above-mentioned robot medicine dispensing and recovery method.
[0131] Embodiment 4:
[0132] Corresponding to the above method embodiment, a readable storage medium is also provided in this embodiment. The readable storage medium described below and the robot medicine dispensing and recycling method described above can refer to each other.
[0133] A computer program is stored on the readable storage medium, and when the computer program is executed by the processor, the steps of the robot medicine dispensing and recycling method of the above method embodiment are implemented.
[0134] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.
[0135] In summary, this application provides an optimization method combining deep reinforcement learning and simulated annealing algorithms, which can perform intelligent path planning and task scheduling based on personnel flow data, drug inventory data, and drug identification and classification results; by using deep convolutional neural networks (CNN) and capsule networks (CapsNet) to process drug image data, extract low-level features and spatial relationships of drugs, and then train and optimize through deep reinforcement learning algorithms to achieve efficient path planning and task scheduling; further, combined with simulated annealing algorithms and multi-robot collaborative algorithms based on game theory, path planning and task scheduling schemes are optimized to achieve collaborative task allocation and navigation strategies among multiple robots. This method improves the intelligence level and work efficiency of the system, and can flexibly respond to complex environments and dynamic task requirements in pharmacies.
[0136] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0137] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A robot medicine dispensing and recycling method, characterized in that: include: Obtaining personnel flow data, drug inventory data, and drug image data within the pharmacy, where personnel flow data includes the location and movement trajectory of staff and customers, drug inventory data includes drug types, quantities, and storage locations, and drug image data includes images of drug packaging; The drug image data is processed using deep convolutional neural networks and capsule networks. After image recognition processing, the appearance features of the drug packaging, shape and color are obtained, and then the drug recognition and classification results are obtained. The drug recognition and classification results include the type, quantity and location of the drug in the warehouse. The deep convolutional neural network is used to extract low-level features of the drug image, and the capsule network is used to capture the spatial relationship and subtle features of the drug packaging. The personnel flow data, drug inventory data and drug identification and classification results are used as input items and input into the preset reinforcement learning algorithm model for training. Through iterative calculation and optimization, the path planning and task scheduling scheme are obtained. The path planning is optimized in combination with the simulated annealing algorithm. Finally, the optimal walking route of the robot in the pharmacy and the task scheduling scheme of drug distribution priority and time arrangement are obtained. According to the final optimized path planning and task scheduling scheme, a multi-robot collaborative algorithm based on game theory is used to obtain collaborative task allocation and navigation strategies; Based on collaborative task allocation and navigation strategies, combined with blockchain technology, it ensures that the entire process of drug distribution and recovery is recorded and smart contract execution is realized.
2. The robot medicine dispensing and recycling method according to claim 1, characterized in that: The deep convolutional neural network and capsule network are used to process the drug image data. After image recognition processing, the appearance features of the drug including packaging, shape and color are obtained through processing, and then the drug recognition and classification results are obtained, including: Use the deep convolutional neural network architecture to extract image features from drug packaging image data inside the pharmacy to obtain low-level features of drug images, where low-level features include texture and basic shape, and image feature extraction includes basic texture, shape and color of drugs; Based on low-level features, a capsule network is used to capture the three-dimensional spatial structural features of drug packaging, where the three-dimensional spatial structural features include the three-dimensional shape, logo and other space-related features of the drug packaging; By integrating low-level features and three-dimensional spatial structure features, the support vector machine method is used to classify drugs to obtain drug identification and classification results, which include drug type, quantity and specific location information in the warehouse.
3. The robot medicine dispensing and recycling method according to claim 1, characterized in that: The personnel flow data, drug inventory data and drug identification and classification results are used as input items and input into the preset reinforcement learning algorithm model for training. Through iterative calculation and optimization, the path planning and task scheduling scheme are obtained, which includes: Select a suitable deep reinforcement learning algorithm and model the environment inside the pharmacy as a reinforcement learning environment, where the reinforcement learning environment includes a state space and an action space. The state space is composed of the location of personnel, the status of drug inventory, and the results of drug identification and classification, and the action space includes the movement of the robot, drug distribution, and recycling operations; Based on the deep Q network algorithm, the personnel flow data and drug image data are feature extracted, and the location information and the appearance features of the drug are extracted as the low-level features of the state; a suitable reward function is designed, and its calculation formula is as follows: R(s,a,s′)=f(s,a,s′) Where s is the current state, a is the action performed, s′ is the new state after the action is performed, and f is the reward function; The low-level features and reward function are input into the DQN algorithm for training. The Q-value network is optimized by minimizing the following loss function. The calculation is iterated until the training is completed, and the path planning for determining the best walking route of the robot in the pharmacy and the task scheduling plan for the priority sorting and time arrangement of drug distribution are obtained.
4. The robot medicine dispensing and recycling method according to claim 1, characterized in that: The simulated annealing algorithm is combined to optimize the path planning, and finally the optimal walking route of the robot in the pharmacy and the task scheduling scheme of the priority sorting and time arrangement of drug distribution are obtained, which includes: The path planning and task scheduling scheme are used as the initial solution of the simulated annealing algorithm, and the initial temperature and cooling rate are set to obtain the initial state of the simulated annealing algorithm, which includes the initial path and the initial scheduling scheme; According to the initial state of the simulated annealing algorithm, a new path and task scheduling scheme is obtained through the path perturbation operation and cost function evaluation of the simulated annealing algorithm. The path perturbation operation includes exchanging two nodes in the path or adjusting the task order in a certain time period. The cost function evaluation is used to evaluate the advantages and disadvantages of the new path and task scheduling scheme by calculating the path length, time cost and task completion degree. Based on the new path and task scheduling scheme, the optimized robot's optimal walking route in the pharmacy and the priority sorting and time arrangement of drug distribution are obtained through temperature update and iterative optimization processing of simulated annealing algorithm. The temperature update strategy adopts linear cooling or exponential cooling, and the iterative optimization process is used to gradually approach the global optimal solution through repeated path perturbations and cost function evaluation.
5. The robot medicine dispensing and recycling method according to claim 1, characterized in that: The method uses a multi-robot collaborative algorithm based on game theory to process the final optimized path planning and task scheduling scheme to obtain collaborative task allocation and navigation strategies, including: Select a suitable game theory model and formulate the action strategy for each robot. The calculation formula for generating the action strategy is as follows: In the formula, si is the strategy of robot i, si is the set of strategies of other robots, Ui is the utility function of robot i, which represents the benefit of robot i when adopting strategy si; According to the specific tasks and priorities assigned to each robot in the action strategy, the navigation path of each robot is optimized based on the collaborative task allocation scheme using the A* algorithm; The navigation strategy of each robot is generated according to the optimized path, where the navigation strategy includes the robot's movement instructions and task execution sequence.
6. A robot medicine dispensing and recycling system, based on the robot medicine dispensing and recycling method according to claim 1, characterized in that: include: Acquisition module: used to acquire personnel flow data, drug inventory data and drug image data within the pharmacy, where personnel flow data includes the location and movement trajectory of staff and customers, drug inventory data includes drug types, quantities and storage locations, and drug image data includes images of drug packaging; Classification module: used to process drug image data using deep convolutional neural networks and capsule networks. After image recognition processing, the appearance features of the drug including packaging, shape and color are obtained, and then the drug recognition and classification results are obtained. The drug recognition and classification results include the type, quantity and location of the drug in the warehouse. The deep convolutional neural network is used to extract low-level features of drug images, and the capsule network is used to capture the spatial relationship and subtle features of drug packaging. Training Optimization Module: It is used to input personnel flow data, drug inventory data and drug identification and classification results as input items to the preset reinforcement learning algorithm model for training. Through iterative calculation and optimization, the path planning and task scheduling scheme are obtained. The path planning is optimized in combination with the simulated annealing algorithm. Finally, the optimal walking route of the optimized robot in the pharmacy and the task scheduling scheme of drug distribution priority sorting and time arrangement are obtained. Processing module: used to process the final optimized path planning and task scheduling scheme using a multi-robot collaborative algorithm based on game theory to obtain collaborative task allocation and navigation strategies; Recycling module: It is used to process based on collaborative task allocation and navigation strategies, combined with blockchain technology, to ensure the full process recording and smart contract execution of drug distribution and recycling.
7. The robot medicine dispensing and recycling system according to claim 6, characterized in that: The classification module includes: Extraction unit: used to extract image features from drug packaging image data in the pharmacy using a deep convolutional neural network architecture to obtain low-level features of drug images, where the low-level features include texture and basic shape, and the image feature extraction includes basic texture, shape and color of the drug; Capture unit: used to capture the three-dimensional spatial structure features of the drug packaging using the capsule network based on low-level features, where the three-dimensional spatial structure features include the three-dimensional shape, logo and other space-related features of the drug packaging; Classification unit: used to integrate low-level features and three-dimensional spatial structure features, use the support vector machine method to classify drugs, and obtain drug identification and classification results, where the drug identification and classification results include the type of drugs, quantity and its specific location information in the warehouse.
8. The robot medicine dispensing and recycling system according to claim 6, characterized in that: The training optimization module includes: Modeling unit: used to select a suitable deep reinforcement learning algorithm and model the environment inside the pharmacy as a reinforcement learning environment, where the reinforcement learning environment includes a state space and an action space. The state space is composed of personnel positions, drug inventory status, and drug identification and classification results, and the action space includes robot movement, drug distribution, and recycling operations; Design unit: used to extract features from personnel flow data and drug image data based on the deep Q network algorithm, extract location information and drug appearance features as low-level features of the state; design a suitable reward function, the calculation formula of which is as follows: R(s,a,s′)=f(s,a,s′) Where s is the current state, a is the action performed, s′ is the new state after the action is performed, and f is the reward function; Training unit: used to input low-level features and reward functions into the DQN algorithm for training, optimize the Q value network by minimizing the following loss function, iterate until the training is completed, and obtain the path planning for determining the best walking route of the robot in the pharmacy and the task scheduling plan for the priority sorting and time arrangement of drug distribution.
9. The robot medicine dispensing and recycling system according to claim 6, characterized in that: The training optimization module includes: The first obtaining unit is used to use the path planning and task scheduling scheme as the initial solution of the simulated annealing algorithm, set the initial temperature and the cooling rate, and obtain the initial state of the simulated annealing algorithm, including the initial path and the initial scheduling scheme; The second obtaining unit is used to obtain a new path and task scheduling scheme according to the initial state of the simulated annealing algorithm through the path perturbation operation and cost function evaluation of the simulated annealing algorithm, wherein the path perturbation operation includes exchanging two nodes in the path or adjusting the task sequence in a certain time period, and the cost function evaluation is used to evaluate the advantages and disadvantages of the new path and task scheduling scheme by calculating the path length, time cost and task completion degree; Processing unit: used to obtain the optimal walking route of the robot in the pharmacy and the priority sorting and time arrangement of drug distribution based on the new path and task scheduling scheme through temperature update and iterative optimization processing of simulated annealing algorithm. The temperature update strategy adopts linear cooling or exponential cooling. The iterative optimization process is used to gradually approach the global optimal solution through repeated path perturbations and cost function evaluation.
10. The robot medicine dispensing and recycling system according to claim 6, characterized in that: The processing module includes: Selection unit: used to select a suitable game theory model and formulate the action strategy for each robot. The calculation formula for generating the action strategy is as follows: In the formula, si is the strategy of robot i, si is the set of strategies of other robots, Ui is the utility function of robot i, which represents the benefit of robot i when adopting strategy si; Optimization unit: used to optimize the navigation path of each robot based on the collaborative task allocation scheme using the A* algorithm according to the specific tasks and priorities assigned to each robot in the action strategy; Generation unit: used to generate the navigation strategy of each robot according to the optimized path, wherein the navigation strategy includes the robot's movement instructions and task execution sequence.
Citation Information
Cited By
Industrial Internet of Things unmanned vehicle path planning system and method
CN120806316A
