AI conversation-driven mechanical arm personalized medicine taking method and system
The AI-driven robotic arm drug dispensing system utilizes dialogue state tracking and drug relationship networks to identify users' implicit medication preferences, enabling personalized drug recommendations. This solves the problems of inaccurate intelligent interaction and drug recommendations in existing systems, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BOYAN SHENGKE TECH CO LTD
- Filing Date
- 2025-12-23
- Publication Date
- 2026-06-19
Smart Images

Figure CN121733546B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of AI technology, and in particular to a personalized medication dispensing method and system for robotic arms based on AI dialogue. Background Technology
[0002] With the rapid development of artificial intelligence (AI) technology, intelligent drug delivery systems are showing broad application prospects in the healthcare field. Traditional pharmacy dispensing systems typically rely on manual service or simple automated equipment, which cannot meet the needs of personalized medication and efficient drug dispensing. In recent years, automated drug dispensing systems based on robotic arms have been gradually applied in hospital pharmacies and community pharmacies, using pre-programmed controls to enable robotic arms to pick up and deliver medications. Simultaneously, AI-powered dialogue systems are increasingly used in medical consultations and health management, providing users with medication advice and health guidance.
[0003] However, existing robotic arm medication dispensing systems have significant technical limitations. First, traditional systems lack intelligent interaction capabilities, failing to understand users' natural language expressions and complex medication needs. This forces users to rely on specific commands or interface operations to obtain medication, resulting in a poor user experience. Second, existing systems fail to effectively mine and utilize users' implicit medication preferences, unable to provide personalized medication recommendations based on users' implicit rejection or acceptance tendencies in conversations, leading to a gap between recommended results and users' actual needs. Finally, existing systems have limited capabilities in drug knowledge representation and reasoning, struggling to establish complete drug relationship networks and perform semantic association analysis. This hinders their ability to accurately understand and respond to complex medication requests, limiting the system's practical value and service quality.
[0004] To address these issues, there is an urgent need to develop an intelligent system that can understand natural language, perceive users' implicit preferences, and achieve precise medication dispensing, thereby improving the personalization of medication services and the user experience. Summary of the Invention
[0005] This invention provides a method and system for personalized medication dispensing using a robotic arm based on AI dialogue, which can solve the problems in the prior art.
[0006] A first aspect of the present invention provides a personalized medication dispensing method using a robotic arm based on AI dialogue, comprising:
[0007] The system receives dialogue input from a target user that includes a medication request, and performs contextual analysis on the dialogue input through a dialogue state tracking mechanism to generate the target user's current round intent and historical dialogue context.
[0008] Based on the current round intent in the dialogue state representation, locate the drug entity node in the drug relationship network that is semantically related to the current round intent, and determine the attribute feature set of the drug entity node.
[0009] Based on the historical dialogue context, the implicit medication preferences expressed by the target user in the historical dialogue context are identified. The implicit medication preferences are constituted by the target user's implicit rejection preferences, implicit acceptance preferences, drug doubt attributes, and drug importance attributes.
[0010] The implicit medication preferences are semantically aligned with the attribute feature set to generate a drug recommendation vector, and the selection probability distribution of each drug entity node is calculated based on the drug recommendation vector. The target drug corresponding to the drug entity node with the highest probability value is determined according to the selection probability distribution, and the row and column index of the target drug in the storage matrix is queried. The pose transformation matrix required for the robotic arm to grasp the drug is calculated based on the row and column index, and the robotic arm is controlled to perform the drug retrieval action according to the pose transformation matrix.
[0011] By performing contextual analysis on the dialogue input through a dialogue state tracking mechanism, the current round intent and historical dialogue context corresponding to the target user are generated, including:
[0012] The dialogue input is subjected to multi-granular semantic segmentation to identify the core action phrases and modifying limiting components in the dialogue input, and to extract the intentional semantics that reflect the medication needs.
[0013] A dialogue round dependency graph is constructed from the target user's historical dialogue records. Each node in the dialogue round dependency graph represents a historical dialogue round, and each edge represents the semantic connection relationship between rounds.
[0014] In the dialogue turn dependency graph, the graph is traversed using the intent semantics as the query condition to locate the set of previous turn nodes that have a semantic connection with the intent semantics.
[0015] Semantic extraction is performed on the dialogue content corresponding to each node in the previous round node set, and medication topic tags and interaction decision records are extracted from the dialogue content to generate a historical dialogue context containing the medication topic tags and interaction decision records.
[0016] The semantic intent is semantically fused with the medication topic tags in the historical dialogue context to generate a fused intent for the current round.
[0017] Based on the current round intent in the dialogue state representation, drug entity nodes semantically related to the current round intent are located in the drug relationship network, and the attribute feature set of the drug entity nodes is determined to include:
[0018] Drug entities, symptom entities, and ingredient entities are extracted from a pre-built drug knowledge base. The drug relationship network is constructed based on the therapeutic relationship between drugs and symptoms, the compositional relationship between drugs and ingredients, and the substitution relationship between drugs.
[0019] The current round intent is semantically vectorized to obtain an intent vector reflecting medication needs; in the drug relationship network, semantic description information of each drug entity node is extracted to generate a node semantic vector corresponding to each drug entity node.
[0020] Nodes whose semantic distance metric between the intent vector and the node semantic vector is greater than a preset distance threshold are selected as candidate drug entity nodes.
[0021] In the drug relationship network, bidirectional restricted propagation is performed starting from the candidate drug entity node. Forward propagation is performed along the outgoing edge direction from the candidate drug entity node to obtain forward associated nodes, and backward propagation is performed along the incoming edge direction to obtain reverse associated nodes. When the propagation hop count reaches the depth limit, the forward associated nodes and reverse associated nodes in the propagation path are merged to obtain the drug entity node.
[0022] The attribute labeling information corresponding to the drug entity node includes efficacy attributes, dosage form attributes, and applicable population attributes, and the attribute labeling information is organized into an attribute feature set.
[0023] Based on the historical dialogue context, identifying the implicit medication preferences expressed by the target user in the historical dialogue context includes:
[0024] By performing a difference analysis on the historical medication query records and historical medication decision records from the historical dialogue context, the characteristics of the drugs that the target user queried but did not select and the characteristics of the drugs that the target user did not query but ultimately selected are identified. The historical medication query records contain the drug information consulted by the target user, and the historical medication decision records contain the drug information ultimately selected by the target user.
[0025] The query but unselected drug features are input into the preference inference rule base for reverse reasoning to obtain the target user's implicit rejection preference; the unqueried but ultimately selected drug features are input into the preference inference rule base for forward reasoning to obtain the target user's implicit acceptance preference. The preference inference rule base defines the mapping relationship between user query behavior and drug purchase decision behavior.
[0026] The pause and follow-up question positions of the target user in the dialogue process are determined. The pause position corresponds to the dialogue node where the target user does not respond immediately after receiving the system recommendation information, and the follow-up question position corresponds to the dialogue node where the target user initiates an inquiry about a specific drug attribute.
[0027] The drug attributes involved at the pause point are marked as doubtful attributes, and the drug attributes involved at the follow-up question point are marked as important attributes;
[0028] The implicit rejection preference, implicit acceptance preference, doubt attribute, and importance attribute are integrated to form the target user's implicit medication preference.
[0029] The implicit medication preferences are semantically aligned with the attribute feature set to generate a drug recommendation vector. The selection probability distribution of each drug entity node is then calculated based on the drug recommendation vector, including:
[0030] Each preference dimension in the implicit medication preference is converted into a standardized preference semantic representation, and each attribute feature in the attribute feature set is converted into a standardized feature semantic representation. A semantic alignment matrix is constructed, where the row index of the semantic alignment matrix corresponds to the standardized preference semantic representation, the column index corresponds to the standardized feature semantic representation, and the matrix element values represent the semantic similarity between the preference semantic representation and the feature semantic representation.
[0031] The semantic alignment matrix is row-normalized to obtain the distribution weights of each preference dimension on the attribute feature set. The semantic similarity is weighted and summed based on the distribution weights to obtain the comprehensive matching score of each drug entity node. The comprehensive matching score is used as a component of the drug recommendation vector. The drug recommendation vector is normalized to obtain the selection probability distribution.
[0032] Calculating the pose transformation matrix required for the robotic arm to grasp the drug based on the row and column indices, and controlling the robotic arm to perform the drug-grabbing action according to the pose transformation matrix includes:
[0033] The spatial coordinate information of the medicine storage slot corresponding to the row and column index is retrieved from the preset medicine cabinet layout mapping table. The spatial coordinate information includes the center point coordinates and normal vector direction of the medicine storage slot in the medicine cabinet reference coordinate system.
[0034] Read the current joint angle value of the robotic arm and convert the current joint angle value into the current spatial pose of the end effector in the coordinate system of the robotic arm base;
[0035] Obtain the calibration parameters between the medicine cabinet reference coordinate system and the robotic arm base coordinate system, and convert the spatial coordinate information of the medicine storage slot to the robotic arm base coordinate system based on the calibration parameters;
[0036] The grasping approach direction and grasping depth of the end effector are determined according to the packaging form of the target drug, and the position adjustment amount and attitude adjustment amount of the end effector relative to the center point of the drug storage slot are calculated based on the grasping approach direction and the grasping depth.
[0037] The spatial coordinates of the drug storage slot, converted to the coordinate system of the robotic arm base, are superimposed with the position adjustment amount and the attitude adjustment amount to obtain the desired pose of the end effector.
[0038] Construct a homogeneous transformation matrix from the current spatial pose to the desired pose, and use the homogeneous transformation matrix as the pose transformation matrix; calculate the angle increment that each joint of the robotic arm needs to rotate according to the pose transformation matrix, and control each joint of the robotic arm to perform the drug-retrieving action according to the angle increment.
[0039] A second aspect of the present invention provides an AI dialogue-driven robotic arm personalized medication dispensing system, comprising:
[0040] The first unit is used to receive dialogue input containing medication needs initiated by the target user, and to perform contextual correlation analysis on the dialogue input through a dialogue state tracking mechanism to generate the current round intent and historical dialogue context corresponding to the target user.
[0041] The second unit is used to locate drug entity nodes that are semantically related to the current round intent in the drug relationship network based on the current round intent in the dialogue state representation, and to determine the attribute feature set of the drug entity nodes.
[0042] The third unit is used to identify the implicit medication preferences expressed by the target user in the historical dialogue context based on the historical dialogue context. The implicit medication preferences are constituted by the target user's implicit rejection preferences, implicit acceptance preferences, drug doubt attributes, and drug importance attributes.
[0043] The fourth unit is used to semantically align the implicit medication preferences with the attribute feature set, generate a drug recommendation vector, and calculate the selection probability distribution of each drug entity node based on the drug recommendation vector; determine the target drug corresponding to the drug entity node with the highest probability value according to the selection probability distribution, and query the row and column index of the target drug in the storage matrix; calculate the pose transformation matrix required for the robotic arm to grasp the drug based on the row and column index, and control the robotic arm to perform the drug-grabbing action according to the pose transformation matrix.
[0044] A third aspect of the present invention,
[0045] An electronic device is provided, comprising:
[0046] processor;
[0047] Memory used to store processor-executable instructions;
[0048] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0049] Fourth aspect of the embodiments of the present invention,
[0050] A computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0051] The beneficial effects of this application are as follows:
[0052] By using a dialogue state tracking mechanism to perform contextual analysis, we can accurately capture the user's current intent and historical dialogue context, thereby achieving a precise understanding of the user's medication needs and avoiding the problem of incomplete understanding of user needs in traditional medication dispensing systems.
[0053] This invention innovatively identifies implicit medication preferences expressed by users in historical conversations, including implicit rejection preferences, implicit acceptance preferences, drug doubt attributes, and drug importance attributes, making drug recommendations more in line with users' actual needs and potential expectations, thereby improving user satisfaction.
[0054] In drug relationship networks, semantic relevance-based drug entity node localization overcomes the limitations of traditional keyword matching, enabling the understanding of diverse user expressions and improving the adaptability and flexibility of the medication retrieval system. By semantically aligning users' implicit medication preferences with drug attribute feature sets, generating drug recommendation vectors and calculating selection probability distributions, precise drug selection based on personalized user needs is achieved, avoiding the blindness of drug recommendations. Attached Figure Description
[0055] Figure 1 This is a flowchart illustrating the AI-driven dialogue-based personalized medicine dispensing method using a robotic arm, as described in an embodiment of the present invention.
[0056] Figure 2 A flowchart illustrating the process of controlling the robotic arm to perform the drug-retrieving action according to the pose transformation matrix. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0058] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0059] Figure 1 This is a flowchart illustrating the AI-driven dialogue-based personalized medication dispensing method using a robotic arm, as described in an embodiment of the present invention. Figure 1 As shown, the method includes:
[0060] The system receives dialogue input from a target user that includes a medication request, and performs contextual analysis on the dialogue input through a dialogue state tracking mechanism to generate the target user's current round intent and historical dialogue context.
[0061] Based on the current round intent in the dialogue state representation, locate the drug entity node in the drug relationship network that is semantically related to the current round intent, and determine the attribute feature set of the drug entity node.
[0062] Based on the historical dialogue context, the implicit medication preferences expressed by the target user in the historical dialogue context are identified. The implicit medication preferences are constituted by the target user's implicit rejection preferences, implicit acceptance preferences, drug doubt attributes, and drug importance attributes.
[0063] The implicit medication preferences are semantically aligned with the attribute feature set to generate a drug recommendation vector, and the selection probability distribution of each drug entity node is calculated based on the drug recommendation vector. The target drug corresponding to the drug entity node with the highest probability value is determined according to the selection probability distribution, and the row and column index of the target drug in the storage matrix is queried. The pose transformation matrix required for the robotic arm to grasp the drug is calculated based on the row and column index, and the robotic arm is controlled to perform the drug retrieval action according to the pose transformation matrix.
[0064] In one optional implementation, the dialogue input is analyzed for contextual association using a dialogue state tracking mechanism to generate the current round intent and historical dialogue context corresponding to the target user, including:
[0065] The dialogue input is subjected to multi-granular semantic segmentation to identify the core action phrases and modifying limiting components in the dialogue input, and to extract the intentional semantics that reflect the medication needs.
[0066] A dialogue round dependency graph is constructed from the target user's historical dialogue records. Each node in the dialogue round dependency graph represents a historical dialogue round, and each edge represents the semantic connection relationship between rounds.
[0067] In the dialogue turn dependency graph, the graph is traversed using the intent semantics as the query condition to locate the set of previous turn nodes that have a semantic connection with the intent semantics.
[0068] Semantic extraction is performed on the dialogue content corresponding to each node in the previous round node set, and medication topic tags and interaction decision records are extracted from the dialogue content to generate a historical dialogue context containing the medication topic tags and interaction decision records.
[0069] The semantic intent is semantically fused with the medication topic tags in the historical dialogue context to generate a fused intent for the current round.
[0070] In intelligent drug consultation systems based on the medical field, to accurately understand user intent and provide precise drug recommendations, a dialogue state tracking mechanism is used to perform contextual analysis of user dialogue input. The specific implementation method is as follows:
[0071] The system performs multi-granular semantic segmentation on user dialogue input. This process uses a Bidirectional Long Short-Term Memory (BiLSTM) network model based on an attention mechanism to convert the user's input natural language text into a semantic representation vector. Based on this, by setting a semantic segmentation threshold, the system identifies core action phrases and modifying qualifiers in the dialogue input. For example, when a user inputs "I've had a cough recently, and I'd like to ask what medicine I can take," the system identifies "cough" as a symptom description and "what medicine" as a core action phrase, thus extracting the user's intent semantics of "seeking medication advice." This intent semantics is represented in vector form, containing attribute fields such as intent type, symptom label, and query target.
[0072] A historical dialogue turn dependency graph for the target user is constructed by retrieving recent dialogue content from the user's historical dialogue record database and arranging the dialogue turns in chronological order. Each dialogue turn is treated as a node in the graph, with node attributes including dialogue timestamp, dialogue content text, extracted intent tags, and entity information. Directed connections between nodes are established by calculating semantic similarity and topic continuity between adjacent turns, with edge weights representing the strength of semantic continuity. For example, if the user asks "Can I take ibuprofen for a cold?" in the first turn and then follows up with "What are the side effects of this medicine?" in the second turn, a high-weighted connection is established between these two nodes, indicating that the second turn's dialogue is semantically strongly dependent on the drug entity "ibuprofen" mentioned in the first turn.
[0073] Subsequently, a graph traversal operation is performed on the constructed dialogue turn dependency graph to locate previous turn nodes that have a semantic connection with the current intent. A graph attention network model based on a recurrent neural network is employed, using the current turn intent semantic vector as the query condition. By calculating the semantic relevance score with historical turn nodes, the most relevant set of previous turn nodes is identified. Specifically, a semantic relevance threshold λ = 0.65 is set, retaining only nodes with a relevance score greater than λ, and sorting them by relevance to generate the set of previous turn nodes. If the user's current intent is "inquire about drug dosage," the system will prioritize turn nodes that have mentioned the same drug in historical dialogues.
[0074] Semantic extraction is performed on the dialogue content in the previous rounds' node set. Named entity recognition technology is used to extract medication topic tags such as drug name, indications, and contraindications from the dialogue content. Simultaneously, the system and user interaction decision records are recorded, including user-confirmed medication preferences and system-provided drug recommendations. The extraction results are stored as a structured topic tag tree and decision record table, forming a complete historical dialogue context. For example, from the historical dialogue "I am allergic to penicillin," "Drug allergy history: penicillin" is extracted as the medication topic tag to ensure that subsequent recommendations do not include such drugs.
[0075] The semantics of the current intent are semantically fused with the medication topic tags from the historical dialogue context. A graph neural network-based information fusion algorithm is used to weight and integrate the current intent semantic vector with key information from the historical context to generate a fused complete intent representation for the current round. This fusion process considers the timeliness and relevance of historical interactions, giving higher weight to information from recent interactions. For example, when a user asks "the side effects of this drug," the complete intent "query information on the side effects of ibuprofen" is generated by fusing the clearly defined drug entity "ibuprofen" from the historical dialogue, thus providing accurate information on drug side effects in subsequent processing.
[0076] By employing the aforementioned dialogue state tracking mechanism, accurate understanding of the user's intent in the current round is achieved. Combined with historical dialogue context, this lays the foundation for precise responses in the drug consultation system. This method effectively solves the problems of referential resolution and intent understanding in multi-turn dialogues, improving the intelligence level and user experience of the medical drug consultation system.
[0077] In one optional implementation, based on the current round intent in the dialogue state representation, drug entity nodes semantically related to the current round intent are located in the drug relationship network, and the attribute feature set of the drug entity nodes is determined to include:
[0078] Drug entities, symptom entities, and ingredient entities are extracted from a pre-built drug knowledge base. The drug relationship network is constructed based on the therapeutic relationship between drugs and symptoms, the compositional relationship between drugs and ingredients, and the substitution relationship between drugs.
[0079] The current round intent is semantically vectorized to obtain an intent vector reflecting medication needs; in the drug relationship network, semantic description information of each drug entity node is extracted to generate a node semantic vector corresponding to each drug entity node.
[0080] Nodes whose semantic distance metric between the intent vector and the node semantic vector is greater than a preset distance threshold are selected as candidate drug entity nodes.
[0081] In the drug relationship network, bidirectional restricted propagation is performed starting from the candidate drug entity node. Forward propagation is performed along the outgoing edge direction from the candidate drug entity node to obtain forward associated nodes, and backward propagation is performed along the incoming edge direction to obtain reverse associated nodes. When the propagation hop count reaches the depth limit, the forward associated nodes and reverse associated nodes in the propagation path are merged to obtain the drug entity node.
[0082] The attribute labeling information corresponding to the drug entity node includes efficacy attributes, dosage form attributes, and applicable population attributes, and the attribute labeling information is organized into an attribute feature set.
[0083] Drug entities, symptom entities, and ingredient entities are extracted from a pre-built drug knowledge base, and a drug relationship network is constructed based on the various relationships between them. The drug knowledge base can be built by integrating authoritative data such as medical literature, drug instructions, and clinical practice guidelines, and contains structured information such as drug names, indications, ingredients, and contraindications. The drug relationship network contains three main types of relationships: treatment relationships between drugs and symptoms, such as "aspirin - relieves - headache"; composition relationships between drugs and ingredients, such as "compound cold medicine - contains - acetaminophen"; and substitution relationships between drugs, such as "ibuprofen - substitutes for - aspirin". These relationships are stored in the form of triples and constructed into a directed graph structure, where entities are nodes and relationships are edges connecting nodes.
[0084] When representing the intent of the current round semantically, the user's input natural language text is first preprocessed, including word segmentation and stop word removal. Then, a pre-trained medical domain language model, such as Medical BERT or BioBERT, is used to transform the processed text into an intent vector in a high-dimensional semantic vector space. For example, when a user expresses "What medicine can relieve headaches?", the language model encodes this as a 768-dimensional vector, which reflects the user's intent to use medication.
[0085] Simultaneously, for each drug entity node in the drug relationship network, its semantic description information is extracted, including textual content such as drug name, efficacy description, and indications. Using the same language model as intent vectorization, this descriptive information is transformed into node semantic vectors. For example, the descriptive information of the "aspirin" node might include "used to relieve mild to moderate pain, such as headache, toothache, muscle pain, etc.", which is transformed into a node semantic vector with the same dimension as the intent vector.
[0086] The semantic similarity between the intent vector and the semantic vectors of each drug entity node is calculated. Common calculation methods include cosine similarity or Euclidean distance. By setting a preset distance threshold (such as a cosine similarity greater than 0.75 or an Euclidean distance less than 0.3), nodes that are semantically similar to the user's intent are selected as candidate drug entity nodes. For example, for the intent of "relieve headache", "aspirin", "ibuprofen", and "acetaminophen" might be selected as candidate nodes.
[0087] Starting with candidate drug entity nodes, a bidirectional restricted propagation is performed within the drug relationship network. This bidirectional restricted propagation includes two directions: forward propagation and backward propagation. Forward propagation involves exploring from the candidate node along outgoing edges to find downstream nodes directly related to it, such as "Aspirin - Treatment → Headache". Backward propagation involves exploring from the candidate node along incoming edges to find upstream nodes pointing to it, such as "Salicylic acid - Composition → Aspirin". The propagation process is controlled by a depth constraint, typically set to 2 to 3 hops, to prevent semantic deviation due to excessively long relationship chains. When the set depth constraint is reached, the forward and backward related nodes in the propagation path are merged to obtain the final set of drug entity nodes.
[0088] For the identified drug entity nodes, their attribute annotation information is extracted. The efficacy attribute describes the drug's therapeutic effect and mechanism of action, such as "antipyretic and analgesic" or "anti-inflammatory"; the dosage form attribute describes the drug's physical form and administration method, such as "tablets," "capsules," or "injection"; and the applicable population attribute describes the suitable population for the drug, such as "adults," "children," or "contraindicated in pregnant women." This attribute information is organized in a structured manner into an attribute feature set for subsequent drug recommendations and medication guidance.
[0089] In specific application scenarios, when a user expresses "My child has a fever, what medicine can I use?" in a conversation, the system first parses it as an intent of "children-fever-medication need" and quantifies it. Through semantic matching with drug nodes, candidate nodes such as "acetaminophen" and "ibuprofen" may be identified. After two-way restricted propagation, related drugs such as "Tylenol" and "Motrin," commonly used antipyretics for children, are expanded to be obtained. Finally, based on the attribute feature set of these drugs (such as "antipyretic" efficacy, "oral liquid" dosage form, and "suitable for children" population attribute), the system can provide users with drug recommendations and medication suggestions that meet their needs.
[0090] This method enables accurate understanding of users' medication needs, locating relevant drug entities within complex drug relationship networks, and extracting key attribute features to support intelligent drug consultation and recommendation.
[0091] In one optional implementation, identifying the implicit medication preferences expressed by the target user in the historical dialogue context, based on the historical dialogue context, includes:
[0092] By performing a difference analysis on the historical medication query records and historical medication decision records from the historical dialogue context, the characteristics of the drugs that the target user queried but did not select and the characteristics of the drugs that the target user did not query but ultimately selected are identified. The historical medication query records contain the drug information consulted by the target user, and the historical medication decision records contain the drug information ultimately selected by the target user.
[0093] The query but unselected drug features are input into the preference inference rule base for reverse reasoning to obtain the target user's implicit rejection preference; the unqueried but ultimately selected drug features are input into the preference inference rule base for forward reasoning to obtain the target user's implicit acceptance preference. The preference inference rule base defines the mapping relationship between user query behavior and drug purchase decision behavior.
[0094] The pause and follow-up question positions of the target user in the dialogue process are determined. The pause position corresponds to the dialogue node where the target user does not respond immediately after receiving the system recommendation information, and the follow-up question position corresponds to the dialogue node where the target user initiates an inquiry about a specific drug attribute.
[0095] The drug attributes involved at the pause point are marked as doubtful attributes, and the drug attributes involved at the follow-up question point are marked as important attributes;
[0096] The implicit rejection preference, implicit acceptance preference, doubt attribute, and importance attribute are integrated to form the target user's implicit medication preference.
[0097] Identifying target users' implicit medication preferences based on historical dialogue context includes analyzing the differences between historical medication query records and historical medication decision records, using a preference inference rule base for backward and forward reasoning, and combining pauses and follow-up questions in user dialogue to ultimately form a complete implicit medication preference.
[0098] First, historical medication query records and historical medication decision records are extracted from the context of historical dialogues. Historical medication query records contain information about medications the user inquired about, such as "Please introduce medications for treating colds" or "What are the side effects of ibuprofen?" Historical medication decision records contain information about the medications the user ultimately chose, such as "I decide to buy compound cold capsules" or "I choose this ibuprofen suspension." Using natural language processing technology, the dialogue content is parsed into structured data, marking the medication name, medication attributes (such as dosage form, price, and side effects), and the user's attitude towards these attributes.
[0099] When conducting differential analysis, the first step is to construct a set of queried drugs (A) and a set of selected drugs (B). For each drug, its key features are extracted to form a feature vector, including dimensions such as active ingredient, dosage form, target population, price range, and brand type (imported / domestic). For example, if a user queries "imported children's ibuprofen syrup" but ultimately selects "domestic children's acetaminophen suspension," a comparison can identify the features of drugs queried but not selected (imported drugs, syrup dosage form, ibuprofen ingredient) and the features of drugs not queried but ultimately selected (domestic drugs, suspension dosage form, acetaminophen ingredient).
[0100] The features of drugs queried but not selected are input into a preference inference rule base for reverse reasoning. This rule base, built on expert knowledge and historical data, contains rules such as "If a user queries feature X but does not select it, they may reject attribute Y." For example, rules like "Querying imported drugs but selecting domestic drugs → price-sensitive" and "Querying syrup formulations but selecting suspensions → emphasis on precision medicine" are used to infer implicit user preferences, such as "rejection of high-priced drugs" and "concern about sugar-containing formulations."
[0101] Simultaneously, the characteristics of drugs that were not queried but were ultimately selected are input into the preference inference rule base for forward reasoning. The rule base contains rules in the form of "If a user did not query feature X but ultimately selected it, they may prefer attribute Y." For example, rules such as "Not queried but selected acetaminophen → preference for ingredients with high safety profile" and "Not queried but selected domestic drugs → preference for affordable products" are used to infer the user's implicit acceptance preferences, such as "preferring drugs with fewer side effects" and "preferring affordable drugs."
[0102] Identify user pauses and follow-up questions in historical conversations. A pause refers to a conversation node where a user responds after receiving a system recommendation but within a preset time threshold (e.g., 5 seconds). For example, after the system recommends "This medication contains aspirin," the user might pause for a considerable time before responding. A follow-up question refers to a conversation node where the user actively inquires about specific medication attributes, such as "Will this medication affect the gastric mucosa?" or "Can pregnant women use it?" These specific locations are marked using conversation timing analysis technology.
[0103] Marking drug attributes related to pauses (such as aspirin ingredients) as "concern attributes" indicates that users have concerns or uncertainties about these attributes. Marking drug attributes related to follow-up questions (such as effects on the stomach or suitability for specific populations) as "important attributes" indicates that users are particularly concerned about these attributes. These markings can be achieved through semantic understanding and keyword extraction technologies.
[0104] Finally, implicit rejection preferences, implicit acceptance preferences, concerns, and importance attributes are integrated to form the target user's complete implicit medication preferences. The integration process employs a weighted fusion method, assigning different weights to each type of preference information. For example, users' rejection preferences and importance attributes can be given higher weights (e.g., 0.8), while acceptance preferences and concerns attributes can be given medium weights (e.g., 0.6). The integration result can be expressed as a series of preference statements, such as "Users have concerns about drugs containing aspirin (confidence level 0.8)," "Users are concerned about the effects of drugs on the stomach (confidence level 0.8)," and "Users prefer affordable domestically produced drugs (confidence level 0.6)," etc.
[0105] This method of identifying implicit medication preferences can uncover users' unexpressed but actual drug selection tendencies from historical conversations, helping to provide more accurate medication recommendations. For example, when a user inquires about cold medicine, the system can prioritize recommending domestically produced drugs that do not contain aspirin, have minimal impact on the stomach, and are reasonably priced, based on the identified implicit preferences, thereby better meeting the user's actual needs and improving user satisfaction.
[0106] In one optional implementation, the implicit medication preference is semantically aligned with the attribute feature set to generate a drug recommendation vector, and the selection probability distribution of each drug entity node is calculated based on the drug recommendation vector, including:
[0107] Each preference dimension in the implicit medication preference is converted into a standardized preference semantic representation, and each attribute feature in the attribute feature set is converted into a standardized feature semantic representation. A semantic alignment matrix is constructed, where the row index of the semantic alignment matrix corresponds to the standardized preference semantic representation, the column index corresponds to the standardized feature semantic representation, and the matrix element values represent the semantic similarity between the preference semantic representation and the feature semantic representation.
[0108] The semantic alignment matrix is row-normalized to obtain the distribution weights of each preference dimension on the attribute feature set. The semantic similarity is weighted and summed based on the distribution weights to obtain the comprehensive matching score of each drug entity node. The comprehensive matching score is used as a component of the drug recommendation vector. The drug recommendation vector is normalized to obtain the selection probability distribution.
[0109] Obtain the user's implicit medication preferences. Implicit medication preferences typically include multiple dimensions, such as efficacy preference, price sensitivity, and brand preference. These preferences are usually represented in vector form, such as preference vector P = [p1, p2, ..., p...]. m ], where m represents the number of preference dimensions. For example, a user may have high expectations for pain relief (p1=0.8), be more sensitive to drug prices (p2=0.6), and be more concerned about side effects (p3=0.7).
[0110] Next, the implicit medication preferences are transformed into standardized semantic representations. This process uses a semantic encoder to map each preference dimension into a unified semantic space. Specifically, for each component p of the preference vector P... i Processed using the semantic encoding function f: P' i = f(p i This yields the standardized preference semantic representation P'=[P'1, P'2, ..., P''], which is then obtained. mThe semantic encoding function f can be a pre-trained word embedding model, such as Word2Vec or BERT, which converts the semantic connotation of the preference dimension into a high-dimensional vector representation.
[0111] Simultaneously, the attribute feature set of the drug entity node is obtained. Drug attribute features include multiple aspects such as drug efficacy, ingredients, indications, dosage, and contraindications, denoted as the feature set F = [f1, f2, ..., f...]. n ], where n represents the number of features. For example, the properties of a painkiller might include "the main ingredient is acetaminophen", "suitable for mild to moderate pain", "contraindicated in patients with hepatic impairment", etc.
[0112] Each attribute feature in the attribute feature set is converted into a standardized semantic representation. Using the same semantic encoding method as that used for the preference dimension, each attribute feature f is... j Mapped to the same semantic space: F' j = g(f j This yields the standardized feature semantic representation F'=[F'1, F'2, ..., F'']. n] The function g typically uses the same semantic model as f, ensuring that preference dimensions and attribute features are comparable within the same semantic space.
[0113] Based on the standardized preference semantic representation P' and feature semantic representation F', a semantic alignment matrix S is constructed. The row indices of matrix S correspond to the standardized preference semantic representations, the column indices correspond to the standardized feature semantic representations, and the matrix element values S... ij P' represents the semantic representation of preferences. i With the feature semantic representation F' j The semantic similarity between them. Semantic similarity can be calculated using cosine similarity: S ij = cos(P' i F' j The range is [-1, 1], and the closer it is to 1, the more similar the semantics are.
[0114] Row normalization is performed on the semantic alignment matrix S to obtain the distribution weight matrix W of each preference dimension on the attribute feature set. This step helps identify which drug attribute features are most relevant to each user's preference.
[0115] The semantic similarity is weighted and summed based on the distributed weight matrix W to calculate the comprehensive matching score for each drug entity node. For drug entity node k, its matching score R... k The calculation is the sum of weighted similarities between each preference dimension and its corresponding attribute feature, taking into account the strength of user preferences, the correlation between preferences and features, and the degree of matching between drug features and preferences.
[0116] The overall matching score is used as a component of the drug recommendation vector. The drug recommendation vector R = [R1, R2, ..., R...]. l ],in l This indicates the quantity of candidate drugs, with each component R... k This indicates the recommended score for the corresponding drug.
[0117] Finally, the drug recommendation vector R is normalized to obtain the selection probability distribution. The recommendation score is then converted into a probability distribution P using the softmax function. k = exp(R k ) / ∑ᵏexp(R k ), ensure ∑ k P k = 1. This probability distribution reflects the system's recommendation tendency for each drug; the higher the probability value, the more the drug aligns with the user's implicit medication preferences.
[0118] In practical applications, the final selection probability can be adjusted by incorporating the user's explicit needs, such as specified indications and dosage form preferences. For example, if a user clearly needs treatment for cold symptoms, the selection probability of cold medicines can be given additional weight, or non-cold medicines can be filtered out to ensure more accurate recommendations.
[0119] The above methods achieve semantic alignment between users' implicit medication preferences and drug attribute features, enabling the recommendation system to understand users' true medication needs, provide more personalized and accurate drug recommendation services, and improve user satisfaction and medication safety.
[0120] In one optional implementation, calculating the pose transformation matrix required for the robotic arm to grasp the drug based on the row and column indices, and controlling the robotic arm to perform the drug-grabbing action according to the pose transformation matrix includes:
[0121] The spatial coordinate information of the medicine storage slot corresponding to the row and column index is retrieved from the preset medicine cabinet layout mapping table. The spatial coordinate information includes the center point coordinates and normal vector direction of the medicine storage slot in the medicine cabinet reference coordinate system.
[0122] Read the current joint angle value of the robotic arm and convert the current joint angle value into the current spatial pose of the end effector in the coordinate system of the robotic arm base;
[0123] Obtain the calibration parameters between the medicine cabinet reference coordinate system and the robotic arm base coordinate system, and convert the spatial coordinate information of the medicine storage slot to the robotic arm base coordinate system based on the calibration parameters;
[0124] The grasping approach direction and grasping depth of the end effector are determined according to the packaging form of the target drug, and the position adjustment amount and attitude adjustment amount of the end effector relative to the center point of the drug storage slot are calculated based on the grasping approach direction and the grasping depth.
[0125] The spatial coordinates of the drug storage slot, converted to the coordinate system of the robotic arm base, are superimposed with the position adjustment amount and the attitude adjustment amount to obtain the desired pose of the end effector.
[0126] Construct a homogeneous transformation matrix from the current spatial pose to the desired pose, and use the homogeneous transformation matrix as the pose transformation matrix; calculate the angle increment that each joint of the robotic arm needs to rotate according to the pose transformation matrix, and control each joint of the robotic arm to perform the drug-retrieving action according to the angle increment.
[0127] Figure 2 The flowchart illustrates the process of controlling a robotic arm to perform a drug-grabbing action according to a pose transformation matrix. The process of calculating the pose transformation matrix required for the robotic arm to grasp the drug based on row and column indices, and controlling the robotic arm to perform the drug-grabbing action according to the pose transformation matrix, includes the following steps:
[0128] The spatial coordinates of the medicine storage slot corresponding to the row and column index are retrieved from the preset medicine cabinet layout mapping table. This mapping table stores the center point coordinates and normal vector direction of each medicine storage slot in the medicine cabinet reference coordinate system. For example, for the storage slot with index (3, 5), the corresponding spatial coordinates may be the center point coordinates (300mm, 450mm, 200mm) and normal vector direction (0, 1, 0), indicating that the storage slot is located at a specific position in the medicine cabinet coordinate system and the opening direction is towards the positive Y-axis.
[0129] Next, the current joint angle values of the robotic arm are read and converted into the current spatial pose of the end effector in the robotic arm's base coordinate system. Assuming the current joint angle values of the six-axis robotic arm are [30°, 45°, -20°, 15°, 60°, 0°], the current pose of the end effector in the base coordinate system can be obtained through forward kinematics calculations, including position coordinates (x, y, z) and attitude representation (such as Euler angles or quaternions). This conversion is typically achieved using the DH parameter method or the Product of Exponentials method.
[0130] Then, the calibration parameters between the medicine cabinet reference coordinate system and the robotic arm base coordinate system are obtained. These parameters are usually obtained in advance through the calibration process and stored as a homogeneous transformation matrix. Based on these calibration parameters, the spatial coordinate information of the medicine storage slot is transformed to the robotic arm base coordinate system. Specifically, the coordinates of the center point of the storage slot and the normal vector direction are multiplied by the transformation matrix to obtain the coordinates of the center point of the slot and the normal vector direction in the robotic arm base coordinate system.
[0131] The approach direction and gripping depth of the end effector are determined based on the packaging of the target drug. For example, for boxed drugs, it may be necessary to approach and grip from the front, with a gripping depth of half the thickness of the box; while for bottled drugs, it may be necessary to grip from the side, with a gripping depth of half the diameter of the bottle. This information can be obtained from a drug information database. Based on the approach direction and gripping depth, the position and attitude adjustments of the end effector relative to the center point of the drug storage slot are calculated.
[0132] The spatial coordinates of the medicine storage slot, transformed to the robot arm's base coordinate system, are superimposed with the position and attitude adjustments to obtain the desired pose of the end effector. In the superposition operation, the position is achieved through vector addition; the attitude is achieved through rotation matrix or quaternion multiplication. Assuming the center point of the medicine slot is (500mm, 300mm, 200mm) in the base coordinate system, and the normal vector is (0, 1, 0), and the gripping needs to be offset by 50mm along the normal vector direction, the desired position is (500mm, 350mm, 200mm), and the attitude requires the end effector's gripping surface to face the (-0, -1, 0) direction.
[0133] Construct a homogeneous transformation matrix from the current spatial pose to the desired pose, and use this homogeneous transformation matrix as the pose transformation matrix. This process first calculates the relative relationship between the two poses to obtain a homogeneous transformation matrix describing the motion required to reach the target pose from the current pose. In practice, the inverse matrix of the current pose can be obtained first, and then multiplied by the target pose matrix to obtain the relative transformation matrix.
[0134] Finally, the required rotation angle increments for each joint of the robotic arm are calculated based on the pose transformation matrix, and the robotic arm is controlled to perform the drug-retrieval action according to the angle increments. This process involves inverse kinematics calculation of the robotic arm, converting the spatial pose into joint angles. For a six-axis robotic arm, there may be multiple solutions, and the optimal solution must be selected based on conditions such as joint limits and minimum motion. Subsequently, the calculated joint angle values are sent to each actuator through the robotic arm controller to achieve precise drug-retrieval.
[0135] In practical applications, to ensure the stability and safety of the gripping action, the device can be moved to a preparatory position above the medicine before performing the final gripping action, and then slowly approached in the gripping direction. After the gripping is completed, the end effector needs to be controlled to close the gripper or activate the suction cup, and then slowly exit the medicine cabinet to complete the entire medicine retrieval process.
[0136] This invention relates to an AI-driven dialogue-based personalized medication dispensing system using a robotic arm, comprising:
[0137] The first unit is used to receive dialogue input containing medication needs initiated by the target user, and to perform contextual correlation analysis on the dialogue input through a dialogue state tracking mechanism to generate the current round intent and historical dialogue context corresponding to the target user.
[0138] The second unit is used to locate drug entity nodes that are semantically related to the current round intent in the drug relationship network based on the current round intent in the dialogue state representation, and to determine the attribute feature set of the drug entity nodes.
[0139] The third unit is used to identify the implicit medication preferences expressed by the target user in the historical dialogue context based on the historical dialogue context. The implicit medication preferences are constituted by the target user's implicit rejection preferences, implicit acceptance preferences, drug doubt attributes, and drug importance attributes.
[0140] The fourth unit is used to semantically align the implicit medication preferences with the attribute feature set, generate a drug recommendation vector, and calculate the selection probability distribution of each drug entity node based on the drug recommendation vector; determine the target drug corresponding to the drug entity node with the highest probability value according to the selection probability distribution, and query the row and column index of the target drug in the storage matrix; calculate the pose transformation matrix required for the robotic arm to grasp the drug based on the row and column index, and control the robotic arm to perform the drug-grabbing action according to the pose transformation matrix.
[0141] A third aspect of the present invention,
[0142] An electronic device is provided, comprising:
[0143] processor;
[0144] Memory used to store processor-executable instructions;
[0145] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0146] Fourth aspect of the embodiments of the present invention,
[0147] A computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0148] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A personalized medication dispensing method using a robotic arm driven by AI dialogue, characterized in that, include: The system receives dialogue input from a target user that includes a medication request, and performs contextual analysis on the dialogue input through a dialogue state tracking mechanism to generate the target user's current round intent and historical dialogue context. Based on the current round intent in the dialogue state representation, locate the drug entity node in the drug relationship network that is semantically related to the current round intent, and determine the attribute feature set of the drug entity node. Based on the historical dialogue context, identify the implicit medication preferences expressed by the target user in the historical dialogue context, including: By performing a difference analysis on the historical medication query records and historical medication decision records from the historical dialogue context, the characteristics of the drugs that the target user queried but did not select and the characteristics of the drugs that the target user did not query but ultimately selected are identified. The historical medication query records contain the drug information consulted by the target user, and the historical medication decision records contain the drug information ultimately selected by the target user. The query but unselected drug features are input into the preference inference rule base for reverse reasoning to obtain the target user's implicit rejection preference; The characteristics of the drugs that were not queried but were ultimately selected are input into the preference inference rule base for forward reasoning to obtain the implicit acceptance preference of the target user. The preference inference rule base defines the mapping relationship between user query behavior and drug purchase decision behavior. The pause and follow-up question positions of the target user in the dialogue process are determined. The pause position corresponds to the dialogue node where the target user does not respond immediately after receiving the system recommendation information, and the follow-up question position corresponds to the dialogue node where the target user initiates an inquiry about a specific drug attribute. The drug attributes involved at the pause point are marked as doubtful attributes, and the drug attributes involved at the follow-up question point are marked as important attributes; The implicit rejection preference, implicit acceptance preference, doubt attribute, and importance attribute are integrated to form the implicit medication preference of the target user; The implicit medication preferences are semantically aligned with the attribute feature set to generate a drug recommendation vector, and the selection probability distribution of each drug entity node is calculated based on the drug recommendation vector. Based on the selection probability distribution, determine the target drug corresponding to the drug entity node with the highest probability value, and query the row and column index of the target drug in the storage matrix; The robot arm calculates the pose transformation matrix required for grasping based on the row and column indices, and controls the robot arm to perform the drug-grabbing action according to the pose transformation matrix.
2. The method according to claim 1, characterized in that, By performing contextual analysis on the dialogue input through a dialogue state tracking mechanism, the current round intent and historical dialogue context corresponding to the target user are generated, including: The dialogue input is subjected to multi-granular semantic segmentation to identify the core action phrases and modifying limiting components in the dialogue input, and to extract the intentional semantics that reflect the medication needs. A dialogue round dependency graph is constructed from the target user's historical dialogue records. Each node in the dialogue round dependency graph represents a historical dialogue round, and each edge represents the semantic connection relationship between rounds. In the dialogue turn dependency graph, the graph is traversed using the intent semantics as the query condition to locate the set of previous turn nodes that have a semantic connection with the intent semantics. Semantic extraction is performed on the dialogue content corresponding to each node in the previous round node set, and medication topic tags and interaction decision records are extracted from the dialogue content to generate a historical dialogue context containing the medication topic tags and interaction decision records. The semantic intent is semantically fused with the medication topic tags in the historical dialogue context to generate a fused intent for the current round.
3. The method according to claim 1, characterized in that, Based on the current round intent in the dialogue state representation, drug entity nodes semantically related to the current round intent are located in the drug relationship network, and the attribute feature set of the drug entity nodes is determined to include: Drug entities, symptom entities, and ingredient entities are extracted from a pre-built drug knowledge base. The drug relationship network is constructed based on the therapeutic relationship between drugs and symptoms, the compositional relationship between drugs and ingredients, and the substitution relationship between drugs. The current round intent is semantically vectorized to obtain an intent vector reflecting medication demand; In the drug relationship network, semantic description information of each drug entity node is extracted to generate a node semantic vector corresponding to each drug entity node. Nodes whose semantic distance metric between the intent vector and the node semantic vector is greater than a preset distance threshold are selected as candidate drug entity nodes. In the drug relationship network, bidirectional restricted propagation is performed starting from the candidate drug entity node. Forward propagation is performed from the candidate drug entity node along the outgoing edge direction to obtain forward associated nodes, and backward propagation is performed along the incoming edge direction to obtain reverse associated nodes. When the propagation hop count reaches the depth limit, the forward and reverse related nodes in the propagation path are merged to obtain the drug entity node; The attribute labeling information corresponding to the drug entity node includes efficacy attributes, dosage form attributes, and applicable population attributes, and the attribute labeling information is organized into an attribute feature set.
4. The method according to claim 1, characterized in that, The implicit medication preferences are semantically aligned with the attribute feature set to generate a drug recommendation vector. The selection probability distribution of each drug entity node is then calculated based on the drug recommendation vector, including: Each preference dimension in the implicit medication preference is converted into a standardized preference semantic representation, and each attribute feature in the attribute feature set is converted into a standardized feature semantic representation. A semantic alignment matrix is constructed, where the row index of the semantic alignment matrix corresponds to the standardized preference semantic representation, the column index corresponds to the standardized feature semantic representation, and the matrix element values represent the semantic similarity between the preference semantic representation and the feature semantic representation. The semantic alignment matrix is row-normalized to obtain the distribution weights of each preference dimension on the attribute feature set. The semantic similarity is weighted and summed based on the distribution weights to obtain the comprehensive matching score of each drug entity node. The comprehensive matching score is used as a component of the drug recommendation vector. The drug recommendation vector is normalized to obtain the selection probability distribution.
5. The method according to claim 1, characterized in that, Calculating the pose transformation matrix required for the robotic arm to grasp the drug based on the row and column indices, and controlling the robotic arm to perform the drug-grabbing action according to the pose transformation matrix includes: The spatial coordinate information of the medicine storage slot corresponding to the row and column index is retrieved from the preset medicine cabinet layout mapping table. The spatial coordinate information includes the center point coordinates and normal vector direction of the medicine storage slot in the medicine cabinet reference coordinate system. Read the current joint angle value of the robotic arm and convert the current joint angle value into the current spatial pose of the end effector in the coordinate system of the robotic arm base; Obtain the calibration parameters between the medicine cabinet reference coordinate system and the robotic arm base coordinate system, and convert the spatial coordinate information of the medicine storage slot to the robotic arm base coordinate system based on the calibration parameters; The grasping approach direction and grasping depth of the end effector are determined according to the packaging form of the target drug, and the position adjustment amount and attitude adjustment amount of the end effector relative to the center point of the drug storage slot are calculated based on the grasping approach direction and the grasping depth. The spatial coordinates of the drug storage slot, converted to the coordinate system of the robotic arm base, are superimposed with the position adjustment amount and the attitude adjustment amount to obtain the desired pose of the end effector. Construct a homogeneous transformation matrix from the current spatial pose to the desired pose, and use the homogeneous transformation matrix as the pose transformation matrix; The required rotation angle increments for each joint of the robotic arm are calculated based on the pose transformation matrix, and the robotic arm joints are controlled to perform the drug-retrieving action according to the angle increments.
6. A personalized medication dispensing system based on AI dialogue-driven robotic arm, used to implement the method as described in any one of claims 1-5, characterized in that, include: The first unit is used to receive dialogue input containing medication needs initiated by the target user, and to perform contextual correlation analysis on the dialogue input through a dialogue state tracking mechanism to generate the current round intent and historical dialogue context corresponding to the target user. The second unit is used to locate drug entity nodes that are semantically related to the current round intent in the drug relationship network based on the current round intent in the dialogue state representation, and to determine the attribute feature set of the drug entity nodes. The third unit is used to identify the implicit medication preferences expressed by the target user in the historical dialogue context based on the historical dialogue context. The implicit medication preferences are constituted by the target user's implicit rejection preferences, implicit acceptance preferences, drug doubt attributes, and drug importance attributes. The fourth unit is used to semantically align the implicit medication preferences with the attribute feature set, generate a drug recommendation vector, and calculate the selection probability distribution of each drug entity node based on the drug recommendation vector. Based on the selection probability distribution, determine the target drug corresponding to the drug entity node with the highest probability value, and query the row and column index of the target drug in the storage matrix; The robot arm calculates the pose transformation matrix required for grasping based on the row and column indices, and controls the robot arm to perform the drug-grabbing action according to the pose transformation matrix.
7. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Intelligent pharmacy medicine taking system and medicine taking method
CN116729869A
Recommendation output method and device, computer equipment and storage medium
CN120973985A