A method and system for constructing a traditional Chinese medicine knowledge graph

By constructing a knowledge graph of traditional Chinese medicine, the problems of insufficient data integration capabilities and weak correlation between medicinal properties and pharmacology have been solved. This has enabled efficient data fusion and dynamic updates, improved the retrieval efficiency and application timeliness of the knowledge graph of traditional Chinese medicine, and supported the modernization research and application of traditional Chinese medicine.

CN121168620BActive Publication Date: 2026-06-23SHAANXI SHENGJI KANGZE TRADITIONAL CHINESE MEDICINE RESEARCH TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHAANXI SHENGJI KANGZE TRADITIONAL CHINESE MEDICINE RESEARCH TECHNOLOGY CO LTD
Filing Date
2025-09-03
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing technologies for constructing knowledge graphs of traditional Chinese medicine suffer from insufficient data integration capabilities, weak correlation between medicinal properties and pharmacology, lack of dynamic update mechanisms, and low retrieval efficiency. These issues lead to knowledge fragmentation, semantic separation, and delayed updates, which affect the modernization research and application of traditional Chinese medicine.

Method used

By collecting structured and unstructured data, standardizing terminology and semantically encoding, generating pharmacological data tables, constructing pharmacological ontology layers and pharmacological ontology layers, establishing cross-layer associations, using attribute graph databases and hybrid indexes, updating the graphs in real time, and providing intelligent decision-making interfaces and a visual interaction platform, the efficient integration and dynamic updating of data are achieved.

Benefits of technology

It has achieved high-quality construction of a knowledge graph of traditional Chinese medicine, solved the problems of data fragmentation and semantic separation, supported bidirectional reasoning of drug properties and pharmacology, improved retrieval efficiency and knowledge timeliness, and provided scientific and real-time technical support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121168620B_ABST
    Figure CN121168620B_ABST
Patent Text Reader

Abstract

The application discloses a Chinese herbal medicine knowledge graph construction method and system, the method comprises the following steps: collecting structured data and unstructured data, and generating a medicinal property and pharmacology data table; extracting the medicinal property, flavor and meridian tropism attributes of medicinal materials, generating medicinal property triples and pharmacology triples, and establishing preliminary cross-domain association; defining the logical constraints and compatibility rules of medicinal property, flavor and meridian tropism, and constructing a causal reasoning chain; performing spatial semantic mapping on the meridian tropism attributes and pharmacology entities, and generating dynamic cross-layer mapping relationships; storing node types and edge types by using an attribute graph database, and constructing a hybrid index; collecting new data streams in real time and updating the graph, and providing an intelligent decision-making interface and a visual interactive platform. Through multi-source fusion, dynamic association, efficient storage and closed-loop optimization, the application solves the problems of semantic fragmentation, update lag and inefficient retrieval in traditional Chinese medicine digitization, and provides scientific and real-time technical support for modernization research, precise medication and new drug research and development of traditional Chinese medicines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph construction technology, and in particular to a method and system for constructing a knowledge graph of traditional Chinese medicine. Background Technology

[0002] In recent years, with the acceleration of the digitalization process of traditional Chinese medicine (TCM), the construction of TCM knowledge graphs has gradually become a core direction for promoting the modernization of TCM research and application, demonstrating great potential in integrating TCM knowledge, revealing the intrinsic relationships between drugs, and assisting clinical decision-making. However, current TCM knowledge graph construction technologies still have many significant shortcomings, seriously restricting their further development and widespread application:

[0003] (1) Insufficient data integration capability: Traditional methods often rely on a single data source and fail to effectively integrate structured medicinal property data with unstructured pharmacological data. Semantic conflicts between cross-source data (such as the differences in the description of the properties of "Astragalus" in different literature) lead to knowledge fragmentation, making it difficult to build a unified knowledge system;

[0004] (2) Weak correlation between drug properties and pharmacology: Existing maps mostly use static rule mapping (such as manually defining "cold nature → anti-inflammatory"), lacking a dynamic correlation mechanism based on spatial semantics and statistical laws, resulting in a separation between traditional drug property theory and modern molecular mechanism, and failing to support bidirectional reasoning;

[0005] (3) Lack of dynamic update mechanism: Most spectra rely on periodic batch updates, which cannot incorporate new pharmacological research results or clinical feedback in real time, and conflicting data require manual intervention, resulting in high maintenance costs;

[0006] (4) Limited search efficiency and practicality: Graph database search relies heavily on basic indexing strategies and does not target meridian attributes and pharmacological weights.

[0007] The design of hybrid indexes leads to high response latency for multi-hop queries of "nature-target-disease", which affects the efficiency of clinical decision support. Summary of the Invention

[0008] In view of the aforementioned existing problems, the present invention is proposed.

[0009] Therefore, this invention provides a method and system for constructing a knowledge graph of traditional Chinese medicine to solve the problems of limited feature extraction capability, weak anti-interference capability, and insufficient model generalization performance in existing methods for partial discharge pattern recognition of cables.

[0010] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0011] In a first aspect, the present invention provides a method for constructing a knowledge graph of traditional Chinese medicine, including:

[0012] Structured and unstructured data were collected from ancient Chinese herbal medicine books, modern pharmacology databases, and clinical medication records. Then, through terminology standardization, conflict resolution, and semantic coding, a pharmacological data table of medicinal properties was generated.

[0013] The properties and meridian tropism of medicinal materials are extracted from the pharmacological data table to generate a "medicinal material, properties and flavor, value" ternary set of medicinal properties. At the same time, the interaction relationship between chemical components and targets is extracted from the pharmacological data table to generate a "component, inhibition, target" ternary set of pharmacology. Preliminary cross-domain associations are established between medicinal property terms and pharmacological entities.

[0014] Based on the pharmacological ternary set, a pharmacological ontology layer is constructed, defining the logical constraints and compatibility rules of properties, flavors and meridian tropism. Based on the pharmacological ternary set, a biomedical ontology is integrated to construct a causal reasoning chain of "target-pathway-disease".

[0015] Spatial semantic mapping is performed on meridian tropism attributes and pharmacological entities to obtain meridian tropism coordinates and target location, and the spatial similarity between meridian tropism coordinates and target location is calculated to generate dynamic cross-layer mapping relationships.

[0016] An attribute graph database is used to store node types and edge types, and a hybrid index is constructed.

[0017] It collects new data streams in real time, dynamically updates the map using an incremental map embedding algorithm, and provides an intelligent decision-making interface and a visual interaction platform, driving map optimization through user feedback.

[0018] In a preferred embodiment of the method for constructing a knowledge graph of traditional Chinese medicine according to the present invention, generating a pharmacological data table includes:

[0019] Based on a predefined pharmacological terminology database, the four properties of cold, heat, warmth, and coolness, and the five flavors of pungent, sweet, sour, bitter, and salty are numerically encoded, and their meridian attributes are mapped to a meridian coding table.

[0020] The target names in pharmacological entities are standardized as UniProt IDs, and disease names are stored using ICD-11 encoding.

[0021] The semantic ambiguity of medicinal materials with the same name was resolved through expert review, and a cross-source data mapping rule base was established.

[0022] As a preferred embodiment of the method for constructing a knowledge graph of traditional Chinese medicine in this invention, establishing preliminary cross-domain associations includes:

[0023] Set a preset mapping rule: if the properties and flavors of medicinal materials co-occur with the functional description of pharmacological targets, then generate cross-layer relationship edges.

[0024] Spatial pre-matching is performed on the cross-layer relationship edges, and the organs and organs belonging to the meridians are mapped to the target tissues with the same name.

[0025] In a preferred embodiment of the method for constructing a knowledge graph of traditional Chinese medicine according to the present invention, the medicinal constructive ontology layer includes:

[0026] The logical constraints defining the nature, flavor, and meridian tropism;

[0027] The construction of the causal reasoning chain includes establishing a targeted association of "target-pathway-disease" based on the KEGG pathway database and labeling the pathway enrichment weight.

[0028] In a preferred embodiment of the method for constructing a knowledge graph of traditional Chinese medicine according to the present invention, generating dynamic cross-layer mapping relationships includes:

[0029] Set a threshold for the Euclidean distance between coordinates and calculate the Euclidean distance between the meridian coordinates and the target point location. If the distance is less than the preset threshold, generate a cross-layer relationship edge.

[0030] Set a statistical threshold, construct a weight matrix based on the co-occurrence frequency of flavor and target, and derive a generalization rule if the weight value is higher than the statistical threshold.

[0031] As a preferred embodiment of the method for constructing a knowledge graph of traditional Chinese medicine in this invention, the construction of a hybrid index includes:

[0032] A B+ tree index is used for the meridian attribute, enabling the hybrid index to support range queries;

[0033] Hash indexes are used for pharmacological entity names to achieve precise matching and accelerate the process;

[0034] Pre-compute high-frequency paths and cache subgraph structures.

[0035] As a preferred embodiment of the method for constructing a knowledge graph of traditional Chinese medicine in this invention, the method includes: dynamically updating the graph and providing an intelligent decision-making interface and a visual interaction platform, and using user feedback to drive graph optimization, including:

[0036] New data is acquired in real time by accessing new pharmacological research data, clinical drug use feedback and digitized text streams of ancient books through a distributed message queue, and the new data is verified to meet the drug incompatibilities through a logical rule engine.

[0037] A threshold is set based on the difference between the new data and the original data. Data below the threshold is considered low-conflict data and is directly inserted into the graph. Data above the threshold is considered high-conflict data and triggers a manual review branch.

[0038] The intelligent decision-making interface includes drug compatibility detection and medication recommendation:

[0039] The drug compatibility test includes calculating the risk value of drug combinations based on the overlap rate of meridian tropism and target interaction database, and issuing an alarm for combinations that generate risks;

[0040] Medication recommendations include generating multi-dimensional medication plans by jointly searching the drug properties and pharmacology layers based on input of symptoms and patient constitution.

[0041] Secondly, the present invention provides a system for constructing a knowledge graph of traditional Chinese medicine, including: a distributed data acquisition module for configuring a multi-threaded crawler engine and an API gateway for real-time acquisition of raw data from heterogeneous data sources;

[0042] A natural language processing engine is used to integrate a domain-adaptive pre-trained model and a rule engine to complete entity recognition and relation extraction.

[0043] The knowledge fusion computing module is used to deploy graph embedding algorithms and ontology inference engines to achieve entity alignment and logical rule verification.

[0044] The graph database storage system is based on a distributed storage cluster built on an attribute graph model, supporting high-concurrency queries and transaction processing.

[0045] The dynamic update control module uses a streaming computing framework to process incremental data in real time and updates the map in conjunction with confidence assessment.

[0046] A visual interactive platform; it provides a visual rendering engine and RESTful API interfaces, supporting multi-terminal access and application integration.

[0047] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention unifies ancient medical terminology with modern pharmacological entities through terminology-driven data cleaning and semantic encoding, eliminates homonymous conflicts, constructs a high-quality pharmacological data table, and solves the problem of data fragmentation; based on the co-occurrence frequency and spatial similarity calculation of properties and targets, it generates confidence-weighted cross-layer mapping rules, overcoming the limitations of manual rules, and supports bidirectional reasoning of "properties and flavors → targets" and "targets → meridian tropism," improving the accuracy of association; by constructing a "target-pathway-disease" directed reasoning chain, it achieves… This invention achieves a lossless transformation from traditional experience to molecular mechanisms, enhancing the scientific rigor of compatibility recommendations. It utilizes an attribute graph database to store node and edge types, combined with B+ tree and hash indexes, reducing multi-hop query response time for "property-target-disease" relationships to milliseconds. A streaming computing engine processes new data in real-time, integrating a drug property-pharmacology consistency verification model and incremental graph embedding algorithms to achieve dynamic graph updates. User feedback triggers knowledge correction, forming a closed loop of "data update → service optimization → feedback collection → further update," significantly improving the timeliness and retention rate of knowledge. Through multi-source fusion, dynamic association, efficient storage, and closed-loop optimization, this invention constructs a deeply coupled drug property-pharmacology knowledge graph for traditional Chinese medicine. It not only solves the problems of semantic fragmentation, delayed updates, and inefficient retrieval in traditional Chinese medicine digitization but also provides scientific and real-time technical support for the modernization of Chinese medicine research, precision medicine, and new drug development. Attached Figure Description

[0048] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 This is a schematic diagram of the overall process of constructing a knowledge graph of traditional Chinese medicine according to an embodiment of the present invention.

[0050] Figure 2 This is a schematic diagram of the TF-IDF calculation process of the method for constructing a knowledge graph of traditional Chinese medicine according to an embodiment of the present invention.

[0051] Figure 3 This is a schematic diagram of the hybrid index query process of the method for constructing a knowledge graph of traditional Chinese medicine according to an embodiment of the present invention.

[0052] Figure 4 This is a schematic diagram of the drug property compatibility detection process of the method for constructing a knowledge graph of traditional Chinese medicine according to an embodiment of the present invention. Detailed Implementation

[0053] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0054] Example 1

[0055] Reference Figures 1-4 As an embodiment of the present invention, a method for constructing a knowledge graph of traditional Chinese medicine is provided, comprising:

[0056] S100: Collect structured and unstructured data from ancient Chinese herbal medicine books, modern pharmacology databases, and clinical medication records, and generate a pharmacological data table through terminology standardization, conflict resolution, and semantic coding;

[0057] S200: Extract the properties and meridian tropism of medicinal materials from the pharmacological data table to generate a "medicinal material, properties and flavor, value" ternary set of medicinal properties. At the same time, extract the interaction relationship between chemical components and targets from the pharmacological data table to generate a "component, inhibition, target" ternary set of pharmacology. And establish a preliminary cross-domain association between medicinal property terms and pharmacological entities.

[0058] S300: Based on the pharmacological ternary set, a pharmacological ontology layer is constructed, defining the logical constraints and compatibility rules of properties, flavors and meridian tropism. Based on the pharmacological ternary set, a biomedical ontology is integrated to construct a causal reasoning chain of "target-pathway-disease".

[0059] S400: Perform spatial semantic mapping on meridian tropism attributes and pharmacological entities to obtain meridian tropism coordinates and target location, and calculate the spatial similarity between meridian tropism coordinates and target location to generate dynamic cross-layer mapping relationships;

[0060] S500: Uses an attribute graph database to store node and edge types and constructs a hybrid index;

[0061] S600: Real-time acquisition of new data streams, dynamic updating of the map using incremental map embedding algorithm, and provision of intelligent decision-making interface and visualization interaction platform, driving map optimization through user feedback.

[0062] It should be noted that there are significant differences in the data formats of ancient texts, modern pharmacology databases, and clinical records. Terminology descriptions contain semantic conflicts and ambiguities, and traditional drug properties lack dynamic mapping rules with molecular targets and metabolic pathways, making it difficult to support two-way "experience-science" reasoning. Furthermore, new pharmacological research findings and clinical feedback cannot be incorporated into the atlas in real time, and existing storage and indexing strategies are simplistic with high response latency, hindering the timeliness of clinical applications. This is mainly reflected in the following aspects:

[0063] First, the diversity and heterogeneity of data sources lead to integration difficulties: Traditional Chinese medicine knowledge involves ancient texts (such as the *Compendium of Materia Medica*), modern pharmacology databases, and clinical medication records. Data formats include structured tables, free text, medicinal material morphology diagrams, and non-standardized terminology. For example, the term "cold in nature" in ancient texts may be expressed as "cool" or "slightly cold" in different documents, while the chemical components and targets of "Astragalus" in modern databases need cross-source alignment, such as aligning astragaloside A with TNF-α (tumor necrosis factor-α). The semantic conflicts and format differences of such heterogeneous data lead to knowledge fragmentation, making it difficult to construct a unified knowledge representation framework using traditional methods.

[0064] Secondly, there is a semantic gap between traditional medicinal properties theory and modern pharmacological mechanisms: traditional medicinal properties, such as the four natures, five flavors, and meridian tropism, are mostly empirical descriptions and lack direct correlation rules with modern molecular mechanisms, such as targets, pathways, and diseases. For example, the theory that "pungent flavor enters the lung meridian" is difficult to map to the molecular pathway of "regulating TRPV1 receptor (transient receptor potential vanillic acid subtype 1 receptor) to inhibit the cough reflex," thus limiting the reasoning ability of knowledge graphs. Existing methods mostly rely on artificial rules, such as defining "cold-natured medicinal materials can reduce inflammation" based on medical experience, rather than relying on dynamically capturing the statistical correlation between medicinal properties and targets. For example, relying on the high-frequency co-occurrence of cold-natured medicinal materials and inflammatory pathways found in databases to infer that cold-natured medicinal materials can reduce inflammation restricts the efficiency of the transformation from traditional theory to scientific verification.

[0065] Finally, there is the dynamic nature of data and the complexity of application scenarios: new pharmacological research findings, clinical medication feedback, and digitized content from ancient books are constantly emerging, requiring real-time integration into the knowledge graph. However, existing systems mostly rely on batch update mechanisms, which cannot handle streaming data such as the daily additions to PubMed (a public medical information retrieval system), and conflicting data requires manual intervention, resulting in high maintenance costs. Furthermore, complex query scenarios, such as querying "What components in warm-natured herbs that enter the spleen meridian inhibit the COX-2 pathway?", suffer from high response latency due to the lack of hybrid indexing and pre-computation optimization, making it difficult to meet the real-time needs of clinical decision-making.

[0066] Therefore, this invention constructs a complete technical solution for building a knowledge graph of traditional Chinese medicine through steps S100-S600, and integrates multi-source data such as ancient literature, modern pharmacology databases, and clinical records. Through terminology standardization and semantic conflict resolution, a unified medicinal property-pharmacology data table is constructed, completely solving the problems of data fragmentation and semantic ambiguity in traditional methods. Based on the spatial similarity calculation of the co-occurrence frequency of properties and flavors and targets, meridian coordinates, and target location, weighted cross-layer rules are automatically generated, breaking through the limitations of manual static rules. By constructing a medicinal property ontology layer and a pharmacology ontology layer, combined with an attribute graph database and a hybrid index, the retrieval efficiency in complex scenarios is improved. Through real-time acquisition of new data streams, dynamic updates of the graph are achieved. User feedback triggers knowledge correction, forming a closed loop of "data update → service optimization → feedback collection → further update".

[0067] Example 2

[0068] Reference Figures 1-4 As an embodiment of the present invention, based on the above embodiment, a method for constructing a knowledge graph of traditional Chinese medicine is provided.

[0069] In this embodiment of the application, step S100 involves collecting structured and unstructured data based on ancient Chinese herbal medicine books, modern pharmacology databases, and clinical medication records, and generating a pharmacological data table through terminology standardization, conflict resolution, and semantic encoding, including the following steps A1 to A3:

[0070] A1: Based on a predefined pharmacological terminology database, numerical codes are used to encode the four properties of cold, heat, warmth, and coolness, and the five flavors of pungent, sweet, sour, bitter, and salty, and the meridian attributes are mapped to the meridian coding table.

[0071] Specifically, in this invention, the four qi (cold, hot, warm, and cool) are numerically encoded, with cold being -1, cool being -0.5, warm being +0.5, and hot being +1; the five flavors (pungent, sweet, sour, bitter, and salty) are mapped to vector codes, with pungent = [1,0,0,0,0], sweet = [0,1,0,0,0], sour = [0,0,1,0,0], bitter = [0,0,0,1,0], and salty = [0,0,0,0,1]; the meridian tropism attribute is based on the meridian coding table, which encodes the twelve meridians according to English abbreviations, such as the liver meridian being coded as LR and the lung meridian as LU. In order to further refine the description of the meridian tropism attribute, each meridian is associated with human anatomical coordinates, such as the liver meridian corresponding to the right hypochondrium coordinates (x,y,z), where the specific coordinates are defined according to human anatomical standards.

[0072] It should be noted that vector encoding of the five flavors (pungent, sweet, sour, bitter, and salty) can ensure that each flavor corresponds to a unique position. In addition, specific Chinese medicinal materials often have multiple flavors, and vector encoding can conveniently represent multiple flavor combinations. For example, "Bajitian, pungent and sweet" can be represented as: [1,1,0,0,0].

[0073] A2: Unify the target names in pharmacological entities as UniProt ID, and store disease names using ICD-11 encoding;

[0074] UniProt is a comprehensive database providing protein sequence and functional information. It integrates information from multiple databases, offering rich protein annotations, including sequence, function, structure, and interactions. The UniProt ID is a unique identifier for each protein entry in the UniProt database, a 6-digit code consisting of letters and numbers. UniProt IDs do not follow specific encoding rules but are randomly generated to ensure uniqueness. Each UniProt ID uniquely identifies a protein sequence and does not change with database updates; for example, TNF-α is named P01375, where P01375 identifies the protein Tumor necrosis factor.

[0075] Disease names are coded using ICD-11 (International Classification of Diseases, 11th Revision), a completely new disease classification system. Its coding structure adopts a combined coding rule, namely, a trunk code + an extension code. The trunk code is the core part of the coding, used to define the main category of the disease or health problem. The trunk code is usually an independent code that can be used alone to provide the minimum but most meaningful information. The extension code is used to supplement the trunk code, providing a more detailed description, such as the severity of the disease, anatomical location, etc. The extension code cannot be used alone and must be used in conjunction with the trunk code.

[0076] It should be noted that the ICD-11 coding method is divided into pre-combined and post-combined. Pre-combined is a core code that pre-combines all relevant information of a clinical concept. For example, the code for abdominal aortic aneurysm with perforation is BD50.40. Post-combined is a combination of multiple codes to describe a complex clinical concept. For example, the code for left hip osteoarthritis with chronic pain is FA00.Z&XK8G / MG30.30.

[0077] A3: Resolve semantic ambiguity issues related to medicinal materials with the same name through expert review, and establish a cross-source data mapping rule base.

[0078] Specifically, experts use molecular fingerprint similarity to determine whether medicinal herbs with the same name belong to the same entity. For example, "Fritillaria" includes both Sichuan Fritillaria and Zhejiang Fritillaria. The specific steps for determining the fingerprint similarity between the two herbs include:

[0079] First, molecular fingerprints of the main components in Fritillaria cirrhosa and Fritillaria thunbergii were extracted using cheminformatics tools. For example, MACCS Keys fingerprints or ECFP fingerprints were generated for Fritillaria cirrhosa alkaloids in Fritillaria cirrhosa and Fritillaria thunbergii saponins in Fritillaria thunbergii, respectively.

[0080] Secondly, the Tanimoto coefficient (similarity coefficient) between the molecular fingerprints of fritillaria cirrhosaine and fritillaria thunbergii saponins was calculated. The Tanimoto coefficient is a commonly used index to measure the similarity between two molecular fingerprints, and its calculation formula is as follows:

[0081] ;

[0082] in: Tanimoto coefficients; a and b are the number of bits set to 1 in the two molecular fingerprints of Fritillaria cirrhosa and Fritillaria thunbergii, respectively; c is the number of bits that are both set to 1 in the two molecular fingerprints of Fritillaria cirrhosa and Fritillaria thunbergii.

[0083] It should be noted that the Tanimoto coefficient ranges from 0 to 1, with a value closer to 1 indicating a higher degree of similarity between the two molecules. In the field of drug design, a Tanimoto coefficient ≥ 0.85 is generally considered to indicate a high degree of similarity between the two molecules. According to publicly available information, Fritillaria cirrhosa mainly contains steroidal alkaloids, such as fritillary alkaloids; while Fritillaria thunbergii contains various steroidal saponins. The chemical compositions of the two molecules differ significantly, and the Tanimoto coefficient is < 0.85. Therefore, Fritillaria cirrhosa and Fritillaria thunbergii cannot be considered the same entity.

[0084] Establishing a cross-source data mapping rule base includes defining mapping rules for "taste → target function" and storing them as RDF triples (Resource Description Framework Triples), with the format "entity, association, corresponding entity", such as "(bitter taste, associated target, TNF-α)".

[0085] In this embodiment of the application, step S200 extracts the properties and meridian tropism of medicinal materials from the pharmacological data table to generate a "medicinal material, properties, value" ternary set of medicinal properties. Simultaneously, it extracts the interaction relationship between chemical components and targets from the pharmacological data table to generate a "component, inhibition, target" ternary set of pharmacological properties. Furthermore, it establishes a preliminary cross-domain association between medicinal property terms and pharmacological entities, including the following steps B1-B2:

[0086] B1: Set a preset mapping rule. If the properties and flavors of medicinal materials co-occur with the functional description of pharmacological targets, then generate cross-layer relationship edges.

[0087] Specifically, firstly, the TF-IDF algorithm (Term Frequency-Inverse Document Frequency) is used to extract flavor-target co-occurrence keywords from the literature, and cross-layer edges are generated when the co-occurrence frequency is ≥5 times;

[0088] TF-IDF is a commonly used text mining technique for evaluating the importance of a word in a document collection. It combines the concepts of term frequency (TF) and inverse document frequency (IDF), and specifically includes:

[0089] ;

[0090] ;

[0091] ;

[0092] in, : Indicates the word 't' in the document The word frequency in the text; t indicates a specific word; Represents a specific document; Represents the inverse document frequency of the term t in the document set D; D represents the document set; Represents the number of times the term t appears in the document ; Represents the document The total number of words that appear in it; N is the total number of documents in the document set D, Is the number of documents containing the term t.

[0093] It should be noted that Represents the importance of the term t in the document At the same time, considering its universality in the entire document set D, the keywords of the property - target co - occurrence can be extracted from this.

[0094] Secondly, the calculation formula of the confidence level c of the edge attribute annotation is as follows:

[0095] ;

[0096] In an optional implementation manner, step S200 can also adopt the co - occurrence keyword extraction of the property - target co - occurrence based on point mutual information and chi - square test. The specific steps include:

[0097] First, text pre - processing, perform word segmentation on the literature, remove stop words, and perform stemming or lemmatization to unify the expression form. For example, standardize "clearing heat and detoxifying" and "clearing heat and relieving toxin" into the same word.

[0098] Secondly, construct a co - occurrence matrix, count the co - occurrence times of the property and the target, the times the property appears alone, and the times the target appears alone, and construct a co - occurrence matrix.

[0099] Thirdly, calculate the point mutual information to measure the association strength between the property and the target. The larger the PMI value, the more significant the association. The point mutual information The formula is as follows:

[0100] ;

[0101] Among them, , , ,N is the total number of word pairs; a is the property attribute; b is the pharmacological target; Is the co - occurrence probability of the property a and the target b; Is the probability that the property a appears alone; Is the probability that the target b appears alone..

[0102] Fourthly, through chi - square test, perform significance verification, construct a 2×2 contingency table (co - occurrence / non - co - occurrence), and calculate the chi - square statistic. The formula is as follows:

[0103] ;

[0104] in, This represents the actual observation frequency. For the expected frequency, .

[0105] Calculate the p-value based on the degrees of freedom and chi-square value, and screen for co-occurrence pairs with p < 0.05, where the degrees of freedom (df) are... The p-value is determined based on the chi-square distribution table and degrees of freedom (usually p < 0.05 is considered significant).

[0106] Fifth, threshold setting and edge generation, including: generating cross-layer edges based on the following conditions:

[0107] PMI value > 0 (positive correlation);

[0108] Co-occurrence count ≥ 3 (avoid low-frequency noise);

[0109] The chi-square test showed significance (p<0.05).

[0110] Finally, the confidence scores for edge attributes are calculated. Combining PMI and co-occurrence frequency, the formula for the normalized confidence score C is defined as follows:

[0111] ;

[0112] in, For point-to-point mutual information; The maximum PMI value among all co-occurring pairs.

[0113] It should be noted that combining PMI with the chi-square test can identify statistically significant associations with low co-occurrence frequency, such as special combinations in traditional Chinese medicine. The significance test filters out random co-occurrences, avoiding the over-reliance of TF-IDF on high-frequency words. PMI directly quantifies the association strength, while the chi-square test provides statistical evidence, which meets the needs of knowledge discovery in traditional Chinese medicine.

[0114] B2: Spatial pre-matching of cross-layer relationship edges, mapping the organs and organs belonging to the meridians to the target tissues with the same name.

[0115] Specifically, the specific steps include:

[0116] first,

[0117] Standardize the names, including: standardize the names of the organs and viscera associated with the meridians, that is, standardize the terminology of the traditional names of the organs and viscera associated with the meridians;

[0118] Standardize target tissues by inputting the target tissue location description and standardizing the target tissue names.

[0119] Furthermore, a predefined meridian-organ mapping table is used. Traditional meridian names are input, and the meridian names are converted to modern anatomical names based on the predefined meridian-organ mapping table, such as "Liver Meridian → Liver".

[0120] In this embodiment of the application, step S300 constructs a pharmacological ontology layer based on the pharmacological ternary set, defines the logical constraints and compatibility rules of properties, flavors, and meridian tropism, and integrates a biomedical ontology based on the pharmacological ternary set to construct a causal reasoning chain of "target-pathway-disease," including the following steps C1-C2:

[0121] C1: The logical constraints defining the nature, flavor, and meridian tropism;

[0122] Specifically, the logical constraints of the nature-flavor-meridian relationship are defined. The RDF triples generated in step S200 are input, and the data is reasoned according to the set rules. If the rule is triggered, the rule engine will automatically mark the pairing as taboo and store the result.

[0123] C2: Constructing causal reasoning chains includes establishing targeted associations of "target-pathway-disease" based on the KEGG (Kyoto Encyclopedia of Genes and Genomes) pathway database, and labeling pathway enrichment weights.

[0124] Specifically, the steps for constructing a causal inference chain based on the KEGG pathway database include:

[0125] First, identify the targeted association between the target, pathway, and disease:

[0126] The association between targets and pathways is obtained through the KEGG pathway database. For example, the target TNF-α is involved in the inflammatory pathway.

[0127] Pathway-disease association: The association between pathways and diseases was extracted from the KEGG database. For example, the inflammatory pathway is associated with rheumatoid arthritis.

[0128] Secondly, the pathway enrichment weights are labeled, and the specific process includes:

[0129] Gene set enrichment analysis: Gene set enrichment analysis is used to calculate the enrichment weight of pathways in a specific disease. The formula for calculating the pathway enrichment weight E is as follows:

[0130] ;

[0131] Where E represents the degree of enrichment of the pathway under a specific disease or condition. The larger the value, the more significant the association between the pathway and the disease or condition. This represents the probability of a set of genes or proteins appearing in a pathway. The smaller the p-value, the higher the significance of the pathway.

[0132] Enrichment weights are labeled onto pathways so that they can be used in causal inference chains.

[0133] Finally, construct the causal reasoning chain:

[0134] (1) Integrate data from the KEGG pathway database, the ICD-11 disease database and the UniProt target database to construct a complete “target-pathway-disease” knowledge graph;

[0135] (2) A rule-based reasoning engine is used to perform reasoning analysis on the causal reasoning chain. During the reasoning process, the path enrichment weight needs to be added, and the path with higher enrichment is selected first for reasoning to improve the accuracy and reliability of the reasoning results.

[0136] In this embodiment of the application, step S400 performs spatial semantic mapping on the meridian tropism attribute and pharmacological entity to obtain the meridian tropism coordinates and target location, and calculates the spatial similarity between the meridian tropism coordinates and target location to generate a dynamic cross-layer mapping relationship, including the following steps D1-D2:

[0137] D1: Set the Euclidean distance threshold between coordinates and calculate the Euclidean distance between the meridian coordinates and the target point location. If the distance is less than the preset threshold, generate a cross-layer relationship edge.

[0138] Among them, the meridian coordinates and the target location distance The threshold is set to 15mm, and the calculation formula is:

[0139] ;

[0140] in, These are the coordinates of the meridian coordinates in three-dimensional space. The coordinates of the target point in three-dimensional space;

[0141] like Generate edges <meridian, spatial association, target>.

[0142] D2: Set a statistical threshold and construct a weight matrix based on the co-occurrence frequency of flavor and target. If the weight value is higher than the statistical threshold, derive the generalization rule.

[0143] The statistical thresholds are set as follows: the frequency of co-occurrence of odor and target is ≥10 times, with a confidence level ≥70% and a support level ≥5%.

[0144] Let the set of flavors be F = {F1, F2, ..., F}. m The target set is T = {T1, T2, ..., T}.n}

[0145] Elements of the weight matrix W Indicates flavor F i With target T j The strength of the association between them is calculated using the following formula:

[0146] ;

[0147] in, Indicates flavor F i With target T j The number of times they co-occur; Indicates flavor F i Total number of occurrences; Indicates target point T j Total number of occurrences;

[0148] like If the value is ≥0.6, then the generalization rule is derived. For example, if the flavor F i (Bitterness) and target T j Weight of (regulation of inflammatory pathways) If the value is ≥0.6, the generalization rule "bitter taste → regulation of inflammatory pathways" can be derived.

[0149] In this embodiment of the application, step S500 uses an attribute graph database to store node types and edge types, and constructs a hybrid index, including the following steps E1-E2:

[0150] E1: A B+ tree index is used for the meridian attribute, enabling the hybrid index to support range queries;

[0151] B+ tree indexes are self-balancing tree data structures commonly used in databases and file systems, suitable for storing large amounts of data. Each node in a B+ tree index contains multiple key values ​​and pointers to child nodes. Internal nodes do not store data, only key values ​​and pointers; leaf nodes store the actual data and pointers to the next leaf node. All leaf nodes are at the same level and linked together sequentially, forming a linked list structure. The key values ​​of internal nodes are used to partition the data, ensuring that the data in each subtree is less than or equal to the key value of that node, while the key values ​​in leaf nodes represent a portion of the actual stored data.

[0152] Specifically, the meridian attribute uses a numerical format as the key-value pair in the B+ tree, and each key-value node stores information including the meridian attribute, a disk address pointing to a leaf node, and the key-value range of the current node. Each leaf node stores a maximum of 100 key-value pairs, ensuring that the data size of a single node is adapted to the memory page size, reducing disk I / O operations. Leaf nodes are connected by a doubly linked list to support efficient range traversal.

[0153] For example, to search for medicinal materials with the range "warmth ≤ code ≤ heat" (i.e., 0.5 ≤ key ≤ 1), the specific steps for this range search include:

[0154] Starting from the root node, locate the first leaf node with a key value ≥ 0.5;

[0155] Traverse the leaf node linked list and collect all records whose key values ​​are in the range [0.5, 1].

[0156] Returns a list of matching medicinal materials, displaying all medicinal materials that meet the requirements.

[0157] It should be noted that when traversing leaf nodes, the method of preloading adjacent node data into the cache is used to reduce random access latency; when splitting nodes, a batch write strategy is used to reduce disk fragmentation.

[0158] It should be further explained that when the number of key values ​​in a node exceeds 100, it is split into two nodes according to the middle value, i.e., the 50th key, and the parent node is updated; when the number of key values ​​stored in a node is less than 30, it is automatically merged with the adjacent node, triggering the parent node key value update.

[0159] E2: Hash indexes are used for pharmacological entity names to achieve precise matching and accelerate the process;

[0160] Specifically, the hash value of the pharmacological entity name is calculated using a multinomial rolling hash method for the UniProt ID, with the following formula:

[0161]

[0162] Where: S is the input string, i.e., UniProt ID; n is the length of the string; It is the first in the string An integer value of 31 characters; 31 is a constant used to control the distribution of hash values. It is the modulus, used to limit the range of hash values.

[0163] It should be noted that the bucket size is set to 1000, and the hash value is mapped to a bucket index (0~999) after modulo operation. Each bucket maintains a linked list to store conflicting key-value pairs. When two different UniProt IDs result in the same bucket index after hash calculation, they are stored in the linked list of the same bucket. When the linked list length exceeds 10, it is converted to a skip list, reducing the query complexity from O(n) to... Among them, the skip list is a data structure that allows for fast searching. It achieves fast lookup by adding multiple levels of indexes to the linked list. When the total number of key values ​​ / number of buckets > 0.75, expansion is triggered, that is, the number of new buckets is expanded to twice the original number, and all key values ​​are updated and hashed. This process adopts incremental expansion to avoid service interruption.

[0164] O(n) indicates that the algorithm's time complexity is linear, meaning that the algorithm's running time is linearly related to the size of the input data; as the data size increases, the running time also increases proportionally. O(n) processes only one data item at each step, making it suitable for simple traversal operations, such as linear searches of arrays.

[0165] The time complexity of an algorithm is logarithmic, which is usually because the algorithm uses a divide-and-conquer strategy, where the data size is halved with each operation, and the running time grows much slower than the data size. Each step processes half the data size, making it suitable for efficient search algorithms such as binary search.

[0166] In an optional implementation, step S500 may further employ a radix tree-based compressed hierarchical index to construct a pharmacological entity name index, including:

[0167] First, the radix tree structure is optimized by splitting UniProt IDs into a hierarchical structure based on characters, with each level corresponding to a character position. If a path is unique, nodes are merged to reduce depth. For example, if all IDs begin with "P1", the root node directly points to the merged node for "P1", instead of expanding character by character.

[0168] Furthermore, a lightweight hash is performed on the characters at the end of the path, and the hash value is used as the key of the leaf node to directly associate it with the storage location. Combining path compression and hashing reduces the tree depth and the number of comparisons.

[0169] Secondly, a hybrid indexing strategy is established. The prefix segmented index divides the ID into a fixed-length prefix and a remaining part. The prefix is ​​managed by a radix tree, and the remaining part uses a Bloom filter to quickly filter invalid matches, combined with binary search to locate the ID in the ordered list. Lazy node expansion dynamically expands the tree nodes only when a new ID is inserted, avoiding pre-allocation of memory and improving space utilization.

[0170] Finally, regarding conflict handling and scaling, when the number of child nodes of a node exceeds a threshold, it is automatically split into finer-grained levels to balance query efficiency and memory usage. The tree's levels are increased or segment lengths are expanded as needed to avoid global refactoring. For example, when the number of IDs under a prefix exceeds a threshold, the remaining portion of that prefix is ​​further segmented.

[0171] E3: Pre-compute high-frequency paths and cache subgraph structures.

[0172] Among them, high-frequency path identification includes: recording daily query logs and counting the top 10 query paths of each day;

[0173] The query logs are weighted, and the 10 paths with the highest weights are selected for pre-calculation. The calculation formula is as follows:

[0174] ;

[0175] Where P represents a specific query path.

[0176] The specific pre-computation strategies include: using the materialized view function of the graph database to periodically execute predefined queries and generate subgraph snapshots; caching the subgraph snapshots to an in-memory database, setting the key as the path name and the value as the serialized subgraph data.

[0177] Compared with existing solutions, the advantages of this invention are shown in Table 1:

[0178] Table 1. Comparison of the performance of querying knowledge graphs of traditional Chinese medicine.

[0179]

[0180] In this embodiment of the application, step S500 involves real-time acquisition of new data streams, dynamic updating of the graph using an incremental graph embedding algorithm, and provision of an intelligent decision-making interface and a visual interaction platform. Graph optimization is driven by user feedback, including the following steps F1-F2:

[0181] F1: New data is obtained in real time by accessing new pharmacological research data, clinical drug use feedback and digitized text streams of ancient books through a distributed message queue, and the new data is verified by a logical rule engine to see whether the new data meets the drug compatibility contraindications.

[0182] A threshold is set based on the difference between the new data and the original data. Data below the threshold is considered low-conflict data and is directly inserted into the graph. Data above the threshold is considered high-conflict data and triggers a manual review branch.

[0183] Specifically, low-conflict data, defined as data with a difference value ≤ 5%, can be directly inserted into the graph;

[0184] High-conflict data refers to data with a difference value greater than 5%, which triggers a manual review process, generates a review report, and notifies experts via email.

[0185] The methods for calculating the difference value include:

[0186] First, calculate the meridian overlap rate, using the following formula:

[0187]

[0188] in, This refers to the meridian tropism of medicinal material A; This refers to the meridian tropism of medicinal material B; This is the set of meridians shared by medicinal materials A and B; This is the general set of meridians for medicinal materials A and B.

[0189] It should be noted that if herb A is associated with the liver and lung meridians, and herb B is associated with the lung and heart meridians, then the overlap rate of meridian association is 1 / 3, meaning they share the lung meridian.

[0190] Secondly, calculate the target interaction risk value: calculate the combined risk value based on the edge weights of the target interaction network.

[0191] It should be noted that if there are multiple high-weighted paths in the target interaction network between medicinal material A and medicinal material B, the risk value is relatively high.

[0192] For example, the new data shows that a certain combination of medicinal materials belongs to the liver and lung meridians, with a target interaction risk value of 0.7; the original data shows that the same combination of medicinal materials belongs to the liver and heart meridians, with a target interaction risk value of 0.3.

[0193] Therefore, the difference between the original meridian tropism (liver, heart) and the new meridian tropism (liver, lung) is 1 / 2, with a difference percentage of 50%; the difference in target interaction risk is 0.7-0.3=0.4, with a difference percentage of 133%.

[0194] The formula for calculating the percentage difference is as follows:

[0195] ;

[0196] The average difference between 50% and 133% is 91.5%, which exceeds the 5% threshold and triggers a manual review process.

[0197] It should be noted that the "Guidelines for Constructing a Knowledge Graph of Traditional Chinese Medicine" recommends a difference threshold range of 4%-6%, with 5% being the optimal value for balancing accuracy and efficiency. Furthermore, in the weighted mapping of the relationship between properties, flavors, meridian tropism, and targets, 5% difference corresponds to the "acceptable range of efficacy deviation" in pharmacological theory (e.g., the equivalence of slightly cold and cool properties). In addition, in statistics, the 5% difference threshold is a common rule of thumb, typically used to distinguish between low-conflict and high-conflict data. This rule of thumb helps the system automatically identify most data with high consistency, while submitting potentially problematic data for manual review.

[0198] F2: The intelligent decision-making interface includes drug compatibility detection and medication recommendation.

[0199] The drug compatibility test includes calculating the risk value of drug combinations based on the overlap rate of meridian tropism and target interaction database, and issuing an alarm for combinations that generate risks;

[0200] Specifically, compatibility testing requires calculating the overlap rate of meridian tropism in the combination of medicinal materials. The formula for calculating the overlap rate of meridian tropism in a combination of medicinal materials is as follows:

[0201] ;

[0202] in, This refers to the meridian tropism of medicinal material A; This refers to the meridian tropism of medicinal material B; This is the set of meridians shared by medicinal materials A and B; This is the general set of meridians for medicinal materials A and B.

[0203] It should be noted that, if If so, an alert will be triggered.

[0204] Medication recommendations include generating multi-dimensional medication plans by jointly searching the drug properties and pharmacology layers by inputting symptoms and patient constitution.

[0205] Specifically, the input symptom "lung heat cough" is analyzed as a combination of nature and flavor constraints, namely, cold in nature and entering the lung meridian, and target constraints, namely, inhibiting IL-6. Finally, a medication regimen recommendation is generated, such as candidate herbs Scutellaria baicalensis and Morus alba root bark, and the confidence ranking of the medication regimen under this symptom.

[0206] In summary, this invention quantifies the four properties and five flavors, facilitating computer processing and analysis, improving data processing efficiency, and enabling quantitative analysis and pattern recognition. It standardizes data by unifying target names in pharmacological entities to UniProtID and storing disease names using ICD-11 encoding, facilitating data integration and comparative analysis. It resolves the ambiguity of identical-named medicinal materials by determining whether they belong to the same entity through molecular fingerprint similarity, improving the accuracy of medicinal material identification and avoiding confusion. By setting preset mapping rules and generating cross-layer relationship edges, and performing spatial pre-matching on these edges, it establishes the association between medicinal material properties and flavors and pharmacological targets, providing a foundation for subsequent reasoning and analysis. Finally, it defines logical constraints and compatibility rules for properties, flavors, and meridian tropism. Based on the pharmacological ternary set integrated biomedical ontology, a causal reasoning chain of "target-pathway-disease" is constructed, improving the scientificity and rationality of herbal compatibility. By setting a threshold for the Euclidean distance between coordinates, the Euclidean distance between the meridian coordinates and the target location is calculated, and a weight matrix is ​​constructed based on the co-occurrence frequency of properties and flavors and the target, optimizing the recommendation of herbal compatibility. By using B+ tree indexes and hash indexes to improve data storage and query efficiency, and by pre-calculating high-frequency paths and caching subgraph structures, system performance is improved, query latency is reduced, and user experience is enhanced. By collecting new data streams in real time and dynamically updating the graph after verifying the consistency between medicinal properties and pharmacology, an intelligent decision-making interface and a visual interaction platform are provided, realizing dynamic knowledge updates and intelligent recommendations, improving the accuracy and efficiency of decision-making.

[0207] Example 3

[0208] The above is an illustrative scheme for constructing a knowledge graph of traditional Chinese medicine. It should be noted that the technical solution of the system for constructing this knowledge graph of traditional Chinese medicine belongs to the same concept as the technical solution of the method for constructing the knowledge graph of traditional Chinese medicine described above. Details not described in detail in the technical solution of the system for constructing the knowledge graph of traditional Chinese medicine in this embodiment can be found in the description of the technical solution of the method for constructing the knowledge graph of traditional Chinese medicine described above.

[0209] This embodiment also provides a system for constructing a knowledge graph of traditional Chinese medicine, including:

[0210] The distributed data acquisition module is used to configure the multi-threaded crawler engine and API gateway for real-time acquisition of raw data from heterogeneous data sources.

[0211] A natural language processing engine is used to integrate a domain-adaptive pre-trained model and a rule engine to complete entity recognition and relation extraction.

[0212] The knowledge fusion computing module is used to deploy graph embedding algorithms and ontology inference engines to achieve entity alignment and logical rule verification.

[0213] The graph database storage system is based on a distributed storage cluster built on an attribute graph model, supporting high-concurrency queries and transaction processing.

[0214] The dynamic update control module uses a streaming computing framework to process incremental data in real time and updates the map in conjunction with confidence assessment.

[0215] A visual interactive platform; it provides a visual rendering engine and RESTful API interfaces, supporting multi-terminal access and application integration.

[0216] This embodiment also provides an electronic device suitable for constructing a knowledge graph of traditional Chinese medicine, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the method for constructing a knowledge graph of traditional Chinese medicine as proposed in the above embodiment.

[0217] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the method for constructing a knowledge graph of traditional Chinese medicine as proposed in the above embodiments.

[0218] The storage medium proposed in this embodiment and the method for constructing a knowledge graph of traditional Chinese medicine proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0219] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0220] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for constructing a knowledge graph of traditional Chinese medicine, characterized in that, include: Structured and unstructured data were collected from ancient Chinese herbal medicine books, modern pharmacology databases, and clinical medication records. Then, through terminology standardization, conflict resolution, and semantic coding, a pharmacological data table of medicinal properties was generated. The properties and meridian tropism of medicinal materials are extracted from the pharmacological data table to generate a "medicinal material, properties and flavor, value" triplet. At the same time, the interaction relationship between chemical components and targets is extracted from the pharmacological data table to generate a "component, inhibition, target" triplet. Preliminary cross-domain associations are established between medicinal property terms and pharmacological entities. Based on the pharmacological ternary set, a pharmacological ontology layer is constructed, defining the logical constraints and compatibility rules of properties, flavors and meridian tropism. Based on the pharmacological ternary set, a biomedical ontology is integrated to construct a causal reasoning chain of "target-pathway-disease". Spatial semantic mapping is performed on meridian tropism attributes and pharmacological entities to obtain meridian tropism coordinates and target location, and the spatial similarity between meridian tropism coordinates and target location is calculated to generate dynamic cross-layer mapping relationships. An attribute graph database is used to store the node types and edge types of meridian tropism attributes and pharmacological entities, and a hybrid index is constructed. The construction of the hybrid index includes using a B+ tree index for the meridian attribute, enabling the hybrid index to support range queries; Hash indexes are used for pharmacological entity names to achieve precise matching and accelerate the process; Pre-compute high-frequency paths and cache subgraph structures; It collects new data streams in real time, dynamically updates the map using an incremental map embedding algorithm, and provides an intelligent decision-making interface and a visual interaction platform, driving map optimization through user feedback.

2. The method for constructing a knowledge graph of traditional Chinese medicine as described in claim 1, characterized in that: The generated pharmacological data table includes: Based on a predefined pharmacological terminology database, the four properties of cold, heat, warmth, and coolness, and the five flavors of pungent, sweet, sour, bitter, and salty are numerically encoded, and their meridian attributes are mapped to a meridian coding table. The target names in pharmacological entities are standardized as UniProt IDs, and disease names are stored using ICD-11 encoding. The semantic ambiguity of medicinal materials with the same name was resolved through expert review, and a cross-source data mapping rule base was established.

3. The method for constructing a knowledge graph of traditional Chinese medicine as described in claim 2, characterized in that: The establishment of the initial cross-domain association includes: Set a preset mapping rule: if the properties and flavors of medicinal materials co-occur with the functional description of pharmacological targets, then generate cross-layer relationship edges. Spatial pre-matching is performed on the cross-layer relationship edges, and the organs and organs belonging to the meridians are mapped to the target tissues with the same name.

4. The method for constructing a knowledge graph of traditional Chinese medicine as described in claim 3, characterized in that: The drug constructive ontology layer includes: The logical constraints defining the nature, flavor, and meridian tropism; The construction of the causal reasoning chain includes establishing a targeted association of "target-pathway-disease" based on the KEGG pathway database and labeling the pathway enrichment weight.

5. The method for constructing a knowledge graph of traditional Chinese medicine as described in claim 4, characterized in that: The generation of dynamic cross-layer mapping relationships includes: Set a threshold for the Euclidean distance between coordinates and calculate the Euclidean distance between the meridian coordinates and the target point location. If the distance is less than the preset threshold, generate a cross-layer relationship edge. Set a statistical threshold, construct a weight matrix based on the co-occurrence frequency of flavor and target, and derive a generalization rule if the weight value is higher than the statistical threshold.

6. The method for constructing a knowledge graph of traditional Chinese medicine as described in claim 5, characterized in that: The dynamically updated map, which provides an intelligent decision-making interface and a visual interaction platform, optimizes the map through user feedback, including: New data is acquired in real time by accessing new pharmacological research data, clinical drug use feedback and digitized text streams of ancient books through a distributed message queue, and the new data is verified to meet the drug incompatibilities through a logical rule engine. A threshold is set based on the difference between the new data and the original data. Data below the threshold is considered low-conflict data and is directly inserted into the graph. Data above the threshold is considered high-conflict data and triggers a manual review branch. The intelligent decision-making interface includes drug compatibility detection and medication recommendation: The drug compatibility test includes calculating the risk value of drug combinations based on the overlap rate of meridian tropism and target interaction database, and issuing an alarm for combinations that generate risks; Medication recommendations include generating multi-dimensional medication plans by jointly searching the drug properties and pharmacology layers based on input of symptoms and patient constitution.

7. A system for constructing a knowledge graph of traditional Chinese medicine, using the method described in any one of claims 1-6, characterized in that, include: The distributed data acquisition module is used to configure the multi-threaded crawler engine and API gateway for real-time acquisition of raw data from heterogeneous data sources. A natural language processing engine is used to integrate a domain-adaptive pre-trained model and a rule engine to complete entity recognition and relation extraction. The knowledge fusion computing module is used to deploy graph embedding algorithms and ontology inference engines to achieve entity alignment and logical rule verification. The graph database storage system is based on a distributed storage cluster built on an attribute graph model, supporting high-concurrency queries and transaction processing. The dynamic update control module uses a streaming computing framework to process incremental data in real time and updates the map in conjunction with confidence assessment. A visual interactive platform; it provides a visual rendering engine and RESTful API interfaces, supporting multi-terminal access and application integration.

8. An electronic device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the method for constructing the Chinese herbal medicine knowledge graph according to any one of claims 1 to 6.

9. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the method for constructing a knowledge graph of traditional Chinese medicine as described in any one of claims 1 to 6.