Traditional Chinese medicine diagnosis and treatment knowledge graph construction method and system based on knowledge reasoning
Through a knowledge-based reasoning method combined with statistics, machine learning and graph theory analysis, abnormal nodes in the TCM diagnosis and treatment knowledge graph are identified and the root cause node sorting is optimized, which solves the problems of complexity of TCM diagnosis and treatment data and uncertainty of causal relationships, realizes the systematization and automation of TCM diagnosis and treatment paths, and improves the accuracy and reliability of diagnosis and treatment.
Patent Information
- Application Number
- CN202510934859.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2025-10-17
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN120809268A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of traditional Chinese medicine diagnosis, and in particular to a traditional Chinese medicine diagnosis and treatment knowledge graph construction method and system based on knowledge reasoning. BACKGROUND
[0002] Traditional Chinese medicine diagnosis and treatment knowledge graph construction is to systematically collect data related to traditional Chinese medicine diagnosis and treatment, including symptoms, diseases, drugs, treatment methods, etc., to construct a graph of various nodes (such as symptom nodes, disease nodes, drug nodes, and treatment method nodes), and to assign attributes to each node and define the relationship between nodes. The nodes in the graph represent various entities in traditional Chinese medicine diagnosis and treatment, and the relationships between the nodes describe the interactions or dependencies between these entities. For example, the relationship between symptoms and diseases, the treatment relationship between drugs and diseases, etc. Through these relationships, a multi-dimensional structured data model can be formed to provide knowledge support for subsequent traditional Chinese medicine diagnosis and treatment decisions.
[0003] Traditional Chinese medicine diagnosis and treatment knowledge graph construction based on knowledge reasoning is to further analyze and reason the node relationships and data in the graph by combining reasoning methods such as causal reasoning, statistical analysis, and machine learning techniques, to identify potential root nodes, abnormal nodes, and optimize the relationships and ordering between nodes. Through these reasoning methods, implicit knowledge can be derived from large-scale traditional Chinese medicine diagnosis and treatment data to improve the accuracy and effectiveness of diagnosis and treatment paths.
[0004] In existing related technologies, for example, patent No. 201910362414.1 discloses a method and device for constructing a knowledge graph of traditional Chinese medicine experience data, which includes using Bayesian networks to mine the initial knowledge graph, obtaining direct and indirect relationships between diseases, symptoms, and syndromes, and medication rules, mapping the mining results to the initial knowledge graph, and obtaining an optimized knowledge graph.
[0005] However, the existing related technologies still have the following deficiencies:
[0006] (1) The diversity and complexity of traditional Chinese medicine diagnosis and treatment data may make data collection and organization more tedious, and the relationships between nodes may be ambiguous, requiring determination of how to define and assign attributes to nodes when constructing a knowledge graph.
[0007] (2) The accuracy and reliability of anomaly detection depend on the quality of data and the adaptability of algorithms, and in particular, how to accurately distinguish between normal and abnormal nodes in a complex traditional Chinese medicine knowledge graph is a technical challenge.
[0008] (3) In the construction of the knowledge graph, the causal relationship between nodes is not determined, the ability to handle complex node interactions is insufficient, the identification accuracy of root nodes and the construction effect of the diagnosis and treatment path graph are affected, and finally the practical application and reliability of the traditional Chinese medicine diagnosis and treatment system are affected.
[0009] However, no effective solution has been proposed to solve the problems in the related art. SUMMARY
[0010] Therefore, the purpose of the present application is to provide a traditional Chinese medicine diagnosis and treatment knowledge graph construction method and system based on knowledge reasoning to overcome the above technical problems existing in the prior art.
[0011] To this end, the specific technical solutions adopted by the present application are as follows:
[0012] According to one aspect of the present application, a traditional Chinese medicine diagnosis and treatment knowledge graph construction method based on knowledge reasoning is provided, comprising:
[0013] S1. Constructing a traditional Chinese medicine diagnosis and treatment knowledge graph according to related data, and performing node attribute allocation and node relationship determination;
[0014] S2. Judging the abnormal nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph and identifying the root node candidates based on the combination of statistical analysis and machine learning-based anomaly detection;
[0015] S3. Calculating the centrality of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph through graph theory analysis, and preliminarily sorting the root node candidates according to the centrality; using genetic programming and causal discovery algorithm to optimize the sorting rules of the root node candidates, obtaining the sorted root node candidates, and determining the root node;
[0016] S4. Constructing a diagnosis and treatment path knowledge graph according to the root node, related diagnosis and treatment information nodes and the causal relationship between the nodes.
[0017] Further, constructing a traditional Chinese medicine diagnosis and treatment knowledge graph according to related data, and performing node attribute allocation and node relationship determination comprises:
[0018] Collecting traditional Chinese medicine diagnosis and treatment related data, including symptoms, diseases, drugs and treatment plans; defining various nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph according to the traditional Chinese medicine diagnosis and treatment related data, including symptom nodes, disease nodes, drug nodes and treatment method nodes;
[0019] Assigning appropriate attributes to each node of the traditional Chinese medicine diagnosis and treatment knowledge graph, defining the relationship between the nodes of the traditional Chinese medicine diagnosis and treatment knowledge graph, and obtaining the constructed traditional Chinese medicine diagnosis and treatment knowledge graph.
[0020] Further, based on the combination of statistical analysis and machine learning-based anomaly detection, the abnormal nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph are judged, and the root cause node candidate options include:
[0021] Statistical properties of all nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph, using standardization method to identify nodes with deviation greater than the preset value, and the corresponding nodes are used as root cause node candidates;
[0022] Statistical frequency of each node in the historical traditional Chinese medicine diagnosis and treatment related data, set the frequency threshold according to the frequency distribution, and filter out the frequency abnormal nodes according to the frequency threshold as the root cause node candidate;
[0023] Using clustering algorithm to group all nodes in traditional Chinese medicine diagnosis and treatment knowledge graph, and get the abnormal clustering nodes as root cause node candidates;
[0024] Using isolation forest algorithm to detect anomalies in nodes, and the nodes marked as abnormal are used as root cause node candidates.
[0025] Further, the centrality of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph is calculated by graph analysis, and the root cause node candidates are preliminarily sorted according to the centrality, including:
[0026] Calculate the number of directly connected edges of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph to get the degree centrality of the node;
[0027] Calculate the average shortest path distance of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph and other nodes to get the closeness centrality of the node;
[0028] Calculate the proportion of each node in the shortest path between other nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph to get the betweenness centrality of the node;
[0029] Calculate the feature vector value of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph, and evaluate the influence of the node in the traditional Chinese medicine diagnosis and treatment knowledge graph according to the feature vector value to get the feature vector centrality;
[0030] According to the degree centrality, closeness centrality, betweenness centrality, feature vector centrality and the weight corresponding to each centrality, the weighted score and descending order of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph are sorted, and the root cause node candidate preliminary sorting result is obtained.
[0031] Further, using genetic programming and causal discovery algorithm, the sorting rules of root cause node candidates are optimized, the sorted root cause node candidates are obtained, and the root cause nodes are determined, including:
[0032] Using causal discovery algorithm to analyze the causal relationship between each node in the root cause node candidate, the strength of the causal relationship between the nodes is obtained;
[0033] According to the root cause node candidate preliminary sorting result, an initial population is generated, and individuals in the initial population represent the sorting rules; the sorting rules are expressed as genes, and the initial population is coded;
[0034] The centrality index of the nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph and the strength of the causal relationship between the nodes are integrated to construct a fitness function to evaluate the effectiveness of each sorting rule, and the fitness score of each individual is calculated according to the fitness function;
[0035] Through selection operation, crossover operation and mutation operation, the population is continuously evolved and optimized;
[0036] Check whether the convergence condition is met, if the convergence condition is met, stop the genetic programming process and output the best sorting rule;
[0037] According to the best sorting rule, the final sorting of the root cause node candidate is obtained, and according to the final sorting result, a number of nodes sorted in the front are selected as the root cause node.
[0038] Further, the causal discovery algorithm is used to analyze the causal relationship between the nodes in the root cause node candidate, and the strength of the causal relationship between the nodes is obtained, including:
[0039] Using the causal discovery algorithm, and through conditional independence test, the causal direction between the nodes in the root cause node candidate is gradually inferred, and a causal graph is generated; the causal graph is used to determine the node relationship between the nodes in the root cause node candidate, and the node relationship includes direct causal relationship and indirect relationship;
[0040] Based on the causal graph, and using the Bayesian network to estimate the conditional probability between each pair of nodes in the root cause node candidate, the strength of the causal relationship between the nodes is measured by calculating the conditional probability.
[0041] Further, the causal discovery algorithm is used, and through conditional independence test, the causal direction between the nodes in the root cause node candidate is gradually inferred, and a causal graph is generated, including:
[0042] When performing conditional independence test, all subsets of the currently selected independent variables are taken as conditions, and it is judged whether the to-be-selected independent variable and the dependent variable are conditionally correlated, if yes, the to-be-selected independent variable and the dependent variable are conditionally correlated under the given subset condition, if not, the to-be-selected independent variable and the dependent variable are conditionally independent under the given subset condition;
[0043] The conditionally correlated independent variables are added to the statistical model framework, and the causal discovery algorithm is used to infer the causal direction between the variables;
[0044] For the existence of condition-related variable pairs, the existence of intermediate variables is explored again through conditional independence test, and the direction of causal chain and the causal diagram are determined.
[0045] Further, the fitness function includes a causal effect measure, a centrality index and a penalty term, and each weight coefficient is configured for the causal effect measure, the centrality index and the penalty term.
[0046] Further, according to the root cause node, the related diagnosis and treatment information node and the causal relationship between the nodes, the diagnosis and treatment path knowledge graph is constructed.
[0047] The causal relationship between the root cause node and the related diagnosis and treatment information node is used to determine the node relationship and the edge structure of the graph, and the diagnosis and treatment path is obtained.
[0048] Each node in the diagnosis and treatment path is taken as a vertex, and the relationship between each node is taken as an edge, to establish the diagnosis and treatment path knowledge graph.
[0049] According to another aspect of the present application, a traditional Chinese medicine diagnosis and treatment knowledge graph construction system based on knowledge reasoning is also provided, which comprises a traditional Chinese medicine diagnosis and treatment knowledge graph construction module, an abnormal node identification module, a root cause node acquisition module and a diagnosis and treatment path knowledge graph construction module.
[0050] The traditional Chinese medicine diagnosis and treatment knowledge graph construction module is used to construct the traditional Chinese medicine diagnosis and treatment knowledge graph according to the related data of traditional Chinese medicine diagnosis and treatment, and to determine the node attribute allocation and the node relationship; the abnormal node identification module is used to determine the abnormal nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph and identify the root cause node candidates based on the combination of statistical analysis and machine learning-based anomaly detection; the root cause node acquisition module is used to calculate the centrality of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph through graph theory analysis, and to preliminarily sort the root cause node candidates according to the centrality; the genetic programming and the causal discovery algorithm are used to optimize the sorting rules of the root cause node candidates, to obtain the sorted root cause node candidates, and to determine the root cause node; the diagnosis and treatment path knowledge graph construction module is used to construct the diagnosis and treatment path knowledge graph according to the root cause node, the related diagnosis and treatment information node and the causal relationship between the nodes.
[0051] The present application includes the following beneficial effects:
[0052] (1) The present application collects and analyzes the related data of traditional Chinese medicine diagnosis and treatment (such as symptoms, diseases, drugs and treatment plans), defines different types of nodes (symptom nodes, disease nodes, drug nodes and treatment method nodes), and allocates attributes to each node, to construct a comprehensive traditional Chinese medicine diagnosis and treatment knowledge graph, so as to systematize and structure the multi-dimensional information of traditional Chinese medicine diagnosis and treatment, and to improve the visualization and operability of traditional Chinese medicine knowledge. It provides a solid foundation for the learning and application of traditional Chinese medicine theory.
[0053] (2) The application detects abnormal nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph by combining statistical analysis (such as Z-score) with machine learning (such as clustering, isolated forest, etc.), and identifies potential root cause nodes, so as to automatically identify abnormal phenomena from a large amount of data, avoid the deviation of manual identification, and improve the automation level of the diagnosis and treatment process. The ability to identify potential root cause nodes helps to provide support for subsequent causal reasoning and decision making.
[0054] (3) The application combines genetic programming with causal discovery algorithm to optimize the sorting rule of root cause nodes. By analyzing the causal relationship between nodes through the causal discovery algorithm and combining with genetic programming, the sorting rule can be dynamically adjusted, the accuracy of sorting is improved, and the analysis of causal relationship can better reveal the interaction between root cause nodes, finally improving the rationality and effect of diagnosis and treatment path. BRIEF DESCRIPTION OF DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiments 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.
[0056] Figure 1 is a flow chart of a traditional Chinese medicine diagnosis and treatment knowledge graph construction method based on knowledge reasoning according to an embodiment of the present application;
[0057] Figure 2 is a principle block diagram of a traditional Chinese medicine diagnosis and treatment knowledge graph construction system based on knowledge reasoning according to an embodiment of the present application.
[0058] In the drawings:
[0059] 1, traditional Chinese medicine diagnosis and treatment knowledge graph construction module; 2, abnormal node identification module; 3, root cause node acquisition module; 4, diagnosis and treatment path knowledge graph construction module. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0062] According to an embodiment of the present invention, a method and system for constructing a TCM diagnosis and treatment knowledge graph based on knowledge reasoning are provided.
[0063] The present invention will now be further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to one embodiment of the present invention, a method for constructing a TCM diagnosis and treatment knowledge graph based on knowledge reasoning is provided, comprising:
[0064] S1. Based on the TCM diagnosis and treatment related data, a TCM diagnosis and treatment knowledge graph is constructed, and node attributes are assigned and node relationships are determined.
[0065] In a further embodiment, based on TCM diagnosis and treatment related data, a TCM diagnosis and treatment knowledge graph is constructed, and node attribute assignment and node relationship determination are performed, including:
[0066] Collect data related to TCM diagnosis and treatment, including symptoms, diseases, drugs and treatment plans, and protect patient privacy; define various nodes in the TCM diagnosis and treatment knowledge graph based on the data related to TCM diagnosis and treatment, including symptom nodes, disease nodes, drug nodes and treatment method nodes; assign corresponding attributes to each node of the TCM diagnosis and treatment knowledge graph. Attributes are numerical or categorical data that describe the characteristics of the node, and define the relationship between the nodes of the TCM diagnosis and treatment knowledge graph to obtain the constructed TCM diagnosis and treatment knowledge graph. Assigning attributes to nodes facilitates subsequent reasoning and querying, and helps establish more accurate connections between nodes. Defining the relationship between nodes is to describe how nodes are connected and interact with each other. For example, there is a "manifestation" relationship between symptoms and diseases, a "treatment" relationship between drugs and diseases, and a "use" relationship between treatment methods and drugs.
[0067] Through S1, a TCM diagnosis and treatment knowledge graph is ultimately constructed, comprising different types of nodes and their interrelationships. This graph systematizes and visualizes TCM diagnosis and treatment knowledge, providing support for further analysis, reasoning, and decision-making. The TCM diagnosis and treatment knowledge graph allows for a more intuitive understanding of the relationships between diseases, symptoms, medications, and treatment methods, improving diagnosis and treatment efficiency.
[0068] S2. Based on a combination of statistical analysis and machine learning anomaly detection, abnormal nodes in the TCM diagnosis and treatment knowledge graph are determined, and root cause node options are identified.
[0069] In a further embodiment, based on a combination of statistical analysis and machine learning anomaly detection, abnormal nodes in the TCM diagnosis and treatment knowledge graph are determined, and the root cause node options are identified, including:
[0070] The attribute data of all nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph is counted, the standardization method (for example, Z-score) is used to identify the node attributes deviating from the mean value by more than a preset value, and the corresponding nodes are selected as root node candidates; the frequency of each node in the historical traditional Chinese medicine diagnosis and treatment related data is counted, the frequency threshold is set according to the frequency distribution, and the nodes with abnormal frequency are selected as root node candidates according to the frequency threshold; a clustering algorithm is used to group all nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph, and the nodes in the abnormal cluster are obtained as root node candidates; an isolation forest algorithm is used for anomaly detection of the nodes, and the nodes marked as abnormal are selected as root node candidates.
[0071] In statistical analysis, nodes with Z-score values greater than a certain preset threshold are considered "abnormal nodes", which play an abnormal or special role in the diagnosis and treatment process, thus becoming potential root node candidates. The frequency of each node in the historical data is counted, and if the frequency of some nodes is much higher or lower than the normal distribution, they will be considered as abnormal nodes. By setting a frequency threshold, these nodes with abnormal frequency are screened out, which indicate abnormal manifestations of certain diseases or symptoms, or special needs of some treatment methods, thus serving as potential root nodes. Through clustering algorithms (such as K-means, DBSCAN, etc.), similar nodes are grouped according to their attribute data, and abnormal clusters that are significantly different from most nodes are identified. Through clustering, some nodes are found to be significantly different from other nodes in the overall graph, representing special disease manifestations, treatment needs or drug use patterns. Cluster analysis helps identify these special cases as potential root node candidates for further analysis. The isolation forest algorithm identifies abnormal nodes by dividing the data into multiple "isolated" regions. Isolated nodes are usually far from most other nodes and have unusual manifestations in the diagnosis and treatment process. After screening for abnormal nodes, de-duplication and other methods are used to ensure that each node appears only once in subsequent analysis.
[0072] S3, calculate the centrality of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph through graph analysis, and preliminarily sort the root node candidates according to the centrality; use genetic programming and causal discovery algorithm to optimize the sorting rules of the root node candidates, obtain the sorted root node candidates, and determine the root node.
[0073] In further embodiments, calculating the centrality of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph through graph analysis, and preliminarily sorting the root node candidates according to the centrality include:
[0074] The number of edges directly connecting each node in the traditional Chinese medicine diagnosis and treatment knowledge graph is calculated to obtain the degree centrality of the node; the average shortest path distance between each node and other nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph is calculated to obtain the closeness centrality of the node; the proportion of each node in the shortest path between other nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph is calculated to obtain the betweenness centrality of the node; the feature vector value of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph is calculated, and the influence of the node in the traditional Chinese medicine diagnosis and treatment knowledge graph is evaluated according to the feature vector value to obtain the feature vector centrality; the degree centrality, the closeness centrality, the betweenness centrality, the feature vector centrality and the weight corresponding to each centrality are used to score and sort each node in the traditional Chinese medicine diagnosis and treatment knowledge graph in a descending order, and a preliminary sorting result of the root cause node candidate is obtained.
[0075] In further embodiments, the sorting rule of the root cause node candidate is optimized using genetic programming and a causal discovery algorithm, and a sorted root cause node candidate is obtained, and the root cause node includes:
[0076] The strength of the causal relationship between the nodes in the root cause node candidate is obtained by analyzing the causal relationship between the nodes in the root cause node candidate using the causal discovery algorithm; an initial population is generated according to the preliminary sorting result of the root cause node candidate, and each individual in the initial population represents a sorting rule; the sorting rule is represented as a gene, and the initial population is encoded; the centrality index of the node in the traditional Chinese medicine diagnosis and treatment knowledge graph and the strength of the causal relationship between the nodes are integrated to construct a fitness function to evaluate the effectiveness of each sorting rule, and the fitness score of each individual is calculated according to the fitness function; the population is continuously evolved and optimized through selection, crossover and mutation operations; it is checked whether the convergence condition is met, and if the convergence condition is met, the genetic programming process is stopped and the best sorting rule is output; the final sorting of the root cause node candidate is obtained according to the best sorting rule (referring to the sorting of the nodes in the root cause node candidate), and a number of nodes sorted in the front are selected as the root cause node according to the final sorting result.
[0077] In further embodiments, the strength of the causal relationship between the nodes in the root cause node candidate is obtained by analyzing the causal relationship between the nodes in the root cause node candidate using the causal discovery algorithm, and includes:
[0078] The causal graph is generated by using the causal discovery algorithm and gradually inferring the causal direction between the nodes in the root cause node candidate through conditional independence testing; the causal graph is used to determine the node relationship between the nodes in the root cause node candidate, and the node relationship includes direct causal relationship and indirect relationship; based on the causal graph, the conditional probability between each pair of nodes in the root cause node candidate is estimated using the Bayesian network, and the strength of the causal relationship between the nodes is measured by calculating the conditional probability.
[0079] The quantitative formula of the strength of the causal relationship between the nodes is:
[0080]
[0081] In the formula, P(B) represents the marginal probability of node B; and P(B|A) represents the conditional probability of node B given node A.
[0082] In a further embodiment, the causal graph is generated by using a causal discovery algorithm and inferring the causal direction between each node in the root cause node candidate by conditional independence test step by step, including:
[0083] In the conditional independence test, it is determined whether the to-be-selected independent variable and the dependent variable are conditionally correlated, with all subsets of the currently selected independent variables as the condition; if yes, the to-be-selected independent variable and the dependent variable are conditionally correlated under the given subset condition; if no, the to-be-selected independent variable and the dependent variable are conditionally independent under the given subset condition; the conditionally correlated independent variable is added to the statistical model framework, and the causal discovery algorithm is used to infer the causal direction between the variables; for the conditionally correlated variable pair, the conditional independence test is used again to explore whether there is a mediating variable, and the direction of the causal chain is determined and the causal graph is constructed.
[0084] The independent variables include various factors related to diseases, symptoms, and treatment methods. The dependent variable is usually a certain clinical outcome indicator, reflecting the treatment effect or the development of the disease.
[0085] In a further embodiment, the fitness function includes a causal effect measure and a centrality index, and the formula of the fitness function is:
[0086] f(x) = w1·Centrality(x) + w2·CausalEffect(x) - w3·Penalty(x);
[0087] In the formula, f(x) represents the fitness function value of the ranking rule x, which indicates the pros and cons of the ranking rule, and the higher the fitness value, the better the ranking rule; Centrality(x) represents the centrality index in the ranking rule x, and the centrality index of the node (including degree centrality, closeness centrality, betweenness centrality and eigenvector centrality) represents the importance of the node in the graph. The higher the centrality, the greater the contribution of the node to the ranking rule; CausalEffect(x) represents the strength of the causal relationship between nodes (causal effect measure) in the ranking rule x, which is calculated by a causal discovery algorithm (such as PC algorithm), and a strong causal relationship means that the node is more critical in root cause node identification; Penalty(x) represents the penalty term, and the penalty for the ranking rule with unreasonable causal relationship. For example, if the ranking rule violates the known causal relationship (such as node A is the causal predecessor of node B), a certain penalty is given to ensure that the final ranking rule conforms to the causal reasoning; w1, w2 and w3 represent the weight coefficients of the centrality index, the causal effect measure and the penalty term in the fitness function, respectively.
[0088] In the root cause node candidate, a causal discovery algorithm is applied to analyze the causal relationship between nodes. Through conditional independence test, the causal direction between nodes is inferred, a causal graph is generated, and the strength of the causal relationship between nodes is calculated. According to the preliminary ranking of the root cause node, an initial population is generated, and each individual in the population represents a ranking rule. Each ranking rule is encoded into a gene, and is evolved and optimized by a genetic algorithm. The fitness function combines the centrality index of the node (such as degree centrality, closeness centrality, etc.) and the strength of the causal relationship between nodes, and the goal is to evaluate the effectiveness of each ranking rule, and to ensure that the ranking rule not only conforms to the structure of the graph, but also maximizes the explanatory power of the causal relationship.
[0089] Through S3, the root cause node candidate is finally ranked, and the ranking result is arranged according to the fitness and the strength of the causal relationship of each node. The nodes ranked in the front are considered to be more likely root cause nodes, thereby helping the clinician to identify the most likely root cause node and optimize the diagnosis and treatment path.
[0090] S4, according to the root cause node, the related diagnosis and treatment information node and the causal relationship between nodes, a diagnosis and treatment path knowledge graph is constructed.
[0091] In further embodiments, constructing a diagnosis and treatment path knowledge graph according to the root cause node, the related diagnosis and treatment information node and the causal relationship between nodes includes:
[0092] The cause-effect relationship between the root cause node and the related diagnosis and treatment information node is used to determine the node relationship and the edge structure of the graph, and a diagnosis and treatment path is obtained; each node in the diagnosis and treatment path is assigned a node attribute; each node in the diagnosis and treatment path is taken as a vertex, and the relationship between each node is taken as an edge, to establish a diagnosis and treatment path knowledge graph.
[0093] Through cause-effect relationship analysis, the role of each node in the diagnosis and treatment path is determined. After determining the cause-effect relationship of the node, the relationship needs to be converted into an edge in the graph. In graph theory, the edge of the graph represents the relationship between two nodes, and the direction of the edge usually represents the direction of the cause-effect relationship.
[0094] As shown in Figure 2 According to another embodiment of the application, a traditional Chinese medicine diagnosis and treatment knowledge graph construction system based on knowledge reasoning is also provided, which comprises a traditional Chinese medicine diagnosis and treatment knowledge graph construction module 1, an abnormal node identification module 2, a root cause node acquisition module 3, and a diagnosis and treatment path knowledge graph construction module 4.
[0095] The traditional Chinese medicine diagnosis and treatment knowledge graph construction module 1 is used to construct a traditional Chinese medicine diagnosis and treatment knowledge graph according to traditional Chinese medicine diagnosis and treatment related data, and to determine node attributes and node relationships.
[0096] The abnormal node identification module 2 is used to determine abnormal nodes in the traditional Chinese medicine diagnosis and treatment knowledge graph based on a combination of statistical analysis and machine learning-based anomaly detection, and to identify root cause node candidates.
[0097] The root cause node acquisition module 3 is used to calculate the centrality of each node in the traditional Chinese medicine diagnosis and treatment knowledge graph through graph theory analysis, and to preliminarily sort the root cause node candidates according to the centrality; genetic programming and cause-effect discovery algorithm are used to optimize the sorting rules of the root cause node candidates, to obtain sorted root cause node candidates, and to determine the root cause node.
[0098] The diagnosis and treatment path knowledge graph construction module 4 is used to construct a diagnosis and treatment path knowledge graph according to the root cause node, the related diagnosis and treatment information node, and the cause-effect relationship between the nodes.
[0099] In order to facilitate the understanding of the above technical solutions of the application, the working principle of the application in the actual process will be described in detail below.
[0100] Through medical records, scientific research literature, clinical cases, diagnosis and treatment manuals, etc., symptom data, disease data, drug data and treatment method data, etc. are collected, and after the relationship extraction, ontology construction and other processes, a traditional Chinese medicine diagnosis and treatment knowledge graph is obtained.
[0101] The severity data of each symptom is standardized using the Z-score method. For example, the Z-score of the "headache" node is calculated, resulting in a standardized value of 2.5. Since the Z-score is greater than the preset threshold of 2, this node is considered an anomaly node and plays a special role in the diagnosis and treatment process, thus becoming a potential root node candidate. The frequency of the "cold" node in the historical diagnosis and treatment data is counted, and it is found that its frequency is 50%, much higher than that of other disease nodes (such as the frequency of influenza is 10%). Therefore, the frequency of the "cold" node is abnormal, and it is identified as a root node candidate. When performing anomaly detection, the Isolation Forest algorithm identifies the "headache" node as an anomaly node because it has a relatively weak relationship with other common symptoms (such as fever, fatigue, etc.), indicating that this symptom is a key symptom in some special cases and is worth further research. Using the DBSCAN algorithm, all symptom and disease nodes are clustered, and some rare disease combinations (such as the high frequency of "cold" and "fatigue" appearing at the same time) are found. These abnormal cluster nodes are also considered as root node candidates.
[0102] By calculating the number of direct connection edges of each node, it is found that the degree centrality of the "cold" node is 10 (i.e. connected to 10 other nodes, including symptoms, drugs, treatment methods, etc.). Since it has a large number of connected nodes, it has a large influence in the entire graph, and is a high centrality node. The average shortest path distance of the "headache" node to all other nodes is calculated, and it is found that its closeness centrality is 0.6, indicating that it is relatively close to other nodes and can quickly affect other nodes in the entire graph (such as the "cold" and "drug treatment" nodes). The betweenness centrality of the "dangshen" node is calculated, and it is found that it is located on the shortest path between multiple node pairs (such as connecting the "cold" and "treatment method" nodes), and the betweenness centrality value is 0.35, indicating that it plays a key bridge role in the entire diagnosis and treatment path. By calculating the eigenvector centrality, the eigenvector centrality of the "cold" node is 0.75, indicating that it has a large overall influence in the graph.
[0103] The initial ranking is: "cold", "flu", "headache", "stomach disease", "cough". The fitness function considers both the centrality of the node (such as degree centrality, closeness centrality) and the causal effect (conditional probability obtained through Bayesian network). For example, the causal effect measure of the "cold" node is 0.85, and the centrality score is 0.91, so its fitness score is higher. In genetic programming, the ranking rule is evolved through selection, crossover, and mutation operations to optimize the ranking. In each generation of optimization, individuals with higher fitness (ranking rules) are selected. After several optimizations, the final ranking rule is obtained: "cold", "headache", "dangshen", "flu", "cough".
[0104] According to the optimized sorting rules, the root cause node is selected as "cold", followed by "headache" and "Codonopsis pilosula". Based on the causal relationship between the nodes, a diagnosis and treatment pathway map is constructed.
[0105] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for constructing a knowledge graph of traditional Chinese medicine diagnosis and treatment based on knowledge reasoning, characterized in that: include: S1. Based on TCM diagnosis and treatment related data, construct a TCM diagnosis and treatment knowledge graph, and perform node attribute assignment and node relationship determination; S2. Based on a combination of statistical analysis and machine learning anomaly detection, identify abnormal nodes in the TCM diagnosis and treatment knowledge graph and identify alternative root cause nodes; S3. Calculate the centrality of each node in the TCM diagnosis and treatment knowledge graph through graph theory analysis, and preliminarily sort the root cause node candidates based on the centrality; use genetic programming and causal discovery algorithms to optimize the sorting rules of the root cause node candidates, obtain the sorted root cause node candidates, and determine the root cause node; S4. Construct a diagnosis and treatment pathway knowledge graph based on the root cause nodes, related diagnosis and treatment information nodes, and the causal relationship between nodes.
2. A method for constructing a TCM diagnosis and treatment knowledge graph based on knowledge reasoning according to claim 1, characterized in that: The construction of a TCM diagnosis and treatment knowledge graph based on TCM diagnosis and treatment related data, and the allocation of node attributes and determination of node relationships include: Collect data related to TCM diagnosis and treatment, including symptoms, diseases, drugs, and treatment plans; based on the data related to TCM diagnosis and treatment, define various nodes in the TCM diagnosis and treatment knowledge graph, including symptom nodes, disease nodes, drug nodes, and treatment method nodes; Assign corresponding attributes to each node of the TCM diagnosis and treatment knowledge graph, define the relationship between the nodes of the TCM diagnosis and treatment knowledge graph, and obtain the constructed TCM diagnosis and treatment knowledge graph.
3. The method for constructing a TCM diagnosis and treatment knowledge graph based on knowledge reasoning according to claim 1 is characterized in that: The combination of statistical analysis and machine learning-based anomaly detection can be used to identify abnormal nodes in the TCM diagnosis and treatment knowledge graph and identify the root cause node options, including: Collect the attribute data of all nodes in the TCM diagnosis and treatment knowledge graph, use the standardization method to identify the node attributes whose deviation from the mean is greater than the preset value, and select the corresponding nodes as candidate root cause nodes; Count the frequency of occurrence of each node in the historical TCM diagnosis and treatment related data, set the frequency threshold according to the frequency distribution, and filter out nodes with abnormal frequencies according to the frequency threshold as candidate root cause nodes; Use clustering algorithms to group all nodes in the TCM diagnosis and treatment knowledge graph and obtain abnormal clustered nodes as candidate root cause nodes; The isolation forest algorithm is used to detect anomalies in nodes, and nodes marked as anomalies are selected as candidates for root cause nodes.
4. The method for constructing a TCM diagnosis and treatment knowledge graph based on knowledge reasoning according to claim 1, characterized in that: The method of calculating the centrality of each node in the TCM diagnosis and treatment knowledge graph through graph theory analysis and preliminarily sorting the root cause node options according to the centrality includes: Calculate the number of directly connected edges of each node in the TCM diagnosis and treatment knowledge graph to obtain the degree centrality of the node; Calculate the average shortest path distance between each node and other nodes in the TCM diagnosis and treatment knowledge graph to obtain the node's proximity centrality; Calculate the proportion of each node in the shortest path between other nodes in the TCM diagnosis and treatment knowledge graph to obtain the node's betweenness centrality; Calculate the eigenvector value of each node in the TCM diagnosis and treatment knowledge graph, and evaluate the influence of the node in the TCM diagnosis and treatment knowledge graph based on the eigenvector value to obtain the eigenvector centrality; According to degree centrality, closeness centrality, betweenness centrality, eigenvector centrality and the corresponding weights of each centrality, each node in the TCM diagnosis and treatment knowledge graph is weighted scored and sorted in descending order to obtain the preliminary ranking results of the root cause node options.
5. The method for constructing a TCM diagnosis and treatment knowledge graph based on knowledge reasoning according to claim 1 is characterized in that: The genetic programming and causal discovery algorithm are used to optimize the sorting rules of the root cause node candidates to obtain sorted root cause node candidates, and the root cause nodes are determined to include: Use the causal discovery algorithm to analyze the causal relationship between each node in the root cause node candidate and obtain the strength of the causal relationship between the nodes; Based on the preliminary ranking results of the root cause node candidates, an initial population is generated, and the individuals in the initial population represent the ranking rules; the ranking rules are represented as genes, and the initial population is encoded; By integrating the centrality index of nodes in the TCM diagnosis and treatment knowledge graph and the strength of the causal relationship between nodes, a fitness function is constructed to evaluate the effectiveness of each sorting rule, and the fitness score of each individual is calculated based on the fitness function; Through selection operations, crossover operations and mutation operations, the population can be continuously evolved and optimized; Check whether the convergence conditions are met. If so, stop the genetic programming process and output the optimal sorting rule. According to the optimal sorting rule, the final sorting of the root cause node candidates is obtained, and according to the final sorting result, several nodes with the highest sorting positions are selected as the root cause nodes.
6. A method for constructing a TCM diagnosis and treatment knowledge graph based on knowledge reasoning according to claim 5, characterized in that: The causal relationship between each node in the root cause node candidate is analyzed using the causal discovery algorithm to obtain the strength of the causal relationship between the nodes, including: Using a causal discovery algorithm and conditional independence tests, the causal direction between each node in the root cause node candidate is gradually inferred to generate a causal graph. The causal graph is used to determine the node relationships between each node in the root cause node candidate, including direct causal relationships and indirect relationships. Based on the causal graph, the Bayesian network is used to estimate the conditional probability between each pair of nodes in the root cause node alternatives, and the strength of the causal relationship between the nodes is measured by calculating the conditional probability.
7. The method for constructing a TCM diagnosis and treatment knowledge graph based on knowledge reasoning according to claim 5, characterized in that: The method of using the causal discovery algorithm and gradually inferring the causal direction between the nodes in the root cause node candidate through the conditional independence test to generate the causal graph includes: When performing the conditional independence test, all subsets of variables currently selected are used as conditions to determine whether the variable to be selected and the dependent variable are conditionally correlated. If so, the variable to be selected and the dependent variable are conditionally correlated under the given subset conditions. If not, the variable to be selected and the dependent variable are conditionally independent under the given subset conditions. Add conditionally correlated independent variables to the statistical model framework and use causal discovery algorithms to infer the causal direction between variables; For conditionally correlated variable pairs, the conditional independence test is again used to explore whether there are mediating variables, determine the direction of the causal chain, and construct a causal diagram.
8. The method for constructing a TCM diagnosis and treatment knowledge graph based on knowledge reasoning according to claim 5, characterized in that: The fitness function includes a causal effect measure, a centrality index, and a penalty term, and configures respective weight coefficients for the causal effect measure, the centrality index, and the penalty term.
9. The method for constructing a TCM diagnosis and treatment knowledge graph based on knowledge reasoning according to claim 5, characterized in that: The construction of the diagnosis and treatment pathway knowledge graph based on the root cause node, the related diagnosis and treatment information node, and the causal relationship between the nodes includes: Using the causal relationship between the root cause node and the related diagnosis and treatment information nodes, the node relationship and the edge structure of the graph are determined, and the diagnosis and treatment path is obtained; node attributes are assigned to each node in the diagnosis and treatment path; Each node in the diagnosis and treatment path is taken as a vertex, and the relationship between each node is taken as an edge to establish a diagnosis and treatment path knowledge graph.
10. A system for constructing a knowledge graph of TCM diagnosis and treatment based on knowledge reasoning, used to implement the method for constructing a knowledge graph of TCM diagnosis and treatment based on knowledge reasoning according to any one of claims 1 to 9, characterized in that: It includes a TCM diagnosis and treatment knowledge graph construction module, an abnormal node identification module, a root cause node acquisition module, and a diagnosis and treatment path knowledge graph construction module; The TCM diagnosis and treatment knowledge graph construction module is used to construct a TCM diagnosis and treatment knowledge graph based on TCM diagnosis and treatment related data, and to assign node attributes and determine node relationships; The abnormal node identification module is used to identify abnormal nodes in the TCM diagnosis and treatment knowledge graph and identify root cause node options based on a combination of statistical analysis and machine learning anomaly detection; The root cause node acquisition module is used to calculate the centrality of each node in the TCM diagnosis and treatment knowledge graph through graph theory analysis, and preliminarily sort the root cause node candidates according to the centrality; genetic programming and causal discovery algorithms are used to optimize the sorting rules of the root cause node candidates, obtain the sorted root cause node candidates, and determine the root cause node; The diagnosis and treatment pathway knowledge graph construction module is used to construct the diagnosis and treatment pathway knowledge graph based on the root cause nodes, related diagnosis and treatment information nodes and the causal relationship between the nodes.