Method and device for detecting medication safety

By aligning drug names with standard drug names, constructing an information graph, and utilizing a medication knowledge graph for graph retrieval, the safety issue of medication recommendations from medical intelligent agents is resolved, enabling automated and large-scale safety testing and risk identification of medication recommendations.

CN121725974AActive Publication Date: 2026-03-24ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-25
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

When providing medication advice, medical AI agents may have issues with the accuracy, standardization, and safety of their responses, potentially leading to health risks for users.

Method used

By obtaining the drug names in the medication recommendations and aligning them with standard drug names in the drug knowledge base, an information graph containing user disease entities and relationships is constructed. The medication knowledge graph is then used for graph retrieval to determine whether the medication recommendations pose any risks.

Benefits of technology

It enables automated and large-scale safety testing of medication recommendations, identifies medication risks in complex scenarios, and improves the accuracy and safety of medication recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121725974A_ABST
    Figure CN121725974A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and a device for detecting medication safety, and aims to detect the medication safety in medication suggestions and obtain the medication suggestions and user health portraits. The method comprises the following steps: acquiring a drug name in a drug use suggestion, and then aligning the drug name with a standard drug name in a drug knowledge base based on multiple alignment approaches; thirdly, through user portrait information and the aligned standard medicine names, an information graph at least containing disease entities, medicine entities and the incidence relation between the disease entities and the medicine entities is constructed; and based on the information graph, performing graph retrieval in a pre-constructed drug use knowledge graph, and determining whether the drug use suggestions have drug use safety risks or not by using drug use risk knowledge in the drug use knowledge graph. Therefore, the drug use risk in a complex scene can be identified.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] One or more embodiments of the present specification relate to the field of computer technology, and in particular, to a method and device for detecting medication safety. BACKGROUND

[0002] Large Language Model (LLM) refers to a class of complex neural network models trained through deep learning technology, which can understand and generate human natural language. These models usually have hundreds of millions to tens of billions of parameters, which enables them to perform well in a wide range of natural language processing tasks, including but not limited to text generation, translation, question answering, summarization, dialogue, etc. The usage methods of LLM usually include two modes: direct inference and fine-tuning. In the direct inference mode, users can guide the large language model to generate specific output by designing prompts. The prompt can be a task description or instruction in text form, which is used to stimulate the semantic understanding and generation ability of the large language model. In the fine-tuning mode, the large language model is further trained on a small-scale dataset in a specific domain to optimize its performance on specific tasks.

[0003] With the development of large language models, health and medical professional agents (hereinafter referred to as "medical agents") centered on large language models have developed rapidly and can provide users with convenient health consultation services. However, these medical agents have great potential risks in the accuracy, standardization and safety of their answers when providing medication recommendations. If the agent gives an incorrect medication recommendation (such as incorrect dosage, ignoring contraindications, not considering drug interactions, etc.), it may cause serious harm to the user's health. Therefore, automatically and scalably detecting the safety of the medication recommendations generated by the agent has become a key technical problem that must be solved before the agent gives a medication recommendation. SUMMARY

[0004] One or more embodiments of the present specification describe a method and device for detecting medication safety to solve one or more problems mentioned in the background.

[0005] According to a first aspect, a method for detecting medication safety is provided, comprising: obtaining a drug name from a first medication recommendation for a first user, the first medication recommendation being generated by a large model; aligning the drug name with a standard drug name in a drug knowledge base to obtain a standard drug name corresponding to the drug name; constructing a first information graph for the first user, which includes drug entities identified by the standard drug name, disease entities obtained from health profile information of the first user, and association relationships between the entities; performing graph retrieval in a medication knowledge graph based on the first information graph to determine whether the first medication recommendation has risks, wherein the medication knowledge graph contains risk knowledge of drug use.

[0006] In some embodiments, the method further comprises aligning each drug name with a standard drug name in a drug knowledge base based on multiple alignment approaches, specifically comprising: for any first drug name, recalling a plurality of candidate standard drug names through multiple alignment approaches; and scoring the plurality of candidate standard drug names through a pre-trained scoring model to determine a first standard drug name corresponding to the first drug name.

[0007] In some further embodiments, each drug name includes a first drug name; and aligning each drug name with a standard drug name in a drug knowledge base based on multiple alignment approaches includes at least one of the following: aligning through vector retrieval, which includes performing vector similarity calculation between a first semantic embedding vector corresponding to the first drug name and reference semantic embedding vectors corresponding to standard drug names in the drug knowledge base, and recalling a plurality of standard drug names according to the vector similarity with the first drug name; aligning according to edit distance, which includes calculating the edit distance between the first drug name and standard drug names in the drug knowledge base, and recalling a plurality of standard drug names according to the edit distance; and querying an alias dictionary, which includes recalling a corresponding standard drug name if the first drug name is detected as an alias of any standard drug name.

[0008] In some embodiments, the medication knowledge graph at least includes the following entities and association edges therebetween: drug entities identified by standard drug names, disease entities; and performing graph retrieval in the medication knowledge graph to determine whether the first medication recommendation has risks includes: mapping each entity in the first information graph to a target entity in the medication knowledge graph; obtaining relevant risk knowledge based on the association edges and / or attribute information of the target entity; and determining whether the first medication recommendation has risks according to the relevant risk knowledge and the first information graph.

[0009] In a further embodiment, the related risk knowledge comprises risk association edges indicating contraindications or harmful effects between target entities; and determining whether the first medication recommendation is risky based on the related risk knowledge and the first information graph comprises: for the first entity and the second entity in the first information graph indicating simultaneous effects on the first user, if the risk association edge exists between the first target entity and the second target entity obtained by mapping, it is determined that the first medication recommendation is risky.

[0010] In a still further embodiment, the risk association edge comprises a first association edge representing a contraindication relationship between a drug entity and a disease entity; and / or a second association edge representing a harmful interaction relationship between two drug entities.

[0011] In another further embodiment, the related risk knowledge comprises medication description information recorded in attribute information of a drug entity, including safe medication rules and / or risky medication rules; and determining whether the first medication recommendation is risky based on the related risk knowledge and the first information graph comprises: for the first entity in the first information graph identified by a first standard drug name, obtaining a corresponding first medication description, the first medication description being extracted from the first medication recommendation; if the first medication description does not conform to the safe medication rule of the target drug entity to which the first entity is mapped, and / or conforms to the risky medication rule of the target drug entity, it is determined that the first medication recommendation is risky.

[0012] In some still further embodiments, the medication description information comprises medication rules for at least one of the following: dosage, frequency, course of treatment, route of administration.

[0013] In some embodiments, the entities in the first information graph further comprise at least one of the following: gender, age, population type, previous disease history, allergy history, smoking and drinking history, and other currently used drugs.

[0014] In some embodiments, aligning the drug name with the standard drug name in the drug knowledge base comprises: in response to confirming that the first drug name obtained from the first medication recommendation is the name of a composite drug, obtaining multiple active ingredients corresponding to the first drug name; aligning each active ingredient with the standard drug name in the drug knowledge base to obtain the standard drug name corresponding to each active ingredient, and attributing it to the first standard drug name corresponding to the first drug name.

[0015] In a further embodiment, confirming that the first drug name is the name of a composite drug comprises: detecting a predetermined keyword representing a composite drug in the first drug name; or failing to recall the standard drug name corresponding to the first drug name from the standard drug names in the drug knowledge base.

[0016] In another further embodiment, the plurality of effective components corresponding to the first drug name are acquired by: extracting a plurality of effective components from the first drug name; and / or, retrieving drug description information corresponding to the first drug name, and extracting a plurality of effective components from the drug description information.

[0017] According to a second aspect, a device for detecting medication safety is provided, comprising:

[0018] An acquisition unit configured to acquire a drug name from a first medication recommendation for a first user, the first medication recommendation being generated by a large model;

[0019] An alignment unit configured to align the drug name with a standard drug name in a drug knowledge base to obtain a standard drug name corresponding to the drug name;

[0020] A construction unit configured to construct a first information graph for the first user, wherein each drug entity is identified by the standard drug name, a disease entity is acquired from health profile information of the first user, and an association relationship between the entities is included;

[0021] A determination unit configured to perform graph retrieval in a medication knowledge graph based on the first information graph to determine whether the first medication recommendation has risks, wherein the medication knowledge graph contains risk knowledge of drug use.

[0022] According to a third aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed in a computer, the computer executes the method of the first aspect.

[0023] According to a fourth aspect, a computing device is provided, comprising a memory and a processor, characterized in that the memory stores executable code, and the processor executes the executable code to implement the method of the first aspect.

[0024] Through the method and device provided by the embodiments of the present disclosure, in order to detect the medication safety of the medication recommendation, the drug name in the medication recommendation can be acquired. Then, the drug name is aligned with the standard drug name in the drug knowledge base to obtain each standard drug name corresponding to each drug name. Next, an information graph containing disease entities and drug entities is constructed through the disease entities acquired from the user profile information and the standard drug names. Based on the information graph, graph retrieval is performed in a pre-constructed medication knowledge graph, which can contain risk knowledge of drug use, to determine whether the medication recommendation has medication safety risks. In this way, it is beneficial to identify medication risks in complex scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0026] Figure 1 Fig. 1 shows a schematic diagram of an application scenario for detecting drug risk; Figure 2 Fig. 2 is a schematic diagram of a process for detecting drug safety according to an embodiment of the present specification; Figure 3 Fig. 3 shows a user information diagram of a specific example; Figure 4 Fig. 4 shows a schematic diagram of the process structure for detecting drug safety in a specific example; Figure 5 Fig. 5 is a schematic block diagram of a drug safety detection device according to an embodiment of the present specification. DETAILED DESCRIPTION

[0027] The scheme provided in the present specification will be described below in conjunction with the drawings.

[0028] Figure 1 Fig. 1 shows a specific application scenario of drug recommendation. The application scenario is specifically a use scenario of a medical Q&A platform. The specific architecture can include a client and a server. The client can be a user terminal or a Q&A platform application running on the user terminal. The client can obtain user questions through user interaction with the user terminal. The user questions can be various questions, instructions, requests seeking answers proposed by the user, such as Figure 1 “what medicine to eat for stomach acid” in Fig. 1, etc. The client sends the user question to the server through the network, and the server generates a corresponding drug recommendation through a computing platform with a generated model (such as a large language model).

[0029] Among them, the server can perform safety detection on the generated drug recommendation. The drug recommendation can include recommended drugs, methods of taking, etc. The drug recommendation can be fed back to the client by the server. It is worth noting that the drug safety detection result can be used as a prompt and drug recommendation output to the user, or the drug safety detection can be used to supervise the drug recommendation when generating the drug recommendation, and the improved drug recommendation is provided to the user. For example, Figure 1As shown, the client-side dialog box displays the user question "What medicine is good for stomach acid?", the server-side feedback answer (i.e., the drug recommendation such as "Drug recommendation: omeprazole, *********"), and the drug safety tips such as "Notes: Omeprazole is a proton pump inhibitor (PPI). Common side effects are as follows: *********".

[0030] It can be understood that Figure 1 A simple application architecture example is given. In real scenarios, the number of clients can be multiple, or the computing platform can be set on the user terminal without the need for a server, etc. The specific scenario can also not be limited to Q&A, but can also be various completion instructions, task scenarios, etc.

[0031] In order to detect the drug safety in the drug recommendation, in the conventional technology, there are the following solutions: manual sampling review, keyword or rule-based detection, basic natural language processing method, etc. Among them, manual sampling review relies on pharmacists or doctors for manual review, which is costly, inefficient, and has a narrow coverage, making it difficult to meet the needs of large-scale processing and real-time detection. The keyword or rule-based detection matches by setting keywords (such as "forbidden", "cautious") and simple rules. This method is relatively rigid and difficult to understand the context, which can easily cause false negatives and false positives. For example, it cannot accurately identify non-standard drug names (such as various trade names, colloquial names, aliases, etc.), and it cannot handle complex drug use scenarios. The basic natural language processing method obtains user information and drug recommendations through conventional information extraction technology, and then compares them with the standard knowledge base through vector retrieval, etc. This method solves some text understanding problems, but still has defects, such as single information source, insufficient reliability, inability to effectively integrate information from multiple channels such as user dialogue, electronic medical records, and test reports, and inability to handle conflicts and uncertainties that may exist between information; Shallow understanding of drug recommendations, only extracting scattered drug information (such as drug names, dosages), unable to understand complex drug logic with conditions such as "A before B" and "A / B two choices"; Weak drug concept alignment ability, poor matching and recognition ability for colloquial names, misspelled words, and especially for complex prescriptions not explicitly included in the knowledge base; Single risk detection dimension, mostly "point-to-point" verification (such as "person-drug" contraindications), unable to discover systemic and hidden risks caused by multiple drugs and multiple diseases; and so on.

[0032] In view of this, the present specification provides a technical solution for detecting medication safety, aiming to solve one or more of the above conventional technical defects. Specifically, one or more drug names can be obtained from the medication recommendation. Then, each drug name is aligned with the standard drug name in the drug knowledge base, so that an information graph is constructed based on the disease entity obtained based on the user portrait information and the drug entity identified by the aligned standard drug name. The information graph is used for graph retrieval in the pre-constructed medication knowledge graph containing risk knowledge of drug use, so as to determine whether there is a safety hazard. In this way, the user's portrait information can be used to construct a more complete user information graph, and the medication plan with complex logic such as conditions and sequences can be understood, rather than isolated medication instructions, which is closer to the real medical scene. Further, from the "point-to-point" rule check, it jumps to the "systematic" risk discovery based on graph calculation, which can effectively reveal the hidden risks caused by the coupling of multiple factors such as drugs and drugs, and drugs and diseases.

[0033] The technical concept of the present specification will be described in detail below with reference to the accompanying drawings.

[0034] Figure 2 The flow of detecting medication safety provided by an embodiment of the present specification is shown. The execution subject of the flow can be a computer, device, server with certain computing power, more specifically, for example Figure 1 The computing platform in the service platform containing medical questions and answers. The flow can be used in the scene of providing medication recommendations to users. The medication safety detection result can be displayed to the user, for example, together with the medication recommendation, or not displayed to the user, for example, before giving the medication recommendation, the medication recommendation is repeatedly corrected through safety detection until a safe and reasonable medication recommendation is given, or in the case where there is no safe and reasonable medication recommendation, the user is provided with the result that the medication recommendation cannot be provided.

[0035] As shown in Figure 2 The flow of detecting medication safety provided by the present specification can include: step 201, obtaining drug names from a first medication recommendation for a first user, the first medication recommendation being generated by a large model; step 202, aligning the drug names with the standard drug names in the drug knowledge base to obtain the standard drug names corresponding to the drug names; step 203, constructing a first information graph for the first user, which includes each drug entity identified by the standard drug name, the disease entity obtained from the health portrait information of the first user, and the association relationship between the entities; step 204, based on the first information graph, performing graph retrieval in the medication knowledge graph to determine whether the first medication recommendation has risks, wherein the medication knowledge graph contains risk knowledge of drug use.

[0036] First, in step 201, drug names are obtained from a first medication recommendation for a first user.

[0037] The so-called drug use recommendation is determined in combination with user questions, user requests, etc. on the current Q&A platform, consultation platform, etc. Here, the first drug use recommendation can be a drug use recommendation determined for the first user for the current safety to be detected. The first user is any user of the current Q&A platform, consultation platform, etc.

[0038] In some embodiments, the first drug use recommendation is a drug use recommendation generated by the current Q&A platform, consultation platform, etc. and provided to the user. For example, the first user uploads CT (Computed Tomography), describes symptoms, etc. multi-modal information, and the drug use recommendation generated by the current Q&A platform, consultation platform, etc. through a medical intelligent agent. Among them, the multi-modal information here can be information containing one or more modalities of images (such as medical images), pictures, text (such as conversation records), voice, etc. The medical intelligent agent can be an auxiliary medical intelligent agent for medical consultation, medical recommendation, etc. It can be various software, hardware, hardware and software combined products, such as multi-modal large models (large language models capable of processing multi-modal information, one kind of large model), medical large models (such as large language models trained for medical question and answer fields with medical knowledge, etc. Large models applied in the medical field), auxiliary medical robots, etc. Taking the multi-modal large model as an example, it can be a large language model trained by containing multi-modal information and medical labels (containing at least one of treatment plans and drug use recommendations). By using the trained multi-modal large model as a medical intelligent agent to process the multi-modal information input by the first user, the first user can be provided with the current drug use recommendation by the multi-modal large model, i.e. the first drug use recommendation. According to the description in the foregoing, the first drug use recommendation can be a drug use recommendation provided to the first user, or an intermediate drug use recommendation generated before the drug use recommendation is provided to the first user, which is not limited here.

[0039] In other optional embodiments, the first drug use recommendation can also be determined based on the information input by the first user, such as the first user input consultation question containing "I have ***** disease, take ******* all the year round, and now how about taking omeprazole for stomach acid", etc.

[0040] In other embodiments, it can also be a drug use recommendation obtained in other ways, which is not described here. Analyzing the first drug use recommendation can identify key drug information in the first drug use recommendation, which at least includes the name of the drug.

[0041] Generally, a drug name is a unique drug identifier, in other words, a drug name is the basic information to identify a drug, and its ingredients and effects are usually determined, otherwise it may cause misuse when buying medicine, resulting in serious consequences, for example, referring to "Melin", it usually refers to the antipyretic drug containing ibuprofen.

[0042] The extraction of drug names can be performed by a natural language processing model (such as a large language model) or predetermined rules. The predetermined rules are, for example, by matching keywords or sentence patterns. The sentence patterns in which the drug name appears may include, but are not limited to, the following: eat, take, oral, injection, try, etc. In these sentence patterns, the object after the verbs "eat, take, oral, register, try" is usually the drug name.

[0043] In optional embodiments, the drug use suggestion is parsed, and not only the drug name but also the drug use matter is extracted. The drug use matter may include, but is not limited to, at least one of the following: dosage, frequency, course of treatment, route of administration, etc. Among them, the dosage is usually the amount of a single dose, such as 10 milliliters of oral liquid, 3 tablets, etc., the frequency can be the frequency of taking, such as three times a day, the course of treatment can be the length of a course of treatment (such as 7 days), the number of courses of treatment, etc., and the route of administration is, for example, oral, injection, etc.

[0044] Similar to the drug name, the extraction of the drug use matter can be performed by a natural language processing model (such as a large language model) or predetermined rules. Among them, the way of performing by predetermined rules is, for example, matching predetermined sentence patterns or predetermined keywords. In the drug use matter, the keywords corresponding to the dosage are, for example, each time ( / time), the keywords corresponding to the frequency are, for example, each day (times / day), each day (times / day), and each hour (times / hour), the keywords corresponding to the course of treatment are the course of treatment, and the keywords of the route of administration include oral, injection, application, and anal plug, etc.

[0045] In the case of using a large language model for parsing, the first drug use suggestion can be used as a prompt information, and an information extraction task is given, and a small amount of examples of extracting effective information (drug name, or drug name and drug use matter) from the drug use suggestion are given, and the large language model is called to extract the relevant information from the first drug use suggestion. The design of the prompt information and the specific large language model are related, and will not be described here.

[0046] Next, in step 202, the drug name is aligned with the standard drug name in the drug knowledge base to obtain the standard drug name corresponding to the drug name.

[0047] It is easy to understand that a single drug name can correspond to one drug or a combination of multiple drugs (drug refers to the active ingredient constituting the drug in the specification), while different brands of a drug may have different names in the naming habit, such as drug names "Tylenol" and "Pertussin", the active ingredient of which is "acetaminophen", and the efficacy is exactly the same, drug names "Advil" and "Motrin", the active ingredient of which is "ibuprofen", and the efficacy is the same, "*** sustained-release tablets" and "*** capsules" have the same active ingredient and the same efficacy, and so on.

[0048] In order to avoid the use of different drug names for the same drug, data redundancy, and collection omission, the drug name can be aligned with the standard drug name in the drug knowledge base, or in other words, the drug name in the first drug use suggestion can be standardized. Among them, the standard drug name in the drug knowledge base can be the name obtained by removing the morphological description such as "tablet", "capsule" and the like from the drug ingredient and drug name. The alignment of the drug name and the standard drug name in the drug knowledge base can be performed through a predetermined alignment approach.

[0049] The predetermined alignment approach of the drug name and the standard drug name can include but is not limited to at least one of the following: alignment through vector retrieval, alignment according to edit distance, alignment by querying an alias dictionary, and the like. Using various alignment approaches can recall the standard drug name in the standard drug knowledge base. The following describes various alignment approaches taking an arbitrary first drug name as an example.

[0050] It can be understood that vector retrieval is usually performed through semantic vectors. For the first drug name, semantic embedding can be performed to obtain a corresponding first semantic embedding vector. Each standard drug name in the drug knowledge base can also correspond to a reference semantic embedding vector obtained by pre-semantic embedding. The vector similarity of the first semantic embedding vector and each reference semantic embedding vector is calculated, and a plurality of standard drug names are recalled according to the vector similarity of the first drug name. For example, each standard drug name with a vector similarity greater than a predetermined similarity threshold with the first drug name is recalled, or a predetermined number (such as 10) of standard drug names with the largest vector similarity with the first drug name are recalled.

[0051] The edit distance (Edit Distance, such as Levenshtein Distance) describes the minimum number of editing operations required to convert one string to another, and the allowed editing operations are, for example, replacing one character with another character, inserting a character, and deleting a character. One measure of edit distance is: , wherein sum refers to the sum of the lengths of string 1 (e.g., a drug name A) and string 2 (e.g., a standard drug name B), is the class edit distance. In the determination of the class edit distance, deletion and insertion are each increased by 1, and replacement is increased by 2. The greater the class edit distance, the more modifications, the smaller the edit distance index r, and thus the first drug name can be recalled to the standard drug name with an edit distance index r less than a predetermined index threshold, or the predetermined number (e.g., 10) of standard drug names with the smallest edit distance index r. The purpose of the edit distance is more spelling correction.

[0052] The way of querying the alias dictionary alignment is usually string matching. The alias dictionary can include various aliases of standard drug names, such as the aliases of Sanqi (Panax notoginseng) including Tianqi, Jinbuhuan, Xuesheng, Diannianqi, Panlongqi, Hou Sanqi, Shanjia, Shansanqi, etc., and the aliases of Yuanhu (Corydalis tuber) including Yanhusuo, Xuanyuhuo, Yuanhuhuo, etc. Different drug names can use different medicinal material names, such as Sanqi tablets, Tianqi powder, Jinbuhuan capsules, etc. By querying in the alias dictionary, it can be determined whether the first drug name is an alias of a standard drug name. In the case of yes, the corresponding standard drug name can be recalled.

[0053] In practice, the drug name can also be recalled through other recall approaches, which will not be described here.

[0054] To avoid omission, in an optional implementation, for any first drug name, the standard drug name can be recalled through multiple alignment approaches to obtain several candidate drug names, and then a pre-trained scoring model is used to score the several candidate drug names, so as to determine the first standard drug name corresponding to the first drug name. The scoring model here can be a large language model, or a pre-trained classification model, prediction model, which discriminates the recall results to determine the most matched (e.g., with the highest scoring score) standard drug name for alignment. In an optional embodiment, the standard drug name aligned with the first drug name corresponds to a scoring score higher than a predetermined threshold, such as 0.6. This is to avoid the case that the candidate drug name and the first drug name have low matching degree, and the first drug name is aligned with the standard drug name that does not match.

[0055] Considering that different approaches to aligning to the standard drug name can obtain the same candidate drug name, in an embodiment, before scoring by the scoring model, the drug names recalled by various approaches can also be deduplicated.

[0056] It can be understood that the drug in the drug recommendation can also be a compound drug. The so-called compound drug can be a preparation prepared by mixing two or more drugs, for example, compound liquorice tablets, compound methoxy gelatin capsules, etc. The determination method of the compound drug is, for example: detecting a predetermined keyword representing a compound drug, such as “compound” and the like, in the first drug name; and failing to retrieve the standard drug name corresponding to the first drug name from the standard drug name in the drug knowledge base, such as failing to obtain an alternative drug name meeting the corresponding condition through various alignment approaches, or the scoring value of the obtained alternative drug name is lower than the predetermined threshold value through the scoring model.

[0057] According to one possible design, for a compound drug, various effective components therein can be identified, and each effective component is aligned with a standard drug name in the drug knowledge base according to the predetermined alignment approach described above. In the case where the first drug name is a compound drug, each standard drug name obtained by alignment can be attributed to the first standard drug name corresponding to the first drug name. The method of identifying the effective components of the drug corresponding to the first drug name is to parse and extract a plurality of effective components (such as the effective components contained in the drug name) from the first drug name, and / or retrieve the corresponding drug description information to obtain the effective components. The drug description information here is, for example, the component description information stored in advance in the drug library constructed in advance or the description obtained by searching the network. In the case where the drug use matters are also obtained, the drug use matters of a single effective component are consistent with the original compound drug.

[0058] In this way, the compound drug is disassembled, so that each effective component can be effectively utilized to mine the possible risks thereof.

[0059] Further, in step 203, a first information graph for the first user is constructed.

[0060] The first information graph here can be regarded as a small relationship network, which can include various entities and the association relationship therebetween, and the association relationship can be identified by an association edge. The entities included in the first information graph can include the first user, the disease entity, and the drug entity (described by the standard drug name).

[0061] The disease entity can be obtained from the health portrait information of the first user. The health portrait information of the first user can be information describing the image, appeal, etc. of the user from multiple dimensions. The user portrait dimensions are different in various scenarios. Here, the information dimensions describing the health portrait of the user can include, but are not limited to, at least one of the following: age, gender, disease, medical history, population type, allergy history, smoking and drinking history, current medication (such as drugs already taken), and the like. In some cases, the current medication can also include the medication information such as the drug already taken and the dosage, frequency, etc. Alternatively, at least one of the following can be extracted from the health portrait information of the first user: gender, age, population type (for example, at least one of children, pregnant women, the elderly, and chronic disease patients), past diseases, allergic drugs, whether to smoke and drink, other drugs currently used, and the like. For a composite drug, there can be a corresponding drug entity for each standard drug name. In addition, the first information graph can also include drug entities (described by drug names such as the first drug name), symptom entities, etc. For example Figure 3 The information graph includes the following entities: the questioner (such as the first user), hypertension (disease entity), the elderly (population type), ibuprofen capsules (drug entity), warfarin (drug entity), ibuprofen (drug entity), and the like.

[0062] The user portrait information can be constructed based on the first multi-modal information describing the first user (such as the multi-modal information used to generate the first user suggestion as described above). The first multi-modal information can include, but is not limited to, at least one of the following: medical images, examination report pictures (examination conditions, analysis conclusions, etc. provided by doctors, which can be obtained by OCR recognition), historical dialogues (in text form), user health records (in picture or text form, such as health records provided by hospitals for users or health questionnaires filled out by users on the current platform), and the like.

[0063] The process of extracting entities from user health portrait information can be performed by predetermined rules or by natural language processing models (such as large language models). The disease entity can be determined by the disease input by the user, the disease involved in the examination report, or the disease with a higher probability predicted from the first multi-modal information. Disease prediction can be performed by a large language model or other prediction models.

[0064] For the extracted entities, relationships between them can also be detected. For example, the detection of relationships between diseases or symptoms and drugs can be performed using a large language model. In an optional implementation, relationship and entity detection can be performed together in a single call to the large language model. In this case, the following information can be provided to the large language model as prompts: the user's health profile information, aligned standard drug names, entity and relationship extraction tasks, and a small number of examples described by text and the extracted entities and relationships. The types of relationships between entities can be predefined, such as the relationship between a user and a disease being "has," and the relationship between a disease and a drug being "treats," "relieves," etc.

[0065] Then, in step 204, based on the first information graph, a graph search is performed in the medication knowledge graph to determine whether the first medication recommendation has any risks.

[0066] Graph retrieval is a technique for efficiently finding, matching, or analyzing information from graph-structured data. It is widely used in fields such as social networks, chemical molecular structures, knowledge graphs, and recommender systems. Its core objective is to quickly locate the desired information using the features of the graph structure (nodes, edges, subgraphs, paths, etc.).

[0067] Under the technical concept described in this specification, a drug use knowledge graph can be constructed using medical background knowledge. The drug use knowledge graph can at least include the following entities: disease entities, drug entities, and the edges between them (describing the relationships between entities). Drug entities can be described using standard drug names. The knowledge graph construction process can be carried out using various techniques in this field, and is not limited here. The drug use knowledge graph can contain rich medical knowledge (including knowledge of drug use risks), such as drug interactions (antagonism, toxicity, etc.), knowledge of the treatment, hindrance, induction, and contraindications between drugs and diseases, and knowledge of contraindications between drugs and population types (such as children, pregnant women, etc.), etc.

[0068] In relational networks or knowledge graphs, paths can be formed by entities moving along connecting edges. Under the technical concept of this specification, the first information graph is simpler and smaller than a medication knowledge graph, and is a personalized relational network for the first user, which can be used as a temporary relational network in the current process. For example... Figure 3As shown, the first information graph can contain multiple paths. These paths are disease information relationship graphs constructed based on the information corresponding to the first user. However, various relationships such as drug interactions, risk relationships between drugs and diseases, and contraindications between drugs and populations may not be reflected in the first information graph and require strong medical background knowledge as support. Therefore, entity matching can be used to map entities in the first information graph to target entities in a pre-constructed medication knowledge graph. Then, graph retrieval can be performed based on the target entities to determine whether medication risks exist in the first information graph.

[0069] The matching process between entities in the first information graph and entities in the medication knowledge graph can be performed through character matching, which will not be elaborated here. When a common entity is matched, a mapping relationship can be established between the entities in the first information graph and the target entity in the medication knowledge graph. Thus, for the target entity in the medication knowledge graph, graph retrieval and other methods can be used to determine whether the first medication recommendation carries a risk, based on the target entity's relevant risk knowledge and the first information graph. Typically, obtaining the first medication recommendation carries a risk, which may include situations that are harmful to the user's health.

[0070] In some optional implementations, the relevant risk knowledge includes risk association edges between target entities that indicate contraindications or harmful effects. Risk association edges can be, for example, edges describing a harmful health interaction between two drugs (connecting drug entities), edges describing a drug as a contraindication to a disease (connecting drug and disease entities), edges describing a drug posing a risk to a population type (connecting drug and population type entities), and so on. Association edges containing risk knowledge can be predefined or left undefined. Optionally, risk paths in the medication knowledge graph can be pre-labeled. In this case, it is only necessary to detect whether a risk path exists between target entities.

[0071] The first medication recommendation may only describe adding medications, or it may describe adding or removing medications, such as discontinuing medication A and taking medication B. Therefore, when constructing the first information graph, there may be entities that do not simultaneously affect the first user. For example, the medication entity corresponding to medication A and the medication entity corresponding to medication B may not simultaneously affect the first user. For the first entity (e.g., the added medication B) and the second entity (e.g., the added medication C) in the first information graph that simultaneously affect the first user, if there is a risk-related edge between the mapped first target entity and the second target entity, then the first medication recommendation is determined to have a risk.

[0072] In some alternative implementations, the relevant risk knowledge includes medication description information recorded in the attribute information of the drug entity, including safe medication rules and / or risk medication rules. Safe medication rules and / or risk medication rules are, for example, related to dosage. Safe medication rules describe how the corresponding drug is used safely, such as no more than 12 tablets per day, while risk medication rules describe how the corresponding drug is used with risks, such as exceeding 20 mg posing a risk. In this case, for the first entity identified by the first standard drug name in the first information graph, a corresponding medication description can be obtained from the first medication recommendation, denoted as the first medication description, which may include at least one of dosage, frequency, course of treatment, etc. The system checks whether the first medication description conforms to the safe medication rules and / or risk medication rules of the target drug entity mapped from the first entity to the medication knowledge graph. If the first medication description does not conform to the safe medication rules of the target drug entity mapped from the first entity, and / or conforms to the risk medication rules of the target drug entity, it is determined that the first medication recommendation has a risk. If the first medication description conforms to the safe medication rules of the target drug entity mapped by the first entity, and / or does not conform to the risk medication rules of the target drug entity, the first medication recommendation is determined to be safe.

[0073] As an example, see reference Figure 3 The image shows a specific example of a first information graph. Assuming that based on entity matching in the first information graph and the drug knowledge graph, the detected target entities include "ibuprofen" and "warfarin," a mapping relationship can be established between these two entities and their corresponding entities in the drug knowledge graph. Thus, graph retrieval can be performed in the drug knowledge graph. For example, if a relationship is found between these two drug entities, specifically an edge indicating "high-risk interaction" with a note indicating "bleeding risk," this is a risky relationship edge. In other words, a risky path exists in the first information graph. Figure 3 The area is circled in dashed circles. Therefore, it can be determined that the corresponding medication recommendations carry a risk.

[0074] Based on this, the risk assessment results can be displayed to users, or the primary medication recommendation can be revised according to the risk assessment results, which will not be elaborated here.

[0075] To further clarify the technical solutions in this specification Figure 4 A more specific application example is shown. For example... Figure 4As shown, for a specific user, such as the first user mentioned earlier, two types of information are obtained: user profile information and current medication recommendations. This includes retrieving at least one item from historical conversations, hospital examination reports, health records, etc., and organizing it into the user's health profile information. The health profile information may include items such as gender, age, population type, past illnesses, allergy history, and medication history. For the current medication recommendations, medication events can be extracted and formatted (stored according to a predetermined format). Formatted medication events may include drug names and medication details, such as dosage, frequency, and course of treatment. The drug names in the medication events can be aligned with standard drug names. This alignment process is performed through various methods, including alignment via vector retrieval, alignment based on edit distance, and alignment by querying an alias dictionary. It is worth noting that for compound drugs (containing two or more drugs as active ingredients), each active ingredient can be broken down and aligned with the standard drug name. The standard drug names recalled through various channels are identified or sorted (usually for the same drug) to determine the standard drug names corresponding to the final number of effective drugs.

[0076] Based on the aligned standard drug names and user health profile information, entities and their relationships can be extracted to construct a medication information graph (as described in the first information graph above). Based on this graph, entities can be matched with entities in a pre-constructed medication knowledge graph, thus establishing a mapping between common entities in the relevant information graph and the medication knowledge graph. These common entities can be denoted as target entities in the medication knowledge graph. Graph retrieval is then performed on the target entities within the medication knowledge graph to determine the presence of risk, thereby assessing the risk level of the current medication recommendation.

[0077] To review the above process, in order to detect the safety of medication recommendations, the drug names can be obtained and then aligned with standard drug names in a drug knowledge base. Next, using user profile information and the aligned standard drug names, an information graph is constructed that includes at least disease entities, drug entities, and the relationships between them. Based on this information graph, graph retrieval is performed in a pre-constructed medication knowledge graph. Utilizing the rich knowledge of drug use risks contained in the medication knowledge graph, it can be determined whether the medication recommendation carries any safety risks. In this way, the text of the medication recommendation can be transformed into a graph structure for graph computation. During the drug recall process, multiple recall strategies can be used to reduce missed concept recall, thereby facilitating the identification of medication risks in complex scenarios.

[0078] According to another embodiment, a device for detecting drug safety is also provided, which can be installed in a computer, device, or server with a certain computing power. Figure 5A drug safety detection device 500 according to one embodiment is shown. Figure 5 As shown, the medication safety detection device 500 may include: an acquisition unit 501, configured to acquire drug names from a first medication recommendation for a first user, the first medication recommendation being generated by a large model; an alignment unit 502, configured to align the drug names with standard drug names in a drug knowledge base to obtain the standard drug names corresponding to the drug names; a construction unit 503, configured to construct a first information graph for the first user, including drug entities identified by standard drug names, disease entities acquired from the first user's health profile information, and the relationships between entities; and a determination unit 504, configured to perform graph retrieval in a medication knowledge graph based on the first information graph to determine whether the first medication recommendation carries a risk, wherein the medication knowledge graph contains risk knowledge about drug use.

[0079] It is worth noting that, Figure 5 The device 500 shown is Figure 2 The method embodiment shown corresponds to this, therefore, Figure 2 The corresponding descriptions in the method embodiments can also be applied to... Figure 5 The device 500 shown will not be described in detail here.

[0080] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 2 The methods described above.

[0081] According to another embodiment, a computing device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 2 The methods described above.

[0082] Those skilled in the art will recognize that the functions described in the embodiments of this specification in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0083] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the technical concept in this specification. It should be understood that the above description is only a specific embodiment of the technical concept in this specification and is not intended to limit the scope of protection of the technical concept in this specification. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments in this specification should be included within the scope of protection of the technical concept in this specification.

Claims

1. A method for detecting the safety of medication, comprising: The drug name is obtained from the first medication recommendation for the first user, which is generated by a large model; Align the drug name with the standard drug name in the drug knowledge base to obtain the standard drug name corresponding to the drug name; Construct a first information graph for the first user, including each drug entity identified by the standard drug name, disease entities obtained from the first user's health profile information, and the relationships between the entities; Based on the first information graph, a graph search is performed in the medication knowledge graph to determine whether the first medication recommendation has any risks, wherein the medication knowledge graph contains knowledge about the risks of drug use.

2. The method as described in claim 1, further comprising aligning each drug name with the standard drug name in the drug knowledge base based on multiple alignment methods, specifically including: For any given first drug name, standard drug names are recalled through multiple alignment methods to obtain several alternative drug names; The first standard drug name corresponding to the first drug name is determined by scoring the candidate drug names using a pre-trained scoring model.

3. The method as described in claim 2, wherein, Each drug name includes the primary drug name; each drug name is aligned with the standard drug names in the drug knowledge base based on multiple alignment methods, including at least one of the following: Alignment is achieved through vector retrieval, including: calculating the vector similarity between the first semantic embedding vector corresponding to the first drug name and the reference semantic embedding vector corresponding to the standard drug name in the drug knowledge base, and recalling several standard drug names according to the size of the vector similarity with the first drug name. Alignment is performed based on edit distance, including: for the first drug name, calculating its edit distance with the standard drug names in the drug knowledge base, and recalling a number of standard drug names according to the size of the edit distance; Alignment is performed by querying an alias dictionary, which includes: for the first drug name, if it is detected as an alias of any standard drug name, recalling the corresponding standard drug name.

4. The method of claim 1, wherein, A medication knowledge graph should include at least the following entities and the edges connecting them: drug entities identified by standard drug names, and disease entities; Graph retrieval is performed within the medication knowledge graph to determine whether the first medication recommendation carries any risk, including: Map each entity in the first information graph to the target entity in the medication knowledge graph; Based on the associated edges and / or attribute information of the target entity, relevant risk knowledge is obtained; Based on the relevant risk knowledge and the first infographic, determine whether the first medication recommendation carries any risk.

5. The method of claim 4, wherein, The relevant risk knowledge includes risk association edges between target entities that indicate taboos or harmful effects; Based on the relevant risk knowledge and the first infographic, determine whether the first medication recommendation carries any risk, including: For the first entity and the second entity that simultaneously act on the first user in the first information graph, if there is a risk-related edge between the mapped first target entity and the second target entity, then it is determined that the first medication recommendation has a risk.

6. The method of claim 5, wherein, The risk association edges include a first association edge representing a contraindication relationship between a drug entity and a disease entity; and / or a second association edge representing a health-harming interaction relationship between two drug entities.

7. The method of claim 4, wherein, The relevant risk knowledge includes medication description information recorded in the attribute information of the drug entity, including safe medication rules and / or risky medication rules; Based on the relevant risk knowledge and the first infographic, determine whether the first medication recommendation carries any risk, including: For the first entity identified by the first standard drug name in the first information graph, obtain the corresponding first medication description, which is extracted from the first medication recommendation; If the first medication description does not conform to the safe medication rules of the target drug entity mapped by the first entity, and / or conforms to the risk medication rules of the target drug entity, it is determined that the first medication recommendation has a risk.

8. The method according to claim 7, wherein, The medication description information includes medication rules for at least one of the following: dosage, frequency, course of treatment, and route of administration.

9. The method of claim 1, wherein, The entities in the first infographic also include at least one of the following: gender, age, population type, medical history, allergy history, smoking and drinking history, and other medications currently in use.

10. The method of claim 1, wherein, The alignment of drug names with standard drug names in the drug knowledge base includes: In response to confirming that the first drug name obtained from the first medication recommendation is the name of a compound drug, multiple active ingredients corresponding to the first drug name are obtained; Each active ingredient is aligned with the standard drug name in the drug knowledge base to obtain the standard drug name corresponding to each active ingredient, and then classified into the first standard drug name corresponding to the first drug name.

11. The method of claim 10, wherein, The name of the first drug is confirmed to be the name of a compound drug, including: The first drug name contains a predetermined keyword characterizing the compound drug; or, The standard drug name corresponding to the first drug name cannot be retrieved from the standard drug names in the drug knowledge base.

12. The method of claim 10, wherein, Obtain multiple active ingredients corresponding to the name of the first drug, including: Extract several active ingredients from the first drug name; and / or, The drug description information corresponding to the first drug name is retrieved, and several active ingredients are extracted from the drug description information.

13. A device for detecting the safety of medication use, comprising: The acquisition unit is configured to acquire the drug name from the first medication recommendation for the first user, wherein the first medication recommendation is generated by a large model; The alignment unit is configured to align the drug name with the standard drug name in the drug knowledge base to obtain the standard drug name corresponding to the drug name. The construction unit is configured to construct a first information graph for a first user, including drug entities identified by the standard drug names, disease entities obtained from the health profile information of the first user, and the relationships between the entities. The determining unit is configured to perform graph retrieval in the medication knowledge graph based on the first information graph to determine whether the first medication recommendation has any risks, wherein the medication knowledge graph contains risk knowledge of drug use.

14. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-12.

15. A computing device, comprising a memory and a processor, characterized in that, The memory stores executable code, and when the processor executes the executable code, it implements the method of any one of claims 1-12.

Citation Information

Patent Citations

  • Clinical medication risk assessment method and system based on mapping knowledge domain

    CN114005507A

  • Medical LLM model reasoning method and device based on knowledge graph

    CN118195011A

  • Drug safety large model method and system based on medical knowledge graph

    CN119541902A

  • Intelligent integrated dispensing method and system

    CN121281736A

  • Medication guidance system and method based on knowledge graph and vector retrieval fusion

    CN121388238A