A medical knowledge graph dynamic construction method based on ontology guided named entity recognition and multi-hop graph reasoning and related devices

By introducing hierarchical constraints on medical ontology and multi-hop graph reasoning, combined with dynamic updates and consistency verification, the problems of entity boundary errors and insufficient knowledge coverage in medical knowledge graphs are solved, realizing dynamic updates and efficient construction of medical knowledge.

CN122332579APending Publication Date: 2026-07-03ZHUHAI HENGQIN ALL-STAR MEDICAL TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHUHAI HENGQIN ALL-STAR MEDICAL TECHNOLOGY CO LTD
Filing Date
2026-06-01
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing methods for constructing medical knowledge graphs suffer from problems such as entity boundary errors, non-fusion of multiple cross-sentence mentions of the same concept, high computational complexity of relation candidates, insufficient inference of implicit relations, limited knowledge coverage, inability of static updates to reflect the evolution of medical knowledge, and lack of ontology consistency verification.

Method used

We employ entity type hierarchical constraint named entity recognition based on medical ontology, cross-sentence reference resolution, multi-hop graph reasoning, graph embedding semantic evaluation, and temporal window dynamic updating, combined with bidirectional ontology consistency verification, to construct a dynamic medical knowledge graph.

Benefits of technology

It significantly reduces the entity boundary error rate, improves the coherence and usability of the knowledge graph, expands the knowledge coverage, reduces computational complexity, supports dynamic updates of medical knowledge and ontology consistency verification, and ensures that the graph conforms to medical common sense.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122332579A_ABST
    Figure CN122332579A_ABST
Patent Text Reader

Abstract

This application provides a method and related apparatus for dynamically constructing a medical knowledge graph based on ontology-guided named entity recognition and multi-hop graph reasoning. The method includes: S1. acquiring medical text and loading a medical ontology; S2. performing ontology-guided named entity recognition based on the entity type hierarchy constraints of the medical ontology; S3. performing graph node fusion on the entity set based on a cross-sentence reference resolution algorithm; S4. generating a candidate set of relations for graph node pairs based on the relation type hierarchy of the medical ontology; S5. constructing an initial graph based on a graph neural network and performing multi-hop graph reasoning to infer implicit medical relations; S6. dynamically updating the medical knowledge graph based on a temporal window, outputting a medical knowledge graph containing multi-hop reasoning paths. This application also provides related apparatus corresponding to the method, including devices, electronic devices, computer-readable storage media, and computer program products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of medical natural language processing and knowledge graph construction, and in particular to a method and related apparatus for dynamic construction of medical knowledge graphs based on ontology-guided named entity recognition and multi-hop graph reasoning. Background Technology

[0002] Medical knowledge graphs are a key technology for organizing entities (diseases, symptoms, drugs, tests, surgeries, anatomical structures, etc.) scattered throughout medical texts and the relationships between them into structured graph data. Medical knowledge graphs are widely used in clinical decision support, medical research discovery, intelligent consultation, and medical education. Constructing knowledge graphs from medical texts faces several core challenges, including difficulties in entity boundary identification, cross-sentence reference resolution, relationship type determination, and implicit relationship inference.

[0003] Existing methods for constructing knowledge graphs from medical texts suffer from the following problems: First, existing methods primarily employ general named entity recognition models to perform entity recognition on medical texts, without incorporating the entity type hierarchy of the medical ontology as a hard constraint. This leads to the identified entity boundaries potentially not conforming to the entity type range of the medical ontology, resulting in numerous boundary errors. Second, existing methods fail to perform graph node fusion for multiple cross-sentence mentions of the same medical concept (such as pronoun references, abbreviations, and synonyms), causing the same medical concept to be represented as multiple independent nodes in the knowledge graph, severely compromising the graph's coherence and usability. Third, existing methods exhaustively search all graph node pair combinations when generating relation candidates, generating N^2-level relation candidates when the number of graph nodes is large, resulting in explosive computational complexity. Fourth, existing methods only infer direct entity relationships in medical texts, failing to reason about implicit medical relationships that are not directly present but can be inferred through multi-hop relationship chains, resulting in limited medical knowledge coverage of the knowledge graph; fifth, existing methods evaluate entities and relationships based on the probability or confidence of the inference engine itself, without introducing semantic distance evaluation of the graph embedding vector space, making it difficult to guarantee semantic rationality; sixth, the medical knowledge graphs constructed by existing methods are static and do not support dynamic updates based on newly added medical texts, failing to reflect the evolution of medical knowledge over time; seventh, existing methods lack bidirectional consistency verification between the constructed medical knowledge graph and the medical ontology, and the resulting graph may violate the hierarchical definition of the medical ontology. Summary of the Invention

[0004] To address the above technical issues, this application provides a method and related apparatus for dynamically constructing a medical knowledge graph based on ontology-guided named entity recognition and multi-hop graph reasoning.

[0005] Firstly, a method for dynamically constructing a medical knowledge graph based on ontology-guided named entity recognition and multi-hop graph reasoning is provided, including the following steps: S1. Obtain medical text and load medical ontology, wherein the medical ontology includes entity type hierarchy and relation type hierarchy; S2. Based on the entity type hierarchy constraints of the medical ontology, ontology-guided named entity recognition is performed on the medical text to obtain an entity set and its ontology type labels. The ontology-guided named entity recognition adopts hard constraints of ontology type hierarchy to ensure that the identified entity types are within the ontology type hierarchy. S3. Based on the cross-sentence reference resolution algorithm, the graph nodes of multiple references to the same medical concept in the entity set are fused to obtain a fused graph node set. Each fused graph node includes an ontology concept identifier, all reference positions and ontology type label. S4. Based on the relation type hierarchy of the medical ontology, generate a relation candidate set for the graph node pairs in the fused graph node set. For each pair of graph nodes, query the allowed relation types between the ontology types of the graph node pairs according to the relation type hierarchy of the medical ontology as relation candidates. S5. Based on the graph neural network, an initial graph containing the fused graph nodes and the candidate set of relations is constructed for the medical text, and implicit medical relation inference is performed based on multi-hop graph reasoning to obtain a medical knowledge graph containing implicit relations. The multi-hop graph reasoning includes at least 2-hop reasoning, which is used to infer implicit medical relations that do not appear directly in the medical text but can be inferred through multi-hop relation chains. S6. Perform dynamic updates on the medical knowledge graph based on a time-series window. The dynamic updates include merging new nodes, evolving existing node attributes, and decaying outdated relationships. The output is a medical knowledge graph containing multi-hop reasoning paths.

[0006] In conjunction with any embodiment of this application, the medical ontology includes, but is not limited to, the Unified Medical Language System (UMLS), the Clinical Medical Terminology System (SNOMED-CT), or the Basic Medical Ontology (FMA).

[0007] In any embodiment of this application, the generation of the candidate relation set is based on the following formula constraint: , Where Cand(n1, n2) is the candidate set of relationships between graph node n1 and graph node n2, and RT is the set of relationship types of the medical ontology. The generation of relationship candidates based on ontology type hierarchy constraints avoids exhaustively enumerating all N^2 combinations.

[0008] In any embodiment of this application, the value of K in the multi-hop graph reasoning ranges from 2 to 4, and the implicit relation score is calculated based on the following formula: , Where max_path is the maximum value among all K-hop paths, Π is the product of the scores of each hop on the path, k is the number of hops, and α is the hop count decay factor.

[0009] In any embodiment of this application, the time window ranges from 7 to 90 days, and the dynamic update supports entity merging, relation updating, and decay of outdated relations for newly added medical text.

[0010] In conjunction with any embodiment of this application, the method further includes performing bidirectional ontology consistency verification on the medical knowledge graph, wherein the bidirectional ontology consistency verification includes both entity type consistency and relation type consistency.

[0011] In a second aspect, a dynamic construction device for a medical knowledge graph based on ontology-guided named entity recognition and multi-hop graph reasoning is provided, comprising: a text and ontology loading unit, an ontology-guided entity recognition unit, a cross-sentence reference fusion unit, a relation candidate generation unit, a graph embedding multi-hop reasoning unit, and a dynamic graph updating unit, which respectively execute steps S1 to S6 of the method described in the first aspect.

[0012] Thirdly, an electronic device is provided, including a processor and a storage unit, the storage unit being used to store computer program code, the code containing computer instructions, wherein when the processor executes these instructions, the electronic device performs the method described in the first aspect.

[0013] Fourthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method described in the first aspect.

[0014] Fifthly, a computer program product is provided, the computer program product comprising a computer program or instructions that, when the computer program or instructions are run on a computer, cause the computer to perform the method described in the first aspect.

[0015] It should be understood that the above general descriptions and subsequent specific descriptions are for illustrative and explanatory purposes only and do not impose any limitations on this application.

[0016] In this application, compared with the prior art, the technical problem to be solved by this application is: to provide hard constraints on entity boundaries based on medical ontology to avoid entity boundary errors in the process of constructing a knowledge graph from medical text; to provide cross-sentence reference graph node fusion to ensure the coherence of the knowledge graph; to provide relation candidate generation based on ontology type hierarchy to avoid N^2 combinatorial explosion; to provide multi-hop graph reasoning to infer implicit medical relations to expand knowledge coverage; to provide semantic distance evaluation of graph embedding vector space; to provide dynamic graph update based on temporal window to reflect the evolution of medical knowledge; and to provide bidirectional consistency verification with medical ontology to ensure that the graph conforms to medical common sense. The technical means employed in this application and their non-obvious aspects compared to existing technologies include: First, this application introduces the entity type hierarchy of the medical ontology (UMLS / SNOMED-CT / FMA) as a hard constraint for named entity recognition. This design is not seen in existing methods using a general named entity recognition model. The ontology-guided recognition ensures from the source that entity boundaries conform to the entity type definition of the medical ontology, significantly reducing boundary errors. Second, this application performs graph node fusion on multiple cross-sentence references of the same medical concept based on a cross-sentence reference resolution algorithm. This design is not seen in existing methods that model each reference independently. The graph node fusion ensures that the same medical concept is represented as a single node in the knowledge graph, greatly improving the coherence and usability of the graph. Third, this application generates a set of relation candidates based on the relation type hierarchy of the medical ontology. This design is not seen in existing methods that exhaustively enumerate all graph node pair combinations. The relation candidate generation based on the ontology type hierarchy reduces the number of relation candidates from the order of N^2 to the legal combinations allowed by the ontology, significantly reducing computational complexity. Fourth, this application is based on... The graph neural network performs multi-hop graph reasoning to infer implicit medical relationships. This design is not seen in existing methods that only infer direct relationships. The multi-hop reasoning infers implicit relationships that do not appear directly in the medical text but can be inferred through K-hop relationship chains, significantly expanding the medical knowledge coverage of the knowledge graph. Fifth, this application evaluates the rationality of relationships based on the semantic distance of the graph embedding vector space. This design is not seen in existing methods that only rely on the probability or confidence of the reasoning engine. The graph embedding semantic distance evaluation guarantees semantic rationality in the geometric sense of the vector space. Sixth, this application performs dynamic updates to the medical knowledge graph based on a temporal window. This design is not seen in existing methods for constructing static knowledge graphs. The dynamic update supports new text fusion, relationship evolution, and decay of outdated relationships, reflecting the evolution of medical knowledge over time. Seventh, this application performs bidirectional consistency verification between the constructed medical knowledge graph and the medical ontology. This design is not seen in existing methods that lack consistency verification. The bidirectional verification includes both entity type consistency and relationship type consistency, ensuring that the graph conforms to the hierarchical definition of the medical ontology. The related devices described in this application include devices, electronic devices, computer-readable storage media, and computer program products. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be explained below.

[0018] Figure 1 This is a flowchart illustrating a method for dynamically constructing a medical knowledge graph based on ontology-guided named entity recognition and multi-hop graph reasoning, as provided in an embodiment of this application.

[0019] Figure 2 This is a schematic diagram of the structure of a dynamic medical knowledge graph construction device based on ontology-guided named entity recognition and multi-hop graph reasoning, provided in an embodiment of this application.

[0020] Figure 3 This is a schematic diagram of the hardware architecture of an electronic device provided in an embodiment of this application. Detailed Implementation

[0021] To enable those skilled in the art to more fully understand the technical solution of this application, the technical solution of this application will be explained in detail and clearly with reference to the accompanying drawings.

[0022] In the specification, claims and related drawings of this application, the terms "first" and "second" are used only to distinguish different elements and do not imply any particular order.

[0023] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for dynamically constructing a medical knowledge graph based on ontology-guided named entity recognition and multi-hop graph reasoning, as provided in an embodiment of this application. The method includes steps S1 to S6.

[0024] S1. Medical Text and Ontology Loading: Retrieves medical text and loads medical ontology.

[0025] In this embodiment, the medical text includes, but is not limited to, electronic medical records, examination reports, surgical records, discharge summaries, clinical guidelines, or medical paper texts. The medical ontology includes, but is not limited to, the Unified Medical Language System (UMLS), the Clinical Medical Terminology System (SNOMED-CT), or the Basic Medical Ontology (FMA). The loading of the medical ontology includes memory loading at the entity type level and the relation type level. The entity type level includes at least disease type nodes, symptom type nodes, drug type nodes, test type nodes, surgery type nodes, and anatomical structure type nodes. The relation type level includes at least the following relation types: "treatment," "cause," "diagnosis," "located," "accompanying," "medication," and "synonym."

[0026] S2. Ontology-guided entity recognition: Based on the entity type hierarchy constraints of the medical ontology, ontology-guided named entity recognition is performed on the medical text to obtain the entity set and its ontology type label.

[0027] In this embodiment, the ontology-guided named entity recognition is performed based on the following rules: An entity candidate set is generated from the medical text using an ontology-aware named entity recognition model. This ontology-aware named entity recognition model includes, but is not limited to, a BERT model fine-tuned on UMLS dictionary data, the biomedical bidirectional encoder BioBERT, or the clinical medical bidirectional encoder ClinicalBERT. For each entity candidate in the entity candidate set, its ontology type is queried based on the entity type hierarchy of the medical ontology to determine whether its ontology type is within that hierarchy. Entity candidates whose ontology type is not within the hierarchy are rejected.

[0028] The hard constraint mechanism of ontology-guided named entity recognition is derived from the objectivity of medical ontology as an authoritative source of medical knowledge. This ensures that the boundaries of the identified entities conform to the definition of medical ontology from the source, significantly reducing the boundary error rate. This hard constraint mechanism is not a routine step in general named entity recognition.

[0029] S3. Cross-sentence reference graph node fusion: Based on the cross-sentence reference resolution algorithm, graph nodes are fused for multiple mentions of the same medical concept in the entity set to obtain a fused graph node set.

[0030] In this embodiment, the cross-sentence reference resolution algorithm is executed based on the following rules: Sentence segmentation and entity boundary marking are performed on the medical text. For pronoun or ellipsis references in the entity set (e.g., "the patient," "the aforementioned medication"), the nearest specific entity is matched as its referent based on the context. For entities with the same name and aliases in the entity set (e.g., "hypertension" and "essential hypertension"), they are merged into the same ontology concept based on the synonym relationships of the medical ontology.

[0031] The graph node fusion includes at least the following processes: assigning an ontology concept identifier (based on UMLS CUI encoding, SNOMED-CT Concept ID, or FMA ontology ID) to each fused graph node; recording the sentence index and character position of all mentioned locations; and unifying them into ontology specification names.

[0032] The cross-sentence reference graph node fusion mechanism addresses the problem that the same medical concept is represented as multiple independent nodes when mentioned multiple times across sentences, ensuring that each medical concept in the knowledge graph has one and only one corresponding node, thus greatly improving the coherence of the graph.

[0033] S4. Ontology Hierarchical Relationship Candidates: Based on the relation type hierarchy of the medical ontology, a relation candidate set is generated from the graph node pairs in the fused graph node set.

[0034] In this embodiment, the generation of the candidate relation set is based on the following formula constraint: , Where Cand(n1, n2) is the candidate set of relationships between graph node n1 and graph node n2, RT is the set of relationship types of the medical ontology, type(n) is the ontology type of graph node n, r ∈ RT indicates that relationship type r belongs to the ontology relationship type set, type(n1) → r type(n2) indicates that there exists a valid relationship definition in the medical ontology that points from type(n1) to type(n2) and the relationship type is r.

[0035] The relation candidate generation based on ontology type hierarchy constraints avoids exhaustively listing all N^2 combinations. For example, when the ontology types of two graph nodes are "medicine" and "disease" respectively, the medical ontology allows relation types of "treatment", "cause", and "medication", and other relation types will not be generated as candidates; when the ontology types of two graph nodes are "anatomical structure" and "symptom" respectively, the medical ontology allows relation type of "located", and other relation types will not be generated as candidates. This mechanism reduces the number of relation candidates from the order of N^2 to the legal combinations allowed by the ontology, significantly reducing computational complexity.

[0036] S5. Graph Embedding Multi-hop Inference: Based on the graph neural network, an initial graph containing the fused graph nodes and the candidate set of relationships is constructed for the medical text, and implicit medical relationship inference is performed based on multi-hop graph inference.

[0037] In this embodiment, the graph neural network includes, but is not limited to, Graph Convolutional Network (GCN), Graph Attention Network (GAT), or Relational Graph Convolutional Network (R-GCN). This application does not depend on a specific graph neural network structure. The graph neural network performs graph embedding on the initial graph, representing each fused graph node as a low-dimensional vector, wherein the dimension of the low-dimensional vector ranges from 64 to 512.

[0038] The multi-hop graph inference is performed based on the following rules: for graph node pairs with direct relationships in the initial graph, a relationship existence score is calculated using graph embedding vectors; for graph node pairs in the initial graph that do not have direct relationships but are reachable through K-hop relationship chains, the implicit relationship type is inferred using the relationship type combination rule of K-hop paths, where K ranges from 2 to 4. The implicit relationship score is calculated based on the following formula: , Where S_implicit(n1, n2) is the implicit relationship score between n1 and n2, max_path is the maximum value among all K-hop paths, Π is the product of the scores of each hop on the path, k is the number of hops, α is the hop count decay factor, the value of the hop count decay factor ranges from 0.5 to 0.9, e_k is the k-th hop relationship on the path, and score(e_k) is the score of the hop relationship.

[0039] The multi-hop graph reasoning mechanism addresses the problem of insufficient medical knowledge coverage in existing methods that only infer direct relationships. For example, the relationship "aspirin-treatment-coronary heart disease" can be directly derived from "patients taking aspirin to treat coronary heart disease," but by using multi-hop reasoning, the implicit relationship "aspirin-prevention-thrombosis" can be inferred from "aspirin-mechanism-antiplatelet" and "antiplatelet-prevention-thrombosis," thus expanding knowledge coverage.

[0040] S6. Dynamic graph time-series update: The medical knowledge graph is dynamically updated based on the time-series window, and a medical knowledge graph containing multi-hop reasoning paths is output.

[0041] In this embodiment, the time-series window ranges from 7 to 90 days. The dynamic update is performed based on the following rules: S1 to S5 are executed on newly added medical text within the time-series window to obtain new entities and new relationships. For the new entity, if a graph node with the same ontology concept identifier already exists in the medical knowledge graph, the mention position of the new entity is merged into the attributes of the existing graph node. For the new relationship, if a relationship of the same type already exists in the medical knowledge graph, the relationship score is updated (by taking the weighted average of observations within all time-series windows). For outdated relationships in the medical knowledge graph that exceed the time-series window, decay is performed based on a time decay coefficient, which ranges from 0.95 to 0.99 per day.

[0042] The method further includes performing bidirectional ontology consistency verification on the medical knowledge graph. The bidirectional ontology consistency verification includes at least two aspects: first, entity type consistency, where the ontology type of each graph node in the medical knowledge graph must have a corresponding node in the entity type hierarchy of the medical ontology; second, relation type consistency, where the relation type of each edge in the medical knowledge graph must conform to the allowed relation definition of the relation type hierarchy of the medical ontology for the combination of ontology types of the edge endpoints. This bidirectional ontology consistency verification mechanism ensures that the final output medical knowledge graph fully conforms to the hierarchical definition of the medical ontology.

[0043] Clinical Application Example 1: In a hospital inpatient medical record intelligent parsing scenario, the method performs medical knowledge graph construction on the admission record text "Patient, male, 65 years old, admitted due to recurrent chest pain for 3 days. History of hypertension for 5 years, currently taking amlodipine 5mg once daily. Chest pain is significantly correlated with activity." S2 Ontology-guided recognition yields entities: [Patient]: Person, [Male]: Attribute, [Chest Pain]: Symptom (SNOMED-CT code "29857009"), [Hypertension]: Disease (SNOMED-CT code "38341003"), [Amlodipine]: Drug (RxNorm code "17767"). S3 After cross-sentence reference fusion, the two occurrences of "chest pain" in the text are merged into a single graph node. S4 Generates relation candidates based on ontology hierarchy: [Amlodipine]-[Hypertension] allows "treatment" relation candidates, [Chest Pain]-[Activity] allows "induced by..." relation candidates. After embedding the S5 graph neural network, direct relationships are inferred: amlodipine - treatment - hypertension (score 0.95); multi-hop reasoning infers implicit relationships: amlodipine → mechanism [calcium channel blockade] → may affect heart rate → implicit [chest pain related] relationship (2 hops). The S6 output is a medical knowledge graph containing direct relationships and multi-hop reasoning paths, stored in a graph database format.

[0044] Clinical Application Example 2: In medical research, the method is used to construct medical knowledge graphs in batches from clinical guidelines and multiple medical records. A 30-day time window is set, with newly added clinical texts being integrated and updated into the same medical knowledge graph daily. Multi-hop reasoning reveals implicit relationship chains such as "drug A → mechanism → protein B → function → disease C," suggesting that drug A may have an effect on disease C, thus aiding in drug relocation research findings. After the medical knowledge graph is constructed, bidirectional ontology consistency verification is performed; any relationships that violate the medical ontology hierarchy are automatically removed, ensuring the rationality of the graph's medical common sense.

[0045] Please see Figure 2 , Figure 2 This application provides a schematic diagram of a dynamic medical knowledge graph construction device based on ontology-guided named entity recognition and multi-hop graph reasoning. The device 1 includes: The text and ontology loading unit 11 is used to obtain medical text and load medical ontology.

[0046] The ontology-guided entity recognition unit 12 is used to perform ontology-guided named entity recognition on the medical text based on the entity type hierarchy constraints of the medical ontology.

[0047] The cross-sentence reference fusion unit 13 is used to perform graph node fusion on multiple mentions of the same medical concept in the entity set based on the cross-sentence reference resolution algorithm.

[0048] The relation candidate generation unit 14 is used to generate a relation candidate set based on the relation type hierarchy of the medical ontology for graph node pairs in the fused graph node set.

[0049] The graph embedding multi-hop inference unit 15 is used to construct an initial graph for the medical text based on a graph neural network and perform multi-hop graph inference to infer implicit medical relationships.

[0050] The dynamic graph update unit 16 is used to perform dynamic updates on the medical knowledge graph based on a time-series window, outputting a medical knowledge graph containing multi-hop reasoning paths.

[0051] Please see Figure 3 , Figure 3 This is a schematic diagram of the hardware architecture of an electronic device provided in an embodiment of this application. The electronic device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, the memory 22, the input device 23, and the output device 24 are connected via a bus. The memory 22 is used to store computer program code, which includes computer instructions. When the processor 21 executes the instructions, the electronic device 2 executes the method for dynamically constructing a medical knowledge graph based on ontology-guided named entity recognition and multi-hop graph reasoning.

[0052] The various embodiments in the application have their own focus. For ease of description and simplification, the same or similar content may not be described in detail in different embodiments.

[0053] The method described in this application can be implemented based on hardware, software, or a combination of hardware and software.

Claims

1. A medical knowledge graph dynamic construction method based on ontology-guided named entity recognition and multi-hop graph reasoning, characterized in that It includes the following steps: S1. Obtain medical text and load medical ontology, wherein the medical ontology includes entity type hierarchy and relation type hierarchy; S2. Based on the entity type hierarchy constraints of the medical ontology, ontology-guided named entity recognition is performed on the medical text to obtain an entity set and its ontology type labels. The ontology-guided named entity recognition adopts hard constraints of ontology type hierarchy to ensure that the identified entity types are within the range of the ontology type hierarchy. S3. Based on the cross-sentence reference resolution algorithm, the graph nodes of multiple mentions of the same medical concept in the entity set are fused to obtain a fused graph node set. Each fused graph node includes an ontology concept identifier, all mention positions, and an ontology type label. S4. Based on the relation type hierarchy of the medical ontology, generate a relation candidate set for the graph node pairs in the fused graph node set. For each graph node pair, query the allowed relation types between the ontology types of the graph node pair according to the relation type hierarchy of the medical ontology as relation candidates. S5. Based on a graph neural network, an initial graph containing the fused graph nodes and the candidate relation set is constructed from the medical text. Implicit medical relation inference is performed based on multi-hop graph reasoning to obtain a medical knowledge graph containing implicit relations. The multi-hop graph reasoning includes at least two-hop reasoning to infer implicit medical relations that do not appear directly in the medical text but can be inferred through multi-hop relation chains. S6. Perform dynamic updates on the medical knowledge graph based on a time-series window. The dynamic updates include merging new nodes, evolving existing node attributes, and decaying outdated relationships. The output is a medical knowledge graph containing multi-hop reasoning paths.

2. The method according to claim 1, characterized in that... The ontology-guided named entity recognition is performed based on the following rules: An entity candidate set is generated for the medical text using an ontology-aware named entity recognition model, including a BERT model fine-tuned on UMLS dictionary data, a biomedical bidirectional encoder BioBERT, or a clinical medical bidirectional encoder ClinicalBERT; for each entity candidate in the entity candidate set, its ontology type is queried based on the entity type hierarchy of the medical ontology to determine whether its ontology type is in the hierarchy; entity candidates whose ontology type is not in the hierarchy are rejected; the ontology type hierarchy includes at least disease type nodes, symptom type nodes, drug type nodes, test type nodes, surgery type nodes, and anatomical structure type nodes.

3. The method according to claim 1, characterized in that... The cross-sentence reference resolution algorithm is executed based on the following rules: the medical text is segmented and entity boundary is marked; for pronouns or ellipsis references in the entity set, the nearest specific entity is matched as its referent based on the context; for entities with the same name and aliases in the entity set, they are merged into the same ontology concept based on the synonym relationship of the medical ontology; the graph node fusion includes at least the following processing: assigning an ontology concept identifier to each fused graph node; recording the sentence index and character position of all reference positions; unifying them into a standard ontology name; the ontology concept identifier is specified based on the globally unique identifier of the medical ontology, which includes the CUI code of UMLS, the Concept ID of SNOMED-CT, or the ontology ID of FMA.

4. The method according to claim 1, characterized in that... The generation of the candidate relation set is based on the following formula constraints: , Where Cand(n1, n2) is the candidate set of relationships between graph nodes n1 and n2, RT is the set of relationship types of the medical ontology, type(n) is the ontology type of graph node n, r ∈ RT indicates that relationship type r belongs to the ontology relationship type set, type(n1) → r type(n2) indicates that there exists a valid relationship definition in the medical ontology that points from type(n1) to type(n2) and the relationship type is r; the relationship candidate generation based on ontology type hierarchy constraints avoids exhaustively listing all N^2 combinations, significantly reducing the computational complexity of relationship inference, and the relationship types of the medical ontology include at least "treatment", "cause", "diagnosis", "located", "accompanying", "medication" and "synonym".

5. The method according to claim 1, characterized in that... The graph neural network includes a graph convolutional network (GCN), a graph attention network (GAT), or a relational graph convolutional network (R-GCN). The GCN performs graph embedding on the initial graph, representing each fused graph node as a low-dimensional vector, where the dimension of the low-dimensional vector ranges from 64 to 512. The multi-hop graph inference is performed based on the following rules: for graph node pairs with direct relationships in the initial graph, a relationship existence score is calculated using the graph embedding vector; for graph node pairs in the initial graph without direct relationships but reachable through a K-hop relationship chain, the implicit relationship type is inferred using the relationship type combination rule of the K-hop path, where K ranges from 2 to 4. The implicit relationship score is calculated based on the following formula: , Where S_implicit(n1, n2) is the implicit relationship score between n1 and n2, max_path is the maximum value among all K-hop paths, Π is the product of the scores of each hop on the path, k is the number of hops, α is the hop count decay factor, the value of the hop count decay factor ranges from 0.5 to 0.9, e_k is the k-th hop relationship on the path, and score(e_k) is the score of the hop relationship.

6. The method according to claim 1, characterized in that... The time window ranges from 7 to 90 days; the dynamic update is performed based on the following rules: S1 to S5 are executed on newly added medical text within the time window to obtain new entities and new relationships; for the new entity, if a graph node with the same ontology concept identifier already exists in the medical knowledge graph, the mention position of the new entity is merged into the attributes of the existing graph node; for the new relationship, if a relationship of the same type already exists in the medical knowledge graph, the relationship score is updated; for outdated relationships in the medical knowledge graph that exceed the time window, decay is performed based on a time decay coefficient, the time decay coefficient ranging from 0.95 to 0.99 per day; the method It also includes performing bidirectional ontology consistency verification on the medical knowledge graph. The bidirectional ontology consistency verification includes at least two aspects: First, entity type consistency, the ontology type of each graph node in the medical knowledge graph must have a corresponding node in the entity type hierarchy of the medical ontology; Second, relation type consistency, the relation type of each edge in the medical knowledge graph must conform to the allowed relation definition of the relation type hierarchy of the medical ontology for the combination of ontology types of the endpoints of that edge; The medical knowledge graph is also used for at least one of the following downstream applications: (1) clinical decision support system; (2) medical knowledge retrieval and question answering; (3) evidence mining for evidence-based medicine; (4) precision medicine recommendation.

7. A dynamic construction device for medical knowledge graphs based on ontology-guided named entity recognition and multi-hop graph reasoning, characterized in that... ,include: The text and ontology loading unit is used to perform step S1 as described in claim 1; The entity recognition unit is configured to perform step S2 as described in claim 1. The cross-sentence reference fusion unit is used to perform step S3 as described in claim 1; The relation candidate generation unit is configured to perform step S4 as described in claim 1. The graph is embedded with a multi-hop inference unit for performing step S5 as described in claim 1; The dynamic map update unit is used to perform step S6 as described in claim 1.

8. An electronic device, characterized in that... The electronic device includes: a processor and a storage unit for storing computer program code containing computer instructions, wherein when the processor executes these instructions, the electronic device performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that... The computer-readable storage medium stores a computer program, the computer program containing program instructions that, when executed by a processor, cause the processor to perform the method described in any one of claims 1 to 6.

10. A computer program product, characterized in that... The computer program product comprises a computer program or instructions that, when executed on a computer, cause the computer to perform the method described in any one of claims 1 to 6.