Construction method of Chinese herbal medicine knowledge graph

By combining the storage methods of graph databases and relational databases, recursive constraint optimization graph inference algorithms and graph embedding technology are introduced, which solves the problem of insufficient potential relationship mining and query flexibility in Chinese herbal knowledge graphs, and improves the intelligence and query accuracy of Chinese herbal knowledge graphs.

CN120277224APending Publication Date: 2025-07-08山东衡昊信息技术有限公司 +1
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202510771722.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

The potential relationship mining and query flexibility of the Chinese herbal knowledge graph in the prior art is low, and it is difficult to effectively organize and analyze dispersed Chinese herbal data, resulting in insufficient query accuracy and efficiency.

Method used

The storage method of graph database and relational database is adopted, and the recursive constraint optimization graph inference algorithm and graph embedding technology are introduced, combined with multi-dimensional weighted query algorithm, and potential relationships are gradually discovered through recursive reasoning and constraint optimization, and the herbal entities and relationships are mapped to low-dimensional vector space for precise query.

Benefits of technology

It improves the intelligence and accuracy of the Chinese herbal knowledge graph, enhances the flexibility and efficiency of query, and can dynamically update and accurately return the most relevant herbal information to the query, capturing deep semantic information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120277224A_ABST
    Figure CN120277224A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a construction method of a Chinese herbal medicine knowledge graph. The method comprises the following steps: acquiring and preprocessing original Chinese herbal medicine data, and storing and managing the preprocessed Chinese herbal medicine data to obtain stored Chinese herbal medicine data; constructing a Chinese herbal medicine knowledge graph based on the stored Chinese herbal medicine data; in the Chinese herbal medicine knowledge map, introducing a recursive constraint-based optimization map reasoning algorithm, and updating the map; and multi-dimensional query of herbal medicine information is carried out by combining atlas embedding and a multi-dimensional weighted query algorithm. The technical problems that potential relation mining and derivation in the knowledge graph are inaccurate, and query flexibility is low are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular, to a method for constructing a Chinese herbal medicine knowledge graph. Background Art

[0002] As an important part of traditional medicine, Chinese herbal medicines have rich pharmacological effects and therapeutic values. With the development of modern medicine and technology, how to efficiently manage, transmit, and utilize the relevant knowledge of Chinese herbal medicines has become an urgent problem to be solved. Currently, with the in-depth research on Chinese herbal medicines and the expansion of the application scope of Chinese herbal medicines, the relevant data also shows a rapid growth trend. Traditional knowledge of Chinese herbal medicines usually exists in the forms of literature, pharmacopoeias, manuals, etc. These data sources are diverse, the formats are not unified, and the information content is extensive and complex. How to effectively organize and analyze these scattered data and construct a systematic Chinese herbal medicine knowledge graph has become an important topic in the interdisciplinary field of medicine and computer science. Summary of the Invention

[0003] The present invention provides a method for constructing a Chinese herbal medicine knowledge graph to solve the technical problems of inaccurate mining and derivation of potential relationships in the knowledge graph and low query flexibility.

[0004] A method for constructing a Chinese herbal medicine knowledge graph includes the following steps: S1. Obtain and preprocess the original Chinese herbal medicine data, store and manage the preprocessed Chinese herbal medicine data to obtain the stored Chinese herbal medicine data; construct a Chinese herbal medicine knowledge graph based on the stored Chinese herbal medicine data; S2. In the Chinese herbal medicine knowledge graph, introduce a graph inference algorithm based on recursive constraint optimization to update the graph; and perform multi-dimensional queries of herbal information by combining graph embedding and multi-dimensional weighted query algorithms.

[0005] Preferably, the S1 specifically includes: Store and manage the preprocessed Chinese herbal medicine data by combining a graph database and a relational database.

[0006] Preferably, the S1 specifically includes: The nodes in the Chinese herbal medicine knowledge graph represent herbs and entities associated with the herbs; the edges of the Chinese herbal medicine knowledge graph represent the relationships between different nodes; a Chinese herbal medicine knowledge graph is formed based on the nodes and edges.

[0007] Preferably, the S2 specifically includes: Combine graph inference with constraint optimization based on the graph inference algorithm based on recursive constraint optimization, and update the graph through iterative recursive inference and introducing constraint optimization in each round of iteration.

[0008] Preferably, the S2 specifically includes: In the recursive reasoning and constraint optimization stage of the recursive constraint optimization graph reasoning algorithm, the embedding vector representation of each node is calculated through a graph convolutional network. The embedding vector representation of each node will be updated according to the features of adjacent nodes in the graph to capture the potential relationships between different nodes in the graph; and a constraint optimization mechanism is introduced to calculate the strength of the potential relationships between nodes during the recursive process.

[0009] Preferably, the S2 specifically includes: After the potential relationships are derived, enter the relationship evaluation and correction stage; update the graph by calculating the credibility of the newly derived relationships.

[0010] Preferably, the S2 specifically includes: Update the graph according to the derived relationships and credibility, and enter the next round of recursive reasoning process; the recursive reasoning will continue after the graph is updated until the change in the newly derived relationships in the graph is less than the set threshold or the preset maximum number of iterations is reached.

[0011] Preferably, the S2 specifically includes: Combining graph embedding and multi-dimensional weighted query algorithm, map the herbal entities and relationships to a low-dimensional vector space through graph embedding technology, and at the same time combine the weighted similarity calculation method of multi-dimensional query to return herbal information.

[0012] Preferably, the S2 specifically includes: The specific implementation process of combining graph embedding and multi-dimensional weighted query algorithm is as follows: First, embed the nodes and edges in the Chinese herbal medicine knowledge graph; after the embedding of the graph is completed, preprocess the query input by the user and convert it into a query vector in the low-dimensional vector space; based on the embedding vector of each node and the query vector, calculate the weighted cosine similarity to obtain the similarity score between the embedding vector of each node and the query vector; sort the similarity scores from high to low and return the herbal information most relevant to the query.

[0013] The beneficial effects of the technical solution of the present invention are: 1. Introduce a recursive constraint optimization graph reasoning algorithm. Through multiple rounds of iteration of recursive reasoning, it is possible to gradually discover the potential relationships in the Chinese herbal medicine knowledge graph. For example, deduce the implicit interactions between herbs or the relationships between herbs and diseases that are not explicitly recorded. Constraint optimization is introduced during the reasoning process to ensure that the newly derived relationships conform to the existing knowledge structure in the graph and avoid generating logically inconsistent relationships. Through multiple rounds of recursive reasoning, continuously improve the derivation results, gradually enhance the intelligence and accuracy of the graph, solve the limitations of traditional graph reasoning that only rely on known relationships, and ensure that the graph can be dynamically updated and enhance the reasoning depth and breadth of the knowledge graph.

[0014] 2. Through the graph embedding technology, the herbal entities and relationships are mapped into a low-dimensional vector space. By utilizing the semantic connections between the nodes and edges in the graph, the distances between similar herbal nodes in the low-dimensional vector space are closer. In this way, the query accuracy and efficiency in the search process of the graph are greatly improved. Combining with multi-dimensional weighted queries, the queries not only consider the surface information such as the names and ingredients of herbs, but also consider the deep semantic information such as the therapeutic functions and interactions of herbs. Each query dimension reflects its importance in the query through weighting, so as to flexibly respond to different user query requirements and accurately return the herbal information most relevant to the query. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flowchart of a method for constructing a Chinese herbal medicine knowledge graph according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0016] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.

[0018] The following specifically describes the specific solution of a method for constructing a Chinese herbal medicine knowledge graph provided by the present invention in conjunction with the accompanying drawings.

[0019] Referring to the attached Figure 1 , which shows a flowchart of a method for constructing a Chinese herbal medicine knowledge graph provided by an embodiment of the present invention. The method includes the following steps: S1. Obtain and preprocess the original Chinese herbal medicine data, store and manage the preprocessed Chinese herbal medicine data to obtain the stored Chinese herbal medicine data; construct a Chinese herbal medicine knowledge graph based on the stored Chinese herbal medicine data.

[0020] Obtain the original Chinese herbal medicine data from databases such as medical literature, pharmacopoeias and Chinese herbal medicine handbooks, such as the Chinese Pharmacopoeia Database, open data platforms related to Chinese herbal medicine, and online drug and herbal medicine databases such as PubMed and Google Scholar, including data such as herbal medicine names, ingredients, efficacy, usage methods, and pharmacology. Preprocess the original Chinese herbal medicine data. Specifically, perform text cleaning on the original Chinese herbal medicine data, such as removing irrelevant characters, punctuation marks, special symbols, and duplicate removal, to ensure the neatness of the original Chinese herbal medicine data; and through word segmentation and entity recognition, such as using natural language processing technologies such as spaCy and NLTK, perform word segmentation and entity recognition on the Chinese herbal medicine data after text cleaning. For example, identify herbal medicine names, ingredients, efficacy, interactions, etc. from the original text; use relationship extraction algorithms, such as dependency syntax analysis, named entity recognition, deep learning models, etc., to identify the relationships between herbal medicines. For example, identify the relationships of "a certain herbal medicine contains a certain ingredient" or "a certain herbal medicine treats a certain disease", data formatting (such as JSON, XML, CSV, etc.) to obtain the preprocessed Chinese herbal medicine data. The above preprocessing process uses technical means well-known to those skilled in the art and will not be elaborated here.

[0021] Furthermore, a combination of a graph database (such as Neo4j, ArangoDB, OrientDB, etc.) and a relational database (such as MySQL, PostgreSQL, etc.) is used to store and manage the preprocessed Chinese herbal medicine data. The graph database is used to store the preprocessed Chinese herbal medicine data and can effectively express the multiple relationships between herbal medicines, such as the treatment functions and interactions of herbal medicines; the relational database is used to store the attribute information of the preprocessed Chinese herbal medicine data, such as ingredients and usage methods. The stored Chinese herbal medicine data is obtained through the above process.

[0022] Furthermore, construct a Chinese herbal medicine knowledge graph based on the stored Chinese herbal medicine data. The structure of the Chinese herbal medicine knowledge graph is as follows: The nodes in the Chinese herbal medicine knowledge graph represent herbal medicines and their related entities. For example, the names of Chinese herbal medicines (such as ginseng), ingredients (such as ginsenosides), efficacy (such as treating stomach problems), etc. The edges in the Chinese herbal medicine knowledge graph represent the relationships between different nodes. For example, the "contains" relationship between a herbal medicine and its ingredients, the "treats" relationship between a herbal medicine and a disease, etc. The Chinese herbal medicine knowledge graph is constructed based on the nodes and edges.

[0023] The optimization process of the above Chinese herbal medicine knowledge graph will be described in subsequent steps.

[0024] S2. In the Chinese herbal medicine knowledge graph, introduce a recursive constraint-based optimization graph reasoning algorithm to update the graph; and through a combination of graph embedding and multi-dimensional weighted query algorithms, perform multi-dimensional queries of herbal medicine information.

[0025] In the Chinese herbal medicine knowledge graph, in order to deduce implicit relationships and further enhance the intelligent reasoning ability of the Chinese herbal medicine knowledge graph, a graph reasoning algorithm based on recursive constraint optimization is introduced. The graph reasoning algorithm based on recursive constraint optimization combines graph reasoning with constraint optimization. Through multiple rounds of iteration of recursive reasoning and the introduction of constraint optimization in each round of iteration, the accuracy and efficiency of the reasoning process are gradually improved. The specific implementation process is as follows: Represent the feature of the Chinese herbal medicine entity regarded as a node as a vector , is the dimension of the node feature vector, and the node feature vector contains the basic information of the herb, such as name, ingredients, efficacy, etc.; Assign an initial feature representation to the known relationship between entities regarded as edges , representing the known relationships between herbs, such as "contains ingredients", "treats diseases", etc.

[0026] Furthermore, enter the recursive reasoning and constraint optimization stage. In the recursive reasoning and constraint optimization stage, potential relationships in the graph are gradually discovered through recursive reasoning, and the effectiveness and consistency of the reasoning process are ensured through constraint optimization. First, propagate the features of the nodes through a graph convolutional network and gradually calculate the embedding representation of each node. Each node 's embedding vector representation will be updated according to the features of adjacent nodes in the graph, so as to capture the implicit relationships between different nodes in the graph.

[0027] Furthermore, a constraint optimization mechanism is introduced to ensure that the deduced implicit relationships are not only logical but also meet the constraint conditions of the existing knowledge. Assume that there are potential relationships in the graph, and the derivation process of the relationships is realized through the following formula: , , Among them, is the potential relationship strength between nodes and in the -th round of recursion, representing the potential connection obtained by two nodes (i.e., between Chinese herbal medicine entities) through graph convolution and the reasoning mechanism in the reasoning process, such as the interaction and compatibility relationship between herbs, etc.; and are the embedding vectors of nodes and in the -th round, representing the feature representation of the Chinese herbal medicine entity; represents the adjacent nodes of node . Through the graph convolutional network method, the features of the nodes will be updated in each round of recursion to capture higher-level knowledge; is the weight matrix for relationship derivation, used to map nodes and at the round embedding vectors and into the relationship space, forming the relationship derivation between nodes, controlling the influence of the relationship between nodes. The initial value is obtained by the random method and updated in the optimization step during the recursive reasoning process; is the weight coefficient of the constraint term, used to adjust the influence of the constraint term in the relationship derivation. A larger value will make the constraint condition occupy a larger weight in the reasoning, and vice versa. It is determined according to the expert experience method, such as 0.6; is the activation function, such as the Sigmoid activation function, used to convert the derivation result of the relationship between nodes into a probability value, representing the strength of the potential relationship; is the constraint term, representing the difference between the embedding vectors of nodes and in the previous round. The constraint term ensures that the derived relationship conforms to the existing knowledge structure in the graph, avoiding the derivation of inconsistent or contradictory relationships; and are the embedding vectors of nodes and at the round, representing the feature representation of the herbal medicine entity; represents the transpose; represents the constraint weight matrix, used to adjust the influence of the constraint. The initial value is set according to the expert experience method and is optimized and updated through the recursive reasoning process later.

[0028] The above constraint term calculates the difference between the embedding vectors of nodes and converts the difference into a probability value through the activation function, reflecting whether the features between nodes match. By introducing the constraint, it is ensured that the newly derived relationship does not violate the existing knowledge structure in the graph.

[0029] After deriving the potential relationship, it enters the relationship evaluation and correction stage. In the relationship evaluation and correction stage, evaluating the credibility of the newly derived relationship is the key. Define the credibility of the new relationship as: , where, is the Euclidean distance, used to measure the similarity between nodes and ; is the set of adjacent nodes of node ; represents the index of the adjacent nodes of node ; represents the node In the round of embedding vectors; is the Euclidean distance, which is used to measure the similarity between nodes and . Through the above formula, the credibility of the new relationship can be calculated according to the similarity between nodes; the relationship with a higher credibility, that is, exceeding the threshold preset by the expert experience method, which can take 0.85, will be retained and added to the knowledge graph; while the relationship with a lower credibility, that is, less than the threshold preset by the expert experience method, which can take 0.2, will be deleted; if the credibility is between and , the type correction will be carried out through the expert system or domain knowledge inference. Among them, the specific values of and can be specifically defined according to the specific application scenario.

[0030] Finally, enter the knowledge graph update and termination stage, update the knowledge graph according to the derived relationships and credibilities, and enter the next round of recursive reasoning process. The recursive reasoning will continue after the knowledge graph is updated until the change of the new relationship derivation in the knowledge graph is less than the threshold set by the expert experience method or reaches the maximum number of iterations preset by the expert experience method. In each round of recursion, the derived new relationships and the corrected existing relationships will be added to the knowledge graph to gradually enrich the structure of the knowledge graph. When new Chinese herbal medicine research results appear, on the premise of ensuring the real-time nature of the Chinese herbal medicine knowledge graph, through the existing incremental update method, the information contained in the new Chinese herbal medicine research results is seamlessly integrated into the knowledge graph, avoiding the performance bottleneck brought by the reconstruction of the entire Chinese herbal medicine knowledge graph.

[0031] Furthermore, to solve the problem of insufficient accuracy and flexibility of traditional knowledge graph search engines when facing complex queries, a combined graph embedding and multi-dimensional weighted query algorithm is designed. The combined graph embedding and multi-dimensional weighted query algorithm maps herbal entities and relationships to a low-dimensional vector space through graph embedding technology, and at the same time combines the weighted similarity calculation method of multi-dimensional queries to flexibly respond to different query requirements and accurately return relevant herbal information. The specific implementation process is as follows: First, embed the nodes and edges in the Chinese herbal medicine knowledge graph. Through graph embedding techniques such as GraphSAGE or node2vec, map each node in the Chinese herbal medicine knowledge graph to a low-dimensional vector space, so that the distances between similar nodes in the low-dimensional vector space are as close as possible. The mapping preserves the relative position relationships between nodes, enabling the search process to better capture the semantic connections between nodes. For the relationships between herbal entities, edge embeddings can also be used to represent them. Different relationship types, such as "treat" and "contain", will form different directions or weights in the embedding space, thus providing more abundant semantic information in the subsequent search process.

[0032] After the embedding of the graph is completed, preprocess the user input query, including steps such as word segmentation, entity recognition, and semantic understanding of the query text. Taking "herbs for treating colds" as an example, "treat" and "colds" will be identified as key information from the query and transformed into a query vector in the low-dimensional vector space. The construction of the query vector is based on the graph embedding of the query entity.

[0033] Furthermore, based on the embedding vectors of each node and the query vector, calculate the weighted cosine similarity. By calculating the weighted cosine similarity, obtain the similarity scores between the embedding vectors of each node and the query vector. The similarity scores not only consider the weights of the dimensions of the query vector but also combine the relationships between entities in the graph, making the search results more accurate. At the same time, it also measures the relevance between the query content and each node in the Chinese herbal medicine knowledge graph. The higher the similarity score, the more relevant the herb is.

[0034] Finally, sort the similarity scores between the embedding vectors of each node and the query vector, and return the herbal medicine information related to the query. The returned results are sorted in descending order of similarity scores. Users can view information such as the most relevant herbs, their ingredients, functions, and the diseases they treat based on these returned results, achieving multi-dimensional queries.

[0035] In summary, a construction method for a Chinese herbal medicine knowledge graph is completed.

[0036] The sequence of the invention embodiments is only for description and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0037] Each embodiment in this specification is described in a progressive manner. For the same or similar parts between each embodiment, reference can be made to each other. Each embodiment focuses on the differences from other embodiments.

[0038] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for constructing a Chinese herbal medicine knowledge graph, characterized in that, It includes the following steps: S1. Obtain and preprocess the original Chinese herbal medicine data, store and manage the preprocessed Chinese herbal medicine data to obtain the stored Chinese herbal medicine data; Construct a Chinese herbal medicine knowledge graph based on the stored Chinese herbal medicine data; S2. In the Chinese herbal medicine knowledge graph, introduce a graph inference algorithm based on recursive constraint optimization to update the graph; and perform multi-dimensional queries of herbal medicine information by combining graph embedding and multi-dimensional weighted query algorithms.

2. The method for constructing a Chinese herbal medicine knowledge graph according to claim 1, wherein The specific content of S1 includes: Store and manage the preprocessed Chinese herbal medicine data by combining a graph database and a relational database.

3. The construction method of the Chinese herbal medicine knowledge graph according to claim 1, wherein, The specific content of S1 includes: The nodes in the Chinese herbal medicine knowledge graph represent herbs and entities associated with the herbs; the edges of the Chinese herbal medicine knowledge graph represent the relationships between different nodes; the Chinese herbal medicine knowledge graph is constituted based on the nodes and edges.

4. The method for constructing a Chinese herbal medicine knowledge graph according to claim 1, wherein The specific content of S2 includes: Based on the graph inference algorithm with recursive constraint optimization, combine graph inference and constraint optimization, and update the graph through the iteration of recursive inference and introducing constraint optimization in each round of iteration.

5. The method for constructing the Chinese herbal medicine knowledge graph according to claim 4, wherein, The specific content of S2 includes: In the recursive inference and constraint optimization stage of the graph inference algorithm based on recursive constraint optimization, calculate the embedded vector representation of each node through a graph convolutional network. The embedded vector representation of each node will be updated according to the features of adjacent nodes in the graph to capture the potential relationships between different nodes in the graph; and introduce a constraint optimization mechanism to calculate the potential relationship strength between nodes during the recursive process.

6. The method for constructing the Chinese herbal medicine knowledge graph according to claim 5, wherein The specific content of S2 includes: After deriving the potential relationships, enter the relationship evaluation and correction stage; update the graph by calculating the credibility of the newly derived relationships.

7. The method for constructing the Chinese herbal medicine knowledge graph according to claim 6, wherein, The specific content of S2 includes: Update the graph according to the derived relationships and credibility, and enter the next round of recursive inference process; the recursive inference will continue after the graph is updated until the change in the newly derived relationships in the graph is less than the set threshold or reaches the preset maximum number of iterations.

8. The method for constructing the Chinese herbal medicine knowledge graph according to claim 1, wherein, The specific content of S2 includes: Combine graph embedding and multi-dimensional weighted query algorithms to map herbal medicine entities and relationships to a low-dimensional vector space through graph embedding technology, and at the same time combine the weighted similarity calculation method for multi-dimensional queries to return herbal medicine information.

9. The method for constructing the Chinese herbal medicine knowledge graph according to claim 8, wherein, The specific content of S2 includes: The specific implementation process of combining graph embedding and multi-dimensional weighted query algorithms is as follows: First, embed the nodes and edges in the Chinese herbal medicine knowledge graph; When the embedding of the graph is completed, preprocess the query input by the user and transform it into a query vector in the low-dimensional vector space; based on the embedded vector of each node and the query vector, calculate the weighted cosine similarity to obtain the similarity score between the embedded vector of each node and the query vector; sort the similarity scores from high to low and return the herbal medicine information most relevant to the query.

Citation Information

Patent Citations

  • Knowledge graph construction method and device, computer equipment and storage medium

    CN116881374A

  • Knowledge characterization and reasoning method for multi-modal drug knowledge graph

    CN118072862A

  • Traditional Chinese medicine intelligent query question-answering system and method based on knowledge graph

    CN118349657A

  • Power data analysis method and analysis system, power system, terminal equipment and storage medium

    CN118396162A

  • Decision scheme acquisition method and system based on multi-source heterogeneous knowledge graph

    CN118657213A