Multi-drug sharing query method, mobile terminal and storage medium
By constructing and segmenting query graphs in the knowledge graph, we solve the problem of complex queries in scenarios where elderly patients have multiple coexisting diseases and share multiple drugs, achieve efficient management and query of massive disease drug data, and provide more accurate medication plans. .
Patent Information
- Application Number
- CN202010474272.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-29
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-05-29
AI Technical Summary
Elderly patients have a high risk of adverse reactions due to the coexistence of multiple chronic diseases, resulting in a high risk of adverse reactions when multiple drugs are shared. It is difficult to effectively analyze and manage the impact between complex drugs and diseases using existing technology.
By constructing a query graph and dividing it into multiple query subgraphs, the query is performed in the knowledge graph, and the query plan is determined using the processing cost of the query subgraph, thereby improving query efficiency and achieving rapid management and query of massive disease drug data.
It effectively solves the problem of large-scale, multi-attribute, uncertain and fast query of different data types in elderly patients with coexisting diseases and multi-drug sharing scenarios, improves query processing efficiency, and provides more accurate and safe medication plans.
Smart Images

Figure CN113742443B
Abstract
Description
Technical Field
[0001] The present application relates to the field of medical technology, and in particular to a multi-drug sharing query method, a mobile terminal and a storage medium. Background Art
[0002] Elderly patients often suffer from multiple chronic diseases at the same time, so they need to use multiple drugs for treatment at the same time. When patients take medication on their own and take medication under the guidance of different doctors, they may experience adverse reactions caused by the use of multiple drugs because they do not understand the impact of each drug on the disease. Comprehensive analysis of the use of multiple drugs in elderly patients has become an urgent problem to be solved. Summary of the invention
[0003] In view of this, embodiments of the present application provide a multi-drug sharing query method, a mobile terminal, and a computer-readable storage medium.
[0004] The present application provides a multi-drug sharing query method, the multi-drug sharing query method comprising:
[0005] Construct a query graph based on query conditions;
[0006] Splitting the query graph to obtain a plurality of query subgraphs; and
[0007] A query is performed in the knowledge graph according to the multiple query subgraphs and a medication query result is returned.
[0008] In some embodiments, the query condition includes drug information and disease information, and the step of constructing a query graph according to the query condition includes:
[0009] The query graph is constructed according to the drug information and the disease information.
[0010] In some embodiments, the step of splitting the query graph to obtain a plurality of query subgraphs includes:
[0011] Select the central query node;
[0012] The central query node and the query nodes adjacent to the central query node are divided into a query subgraph.
[0013] In some embodiments, the step of querying in the knowledge graph according to the multiple query subgraphs and returning medication query results includes:
[0014] The processing cost of the query subgraph in the search space is calculated to determine a query plan for the query graph.
[0015] In some embodiments, the step of calculating the processing cost of the query subgraph in the search space to determine the query plan of the query graph includes:
[0016] Calculating the query cost of each to-be-queried node in the query subgraph;
[0017] Calculating the connection cost of each query node in the query subgraph according to the query cost to determine the processing cost;
[0018] The query plan is determined according to the sorting results of the processing costs of the plurality of query subgraphs.
[0019] In some embodiments, the step of calculating the processing cost of the query subgraph in the search space to determine the query plan of the query graph includes:
[0020] A predicate inverted index of the nodes of the knowledge graph is established to compress the search space.
[0021] In some embodiments, the step of establishing an inverted index of predicates of nodes of the knowledge graph to compress the search space includes:
[0022] The search space is compressed based on the result of matching the incoming and / or outgoing predicate structures of the query nodes in the query graph with the predicate inverted index of the nodes of the knowledge graph.
[0023] In some embodiments, the step of calculating the processing cost of the query subgraph in the search space to determine the query plan of the query graph includes:
[0024] The query order of the query subgraph is determined according to the query plan.
[0025] In some implementations, the step of determining the query order of the query subgraph according to the query plan includes:
[0026] Sort the number of nodes in the query graph whose predicate structures are consistent among the query nodes in the current query subgraph;
[0027] The query order of the query nodes is determined according to the sorting result.
[0028] In some implementations, the step of determining the query order of the query nodes according to the sorting result includes:
[0029] Acquire matching nodes of the query node and associated nodes of the matching node in the search space according to the query order of the query node and store them in a result set;
[0030] The result set is returned as the medication query result.
[0031] In certain embodiments, the step of returning the result set as the medication query result includes:
[0032] The result set is filtered to obtain accurate query results.
[0033] In some implementations, the step of filtering the result set to obtain accurate query results includes:
[0034] Duplicate nodes in the result set are filtered according to the knowledge graph and the query graph to obtain accurate query results.
[0035] The present application provides a mobile terminal, comprising one or more processors, a memory; and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the programs include instructions for executing the multi-drug sharing query method as described above.
[0036] The present application provides a non-volatile computer-readable storage medium containing computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the processors execute the multi-drug common query method.
[0037] In the multi-drug sharing query method, mobile terminal and computer-readable storage medium of the implementation mode of the present application, massive disease drug data and the complex relationships between them are managed by means of a knowledge graph, query conditions are constructed into a query graph, and the query graph is used to search in the data graph of the knowledge graph, effectively solving the problems that may be faced in the scenario of complex co-existence of multiple diseases and multi-drug sharing in elderly patients, and improving the efficiency of query processing by dividing the query graph into query subgraphs. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0039] Figure 1 It is a flowchart of a multi-drug sharing query method according to certain embodiments of the present application.
[0040] Figure 2 It is a module schematic diagram of a multi-drug sharing query device according to certain embodiments of the present application.
[0041] Figure 3 It is a schematic diagram of the knowledge graph of certain embodiments of the present application.
[0042] Figure 4 It is a flowchart of a multi-drug sharing query method according to certain embodiments of the present application.
[0043] Figure 5 It is a flowchart of a multi-drug sharing query method according to certain embodiments of the present application.
[0044] Figure 6 It is a flowchart of a multi-drug sharing query method according to certain embodiments of the present application.
[0045] Figure 7 It is a flowchart of a multi-drug sharing query method according to certain embodiments of the present application.
[0046] Figure 8 It is a flowchart of a multi-drug sharing query method according to certain embodiments of the present application.
[0047] Fig. 9 It is a flowchart of a multi-drug sharing query method according to certain embodiments of the present application.
[0048] Fig.10 This is a flow chart of a multi-drug sharing query method in certain embodiments of the present application.
[0049] Fig.11 It is a flowchart of a multi-drug sharing query method according to certain embodiments of the present application.
[0050] Fig.12 It is a flowchart of a multi-drug sharing query method according to certain embodiments of the present application.
[0051] Fig.13 It is an interactive schematic diagram of a multi-drug sharing query method according to certain embodiments of the present application. DETAILED DESCRIPTION
[0052] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0053] See also Figure 1 The present application provides a multi-drug sharing query method. It includes:
[0054] S10: construct a query graph according to the query conditions;
[0055] S20: Split the query graph to obtain multiple query subgraphs;
[0056] S30: Query the knowledge graph according to the multiple query subgraphs and return the medication query results.
[0057] See also Figure 2, the embodiment of the present application provides a mobile terminal. The mobile terminal includes a processor. The processor is used to construct a query graph according to the query conditions, and to split the query graph to obtain multiple query subgraphs, and to query in the knowledge graph according to the multiple query subgraphs and return the medication query results. The mobile terminal can be a consumer electronic device such as a mobile phone, a tablet computer, a personal computer, or an intelligent medical diagnostic device, which is not limited here.
[0058] See also Figure 2 The embodiment of the present application further provides a multi-drug sharing query device 110, and the multi-drug sharing query method of the embodiment of the present application can be implemented by the multi-drug sharing query device 110 of the embodiment of the present application.
[0059] Specifically, the multi-drug sharing query device 110 includes a query graph construction module 112, a segmentation module 114 and a query module 116. S10 can be implemented by the query graph construction module 112, S20 can be implemented by the segmentation module 114, and S30 can be implemented by the query module 116. In other words, the query graph construction module 112 is used to construct a query graph according to the query conditions. The segmentation module 114 is used to segment the query graph to obtain multiple query subgraphs. The query module 116 is used to query in the knowledge graph according to the multiple query subgraphs and return the medication query results.
[0060] In the multi-drug sharing query method, multi-drug sharing query device and mobile terminal of the implementation mode of the present application, massive disease drug data and the complexity between them are managed by means of knowledge graph, query conditions are constructed into a query graph, and the query graph is used to search in the data graph of the knowledge graph, effectively solving the problems that may be faced in the scenario of complex coexistence of multiple diseases and multi-drug sharing in elderly patients, and improving the efficiency of query processing by dividing the query graph into query sub-graphs.
[0061] Specifically, multi-drug use refers to the use of multiple drugs to treat one or more diseases for the same patient. In life, a considerable number of elderly patients have multiple, for example, 3 or more chronic diseases. Because each disease requires one or more drugs to treat, and because the treatment process of chronic diseases is long, the treatment effect is not obvious, and the recovery period is slow, therefore, during the medication process, elderly patients are more likely to experience fluctuations in their mental state, and may exhibit the following behaviors: collecting "folk remedies" and "ancestral secret recipes" for treating related diseases; following the propaganda of drug advertisements, or being influenced by fellow patients, friends or colleagues, not following the doctor's advice, blindly adding drugs, such as adding new drugs, traditional Chinese medicine, and over-the-counter drugs without understanding the pharmacology; buying health products without selection.
[0062] The above-mentioned blind use of multiple drugs by elderly patients is more likely to cause adverse drug reactions, which may be mistaken by doctors as new diseases, leading to new drugs being prescribed to treat the adverse reactions. In this way, many factors have led to a vicious cycle of drug use in elderly patients with chronic diseases, which is not conducive to the treatment of diseases and even harms the health of patients.
[0063] In addition, unreasonable polydrug use may be caused not only by improper patient management, but also by doctors' limited knowledge and other reasons, which may lead to unreasonable or erroneous medication guidance.
[0064] It is understandable that the analysis of multi-drug sharing involves complex relationship expressions such as disease-disease, disease-drug, drug-drug, drug-ingredient, etc. In the implementation mode of the present application, a knowledge graph can be constructed by domain experts and case data-driven, and these complex relationships can be managed and organized in the form of a graph. It is understandable that compared with paths and tree structures, graphs are more capable of expressing complex structural information, and are convenient for managing and expanding massive heterogeneous data. In this way, the problem of multi-drug sharing is converted into a problem of graph matching in the graph data of the knowledge graph. Relationship path analysis is quickly performed in the knowledge graph to help medical staff more clearly analyze the complex multi-drug sharing factors of elderly patients during medical treatment and life, more accurately deal with drug interactions and adverse reactions, and formulate effective, safe and personalized medication plans for elderly patients.
[0065] A large amount of disease, drug data and the complex relationships between diseases and drugs are managed and stored through knowledge graphs, and queries are performed in knowledge graphs using query graphs, which solves the problem of rapid query of large-scale, multi-attribute, uncertain and different data types faced in scenarios where elderly patients have complex coexistence of multiple diseases and use of multiple drugs.
[0066] It is understandable that the analysis of multi-drug sharing is not limited to whether there is a simple relationship between drugs, but also needs to comprehensively consider whether the drug path meets various rule constraints. In comparison, complex multi-attribute queries are more practical. For example: whether there are significant interactions between drugs, whether there are clinically significant drug-disease interactions, whether the drugs have indications, whether the drugs have contraindications, whether the drug dosage is correct, whether there is repeated use of drugs, whether the drug treatment time is reasonable, whether the selected drug is economical compared with equivalent alternative drugs, etc.
[0067] See also Figure 3In this embodiment, the disease-drug knowledge graph can be constructed by medical workers in various disease fields based on existing drug knowledge and experience and prior knowledge such as existing prescriptions as basic information. The knowledge graph can include the following knowledge relationships: the drug's own pharmacology, dosage, route of administration, mechanism of action, adverse reactions, uses, contraindications, etc., drug-drug mutual use, compatibility, etc., compatibility and contraindications between drugs and symptoms, correlation between symptoms and diseases, etc., adverse reactions between diseases and drugs, etc.
[0068] It should be noted that the knowledge relationship is not limited to the content disclosed in this embodiment, and the relationship between any drug and disease-related content can be expressed in the form of a graph.
[0069] By representing, managing and storing pharmaceutical knowledge in the form of graphs, it is easier to express complex relationships such as drug-ingredient, drug-drug, drug-indication, ingredient-adverse reaction, etc., and it is also easier to expand and integrate these knowledge graphs.
[0070] In this embodiment, the knowledge graph includes a data resource layer, a logical relationship layer, and a node method layer. Among them, the data resource layer includes clinical pathways, drug instructions, interactions and / or related educational resources. The logical layer integrates the data resource layer and empirical knowledge. The node display layer is used to display knowledge relationships in a graphical manner, and users can explore the knowledge network. The construction process of the knowledge graph generally includes the steps of knowledge representation, extraction, fusion, reasoning, and quality. The specific methods can refer to the relevant technologies for knowledge graph construction, which will not be repeated here.
[0071] In this embodiment, the data graph of the constructed pharmaceutical knowledge graph can be represented by the following relational expression:
[0072] G = (V, E, A, I);
[0073] Among them, V is the set of nodes in the data graph, E is the set of edges in the data graph, A is the set of multi-attribute values in the knowledge graph, that is, the label set of nodes and edges, A = (a1, a2, ..., an), ai is the i-th attribute, and I is the function process from E to A.
[0074] In actual operation, doctors or patients input drugs, and combine this information with information such as patient diseases and physical examinations obtained through hospital information systems or electronic medical records to build a query graph, and more comprehensive information can be obtained through knowledge graph queries.
[0075] In this application, the method of constructing a query graph to query in the knowledge graph is more efficient than extracting each single information of the patient to query in the knowledge graph. It is understandable that using a single information to query in the knowledge graph may obtain a large amount of information and contain redundant information that the patient does not need, but the redundant information cannot be screened, and manual identification and selection are still required, which poses risks. In addition, when querying, there is a lot of information about the patient that needs to be queried, and querying one by one takes a long time and is inefficient.
[0076] Among them, there are missing and / or unclear parts of the nodes and relationships in the query graph constructed according to the query conditions. By querying in the knowledge graph, the missing nodes and / or relationships can be completed first. If there are interactions between certain drugs in the completed graph structure, there will be corresponding directions between the nodes representing the drugs in the graph. In addition, it is also possible to perform specified relationship queries, such as querying specified interactions, adverse contraindications, and other relationships. In this way, the query result graph obtained is a more comprehensive and complete comprehensive analysis of the patient.
[0077] The process of medication query is actually the process of matching the query graph in the data graph. The subgraph in the data graph that matches the query graph structure is the result of the medication query.
[0078] Understandably, if the entire data graph is used as the search space, the data volume is large, the query speed is slow, and it is not conducive to quickly obtaining query results. Therefore, it is necessary to redefine the search range of the data, that is, the search space, or to compress the search space to a smaller size to make the query speed faster.
[0079] In addition, when there are many nodes in the query graph and the structure is complex, each query node in the query graph may have multiple matching nodes in the data graph, and it is cumbersome to match the query graph as a whole with the data graph. In this case, in this embodiment, the query graph is divided into multiple query subgraphs with simple structures, and the search space of each query subgraph is further narrowed by matching the query subgraph with the data graph.
[0080] See also Figure 4 In some embodiments, the query condition includes drug information and disease information, and S10 includes:
[0081] S11: Construct a query graph based on drug information and disease information.
[0082] In some embodiments, S11 may be implemented by the query graph construction module 112 , that is, the query graph construction module 114 may be used to construct a query graph based on the drug information and the disease information.
[0083] In certain embodiments, the processor is configured to construct a query graph based on the drug information and the disease information.
[0084] Specifically, in this embodiment, the query graph can be expressed by the following relational expression:
[0085] Q=(V Q ,E Q ,A,I Q ,vars);
[0086] Where: V Q represents the set of nodes in the query graph, represents the set of directed edges connecting two nodes, A is the set of labels of nodes and edges in the query graph, and I Q is the mapping function, and vars represents the set of variables in the graph.
[0087] In actual operation, the queryer, that is, the patient or doctor, inputs information such as the diseases he or she has and the drugs he or she is currently using. The processor constructs the query graph based on the input information, matches the query graph with the knowledge graph, and performs a query on multiple drugs. The input diseases and drugs can be used as nodes in the query graph, and drug-drug, drug-disease, disease-disease and other relationships can be used as edges in the query graph. Of course, the query graph can also be previously established and retrieved from the background after the user selects and inputs, which is not limited here.
[0088] See also Figure 5 In some embodiments, S20 includes:
[0089] S21: Select a central query node;
[0090] S22: Divide the central query node and the query nodes adjacent to the central query node into a query subgraph.
[0091] In some implementations, S21 and S22 may be implemented by the segmentation module 114, or in other words, the segmentation module 114 is used to select a central query node and to divide the central query node and the query nodes adjacent to the central query node into a query subgraph.
[0092] Specifically, the segmentation of the query subgraph needs to follow the principle of central covering nodes. Specifically, when a node has an out-degree and an in-degree, it can be considered that the node is a central query node, and the node and its adjacent nodes are divided into a query subgraph. If two adjacent nodes and the central query node form a closed graph, the query subgraph includes the graph. For example, for a node V, if the node V makes the edges from the node to other nodes in the query subgraph all in the query subgraph, node V is the central query node. It should be noted that during the segmentation process, any edge in the query graph must be covered by at least one query subgraph, and the central covering node is the central query node of the query subgraph, thereby ensuring that the segmented query subgraph can ensure that the entire query graph is covered.
[0093] In an example, there is a query graph including a series relationship V1→V2→V3→V4→V5. According to the above definition of the central query node, V2 and V4 are the central query nodes. Thus, the above query graph can be divided into subgraphs to obtain two query subgraphs V1→V2→V3 and V3→V4→V5.
[0094] Therefore, when splitting a complex query graph, the central query node set is first calculated by methods such as linear programming and dynamic programming, and then the central query node is selected and the adjacent nodes of the node are divided together to obtain a query subgraph.
[0095] In this way, after the query subgraph is split, the search space is changed from the nodes in the data graph corresponding to the query graph and the relationships between the nodes to the nodes in the data graph corresponding to the query subgraph and the relationships between the nodes, and the search space is compressed.
[0096] See also Figure 6 In some embodiments, S30 includes:
[0097] S31: Calculate the processing cost of the query subgraph in the search space to determine the query plan of the query graph.
[0098] In some implementations, S31 may be implemented by the query module 116 , that is, the query module 116 is used to calculate the processing cost of the query subgraph in the search space to determine the query plan of the query graph.
[0099] In some embodiments, the processor is configured to calculate a processing cost of a query subgraph in a search space to determine a query plan for the query graph.
[0100] It can be understood that after the query graph is divided into query subgraphs, the basic unit of processing cost is each query subgraph, and the efficiency of query subgraph matching will affect the overall efficiency of the query. For example, for a query graph, it contains 3 central query nodes and is divided into 3 query subgraphs. Therefore, there are 6 query orders for the query subgraphs, and the processing cost generated by each order is different.
[0101] See also Figure 7 In some embodiments, S31 includes:
[0102] S311: Calculate the query cost of each node to be queried in the query subgraph;
[0103] S312: Calculate the connection cost of each query node in the query subgraph according to the query cost to determine the processing cost;
[0104] S313: Determine a query plan according to the sorting results of the processing costs of the multiple query subgraphs.
[0105] In some embodiments, S311-S313 can be implemented by the query module 116, that is, the query module 116 is used to calculate the query cost of each node to be queried in the query subgraph, and to calculate the connection cost of each query node in the query subgraph based on the query cost to determine the processing cost, and to determine the query plan based on the sorting results of the processing costs of multiple query subgraphs.
[0106] In some embodiments, the processor is used to calculate the query cost of each node to be queried in the query subgraph, and to calculate the connection cost of each query node in the query subgraph based on the query cost to determine the processing cost, and to determine the query plan based on the sorting results of the processing costs of multiple query subgraphs.
[0107] Specifically, in the process of calculating the processing cost of the query subgraph, the cost of each node to be queried is first calculated. The cost of the node to be queried is the ratio of the number of nodes in the search space that match the query node to the total number of query nodes in the query subgraph where the query node is located.
[0108] Then, the connection cost of each node to be queried in the query subgraph is calculated, that is, the cost of a single node is multiplied or added, where the connection cost has an influence factor, and the influence factor can be set according to whether there are common nodes with other query subgraphs. In this way, the processing cost of the query subgraph is calculated, and the optimal query plan of the query graph can be further obtained.
[0109] After splitting the complex query graph into simple sub-query graphs, queries based on the relationship between nodes can be quickly matched in the data graph, thereby improving query efficiency.
[0110] Thus, the best query plan for the query graph can be obtained by calculating the processing cost of the query subgraph. For example, according to the calculated processing cost, the cost can be selected from low to high, that is, from easy to difficult for processing.
[0111] See also Figure 8 In some embodiments, S31 includes:
[0112] S314: Establish a predicate inverted index of the nodes of the knowledge graph to compress the search space.
[0113] In some implementations, S314 may be implemented by the query module 116. In other words, the query module 116 is used to establish a predicate inverted index of nodes of the knowledge graph to compress the search space.
[0114] In some embodiments, the processor is used to establish a predicate inverted index of nodes of the knowledge graph to compress the search space.
[0115] Specifically, since the predicate is a relation with directionality, there will be nodes with zero out-degree and zero in-degree in the knowledge graph. Therefore, considering the two cases of nodes as subjects and objects, the node inverted lists based on the incoming and outgoing predicate structures are respectively prepared. Based on the incoming and outgoing predicate structure lists, the query nodes in the query graph can be filtered, and finally the nodes that meet the same structure as the query graph are obtained. In one example, whether the structures of the nodes are the same can be determined by determining whether the incoming and outgoing predicate structures of the nodes are the same.
[0116] For example, for a data graph containing predicates p1, p2, and p3, and nodes v1-v18, according to the data graph structure, an inverted list of nodes based on the incoming and outgoing predicate structures is established:
[0117]
[0118] It is understandable that the nodes in the data graph and the relationships between the nodes are complex, and the number of predicates is smaller than the number of nodes, so an inverted list based on the predicate structure can be established. By establishing an inverted list, the node in the data graph corresponding to the predicate structure of the query node can be quickly located in the list, thereby compressing the search space.
[0119] Please refer to Fig. 9 In some embodiments, S314 includes:
[0120] S3141: Compress the search space based on the result of matching the incoming and / or outgoing predicate structure of the query node in the query graph with the predicate inverted index of the node of the knowledge graph.
[0121] In some embodiments, S3141 may be implemented by the query module 116. That is, the query module 116 is used to compress the search space based on the result of matching the incoming and / or outgoing predicate structure of the query node in the query graph with the predicate inverted index of the node of the knowledge graph.
[0122] In some embodiments, the processor is used to compress the search space based on the results of matching the incoming and / or outgoing predicate structures of the query nodes in the query graph with the predicate inverted index of the nodes of the knowledge graph.
[0123] Specifically, in one example, based on the incoming predicate structure, there is a predicate p in the data graph, and the corresponding node set is (v1, v2, v4, v8). Based on the outgoing predicate structure, there is a predicate p1 in the data graph, and the corresponding node set is (v1, v5, v6, v7, v8). Then, for a query node ? V in the query graph, which has an incoming predicate structure p and an outgoing predicate structure p1, the query node ? V can find the search space S1 (p1|v1, v5, v6, v7, v8) and the search space S2 (p|v1, v2, 4, v8) respectively. Combining S1 and S2 to compress the search space, the nodes that match the query node ? V are v1 and v8.
[0124] See also Fig.10 In some embodiments, S31 further includes:
[0125] S315: Determine the query order of the query subgraph according to the query plan.
[0126] In some implementations, S315 may be implemented by the query module 116. In other words, the query module 116 is used to determine the query order of the query subgraph according to the query plan.
[0127] In some embodiments, the processor is configured to determine a query order for querying the subgraphs according to a query plan.
[0128] Specifically, after determining the query plan, the query order can be obtained, and each query subgraph is queried in the search space according to the query order. In this embodiment, the query graph is divided into multiple query subgraphs. During the query process, the number of nodes and edges in each query subgraph can be sorted, and the query order can be determined according to the sorting result of the number.
[0129] In this way, executing queries according to the query order can ensure that the query actions comply with a certain logical order, so that the query results are returned quickly without duplication or omission.
[0130] See also Fig.11 In some embodiments, S315 further includes:
[0131] S3151: sorting the number of nodes with consistent predicate structures in the query graph among the query nodes in the current query subgraph;
[0132] S3152: Determine the query order of the query nodes according to the sorting result.
[0133] In some implementations, S33-S34 may be implemented by the query module 116. In other words, the query module 116 is used to sort the number of nodes in the query graph whose predicate structures are consistent among the query nodes in the current query subgraph, and to determine the query order of the query nodes according to the sorting result.
[0134] In some embodiments, the processor is used to sort the number of nodes in the query graph whose predicate structures are consistent among the query nodes in the current query subgraph, and to determine the query order of the query nodes according to the sorting result.
[0135] Specifically, after determining the query order of the query subgraph, it is also necessary to determine the query order of each query node in each query subgraph. In this embodiment, the query node with the least number of nodes that have consistent structures after predicate structure matching for each query node in the current query subgraph is used as the query node currently being processed. During the operation, the number of nodes with consistent structures for each query node can be sorted, and the query order of the query nodes can be determined according to the sorting result of the number of nodes with consistent structures, for example, from few to many. Of course, there can also be other query orders, which are not limited here.
[0136] See also Fig.12 In some embodiments, S3152 further includes:
[0137] S31521: Obtain matching nodes and predicate structures of the query nodes in the search space according to the query order of the query nodes and store them in a result set;
[0138] S31522: Return the result set as the medication query result.
[0139] In some embodiments, S35 and S36 may be implemented by the query module 116. In other words, the query module 116 is used to obtain matching nodes and associated nodes of the query node in the search space according to the query order of the query node and store them in a result set, and to return the result set as a medication query result.
[0140] In certain embodiments, the processor is used to obtain matching nodes and associated nodes of the query node in the search space according to the query order of the query node and store them in a result set, and to return the result set as a medication query result.
[0141] See also Fig.13 Specifically, in this embodiment, after determining the query subgraph and the query order of the query node, the matching node of the current query node can be obtained from the corresponding search space, that is, the node in the search space that is consistent with the predicate structure of the query node, and the matching node is stored in the result set. At the same time, the nodes associated with the predicate structure of the matching node are also put into the result set, thereby expanding the query graph.
[0142] It can be understood that information such as diseases and drugs can be regarded as nodes in the query subgraph, and the relationship between two nodes, such as the correlation between two drugs, the correlation between drugs and diseases, etc., can be regarded as the edge of the query subgraph, that is, the predicate structure. Finding matching nodes and associated nodes of query nodes in the search space can be regarded as the simple information such as diseases and drugs inputted in the knowledge graph, and improving the content related to the input information, that is, using a query subgraph with a simple structure to match the complex data graph content in the query graph, including returning more nodes and the expansion of associated nodes, so as to provide users with more comprehensive and accurate guidance.
[0143] During the query process, for each query node in the query subgraph, the matching nodes with consistent structure and the associated nodes of the matching nodes are obtained from the search space. The query results of each query subgraph are stored in the result set, so that the result set contains the matching nodes and associated nodes of each query node. The result set is returned to the inquirer as the final medication query result. Specifically, the processor can process the returned result set, draw a diagram of the graph structure corresponding to the result set according to the relationship between the node and the predicate, and display it to the inquirer. For example, the user enters disease 1, disease 2, drug 1, and drug 2. After the query, the contraindications of drug 2, the incompatibility between drug 1 and drug 2, drug 3 for treating disease 2, the interaction between drug 3 and drug 1, etc. are returned to provide users with more disease and medication information.
[0144] In certain embodiments, S31522 includes:
[0145] Filter the result set to obtain accurate query results.
[0146] In some implementations, this step may be implemented by the query module 116. In other words, the query module 116 is used to filter the result set to obtain accurate query results.
[0147] In some implementations, the processor is used to filter the result set to obtain accurate query results.
[0148] In such an embodiment, this step further comprises the sub-steps of:
[0149] Filter duplicate nodes in the result set based on the knowledge graph and query graph to obtain accurate query results.
[0150] In some embodiments, this sub-step may be implemented by the query module 116, or in other words, the query module 116 is used to filter duplicate nodes in the result set according to the knowledge graph and the query graph to obtain accurate query results.
[0151] In some embodiments, the processor is used to filter duplicate nodes in the result set based on the knowledge graph and the query graph to obtain accurate query results.
[0152] It is understandable that there may be redundant or duplicate nodes in the result set obtained by the above-mentioned query method. For example, when the query subgraph is divided, there may be multiple query subgraphs containing the same query node. Therefore, there may be redundant nodes in the result set. At this time, it is necessary to filter the result set to filter out these possible redundant or duplicate nodes from the result set, so as to obtain accurate query results. When filtering, the structure of the data graph and the query graph should be combined to ensure that the query results for each query node are complete and accurate without duplication or omission.
[0153] By dividing the query graph into subgraphs, the results that meet the query request can be quickly searched in the complex graph data through subgraph matching, which can make the response faster and more efficient without losing data information. In the scenario of elderly patients sharing medicines, the precision and recall rates will be greatly improved, and because the knowledge graph has semantics, attribute information and description logic, the query results can have a clear explanation and reasoning path.
[0154] The present application also provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, enable the processors to execute the multi-drug common query method of any of the above embodiments.
[0155] The present application also provides a mobile terminal. The mobile terminal includes one or more memories and one or more processors, and one or more programs are stored in the memories and configured to be executed by the one or more processors. The program includes a program for executing the multi-drug sharing query method described in any one of the above embodiments.
[0156] The processor can be used to provide computing and control capabilities to support the operation of the entire mobile terminal. The memory in the mobile terminal provides an environment for the computer-readable instructions in the memory to run.
[0157] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM), etc.
[0158] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A multi-drug sharing query method, characterized in that: The following steps are involved: Construct a query graph based on query conditions; Splitting the query graph to obtain a plurality of query subgraphs; and Searching in the knowledge graph according to the multiple query subgraphs and returning medication query results; The step of querying the knowledge graph according to the multiple query subgraphs and returning the medication query results includes: calculating the processing cost of the query subgraph in the search space to determine the query plan of the query graph; the step of calculating the processing cost of the query subgraph in the search space to determine the query plan of the query graph includes: calculating the query cost of each node to be queried in the query subgraph, the query cost being the ratio of the number of nodes matching the query node in the search space to the total number of query nodes in the query subgraph where the query node is located; calculating the connection cost of each query node in the query subgraph according to the query cost to determine the processing cost, the connection cost refers to the cost obtained by multiplying or adding the query costs of a single query node; determining the query plan according to the sorting results of the processing costs of multiple query subgraphs.
2. The multi-drug sharing query method according to claim 1, characterized in that: The query conditions include drug information and disease information, and the step of constructing a query graph according to the query conditions includes: The query graph is constructed according to the drug information and the disease information.
3. The multi-drug sharing query method according to claim 1, characterized in that: The step of dividing the query graph to obtain multiple query subgraphs includes: Select the central query node; The central query node and the query nodes adjacent to the central query node are divided into a query subgraph.
4. The multi-drug sharing query method according to claim 1, characterized in that: The step of calculating the processing cost of the query subgraph in the search space to determine the query plan of the query graph comprises: A predicate inverted index of the nodes of the knowledge graph is established to compress the search space.
5. The multi-drug sharing query method according to claim 4, characterized in that: The step of establishing an inverted index of predicates of nodes of the knowledge graph to compress the search space comprises: The search space is compressed based on the result of matching the incoming and / or outgoing predicate structures of the query nodes in the query graph with the predicate inverted index of the nodes of the knowledge graph.
6. The multi-drug sharing query method according to claim 1, characterized in that: The step of calculating the processing cost of the query subgraph in the search space to determine the query plan of the query graph comprises: The query order of the query subgraph is determined according to the query plan.
7. The multi-drug sharing query method according to claim 6, characterized in that: The step of determining the query order of the query subgraph according to the query plan comprises: Sort the number of nodes in the query graph whose predicate structures are consistent among the query nodes in the current query subgraph; The query order of the query nodes is determined according to the sorting result.
8. The multi-drug sharing query method according to claim 7, characterized in that: The step of determining the query order of the query nodes according to the sorting result comprises: Acquire matching nodes of the query node and associated nodes of the matching node in the search space according to the query order of the query node and store them in a result set; The result set is returned as the medication query result.
9. The multi-drug sharing query method according to claim 8, characterized in that: The step of returning the result set as the medication query result includes: The result set is filtered to obtain accurate query results.
10. The multi-drug sharing query method according to claim 9, characterized in that: The step of filtering the result set to obtain accurate query results includes: Duplicate nodes in the result set are filtered according to the knowledge graph and the query graph to obtain accurate query results.
11. A mobile terminal, characterized in that: include: One or more processors, memory; and One or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the programs include instructions for executing the multi-drug sharing query method according to any one of claims 1-10.
12. A non-volatile computer-readable storage medium of computer-executable instructions, characterized in that: When the computer executable instructions are executed by one or more processors, the processors are caused to execute the multi-drug sharing query method according to any one of claims 1 to 10.
