Traditional Chinese medicine knowledge graph fusion system based on semantic alignment
Through the TCM knowledge graph fusion system based on semantic alignment, the entity alignment and relationship prediction problems of the TCM knowledge graph are solved, and high-precision and high-efficiency knowledge graph fusion is achieved, which supports real-time updates and dynamic expansion and complies with TCM professional standards.
Patent Information
- Application Number
- CN202511101543.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-09-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies cannot effectively solve the problems of semantic complexity, historical evolution, regional variability and dosage representation diversity of traditional Chinese medicine knowledge graphs, resulting in high entity alignment error rate, insufficient relationship prediction accuracy, lack of end-to-end fusion capabilities, low update efficiency, and inability to support real-time and dynamic updates.
A traditional Chinese medicine knowledge graph fusion system based on semantic alignment is adopted, including a multimodal semantic embedding and entity alignment layer, a business representation layer of structure embedding and attribute fusion, an enhanced TransR model and knowledge graph construction layer, an intelligent rule engine and conflict resolution layer, an end-to-end automated pipeline layer and incremental dynamic updates. Through deep semantic understanding, adaptive threshold adjustment, multi-relationship modeling and an intelligent rule engine, high-precision and high-efficiency knowledge graph fusion is achieved.
The high-precision alignment accuracy of the TCM knowledge graph has been increased to 80-90%, the fusion time and update time have been shortened, the need for expert intervention has been reduced, the fusion results have been ensured to comply with TCM professional standards, and real-time updates and efficient incremental updates have been supported.
Smart Images

Figure CN120600343A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of knowledge graph technology, and specifically is a traditional Chinese medicine knowledge graph fusion system based on semantic alignment. Background Art
[0002] Traditional Chinese medicine data has the following characteristics, which determine the limitations of traditional knowledge graph fusion methods: Semantic complexity: Prescription names often contain profound theoretical connotations of traditional Chinese medicine. For example, the "Xiaoyao" in "Xiaoyao San" embodies the therapeutic concept of soothing the liver and relieving depression, while the "San" indicates the characteristics of the dosage form. Historical evolution: The same prescription may have different compositions and dosages in different historical periods. For example, the Xiao Chaihu Decoction in the Treatise on Febrile Diseases has a different composition than that used in modern clinical practice. Regional variability: Physicians in different regions may have different understandings and applications of the same prescription, resulting in subtle differences in composition; Diversity in dosage representation: The dosage units in ancient documents (qian, liang, sheng, he, etc.) need to be standardized and converted.
[0003] Existing technologies lack end-to-end fusion capabilities and collaborative optimization between submodules, resulting in error accumulation and information loss. Furthermore, their semantic understanding is limited, relying primarily on string matching or simple semantic embedding. This inability to deeply understand complex semantic relationships in Traditional Chinese Medicine, such as "same name, different prescriptions" or "different names, same prescriptions," results in high entity alignment error rates and insufficient relationship prediction accuracy.
[0004] Secondly, due to the low degree of automation, a lot of manual intervention is required for parameter tuning, result verification and exception handling, which causes the processing time to increase exponentially; the update efficiency is low, and the use of full reconstruction or batch processing mode cannot support incremental updates. Each update requires reprocessing all data, which seriously affects the overall efficiency of the system; at the same time, the lack of real-time and dynamic update capabilities affects the practicality of the system; the use of batch processing mode cannot support real-time updates, resulting in the knowledge graph being unable to reflect the latest information in a timely manner, affecting the timeliness and accuracy of decision-making.
[0005] Finally, paper-based structured knowledge is underutilized, making it impossible to effectively integrate the multidimensional attribute information of traditional Chinese medicines. This results in limited semantic expression capabilities of knowledge graphs, making them incapable of supporting complex TCM reasoning and decision-making. Limited semantic understanding prevents the establishment of deep knowledge connections, resulting in a lack of internal logic and integrity in the integrated knowledge graph. Therefore, improvements are needed. Summary of the Invention
[0006] The purpose of the present invention is to provide a TCM knowledge graph fusion system based on semantic alignment to solve the problems raised in the above background technology.
[0007] To achieve the above objectives, the present invention provides the following technical solutions: a TCM knowledge graph fusion system based on semantic alignment, comprising a multimodal semantic embedding and entity alignment layer, a business representation layer for structure embedding and attribute fusion, an enhanced TransR model and knowledge graph construction layer, an intelligent rule engine and conflict resolution layer, an end-to-end automated pipeline layer, a multi-task learning framework, and incremental dynamic updates; The multimodal semantic embedding and entity alignment layer is responsible for processing the recognition and preliminary alignment of TCM knowledge entities from different data sources; The business presentation layer of structure embedding and attribute fusion processes the composition structure and drug attribute information of traditional Chinese medicine prescriptions; The enhanced TransR model and knowledge graph construction layer are responsible for constructing a high-quality TCM knowledge graph; The intelligent rule engine and conflict resolution layer handle conflicts and contradictions in the process of integrating traditional Chinese medicine knowledge; The end-to-end automated pipeline layer is responsible for the automated management and quality assurance of the entire TCM knowledge graph fusion process.
[0008] Preferably, the multimodal semantic embedding and entity alignment layer includes a semantic encoding module, an adaptive threshold module and a confidence assessment module; The semantic encoding module performs deep semantic understanding of TCM text descriptions, using an improved BERT model combined with pre-trained corpus in the field of TCM to accurately identify complex semantic relationships in prescriptions. The adaptive threshold module dynamically adjusts the similarity threshold according to the characteristics of different types of entities, avoiding the limitations of traditional fixed threshold methods; The confidence assessment module assigns a confidence score to each alignment result, providing a reliable quality indicator for upper-level processing.
[0009] Preferably, the business representation layer of structure embedding and attribute fusion includes a business standardization module, a graph embedding technology module and an attribute fusion module; The business standardization module solves the problem of inconsistent drug dosage representation in different documents and establishes a unified dosage conversion system to accurately convert ancient measurement units such as "qian" and "liang" to modern units such as "gram" and "milliliter". The graph embedding technology module models the drug composition relationship of the prescription as a graph structure, uses the improved GraphSAGE algorithm to learn the complex relationship between drugs, and captures the hierarchical structure of the monarch, minister, assistant and envoy combinations; The attribute fusion module integrates multi-dimensional attribute information of medicinal materials such as nature, flavor, meridians, and efficacy classification, and automatically learns the importance weights of different attributes through the attention mechanism.
[0010] Preferably, the enhanced TransR model and knowledge graph construction layer includes a multi-relationship modeling module, a multi-task learning framework module and an incremental update algorithm module; The multi-relationship modeling module is based on an improved version of the TransR model, optimized for the multi-relationship characteristics of the field of traditional Chinese medicine, and can simultaneously handle multiple relationship types such as "treatment", "compatibility", and "contraindications"; The multi-task learning framework module is an autonomous learning mechanism that continuously improves model performance through iterative optimization, uses existing high-confidence knowledge to guide the learning of new knowledge, and achieves self-improvement and expansion of knowledge. The incremental update algorithm designs an efficient update strategy with a time complexity of O(k log n), where k is the amount of new data and n is the size of the existing knowledge graph.
[0011] Preferably, the intelligent rule engine and conflict resolution layer includes a business rule detection module, a conflict resolution engine and a rule learning module; The business rule detection module is a compatibility taboo detection module, which integrates the traditional Chinese medicine theory of 18 anti-reactions and 19 fears, establishes a complete compatibility taboo knowledge base, and can automatically identify potential conflicts in prescription composition; The conflict resolution engine adopts a multi-strategy fusion approach, combining multiple dimensions such as literature authority, time recency, and clinical validation to make comprehensive judgments and automatically resolve data conflicts. The rule learning module automatically extracts conflict resolution rules from a large number of fusion cases through machine learning technology, thereby achieving dynamic updating and continuous optimization of the rule base.
[0012] Preferably, the end-to-end automated pipeline layer includes a data preprocessing module, a semantic fusion module and a quality verification module; The data preprocessing module uses intelligent recognition algorithms to automatically detect and process heterogeneous data from different data sources, supports automatic parsing of multiple formats such as XML, JSON, and CSV, and achieves data cleaning and standardization through a combination of rule engines and machine learning, effectively handling the special issues of traditional and simplified Chinese character conversion and variant character recognition in ancient books and documents; The semantic fusion module builds a semantic similarity calculation model based on deep learning technology, which can identify the same concept in different expressions and realize automatic alignment at the concept level through mapping in the semantic vector space; The quality verification module establishes a multidimensional quality assessment system covering data integrity, logical consistency, and medical rationality, and adopts a verification strategy that combines rule-based hard constraint checks and statistical-based soft constraint evaluations to ensure that the fusion results comply with the theoretical standards of traditional Chinese medicine.
[0013] Preferably, the multi-task learning framework simultaneously optimizes three auxiliary tasks, namely entity alignment, relationship prediction, and attribute completion, based on the main task of TransR to improve the generalization ability of the model; Entity alignment task: Determine whether two entities are different representations of the same entity, solving the entity duplication problem in the knowledge graph of traditional Chinese medicine prescriptions; Relationship prediction task: Predict the relationship type based on the given head and tail entities to enhance the model's understanding of relationships in the field of Traditional Chinese Medicine prescriptions. Specific relationship types in the field of Traditional Chinese Medicine include: composition relationship, efficacy relationship, therapeutic relationship, compatibility relationship, meridian relationship, etc. Attribute completion task: predict missing attributes of entities to improve the completeness of the knowledge graph; specific attribute types include: numerical attributes (dose, toxicity level), classification attributes (nature and taste, meridians), text attributes (preparation method, usage), etc.
[0014] Preferably, the incremental dynamic update is used to achieve real-time update of the TCM knowledge graph.
[0015] The beneficial effects of the present invention are as follows: 1. Through the innovative combination of multi-level semantic alignment technology and an intelligent rule engine, this invention achieves an innovative method for automatic end-to-end fusion of TCM knowledge graphs by simply inputting two graph data. Compared to the approximately half accuracy of traditional string matching methods, this invention improves alignment accuracy to 80-90%. More importantly, with the same data, fusion time and incremental update time are shortened, while also improving performance and efficiency. 2. This invention deeply integrates traditional Chinese medicine compatibility theories such as the Eighteen Antidotes and Nineteen Fears into the automated fusion process, improving the accuracy of compatibility taboo detection and ensuring that the fusion results meet the professional standards of Chinese medicine. Through the intelligent rule engine, the system can automatically identify and resolve data conflicts, significantly reducing the need for expert intervention; 3. The present invention abandons the traditional method of manual intervention and builds an end-to-end automated pipeline; the efficient incremental update mechanism enables automatic update of less than 1,000 entities. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is the overall architecture diagram of the system of the present invention; Figure 2 This is the flowchart of the multimodal semantic embedding and entity alignment of the present invention; Figure 3 This is the structural embedding and attribute fusion architecture diagram of the present invention; Figure 4 This is a structural diagram of the enhanced TransR model of the present invention; Figure 5 This is the architecture diagram of the intelligent rule engine of the present invention; Figure 6 This is a flow chart of the end-to-end automated assembly line of the present invention; Figure 7 This is a flow chart of the incremental dynamic update algorithm of the present invention. DETAILED DESCRIPTION
[0017] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0018] Example 1: The embodiment of the present invention provides a TCM knowledge graph fusion system based on semantic alignment, including a multimodal semantic embedding and entity alignment layer, a business representation layer for structure embedding and attribute fusion, an enhanced TransR model and knowledge graph construction layer, an intelligent rule engine and conflict resolution layer, an end-to-end automated pipeline layer, a multi-task learning framework, and incremental dynamic updates; The multimodal semantic embedding and entity alignment layer is responsible for processing the recognition and preliminary alignment of TCM knowledge entities from different data sources; The business presentation layer of structure embedding and attribute fusion processes the composition structure and drug attribute information of traditional Chinese medicine prescriptions; The enhanced TransR model and knowledge graph construction layer are responsible for constructing a high-quality TCM knowledge graph; The intelligent rule engine and conflict resolution layer handle conflicts and contradictions in the process of integrating traditional Chinese medicine knowledge; The end-to-end automated pipeline layer is responsible for the automated management and quality assurance of the entire TCM knowledge graph fusion process.
[0019] Among them, Knowledge Graph: a structured data model used to represent entities and their relationships, organizing knowledge in the form of triples (subject-predicate-object).
[0020] Semantic Alignment: The process of identifying entities or concepts that represent the same concept in different data sources and establishing correspondence between them.
[0021] TransR model (Translation in Relation-specific spaces): A knowledge graph embedding learning model that learns knowledge representation by mapping entities and relations into different vector spaces.
[0022] Graph Embedding: A technique for converting graph-structured data into low-dimensional dense vector representations, preserving the structure and semantic information of the graph.
[0023] The 3σ rule is based on the statistical property of the normal distribution: 3σ range - approximately 99.73% of the data fall within the range of ±3 standard deviations from the mean.
[0024] Knowledge graph fusion technology foundation: Knowledge graph fusion integrates multiple heterogeneous knowledge graphs into a unified knowledge representation. The basic process includes four steps: entity alignment, relationship alignment, attribute fusion, and conflict resolution. Entity alignment is the core step, identifying entities representing the same concept by calculating similarities between them.
[0025] Semantic Embedding Technology Foundation: Semantic embedding converts text into high-dimensional vector representations, preserving semantic similarity. Commonly used pre-trained language models such as BERT and RoBERTa can generate high-quality semantic vectors, providing a foundation for entity alignment.
[0026] Graph embedding technology foundation: Graph embedding technology maps graph-structured data into a low-dimensional vector space, preserving the graph's topological structure and semantic information. Representative methods include DeepWalk, Node2Vec, and Graph2Vec.
[0027] TransR Model Basics: TransR is a classic model for knowledge graph embedding learning. It predicts missing triples by learning vector representations of entities and relations. Its core idea is to project entity embeddings into a relation-specific space for computation.
[0028] The entire five-layer architecture, through close collaboration between layers, forms a complete TCM knowledge graph fusion system. From bottom-level semantic understanding to top-level automated management, it provides innovative solutions to specific technical challenges, achieving the goal of high-precision, high-efficiency, and low-cost knowledge graph fusion.
[0029] Example 2: The multimodal semantic embedding and entity alignment layer includes a semantic encoding module, an adaptive threshold module and a confidence assessment module; The semantic encoding module performs deep semantic understanding of TCM text descriptions. Using an improved BERT model combined with pre-trained corpus in the field of TCM, it can accurately identify complex semantic relationships such as "same name, different prescriptions" and "different names, same prescriptions" in prescriptions. The adaptive threshold module dynamically adjusts the similarity threshold according to the characteristics of different types of entities, avoiding the limitations of traditional fixed threshold methods;
[0030] The confidence assessment module assigns a confidence score to each alignment result, providing a reliable quality indicator for upper-level processing.
[0031] Among them, the innovation of this layer lies in combining the language characteristics of ancient Chinese medicine and the expression methods of modern medical terms, thus achieving semantic unification of cross-era documents.
[0032] The multimodal semantic embedding and entity alignment technology is the core foundation of this invention, which is responsible for solving the entity recognition and alignment problems in the fusion of traditional Chinese medicine knowledge graphs. This technology adopts a five-step pipeline processing architecture, such as Figure 2 As shown in the figure, high-precision alignment of traditional Chinese medicine data entities is achieved through steps such as data preprocessing, semantic encoding, similarity calculation, adaptive threshold judgment and confidence assessment.
[0033] Figure 2 This paper demonstrates the complete process of multimodal semantic embedding and entity alignment. The entire process begins with an input dataset (e.g., a prescription dataset), undergoes five core processing steps, and ultimately outputs a high-quality alignment result set. Each step is specifically optimized for the specificities of Traditional Chinese Medicine (TCM), ensuring accurate processing of complex semantic relationships such as "same name, different prescriptions" and "different names, same prescriptions."
[0034] The data preprocessing module is responsible for cleaning and standardizing the input prescription name data. This module automatically removes modifiers from prescription names, retaining the core semantic information and improving the accuracy of subsequent matching. Let the original prescription name be N_original and define the modifier set M = {addition, flavoring, mixture, soup, powder, pill, paste, etc.}. The preprocessing function formula is: .
[0035] Among them, N_clean represents the name of the clean prescription after preprocessing; N_original represents the input original prescription name; m represents a single modifier element in the modifier set M; |N_original| represents the character length of the original prescription name; |m| represents the character length of the modifier.
[0036] The semantic encoding module uses a pre-trained multilingual semantic embedding model for deep semantic understanding and generates a 384-dimensional high-quality semantic vector. , the semantic encoding function is defined as: , in, Represents the 384-dimensional semantic vector of the i-th prescription name. Semantic similarity is calculated using cosine similarity: , in, represents the vector dot product, Represents the L2 norm of a vector.
[0037] The multi-level similarity calculation module comprehensively considers the three dimensions of string similarity, semantic similarity, and structural similarity to form a comprehensive similarity evaluation system. String similarity is calculated based on the edit distance algorithm and is defined as: , in, Represents a string and The edit distance between .
[0038] Structural similarity is calculated based on the Jaccard similarity coefficient of the prescription drug composition: , in, and They represent the drug composition sets of two prescriptions respectively, and represent the cardinality of the set.
[0039] The comprehensive similarity is obtained by weighted fusion of the similarities in three dimensions: , Among them, the weight parameters are determined by experimental optimization: =0.2 (string weight), =0.5 (semantic weight), = 0.3 (structural weight), and satisfies The adaptive threshold mechanism dynamically adjusts the similarity threshold based on the prescription type and data source. For example, the base threshold is determined by prescription type: 0.85 for decoctions, 0.80 for powders, 0.82 for pills, and 0.83 for ointments. Source adjustment factors: -0.02 for classical medical texts, 0.00 for modern literature, and +0.01 for clinical practice.
[0040] The confidence assessment module combines expert knowledge, cross-validation and consistency check for comprehensive evaluation. The expert knowledge confidence is calculated based on the TCM expert knowledge base, the cross-validation confidence is based on the consistency of similarity in each dimension, and the consistency confidence is based on the coordination of semantic and structural similarity. The final experimental verification achieves the best result according to the calculation ratio of 3:4:3.
[0041] Through the collaborative work of the above five steps, this technical solution can effectively improve the accuracy of prescription entity alignment, effectively solve the problem of identifying complex semantic relationships of TCM prescriptions such as "same name, different prescriptions" and "different names, same prescriptions", and provide high-quality basic data for subsequent knowledge graph construction.
[0042] Example 3: The business presentation layer of structure embedding and attribute fusion includes a business standardization module, a graph embedding technology module and an attribute fusion module; The business standardization module solves the problem of inconsistent drug dosage representation in different documents and establishes a unified dosage conversion system to accurately convert ancient measurement units such as "qian" and "liang" to modern units such as "gram" and "milliliter". The graph embedding technology module models the drug composition relationship of the prescription as a graph structure, uses the improved GraphSAGE algorithm to learn the complex relationship between drugs, and captures the hierarchical structure of the monarch, minister, assistant and envoy combinations;
[0043] The attribute fusion module integrates multi-dimensional attribute information of medicinal materials such as nature, flavor, meridians, and efficacy classification, and automatically learns the importance weights of different attributes through the attention mechanism.
[0044] Among them, the core contribution of this layer is to transform the structured knowledge in traditional Chinese medicine theory into computable vector representation, laying a solid foundation for the subsequent construction of knowledge graphs.
[0045] The structural embedding and attribute fusion technology solution is specifically designed to process the composition structure and drug attribute information of traditional Chinese medicine prescriptions, such as Figure 3 This part adopts a six-step processing process to transform the complex structural information of prescriptions into a 200-dimensional comprehensive feature vector through steps such as dosage standardization, efficacy classification, attribute vectorization, graph structure construction, graph model embedding, and feature fusion.
[0046] Figure 3 The complete architecture of structural embedding and attribute fusion is demonstrated. The entire process begins with the input of medicinal material attributes, undergoes layer-by-layer processing, and ultimately generates a comprehensive feature vector. This numerical representation of traditional Chinese medicine theory, such as the relationship between monarch, minister, assistant, and envoy compatibility, and the properties, flavors, and meridians of medicinal materials, is achieved.
[0047] The dose standardization module addresses the issue of inconsistent drug dosage representation across different literature, establishing a unified dose conversion system. This module accurately converts traditional units of measurement, such as the qian and liang, to modern standard units like gram and milliliter. For example, traditional unit conversion factors include: qian → 3.0 grams, liang → 30.0 grams, jin → 500.0 grams, and sheng → 1000.0 milliliters. Conversions for specialized medicinal ingredients include: 1 jujube → 3.0 grams, 1 aconite → 10.0 grams, and 1 slice of ginger → 2.5 grams.
[0048] The business (efficacy classification) module, based on traditional Chinese medicine theory, categorizes the medicinal ingredients in prescriptions according to the principle of monarch, minister, adjuvant, and envoy compatibility. The quantified medicinal attribute vectors include four dimensions: nature and flavor, meridians, efficacy, and toxicity. The attribute vectors contain 5 dimensions for nature and flavor, 12 dimensions for meridians, 20 dimensions for efficacy, and 3 dimensions for toxicity, for a total of 40 dimensions. Principal component analysis reduces the dimension to 64.
[0049] The graph structure building module models the composition relationship of prescriptions as a three-layer heterogeneous graph structure: prescription layer, medicinal material layer, and attribute layer. The details are as follows: , Where V is the node set, E is the edge set, τ is the node type mapping, and is the edge relationship mapping. Node types include prescriptions, medicinal materials, and attributes, while edge relationships include inclusion, having attributes, synergy, and mutual restraint.
[0050] The weight setting of the graph adjacency matrix construction part is based on traditional Chinese medicine theory: the inclusion relationship weight w_contain is determined by the dosage ratio, the synergistic effect weight w_synergy is based on the compatibility theory, and the antagonism relationship weight w_conflict is based on the Eighteen Counteractions and Nineteen Fears.
[0051] The graph embedding module uses an improved graph neural network algorithm to convert the constructed heterogeneous graph into a 128-dimensional structural vector representation. The topological structure information and node attribute information of the graph are preserved through three parts: graph embedding learning objectives, node embedding aggregation, and graph-level embedding generation.
[0052] The feature fusion module fuses the 64-dimensional attribute vector and the 128-dimensional structure vector into a 200-dimensional comprehensive feature vector, and uses a multi-layer perceptron (MLP) for nonlinear fusion.
[0053] Feature fusion function: , Multi-layer perceptron structure: .
[0054] Network dimension parameters: "W_1 "∈" R^"{"256×192"} (input layer to hidden layer 1); "W_2 "∈" R^"{"256×256"} (hidden layer 1 to hidden layer 2); "W_3 "∈" R^"{"200×256"} (hidden layer 2 to output layer);
[0055] The structure embedding and attribute fusion module can effectively integrate the complex structural information of traditional Chinese medicine prescriptions and the attribute information of medicinal materials to generate a high-quality 200-dimensional comprehensive feature vector, providing a strong numerical foundation for the subsequent knowledge graph construction.
[0056] Example 4: The enhanced TransR model and knowledge graph construction layer includes a multi-relationship modeling module, a multi-task learning framework module, and an incremental update algorithm module; The multi-relationship modeling module is based on an improved version of the TransR model, optimized for the multi-relationship characteristics of the field of traditional Chinese medicine, and can simultaneously handle multiple relationship types such as "treatment", "compatibility", and "contraindications"; The multi-task learning framework module is an autonomous learning mechanism that continuously improves model performance through iterative optimization, uses existing high-confidence knowledge to guide the learning of new knowledge, and achieves self-improvement and expansion of knowledge. The incremental update algorithm designs an efficient update strategy with a time complexity of O(k log n), where k is the amount of new data and n is the size of the existing knowledge graph.
[0057] Among them, the algorithm adopts a local reconstruction strategy, only updating the affected subgraph structure, avoiding the high cost of full reconstruction; compared with the traditional O(n²) complexity, it achieves significant optimization.
[0058] The enhanced Translation in Relation-specific spaces (TransR) model is the core knowledge representation learning module of the present invention, which is specifically used to handle the complex relationship modeling problem in the TCM knowledge graph. Figure 4 As shown in the figure, a five-layer neural network architecture is adopted to achieve accurate modeling of the prescription-herbal-attribute triple relationship through the collaborative work of the entity embedding layer, relationship embedding layer, projection matrix layer, attention layer and scoring function layer.
[0059] Figure 4 The complete structure of the enhanced TransR model is presented. The model starts with entity and relation inputs, undergoes 128-dimensional entity embedding and 64-dimensional relation embedding, performs spatial transformation via a relation-specific projection matrix, is enhanced by an attention mechanism, and finally outputs a credibility score for the triplet through a scoring function.
[0060] The entity embedding layer converts discrete entity identifiers into 128-dimensional continuous vector representations, and the relationship embedding layer maps relationship types into 64-dimensional vector representations. The entity embedding matrix is initialized using Xavier uniform distribution: , Where fan_in is the input dimension and fan_out is the output dimension. For the entity embedding layer, fan_in is the total number of entities and fan_out is 128.
[0061] In order to ensure the stability of the embedding vector, the entity vector is L2 normalized: .
[0062] The main types of relationships in the TCM knowledge graph include inclusion, attribute, compatibility, efficacy, and contraindication. Relationship embedding also uses Xavier initialization and L2 normalization.
[0063] The projection matrix layer learns a specific projection matrix for each relation type, projecting the entity from the 128-dimensional space to the 64-dimensional relation space. , , in, is the projection matrix of relation r, h and t are the embedding vectors of the head entity and the tail entity respectively.
[0064] The goal of learning the projection matrix is to make it so that in a specific relational space: , The attention mechanism module enhances the projected entity representation through a multi-head attention mechanism, increasing the model's attention to important features.
[0065] The multi-head attention mechanism is expressed as follows: , , Among them, 4 attention heads are used for parallel calculation, and the attention weight considers the importance of the entity in the current relationship context: .
[0066] The scoring function calculates the credibility score of the triple (h, r, t) and uses the improved TransR scoring function combined with the attention weight to create the enhanced TransR scoring function: , Among them, h_att is the head entity representation after attention enhancement.
[0067] Embodiment five: The intelligent rule engine and conflict resolution layer includes a business rule detection module, a conflict resolution engine and a rule learning module; The business rule detection module is a compatibility taboo detection module, which integrates the traditional Chinese medicine theory of 18 anti-reactions and 19 fears, establishes a complete compatibility taboo knowledge base, and can automatically identify potential conflicts in prescription composition; The conflict resolution engine adopts a multi-strategy fusion approach, combining multiple dimensions such as literature authority, time recency, and clinical validation to make comprehensive judgments and automatically resolve data conflicts. The rule learning module automatically extracts conflict resolution rules from a large number of fusion cases through machine learning technology, thereby achieving dynamic updating and continuous optimization of the rule base.
[0068] Among them, the design of this layer ensures that the fusion results comply with the professional standards of traditional Chinese medicine and avoids the decline in the quality of the knowledge graph due to data conflicts.
[0069] The intelligent rule engine technology solution is a module for processing TCM prescription incompatibility and conflict resolution in this invention, such as Figure 5 As shown, a five-layer progressive processing architecture is adopted to achieve intelligent management of the compatibility rules of traditional Chinese medicine prescriptions and automatic conflict resolution through the collaborative work of compatibility taboo detection, conflict identification module, rule matching engine, conflict resolution strategy and rule learning module.
[0070] Figure 5 The complete architectural process of the intelligent rule engine is demonstrated. The system begins with data input and first performs incompatibility detection, identifying traditional incompatibility factors such as the Eighteen Antidotes and Nineteen Fears. The conflict identification module then performs four-dimensional conflict detection, including dosage conflicts, efficacy conflicts, compatibility conflicts, and source conflicts. The rule matching engine then applies hierarchical rules. This is followed by intelligent decision-making algorithms for conflict resolution strategies. Finally, the rule learning module dynamically updates rules and outputs the final solution.
[0071] The business rule detection part (compatibility taboo detection) establishes a taboo detection algorithm based on the traditional Chinese medicine theory of "Eighteen Antidotes" and "Nineteen Fears".
[0072] The Eighteen Antidotes mainly include: Licorice root is anti-Gansui, Euphorbia, Daphne, and Sargassum; Aconitum is anti-Fritillaria, Trichosanthes, Pinellia, Bletilla, and Bletilla; Veratrum is anti-Ginseng, Adenophora, Salvia, Scrophularia, Asarum, and Paeonia. The Nineteen Fears mainly include: Sulfur is anti-Potassium, Mercury is anti-Arsenic, Wolfsbane is anti-Malachite, Croton is anti-Pharma, and Clove is anti-Curcuma.
[0073] The conflict identification module uses four-dimensional conflict detection: dosage conflict, efficacy conflict, compatibility conflict, and source conflict.
[0074] Dosage conflict judgment criteria: Differences of general medicinal materials >30%, precious medicinal materials >20%, and toxic medicinal materials >10% are considered conflicts.
[0075] Efficacy conflict detection: contradictory efficacy pairs: warming yang vs. clearing heat, replenishing qi vs. breaking qi, antiperspirant vs. sweating, moisturizing vs. drying dampness, etc.
[0076] The rule matching engine uses a hierarchical rule application and matches by priority: .
[0077] Rule priority setting: security rule (10) → validity rule (8) → rationality rule (6) → consistency rule (4) → integrity rule (2).
[0078] Note: The numbers in brackets in this section represent the rule priority weights. A larger number indicates a higher priority.
[0079] The conflict resolution strategy is based on the authoritative ranking of data sources and intelligent decision-making algorithms.
[0080] Data source authority ranking: Pharmacopoeia of the People's Republic of China (10) → Dictionary of Traditional Chinese Medicine Formulas (9) → Textbook of Formula Studies (8) → Chinese Materia Medica (7) → Modern Clinical Prescriptions (6).
[0081] Dose rationality assessment: normal range (1.0) → extended range (0.8) → upper safety limit (0.3) → upper toxicity limit (0.0).
[0082] Example 6: The end-to-end automated pipeline layer includes a data preprocessing module, a semantic fusion module, and a quality verification module; The data preprocessing module uses intelligent recognition algorithms to automatically detect and process heterogeneous data from different data sources, supports automatic parsing of multiple formats such as XML, JSON, and CSV, and achieves data cleaning and standardization through a combination of rule engines and machine learning. It effectively handles issues such as traditional-simplified character conversion and variant character recognition in ancient books and documents. The semantic fusion module builds a semantic similarity calculation model based on deep learning technology, which can identify the same concepts in different expressions, such as "Danggui" and "Gangui", "Baizhu" and "Yushu", and achieves automatic alignment at the concept level through mapping in the semantic vector space; The quality verification module establishes a multidimensional quality assessment system covering data integrity, logical consistency, and medical rationality, and adopts a verification strategy that combines rule-based hard constraint checks and statistical-based soft constraint evaluations to ensure that the fusion results comply with the theoretical standards of traditional Chinese medicine.
[0083] Among them, the core innovation of this layer lies in the integration and realization of full-process automation from raw data input to high-quality knowledge graph output, which significantly reduces the cost of manual intervention and improves fusion efficiency and result reliability.
[0084] The end-to-end automated pipeline technology solution is the core technology of the present invention to achieve the fully automatic construction of the knowledge graph of traditional Chinese medicine prescriptions. Figure 6 The solution adopts a seven-layer pipeline processing architecture: format recognition and conversion → quality assessment → noise filtering → semantic alignment processing → conflict detection and resolution → quality verification → result output, achieving end-to-end automated conversion from raw heterogeneous data to standardized knowledge graphs.
[0085] Figure 6 The complete process of an end-to-end automated graph fusion pipeline is demonstrated. Starting with multi-source heterogeneous data input, the system first supports automatic identification and standardized conversion of multiple mainstream data formats through the Format Identification and Conversion Module. The Quality Assessment Module then performs three-dimensional quality scoring, including completeness, consistency, and accuracy assessments. The Noise Filtering Module then cleans abnormal data. The Semantic Alignment Processing Module then performs coarse-grained and fine-grained dual alignment. The Conflict Detection and Resolution Module then performs intelligent conflict resolution. Finally, the Quality Verification Module ensures output quality through cross-validation, generating a standardized knowledge graph. The entire pipeline utilizes a modular design, allowing each module to operate and optimize independently.
[0086] The format recognition and conversion module automatically identifies the input data format and converts it into a unified standard format. It supports a variety of mainstream data formats, such as structured data (JSON, CSV, etc.); semi-structured data (HTML, etc.); and unstructured data (TXT, PDF, DOC, etc.). It then converts the data into a standardized JSON Schema data structure, such as a prescription map, which includes fields such as prescription ID, name, drug composition, dosage, efficacy, and source.
[0087] The quality assessment module uses three-dimensional quality scoring: completeness, consistency, and accuracy. , Among them, the weight coefficient is set as: =0.4, =0.3, =0.3. Completeness assessment involves checking for missing mandatory fields, with a threshold of 80%. Consistency assessment involves checking for consistency in data format and units. Accuracy assessment involves verifying data correctness using an expert knowledge base.
[0088] The noise filtering module uses a multi-layer filtering mechanism to clean abnormal data. The noise detection strategy is as follows: .
[0089] Filtering strategies include statistical anomalies: identifying outliers based on the 3σ principle; rule anomalies: detecting dosage anomalies, incompatibility, and efficacy mismatches; and semantic anomalies: detecting semantic deviations based on word vector models.
[0090] The semantic alignment processing module adopts a two-stage strategy of coarse-grained alignment + fine-grained verification, as follows:
[0091] The coarse-grained similarity strategy is as follows: .
[0092] The coarse-grained alignment threshold is set to 0.5, and entity pairs above this threshold enter the fine-grained verification stage.
[0093] Fine-grained verification uses precise matching of multiple feature fusions. The fine-grained matching scores are as follows: , Among them, α=0.5, β=0.3, and γ=0.2 are feature weights.
[0094] The confidence assessment of the alignment results is based on multiple factors. The specific confidence calculation indicators are as follows: .
[0095] The confidence threshold is set to 0.6, and alignment results below this threshold require manual review.
[0096] The conflict detection and resolution module integrates the aforementioned intelligent rule engine to automatically identify and resolve data conflicts. A cross-validation mechanism is then employed to ensure output quality, including both internal and external validation. Internal validation utilizes K-fold cross-validation to assess the stability of the results, while external validation involves expert verification of a random sample of 5% of the results.
[0097] Embodiment seven: The multi-task learning framework simultaneously optimizes three auxiliary tasks, namely entity alignment, relationship prediction, and attribute completion, based on the main task of TransR to improve the generalization ability of the model. Entity alignment task: Determine whether two entities are different representations of the same entity, solving the entity duplication problem in the knowledge graph of traditional Chinese medicine prescriptions; Relationship prediction task: Predict the relationship type based on the given head and tail entities to enhance the model's understanding of relationships in the field of Traditional Chinese Medicine prescriptions. Specific relationship types in the field of Traditional Chinese Medicine include: composition relationship, efficacy relationship, therapeutic relationship, compatibility relationship, meridian relationship, etc. Attribute completion task: predict missing attributes of entities to improve the completeness of the knowledge graph; specific attribute types include: numerical attributes (dose, toxicity level), classification attributes (nature and taste, meridians), text attributes (preparation method, usage), etc.
[0098] The total multi-task loss function is as follows: , in, is the task weight coefficient.
[0099] Embodiment 8: The incremental dynamic update is used to achieve real-time update of the traditional Chinese medicine knowledge graph.
[0100] like Figure 7 This method adopts a six-step process: impact range analysis → triple extraction → conflict detection → local update → model fine-tuning → update completion, achieving efficient dynamic maintenance of the knowledge graph.
[0101] Figure 7 This paper demonstrates the complete process of the incremental dynamic update algorithm. Upon input of new data, the algorithm first performs an impact analysis using a Breadth-First Search (BFS) graph traversal algorithm to determine the entities requiring update. Triples of various relationship types are then extracted. A rule engine is then used to detect conflicts. Finally, only the affected entities are locally updated. Finally, the model is fine-tuned using an incremental gradient descent algorithm. This entire process avoids the high cost of a full rebuild and achieves an efficient update with an O(k log n) complexity, where k is the number of affected entities.
[0102] The impact range analysis module uses the BFS graph traversal algorithm to accurately calculate the impact range of new data on the existing knowledge graph. The impact range calculation formula is as follows: .
[0103] The input is the new data entity set E_new, the knowledge graph KG, and the maximum traversal depth d; the output is the affected entity set E_affected. The impact range threshold is determined based on the number of affected entities. If the number of affected entities is less than 1000, an incremental update is performed; if the number of affected entities is greater than or equal to 1000, a full rebuild is recommended.
[0104] Then, the triple extraction module extracts the relationship types in the field of traditional Chinese medicine prescriptions from the new data, and the conflict detection module verifies the consistency of the new triples with the existing knowledge through the rule engine. Finally, the local update module only updates the embedding vectors of the affected entities to avoid full recalculation. , Where E_new[i] represents the new embedding vector of entity i; E_old[i] represents the original embedding vector of entity i, and α represents the learning rate; : Loss function gradient.
[0105] The model fine-tuning module uses the incremental gradient descent algorithm to locally optimize the model using the new triples.
[0106] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.
[0107] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A TCM knowledge graph fusion system based on semantic alignment, characterized by: It includes a multimodal semantic embedding and entity alignment layer, a business representation layer for structural embedding and attribute fusion, an enhanced TransR model and knowledge graph construction layer, an intelligent rule engine and conflict resolution layer, an end-to-end automated pipeline layer, a multi-task learning framework, and incremental dynamic updates. The multimodal semantic embedding and entity alignment layer is responsible for processing the recognition and preliminary alignment of TCM knowledge entities from different data sources; The business presentation layer of structure embedding and attribute fusion processes the composition structure and drug attribute information of traditional Chinese medicine prescriptions; The enhanced TransR model and knowledge graph construction layer are responsible for constructing a high-quality TCM knowledge graph; The intelligent rule engine and conflict resolution layer handle conflicts and contradictions in the process of integrating traditional Chinese medicine knowledge; The end-to-end automated pipeline layer is responsible for the automated management and quality assurance of the entire TCM knowledge graph fusion process.
2. A TCM knowledge graph fusion system based on semantic alignment according to claim 1, characterized in that: The multimodal semantic embedding and entity alignment layer includes a semantic encoding module, an adaptive threshold module and a confidence assessment module; The semantic encoding module performs deep semantic understanding of TCM text descriptions, using an improved BERT model combined with pre-trained corpus in the field of TCM to accurately identify complex semantic relationships in prescriptions. The adaptive threshold module dynamically adjusts the similarity threshold according to the characteristics of different types of entities, avoiding the limitations of traditional fixed threshold methods; The confidence assessment module assigns a confidence score to each alignment result, providing a reliable quality indicator for upper-level processing.
3. The TCM knowledge graph fusion system based on semantic alignment according to claim 1, characterized in that: The business presentation layer of structure embedding and attribute fusion includes a business standardization module, a graph embedding technology module and an attribute fusion module; The business standardization module solves the problem of inconsistent drug dosage representation in different documents and establishes a unified dosage conversion system to accurately convert the ancient measurement units of "qian" and "liang" to modern units of "gram" and "milliliter". The graph embedding technology module models the drug composition relationship of the prescription as a graph structure, uses the improved GraphSAGE algorithm to learn the complex relationship between drugs, and captures the hierarchical structure of the monarch, minister, assistant and envoy combinations; The attribute fusion module integrates the multi-dimensional attribute information of the nature, flavor, meridians and efficacy classification of the medicinal materials, and automatically learns the importance weights of different attributes through the attention mechanism.
4. The TCM knowledge graph fusion system based on semantic alignment according to claim 1, characterized in that: The enhanced TransR model and knowledge graph construction layer includes a multi-relationship modeling module, a multi-task learning framework module, and an incremental update algorithm module; The multi-relationship modeling module is based on an improved version of the TransR model, optimized for the multi-relationship characteristics of the TCM field, and can simultaneously handle the "treatment", "compatibility", and "contraindication" relationship types; The multi-task learning framework module is an autonomous learning mechanism that continuously improves model performance through iterative optimization, uses existing high-confidence knowledge to guide the learning of new knowledge, and achieves self-improvement and expansion of knowledge. The incremental update algorithm designs an efficient update strategy with a time complexity of O(k log n), where k is the amount of new data and n is the size of the existing knowledge graph.
5. The TCM knowledge graph fusion system based on semantic alignment according to claim 1, characterized in that: The intelligent rule engine and conflict resolution layer includes a business rule detection module, a conflict resolution engine and a rule learning module; The business rule detection module is a compatibility taboo detection module, which integrates the traditional Chinese medicine compatibility taboo theory of 18 anti-incompatibility and 19 fears, establishes a complete compatibility taboo knowledge base, and can automatically identify potential conflicts in prescription composition; The conflict resolution engine adopts a multi-strategy fusion approach, combining multiple dimensions such as literature authority, time recency, and clinical verification to make comprehensive judgments and automatically resolve data conflicts. The rule learning module automatically extracts conflict resolution rules from a large number of fusion cases through machine learning technology, thereby achieving dynamic updating and continuous optimization of the rule base.
6. The TCM knowledge graph fusion system based on semantic alignment according to claim 1, characterized in that: The end-to-end automated pipeline layer includes a data preprocessing module, a semantic fusion module, and a quality verification module; The data preprocessing module uses intelligent recognition algorithms to automatically detect and process heterogeneous data from different data sources, supports automatic parsing of XML, JSON, and CSV formats, and achieves data cleaning and standardization through a combination of rule engines and machine learning, effectively handling the conversion of traditional and simplified Chinese characters and the recognition of variant characters in ancient books and documents; The semantic fusion module builds a semantic similarity calculation model based on deep learning technology, which can identify the same concept in different expressions and realize automatic alignment at the concept level through mapping in the semantic vector space; The quality verification module establishes a multidimensional quality assessment system covering data integrity, logical consistency, and medical rationality, and adopts a verification strategy that combines rule-based hard constraint checks and statistical-based soft constraint evaluations to ensure that the fusion results comply with the theoretical standards of traditional Chinese medicine.
7. The TCM knowledge graph fusion system based on semantic alignment according to claim 1, characterized in that: The multi-task learning framework simultaneously optimizes three auxiliary tasks, namely entity alignment, relationship prediction, and attribute completion, based on the main task of TransR to improve the generalization ability of the model. Entity alignment task: Determine whether two entities are different representations of the same entity, solving the entity duplication problem in the knowledge graph of traditional Chinese medicine prescriptions; Relationship prediction task: predict the relationship type based on the given head and tail entities to enhance the model's understanding of relationships in the field of Traditional Chinese Medicine prescriptions. Specific relationship types in the field of Traditional Chinese Medicine include: composition relationship, efficacy relationship, therapeutic relationship, compatibility relationship, and meridian relationship. Attribute completion task: predict missing attributes of entities to improve the completeness of the knowledge graph; specific attribute types include: numerical attributes, categorical attributes, and text attributes.
8. The TCM knowledge graph fusion system based on semantic alignment according to claim 1, characterized in that: The incremental dynamic update is used to achieve real-time update of the traditional Chinese medicine knowledge graph.
Citation Information
Patent Citations
Chinese medicine prescription monarch, minister, assistant and guide training identification method and system
CN109346180A
Method for constructing stroke medical knowledge graph
CN112420212A
Traditional Chinese medicine prescription generation method based on knowledge graph and group representation learning
CN114121212A
Entity alignment method and device for knowledge graph, medium and equipment
CN116484877A
Traditional Chinese medicine recommendation method based on knowledge-driven and residual attention network
CN119517319A
Cited By
Intelligent electronic medical record generation method based on portable robot
CN120633608A
An intelligent electronic medical record generation method based on a portable robot
CN120633608B
BIM component automatic identification warehousing method and system based on multi-modal artificial intelligence fusion
CN120995908A
Intelligent reasoning knowledge base construction method based on knowledge graph
CN121119092A
Metro operation accident knowledge graph construction method and system, terminal and storage medium
CN121189452A