A multi-feature-based traditional Chinese medical record similarity matching method

CN122967997APending Publication Date: 2026-10-23GUANGZHOU FUYANG ZHILIAN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611174900.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

在典型单一证型中,各维度特征指向一致,线性加权尚可得出合理结果;但当病案涉及病机兼夹或处于传变过程时,某些维度可能出现非典型表现,如表证未解而里热渐生的过渡状态,各维度特征本应呈现特定的演变组合,系统却无法区分这种合理的病机演变与真正的四诊矛盾,将其混为一谈

Benefits of technology

本发明公开了一种基于多特征的中医病案相似度匹配方法,针对现有病案检索仅依赖症状表面特征、忽略病机内在逻辑关联而导致匹配结果临床参考价值不足的问题,通过获取目标病案的四诊维度特征数据,调用中医病机知识图谱匹配出第一病机节点集合及其拓扑结构,并基于图谱中各病机节点间的协同与排斥约束关系,对候选病案集合计算初始相似度,再依据预设筛选条件挑选待比对病案提取第二病机节点集合及其拓扑结构,通过两者拓扑结构的比对判断是否存在病机冲突,若结构差异值超出预设阈值则依据冲突程度调整初始相似度得到目标相似度,反之保留初始数值作为目标相似度,未参与比对的候选病案直接以初始相似度参与降序排序,选取排名靠前的病案生成检索结果列表,并进一步提取其辨证论治方案与用药记录,统计高频治法与方剂组合,分析病机演变规律,生成辅助临床诊疗的参考信息,从而实现了从表层症状匹配向深层病机逻辑一致性匹配的跨越,显著提升了病案检索的准确性与临床实用价值。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122967997A_ABST
    Figure CN122967997A_ABST
Patent Text Reader

Abstract

The application provides a traditional Chinese medicine medical record similarity matching method based on multiple characteristics, comprising: acquiring four-diagnosis dimension characteristic data of a target medical record, calling a traditional Chinese medicine pathogenesis knowledge graph, matching pathogenesis nodes according to the four-diagnosis dimension characteristic data, and extracting a first pathogenesis node set corresponding to the target medical record and a topological structure thereof; based on the traditional Chinese medicine pathogenesis knowledge graph, acquiring constraint relationships between pathogenesis nodes, acquiring four-diagnosis dimension characteristic data of a candidate medical record set, and determining initial similarity between each candidate medical record and the target medical record; based on the constraint relationships, comparing the first topological structure and the second topological structure, and judging whether there is a pathogenesis conflict between the first pathogenesis node set and the second pathogenesis node set; if there is a pathogenesis conflict, adjusting the initial similarity according to the conflict degree to obtain target similarity, and if there is no pathogenesis conflict, taking the initial similarity as the target similarity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology, and in particular to a method for matching the similarity of traditional Chinese medicine medical records based on multiple features. Background Technology

[0002] Traditional Chinese medicine (TCM) clinical diagnosis and treatment are based on a holistic view that integrates the four diagnostic methods of inspection, auscultation, inquiry, and palpation. Its core lies in the inherent connections between these diagnostic dimensions as defined by TCM theory. For example, a patient with wind-cold exterior syndrome will inevitably present with aversion to cold and fever, a floating and tight pulse, and a thin white tongue coating. These characteristics point to the same pathogenesis, rather than existing in isolation. When the characteristics of each dimension cannot form a self-consistent chain of evidence at the pathological mechanism level, a contradiction arises in the four diagnostic methods, prompting the physician to re-examine their diagnostic approach. With the development of TCM clinical information systems, a large number of historical medical records have been digitized. When faced with difficult cases, clinicians often need to retrieve historical records for diagnostic reference. This requires the system to match the current patient's four diagnostic information with historical records in the database and recommend cases based on similarity. Because TCM diagnosis relies on comprehensive judgment of multi-dimensional information, existing medical record retrieval systems generally adopt an architecture of linear weighting after independent calculation of dimensions: first, the medical record is broken down into several dimensions such as chief complaint, pulse, and tongue appearance; then, the local similarity of each dimension is calculated separately; finally, a total score is obtained and ranked by linear weighting using preset weights. However, there are logical constraints at the pathogenesis level between the four diagnostic dimensions in TCM. Certain combinations of features create a rejection relationship at the pathogenesis level and should not appear simultaneously. For example, a patient with exterior heat syndrome should present with a complaint of fever and aversion to wind, a floating and rapid pulse, and a red tongue with a yellow coating. If a candidate case highly matches the target in terms of complaint and pulse, but presents with a pale tongue and white coating, this constitutes a pathogenesis conflict. In the existing linear weighted framework, high scores in the complaint and pulse dimensions are simply added to low scores in the tongue dimension. The system cannot identify the conflict or adjust the matching results accordingly. If the case scores high enough in other dimensions, its total score may still rank high and be recommended to the user by the system, but the case actually has a serious contradiction in its diagnostic logic and lacks clinical reference value. This contradiction is particularly prominent in the disease transformation stage or in complex syndromes. In typical single-symptom patterns, the features across all dimensions are consistent, and linear weighting can yield reasonable results. However, when a case involves multiple pathogenesis pathways or is in a transitional phase, some dimensions may exhibit atypical manifestations, such as a transitional state where the exterior syndrome remains unresolved while internal heat gradually develops. In such cases, the features should present specific evolutionary combinations, but the system cannot distinguish between this reasonable pathogenesis evolution and genuine contradictions in the four diagnostic methods, conflating them. In summary, the core technical problem faced by the existing system is that in multi-dimensional case similarity matching, the linear weighting mechanism cannot identify cross-dimensional pathogenesis logical conflicts, leading to logically broken cases in the recommended results. Furthermore, some cases that are consistent in the four diagnostic methods are filtered out due to slightly lower scores in individual dimensions. Therefore, it is necessary to introduce logical verification at the pathogenesis level on the basis of preliminary multi-dimensional feature matching, judging the consistency of the combination of features across all dimensions, and correcting the matching results according to the conflict situation, so that the final output case has clinical interpretability in the context of comprehensive four diagnostic methods. Summary of the Invention

[0003] This invention provides a method for matching the similarity of traditional Chinese medicine medical records based on multiple features, mainly including: The four diagnostic dimensions feature data of the target medical case are obtained, the TCM pathogenesis knowledge graph is called, the pathogenesis nodes are matched according to the four diagnostic dimensions feature data, and the first pathogenesis node set and its topology structure corresponding to the target medical case are extracted. Based on the TCM pathogenesis knowledge graph, the constraint relationships between each pathogenesis node are obtained, a pre-stored set of candidate cases is obtained, and the four diagnostic dimensions feature data of each candidate case in the set of candidate cases are obtained to determine the initial similarity between each candidate case and the target case. According to the preset screening conditions, candidate cases that meet the initial similarity conditions are selected from the candidate case set as cases to be compared. The TCM pathogenesis knowledge graph is called, and pathogenesis nodes are matched according to the four diagnostic dimensions feature data of the cases to be compared, and a second pathogenesis node set and its topology structure are extracted and formed. Based on the aforementioned constraints, the topological structure of the first set of pathogenesis nodes is compared with the topological structure of the second set of pathogenesis nodes to determine whether there is a pathogenesis conflict between the first set of pathogenesis nodes and the second set of pathogenesis nodes. When there is a conflict in the pathogenesis, the initial similarity is adjusted according to the degree of conflict to obtain the target similarity; when there is no conflict in the pathogenesis, the initial similarity is used as the target similarity. All candidate cases are sorted according to the target similarity corresponding to each candidate case. Candidate cases that are not used as the cases to be compared are sorted using the initial similarity as the target similarity. The candidate cases with the higher ranking are selected as the matching results.

[0004] Furthermore, the acquisition of the four diagnostic dimensions feature data of the target medical case includes: Based on the chief complaint dimension, symptom description and duration of illness are extracted; based on the pulse dimension, pulse position, pulse rate and pulse shape are extracted to complete pulse encoding; based on the tongue dimension, tongue color and tongue coating thickness and moisture attributes are extracted to complete tongue encoding; based on the consultation dimension, cold and heat preferences, sweating amount and bowel characteristics are extracted to obtain the structured four diagnostic features of the target case.

[0005] Furthermore, the step of calling the TCM pathogenesis knowledge graph and matching pathogenesis nodes based on the four diagnostic dimensions feature data includes: Using the location, nature, and progression of the disease as the basic attributes of the pathogenesis nodes, each feature item is mapped to the corresponding pathogenesis node through a standardized dictionary of TCM terminology. In the case where a single feature item is associated with multiple candidate nodes, the node with the highest frequency is selected as the hit node corresponding to the feature item based on the historical co-occurrence frequency. The historical co-occurrence frequency is the number of times the node and the feature item co-occurs based on the statistics of historical medical cases during the atlas construction stage. When all hit nodes are located within the same connected component of the TCM pathogenesis knowledge graph, all hit nodes are taken as necessary nodes, and a minimum connected subgraph covering all necessary nodes is generated from the TCM pathogenesis knowledge graph. The intermediate nodes in the minimum connected subgraph are taken as connecting nodes. The hit nodes and the connecting nodes together constitute the first pathogenesis node set. The edges in the minimum connected subgraph are weighted according to the historical co-occurrence frequency to obtain the first pathogenesis node set and its topology.

[0006] Furthermore, the step of obtaining the constraint relationships between each pathogenesis node based on the TCM pathogenesis knowledge graph includes: The constraint relationships between each pathogenesis node are retrieved from the TCM pathogenesis knowledge graph. The constraint relationships include synergistic relationships and exclusionary relationships. The synergistic relationships are marked according to the co-occurrence frequency and the proportion of the same syndrome in historical medical cases. The exclusionary relationships are marked according to the TCM syndrome differentiation theory of cold-heat opposition and deficiency-excess opposition, thus obtaining a constraint relationship table between pathogenesis nodes. The constraint relationship table uses pathogenesis node pairs as index items, synergistic or exclusionary relationships as corresponding relationship categories, and the co-occurrence frequency and the proportion of occurrence of the same syndrome obtained from the annotation as the weight field of the synergistic relationship.

[0007] Furthermore, the step of obtaining the four diagnostic dimension feature data of the candidate case set and determining the initial similarity between each candidate case and the target case includes: The chief complaint, pulse, tongue appearance, and four diagnostic dimensions of each candidate case in the candidate case set are structured using the same triplet encoding method as the target case. The triplet codes of each dimension are concatenated into a four diagnostic feature vector in dimensional order. Preset weights are assigned to each of the four dimensions from high to low. The four diagnostic feature vectors of the target case and each candidate case are compared dimension by dimension and weighted summed using cosine similarity to determine the initial similarity.

[0008] Furthermore, the step of selecting candidate cases whose initial similarity meets the conditions from the candidate case set as cases to be compared, based on preset screening criteria, includes: The candidate case set is sorted in descending order according to the initial similarity value. A fixed percentage of the top-ranked segments are extracted from the descending sort results. Candidate cases within the segments are marked as cases to be compared. The remaining candidate cases do not participate in the subsequent pathogenesis-level comparison.

[0009] Furthermore, the step of calling the TCM pathogenesis knowledge graph, matching pathogenesis nodes based on the four diagnostic dimensions feature data of the case to be compared, and extracting and forming a second set of pathogenesis nodes and its topological structure includes: The medical records to be compared are normalized and mapped using a standardized dictionary of TCM terminology consistent with the target medical records. Each feature entry is mapped to the corresponding pathogenesis node in the TCM pathogenesis knowledge graph as the hit node. When all hit nodes are located in the same connected component of the TCM pathogenesis knowledge graph, all hit nodes are taken as necessary nodes, and a minimum connected subgraph covering all necessary nodes is generated from the TCM pathogenesis knowledge graph. The intermediate nodes along the path are taken as connecting nodes, and the hit nodes and the connecting nodes together constitute the second pathogenesis node set.

[0010] Furthermore, the step of comparing the topological structure of the first set of pathogenesis nodes with the topological structure of the second set of pathogenesis nodes based on the constraint relationship, and determining whether there is a pathogenesis conflict between the first set of pathogenesis nodes and the second set of pathogenesis nodes, includes: The pathogenesis nodes in the two sets of topologies are aligned according to the location, nature, and severity of the disease. Nodes with consistent basic attributes in the same attribute value system of the currently invoked TCM pathogenesis knowledge graph are marked as aligned nodes, and nodes that appear only on one side are marked as one-sided nodes. Retrieve the relationship entries involving the alignment node and the single-sided node from the constraint relationship, and record the node pairs with simultaneous exclusion relationships and node pairs marked as cooperative relationships but missing associated edges in a set of topologies into the conflict count entries. For associated edges connecting the same pair of aligned nodes, compare the difference between the category and weight of the associated edges; If the alignment node pair has an associated edge only in one set of topologies, then the associated edge is directly recorded as a structural difference edge; Associative edges with inconsistent categories or weight differences exceeding a preset weight difference threshold are recorded as structural difference edges. The number of conflict count entries is divided by the total number of node pairs involved in the two sets of topologies, and the number of structural difference edges is divided by the total number of aligned node pairs involved in the two sets of topologies. Then, the edges are weighted and summed according to preset weighting coefficients corresponding to the number of conflict count entries and the number of structural difference edges, respectively, to obtain the structural difference value. When the structural difference value is greater than the preset difference threshold, it is determined that there is a pathogenesis conflict.

[0011] Furthermore, determining the existence of a pathogenesis conflict when the structural difference value exceeds a preset difference threshold includes: The structural difference value is read as a quantitative basis for the degree of conflict. The structural difference value is divided into three levels: mild conflict, moderate conflict and severe conflict according to the preset first level threshold and the second level threshold. Both the first level threshold and the second level threshold are higher than the preset difference threshold. The preset attenuation coefficient corresponding to the conflict classification result is retrieved from the pre-built and stored attenuation coefficient mapping table. The attenuation coefficient corresponding to the mild conflict classification is greater than the attenuation coefficient corresponding to the severe conflict classification. The retrieved attenuation coefficient is multiplied by the initial similarity of the case to be compared to obtain the target similarity of the case to be compared.

[0012] Furthermore, the step of ranking all candidate cases based on the target similarity corresponding to each candidate case includes: The target similarity of the cases to be compared is merged and summarized with the initial similarity of the candidate cases that are not considered as cases to be compared, forming a target similarity table covering the entire set of candidate cases. The target similarity values ​​corresponding to each candidate case in the target similarity table are sorted in descending order to obtain the candidate case ranking sequence. The top-ranked candidate cases are extracted from the candidate case ranking sequence according to a preset recommendation quota, which is a fixed positive integer number of cases set in advance.

[0013] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects: This invention discloses a multi-feature-based method for matching similarity in traditional Chinese medicine (TCM) medical records. Addressing the problem that existing medical record retrieval methods rely solely on surface symptom features and neglect the inherent logical connections within the pathogenesis, resulting in insufficient clinical reference value for matching results, this method acquires the four diagnostic dimensions (inspection, auscultation and olfaction, inquiry, and palpation) feature data of the target medical record. It then uses a TCM pathogenesis knowledge graph to match the first set of pathogenesis nodes and their topological structure. Based on the synergistic and exclusionary constraints between the pathogenesis nodes in the graph, an initial similarity is calculated for the candidate medical record set. Next, based on preset screening conditions, a second set of pathogenesis nodes and their topological structure are extracted from the selected medical records for comparison. The similarity is then determined by comparing the topological structures of the two sets. If there is a conflict in the pathogenesis, and the structural difference value exceeds the preset threshold, the initial similarity is adjusted according to the degree of conflict to obtain the target similarity. Otherwise, the initial value is retained as the target similarity. Candidate cases that are not included in the comparison are directly sorted in descending order based on the initial similarity. The cases with the highest ranking are selected to generate a list of search results. Furthermore, their syndrome differentiation and treatment plans and medication records are extracted, high-frequency treatment methods and prescription combinations are statistically analyzed, the pathogenesis evolution pattern is analyzed, and reference information to assist clinical diagnosis and treatment is generated. This achieves a leap from surface symptom matching to deep pathogenesis logic consistency matching, significantly improving the accuracy and clinical practical value of case retrieval. Attached Figure Description

[0014] Figure 1 This is a flowchart of a method for matching the similarity of traditional Chinese medicine medical records based on multiple features, according to the present invention.

[0015] Figure 2 This is a schematic diagram of a TCM medical record similarity matching method based on multiple features according to the present invention.

[0016] Figure 3 This is another schematic diagram of a multi-feature-based TCM medical record similarity matching method according to the present invention. Detailed Implementation

[0017] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] like Figures 1-3 This embodiment of a method for matching the similarity of TCM medical records based on multiple features may specifically include: Step S101: Obtain the four diagnostic dimension feature data of the target medical case, call the TCM pathogenesis knowledge graph, match pathogenesis nodes according to the four diagnostic dimension feature data, and extract the first pathogenesis node set and its topology structure corresponding to the target medical case.

[0019] The four diagnostic dimensions feature data of the target medical case are obtained. For the chief complaint dimension, symptom description and duration of illness are extracted. For the pulse dimension, pulse location, pulse rate, and pulse shape are extracted to complete pulse encoding. For the tongue dimension, tongue color, thickness, and moisture attributes are extracted to complete tongue encoding. For the consultation dimension, cold and heat preferences, sweating amount, and bowel and bladder characteristics are extracted to obtain structured four diagnostic feature items. Based on the structured four diagnostic feature items, a pre-constructed TCM pathogenesis knowledge graph is invoked. The TCM pathogenesis knowledge graph uses disease location, disease nature, and disease progression as the basic attributes of pathogenesis nodes. Each feature item is mapped to the corresponding pathogenesis node through a standardized TCM terminology dictionary. Synonyms or near-synonyms are normalized. For cases where a single feature is associated with multiple candidate nodes, the node is selected and retained based on its historical co-occurrence frequency marked in the graph, resulting in a candidate pathogenesis node list. For the candidate pathogenesis node list, preset association edges between nodes are retrieved from the TCM pathogenesis knowledge graph. These association edges include exterior-interior transmission edges, organ-organ mutual generation and restraint edges, and causal inheritance edges. When all candidate pathogenesis nodes are located in the same connected component of the TCM pathogenesis knowledge graph, a minimum connected subgraph covering all candidate pathogenesis nodes is generated. The edges in the subgraph are weighted according to the historical co-occurrence frequency to obtain the first pathogenesis node set and its topology corresponding to the target case.

[0020] In one implementation, the four diagnostic dimensions of the target medical record are derived from outpatient records, inpatient records, and follow-up records in the TCM electronic medical record system, covering the four dimensions of chief complaint, pulse, tongue appearance, and medical history. For the chief complaint dimension, symptom description text and duration of illness are extracted from the medical record's homepage and the present illness history field. The symptom description includes major discomforts such as headache, chills, and cough, and the duration of illness is quantified in days or hours. For the pulse dimension, three elements—pulse location, pulse rate, and pulse shape—are extracted to complete the pulse coding. Pulse location includes three levels: floating, middle, and deep; pulse rate includes three levels: slow, moderate, and rapid; and pulse shape includes four levels: tight, slippery, wiry, and hesitant. The pulse coding is recorded in a tripartite format. For example, a floating and tight pulse is recorded as a tripartite entry with floating pulse location, default pulse rate, and tight pulse shape. For the tongue dimension, tongue color, thickness, and moisture / dryness attributes are extracted to complete the tongue coding. Tongue color is distinguished as light red, red, crimson, and bluish-purple; tongue coating thickness is distinguished as thin and thick; and moisture / dryness is distinguished as moist, dry, and greasy. The tongue coding is also recorded in a tripartite format. For the consultation dimension, three categories of items are extracted: cold and heat preferences, sweating amount, and bowel and bladder characteristics. Finally, these are compiled into structured four diagnostic feature items.

[0021] Specifically, the standardized dictionary of TCM terminology is compiled from authoritative TCM terminology standards, and includes the correspondence between synonyms, near-synonyms, and common terms. For example, "fear of cold," "afraid of cold," and "afraid of cold" are unified into the standardized expression "aversion to cold," and "irritability" and "feeling distress" are merged into the same node entry. Through the standardized dictionary of TCM terminology, structured diagnostic features are mapped to pathogenesis nodes in the TCM pathogenesis knowledge graph. The pathogenesis nodes are based on three elements: location, nature, and progression. Location values ​​include exterior, interior, half-exterior, half-interior, and the five viscera and six bowels. Nature values ​​cover the four basic natures of cold, heat, deficiency, excess, dampness, and dryness, as well as the two pathological products of phlegm and blood stasis. Progression values ​​include initial stage, progression, and outcome.

[0022] In one possible implementation, the same diagnostic feature item is often associated with multiple candidate pathogenesis nodes. For example, "yellow and greasy tongue coating" can correspond to both "damp-heat accumulation in the spleen" and "phlegm-heat obstructing the lungs." In this case, the node with the highest frequency of co-occurrence is selected and retained based on the historical co-occurrence frequency marked in the TCM pathogenesis knowledge graph. The historical co-occurrence frequency is the number of times the node and feature item co-occurs, obtained from the statistics of historical medical cases during the graph construction stage. The node with the highest frequency is selected as the candidate pathogenesis node.

[0023] It should be noted that the aforementioned correlation edges encompass three categories: exterior-interior transmission edges, organ-internal mutual generation and restraint edges, and causal connection edges. Exterior-interior transmission edges depict the transmission pathways of pathogenic factors from the exterior to the interior or from the interior to the exterior, such as the transmission edge between the "Taiyang exterior syndrome" node and the "Yangming interior heat" node; organ-internal mutual generation and restraint edges depict the manifestation of the five elements' generating and restraining relationships at the pathogenesis level, such as the wood-restraining-earth edge between the "liver qi stagnation" node and the "spleen dysfunction" node; causal connection edges depict the causal sequence between pathogenesis mechanisms, such as the connection edge from the "qi stagnation" node to the "blood stasis" node.

[0024] In one embodiment, when all candidate pathogenesis nodes are located within the same connected component of the TCM pathogenesis knowledge graph, a minimum connected subgraph covering all candidate pathogenesis nodes is generated. Using the Steiner tree generation method in graph theory, candidate pathogenesis nodes are selected as essential nodes. The substructure with the fewest edges connecting all essential nodes is chosen from all nodes and edges in the graph. Intermediate nodes along the path are retained as connecting nodes, which are used to handle the transitional relationships between essential nodes. For cases with a large graph size, a local subgraph is first extracted within a preset number of hops, centered on the essential nodes, as the search range. The number of hops is set to 2 to 3 to balance the local search range and computational efficiency. Then, a Steiner tree is generated on this local subgraph to obtain the minimum connected subgraph covering the candidate pathogenesis nodes.

[0025] Preferably, each edge in the minimum connected subgraph is assigned a weight based on its historical co-occurrence frequency, with the weight value ranging from 0 to 1. Let n be the historical co-occurrence frequency of the nodes at both ends of an edge, and N be the maximum co-occurrence frequency of this type of associated edge in the graph. Then, the weight of this edge is n / N, where n and N are dimensionless count values.

[0026] For example, if the historical co-occurrence frequency of the "wind-cold attacking the exterior" node and the "lung qi failing to disperse" node is 480, and the maximum co-occurrence frequency of the same type of edge in the graph is 600, then the weight of the edge is 0.8; if the historical co-occurrence frequency of the "wind-cold attacking the exterior" node and the "stomach failing to descend" node is 120, then the weight of the edge is 0.2.

[0027] It is understood that the first pathogenesis node set is composed of candidate pathogenesis nodes and the connecting nodes. The topology is recorded in the form of a triplet of node set, edge set and edge weight. Each node in the node set carries three basic attributes: lesion location, lesion nature and lesion severity. Each edge in the edge set carries its category and weight value, which serves as a complete characterization of the target case at the pathogenesis level.

[0028] Step S102: Based on the TCM pathogenesis knowledge graph, obtain the constraint relationships between each pathogenesis node, obtain the four diagnostic dimension feature data of the candidate case set, and determine the initial similarity between each candidate case and the target case.

[0029] The constraint relationships between each pathogenesis node are retrieved from the TCM pathogenesis knowledge graph. These constraint relationships include two types: cooperative relationships and exclusionary relationships. Cooperative relationships are labeled based on the co-occurrence frequency and the proportion of identical syndrome types in historical medical cases. Exclusionary relationships are labeled based on the TCM diagnostic theories of cold-heat opposition and deficiency-excess opposition, resulting in a constraint relationship table between pathogenesis nodes. The chief complaint, pulse, tongue appearance, and inquiry-based diagnosis features of each candidate case in the candidate case set are obtained. Structured processing is performed using the same triplet encoding method as the target case. The triplet codes of each dimension are concatenated in dimensional order to form a four-diagnosis feature vector. Preset weights are assigned from high to low for the four dimensions: chief complaint, pulse, tongue appearance, and inquiry. Cosine similarity is used to compare the four-diagnosis feature vectors of the target case and each candidate case dimension by dimension and then weighted and summed to determine the initial similarity between each candidate case and the target case.

[0030] In one implementation, the constraint relationships between each pathogenesis node are retrieved from the TCM pathogenesis knowledge graph and organized into a constraint relationship table. Co-occurrence relationships are marked based on the co-occurrence frequency of two pathogenesis nodes in historical medical records and their proportion of occurrence under the same syndrome type. Node pairs with a co-occurrence frequency exceeding 300 times and a proportion of occurrence under the same syndrome type exceeding 0.6 are marked as co-occurrence relationships. Exclusion relationships are marked based on the TCM diagnostic theory of cold-heat opposition and deficiency-excess opposition; for example, the "cold coagulation" node and the "heat excess" node are marked as exclusion relationships, as are the "qi deficiency" node and the "excessive pathogenic factors" node. The constraint relationship table is stored in the form of node pairs and their relationship categories, serving as the basis for judgment in subsequent pathogenesis comparison stages.

[0031] Specifically, for each candidate case in the candidate case set, a triplet coding method consistent with the target case is used to perform structured processing on the four dimensions of chief complaint, pulse, tongue, and medical history. A fixed-length list of values ​​is pre-defined for each dimension. For example, the pulse dimension has ten values: three levels of pulse position, three levels of pulse rate, and four levels of pulse shape. Each value corresponds to a fixed component bit in the vector. If the value is matched, the component bit is set to 1; otherwise, it is set to 0. The components of the four dimensions are concatenated in the order of chief complaint, pulse, tongue, and medical history to form the four diagnostic feature vectors.

[0032] Preferably, preset weights are assigned to the four dimensions of chief complaint, pulse, tongue, and medical history, from high to low: chief complaint (0.35), pulse (0.25), tongue (0.25), and medical history (0.15), with a sum of 1. These weights are determined based on the importance ranking of the four diagnostic methods in TCM clinical diagnosis. The chief complaint, directly reflecting the patient's core suffering, has the highest weight; pulse and tongue, as objective signs, are in the middle; and medical history, as an auxiliary reference, has the lowest weight. The four diagnostic feature vectors of the target case and each candidate case are segmented into four components: chief complaint, pulse, tongue, and medical history. Cosine similarity is calculated for each component segment to obtain local similarity values ​​for the four dimensions. These local similarity values ​​are then weighted and summed using the aforementioned dimensional weights to obtain the initial similarity between the candidate case and the target case. This initial similarity, along with the aforementioned constraint relationship table, serves as the input basis for the next stage of screening and comparison.

[0033] Step S103: According to the preset screening conditions, select candidate cases whose initial similarity meets the conditions from the candidate case set as cases to be compared. For the cases to be compared, call the TCM pathogenesis knowledge graph, match pathogenesis nodes according to its four diagnostic dimensions feature data, and extract to form a second pathogenesis node set and its topological structure.

[0034] According to preset screening criteria, the candidate case set is sorted in descending order based on initial similarity values. From the descending order, the top-ranked quantile segments are extracted, with each segment representing a certain percentage of candidate cases in the descending order. Candidate cases within these quantile segments are marked as cases to be compared; the remaining candidate cases are not included in subsequent pathogenesis-level comparisons. For each case to be compared, the four diagnostic dimensions (chief complaint, pulse, tongue appearance, and medical history) are extracted. Synonyms and near-synonyms are normalized using a standardized dictionary of TCM terminology consistent with the target case, forming structured feature entries corresponding to the case to be compared. Based on the structured feature entries, the TCM pathogenesis knowledge graph is invoked, and each feature entry is mapped to the corresponding pathogenesis node in the TCM pathogenesis knowledge graph as a hit node. When all hit nodes are located in the same connected component of the TCM pathogenesis knowledge graph, a minimum connected subgraph covering all hit nodes is generated. The intermediate nodes along the path are retained as connecting nodes. The hit nodes and the connecting nodes together constitute the second pathogenesis node set. The node set, edge set, and edge category of the minimum connected subgraph together constitute the topology of the second pathogenesis node set.

[0035] In one implementation, for each candidate medical record in the candidate medical record set, its initial similarity value obtained in the previous step is read, and the records are sorted in descending order according to the initial similarity value to form a descending list of candidate medical records. The higher the ranking of the candidate medical record in the descending list, the higher its overall fit with the target medical record in the four dimensions of chief complaint, pulse, tongue appearance, and medical history.

[0036] Specifically, the top-ranked quantile segments are extracted from the descending sequence list to form the candidate range of cases to be compared. The quantile segments are selected with a fixed proportion of the total number of candidate cases as their length.

[0037] For example, if the quantile ratio is 10% and the total number of candidate cases is 2000, then the top 200 candidate cases in the descending sequence list will be selected. For different clinical search scenarios, the quantile ratio can also be 5% for high-precision, narrow-range searches and 15% for wide-area reference searches. Candidate cases located within the stated quantile range are marked as cases to be compared; the remaining candidate cases will not participate in subsequent pathogenesis-level comparisons.

[0038] In one possible implementation, when the total number of candidate cases is less than 500, directly truncating by quantile ratio would result in too few cases to be compared. Therefore, a minimum number threshold is added in addition to the quantile ratio truncation. The minimum number threshold is 20 cases. This threshold is determined based on the lower limit of the sample size required for statistical analysis in pathogenesis conflict determination, ensuring that the number of cases entering the pathogenesis comparison stage is sufficient to support the statistical significance of subsequent ranking. If the number obtained by truncating by quantile ratio is lower than the minimum number threshold, it is padded to the minimum number threshold in descending order of the initial similarity value.

[0039] It should be noted that, for each of the medical records to be compared, the four diagnostic dimensions of chief complaint, pulse, tongue appearance, and consultation are read from the TCM electronic medical record system. The free text description is normalized by a TCM terminology standardization dictionary consistent with the target medical record. For example, "fear of cold", "afraid of cold", and "fear of cold" are uniformly merged into the standard expression "aversion to cold", and "white and greasy tongue coating" and "white and greasy tongue coating" are merged into the same entry to form the structured feature entries corresponding to the medical records to be compared.

[0040] Specifically, each structured feature entry is input into the TCM pathogenesis knowledge graph for node matching. A feature entry that matches one or more pathogenesis nodes is considered a matched node. For example, the entry "chills and fever" matches the "wind-cold attacking the exterior" node, the entry "floating and tight pulse" matches both the "wind-cold attacking the exterior" and "exterior cold syndrome" nodes, and the entry "red tongue with yellow coating" matches the "intense internal heat" node. If the same entry matches multiple candidate nodes, the historical co-occurrence frequency of the entry with each candidate node is read from the TCM pathogenesis knowledge graph. The candidate node with the highest historical co-occurrence frequency is retained as the matched node, and the remaining candidate nodes are discarded to avoid node redundancy.

[0041] In one embodiment, when all hit nodes are located within the same connected component of the TCM pathogenesis knowledge graph, the Steiner tree generation method in graph theory is used. Taking all hit nodes as necessary nodes, the substructure with the fewest edges that connect all necessary nodes is selected from all nodes and edges of the TCM pathogenesis knowledge graph. The intermediate nodes along the way are retained as connecting nodes. The connecting nodes are connected to the minimum connected subgraph in the form of intermediate nodes. The two sides are connected to the adjacent hit nodes or other connecting nodes through associated edges, respectively, to assume the pathogenesis transition relationship between hit nodes. For example, the "wind-cold attacking the exterior" node and the "intense internal heat" node are connected by the "exterior cold and interior heat" connecting node, reflecting the transitional form of pathogenic factors from the exterior to the interior.

[0042] Preferably, the hit node and the connecting node together constitute the second pathogenesis node set. The node set, edge set, and edge category of the minimum connected subgraph together constitute the topological structure of the second pathogenesis node set. The edge category follows the three categories of surface-interior transmission edge, organ-internal mutual generation and restraint edge, and causal inheritance edge.

[0043] It is understood that the second set of pathogenesis nodes and its topology are consistent with the first set of pathogenesis nodes and its topology corresponding to the target case in terms of storage format. The nodes all carry three basic attributes: location, nature, and severity of the disease. The edges all carry category identifiers and weight values. The weight values ​​of the edges follow the aforementioned weighting method based on historical co-occurrence frequency, serving as a complete characterization of the case to be compared at the pathogenesis level.

[0044] Step S104: Based on the constraint relationship, compare the first topology and the second topology to determine whether there is a pathogenesis conflict between the first set of pathogenesis nodes and the second set of pathogenesis nodes.

[0045] For the pathogenesis nodes in the first and second topologies, node alignment is performed according to three basic attributes: location, nature, and severity. Nodes with completely identical basic attributes in both topologies are marked as aligned nodes, and nodes appearing only on one side are marked as one-sided nodes, forming a node alignment result. Cooperative and repulsive relationship entries involving the aligned nodes and the one-sided nodes are retrieved from the constraint relationship table, forming a constraint relationship subset. Based on the node alignment result and the constraint relationship subset, cooperative and repulsive checks are performed on the first and second topologies. If node pairs marked as repulsive appear simultaneously in both topologies, the node pair is added to the conflict count entry; if a node pair marked as cooperative has an associated edge in one topology but lacks an associated edge in the other, the node pair is also added to the conflict count entry, resulting in a conflict count entry set. Based on the conflict count entry set, path matching and category consistency comparison are performed on the edge sets of the first topology and the second topology. For associated edges connecting the same pair of aligned nodes, the categories of the edges are compared to see if they are the same and whether the weight difference exceeds a preset weight difference threshold. Associated edges with inconsistent categories or weight differences exceeding the threshold are recorded as structural difference edges. The number of conflict count entries is divided by the total number of node pairs involved in the two sets of topologies, and the number of structural difference edges is divided by the total number of aligned node pairs involved in the two sets of topologies. Then, the results are weighted and summed according to preset weighting coefficients corresponding to the number of conflict count entries and the number of structural difference edges, respectively, to obtain the structural difference value. If the structural difference value is greater than the preset difference threshold, it is determined that there is a pathogenesis conflict between the first pathogenesis node set and the second pathogenesis node set.

[0046] In one implementation, the pathogenesis conflict determination is used to identify whether the target case and the case to be compared present a self-consistent chain of evidence at the pathogenesis level. The determination process is carried out in three steps: node alignment, constraint verification, and structural difference synthesis. Finally, the comparison result between the structural difference value and the preset difference threshold is used as the determination conclusion.

[0047] Specifically, for the pathogenesis nodes in the first and second topologies, node alignment is performed based on three fundamental attributes: location, nature, and severity. The alignment process reads nodes one by one from both topologies. Nodes with identical location, nature, and severity values ​​are marked as aligned nodes. For example, if a node with the location "superficial," nature "cold," and severity "initial stage" appears in both topologies, that node is marked as aligned. Nodes appearing only on one side of either the first or second topology are marked as unilateral nodes. For example, a node with the attribute "internal heat and intense heat" appearing only in the second topology is marked as a unilateral node on the second side. The aligned nodes and the unilateral nodes together constitute the node alignment result and are distinguished according to their origin in the topology.

[0048] In one possible implementation, the cooperative relationship entries and exclusion relationship entries involving the aligned node and the single-sided node are retrieved from the constraint relationship table, and the constraint relationship entries that do not involve the above nodes are temporarily filtered out to obtain a subset of constraint relationships covering the relevant nodes in the current two sets of topologies.

[0049] Specifically, exclusion checks are performed on the first topology and the second topology, covering two typical scenarios.

[0050] For example, if the "cold condensation" node and the "heat abundance" node in the constraint relationship subset are mutually exclusive, in case one, the two nodes appear in the first topology and the second topology respectively, and in case two, the two nodes appear in the same topology. Regardless of the case, the node pair and its source topology are recorded as a conflict count entry.

[0051] It should be noted that the collaborative verification is performed on node pairs marked as collaborative relationships within the constraint relationship subset.

[0052] For example, the "Wind and Cold Attack" node and the "Lung Qi Disorder" node are marked as having a cooperative relationship in the constraint relationship table. If there is a direct associated edge or a path connecting the node pair in the first topology without more than a preset number of hops, while there is neither a direct associated edge nor a path connecting the node pair in the second topology without more than a preset number of hops, then it is considered that one side has a cooperative relationship while the other side has a missing cooperative relationship. The node pair and its topology source are recorded as a conflict count entry, and the preset number of hops is 2.

[0053] Preferably, the conflict count entries generated by exclusion check and the conflict count entries generated by co-check are aggregated, deduplicated, and a conflict count entry set is formed. The size of the entry set reflects the degree of inconsistency in the pathogenesis of the two sets of topologies at the node relationship level. Further, based on the conflict count entry set, path matching and category consistency comparison are performed on the edge sets of the first and second topologies. For the same aligned node pair, it is first determined whether the aligned node pair has a directly connected associated edge in both sets of topologies. If it exists in both sets of topologies, the category of each edge is compared to see if they are the same. The edge categories include three types: surface-to-interior transition edges, organ-to-organ mutual generation and restraint edges, and causal inheritance edges. For example, if an aligned node pair in the first topology is a surface-to-interior transition edge, and the same aligned node pair in the second topology is a causal inheritance edge, then it is considered that the categories are inconsistent; if only one side has an associated edge, it is directly considered that the edge is missing.

[0054] In one embodiment, for related edges of the same category, the weight difference is compared to see if it exceeds a preset weight difference threshold. The preset weight difference threshold is 0.3. This threshold is determined based on the statistical distribution of the weight differences of the same pathogenesis node pair in different disease stages in historical medical records. A weight difference exceeding 0.3 indicates that there is a significant difference in the confidence level of the two sets of topologies for the related edge.

[0055] For example, in the first topology, the weight of the associated edge between the "wind-cold attacking the exterior" node and the "lung qi failing to circulate" node is 0.8, and in the second topology, the weight of the associated edge between the same pair of nodes is 0.4. The weight difference is 0.4 > 0.3, so the associated edge is recorded as a structural difference edge. The associated edges with inconsistent categories and the associated edges corresponding to edge missing differences are also directly recorded as structural difference edges.

[0056] Specifically, the structural difference value is obtained by weighting and summing the values ​​according to preset weighting coefficients corresponding to the number of conflict count entries and the number of structural difference edges, respectively. To avoid the two types of quantities being too different in size and causing one to dominate the result, the two types of quantities are first normalized. Let the number of conflict count entries be c, the total number of node pairs involved in the two sets of topologies be C, the number of structural difference edges be e, the total number of aligned node pairs involved in the two sets of topologies be E, the weighting coefficient corresponding to the conflict count entries be a, and the weighting coefficient corresponding to the structural difference edges be b. Then the structural difference value D = ac / C + be / E, where a is 0.6, b is 0.4, the sum of a and b is 1, and a is greater than b, to reflect that the conflict count entries are more important than the structural difference edges in the determination of pathogenesis conflicts. c, C, e, and E are all dimensionless count values, and the value range of D is 0 to 1.

[0057] For example, if the c of a certain case to be compared is 3, C is 10, e is 5, and E is 20, then the structural difference value D = 0.6 × 3 / 10 + 0.4 × 5 / 20 = 0.28.

[0058] Understandably, the structural difference value is compared with a preset difference threshold, which is 0.2. This threshold is determined based on the lower quartile of the statistical distribution of structural difference values ​​in samples in the historical medical case database that have been judged by TCM experts to have a clear pathogenesis conflict. That is, case pairs with a value lower than this are considered by experts to have no significant conflict in clinical diagnosis. If the structural difference value is greater than the preset difference threshold, it is determined that there is a pathogenesis conflict between the first pathogenesis node set and the second pathogenesis node set; otherwise, it is determined that there is no pathogenesis conflict. The determination conclusion is retained as the pathogenesis conflict determination result corresponding to the case to be compared.

[0059] Step S105: If there is a pathogenesis conflict, adjust the initial similarity according to the degree of conflict to obtain the target similarity; if there is no pathogenesis conflict, use the initial similarity as the target similarity.

[0060] Based on the pathogenesis conflict determination results, for cases identified as having pathogenesis conflicts, their structural difference values ​​are read as a quantitative basis for the degree of conflict. These structural difference values ​​are then divided into three levels—mild conflict, moderate conflict, and severe conflict—according to two preset thresholds, resulting in the conflict classification result for each case. Based on this conflict classification result, the corresponding attenuation coefficient is retrieved from a pre-established attenuation coefficient mapping table. This table uses the conflict classification result as the key and values ​​between 0 and 1 as the corresponding attenuation coefficients. Mild conflict corresponds to an attenuation coefficient greater than that of severe conflict, and severe conflict corresponds to an attenuation coefficient less than that of mild conflict. The retrieved attenuation coefficient is multiplied by the initial similarity of the case to be compared, resulting in a downgraded similarity value, which is then used as the target similarity for the case. Based on the pathogenesis conflict determination results, for cases to be compared that are determined to have no pathogenesis conflict, the initial similarity of the cases to be compared is directly passed through as the target similarity of the cases to be compared, and merged with the aforementioned downgraded target similarity to form the target similarity result set at the level of the cases to be compared.

[0061] In one implementation, the target similarity adjustment step takes into account the aforementioned pathogenesis conflict determination results. For cases to be compared that are determined to have pathogenesis conflicts, their initial similarity is reduced according to the degree of conflict. For cases to be compared that are determined not to have pathogenesis conflicts, their initial similarity is retained as is, and finally a target similarity result set covering all cases to be compared is obtained.

[0062] Specifically, the structural difference values ​​corresponding to the cases to be compared that have conflicting pathogenesis are read as the quantitative basis for the degree of conflict, and the structural difference values ​​are divided into three levels according to two preset grading thresholds.

[0063] For example, the first grading threshold is set to 0.35, and the second grading threshold is set to 0.6. These two thresholds are determined based on the distribution range of structural difference values ​​corresponding to the severity of conflict as determined by TCM experts in historical medical records: mild conflict corresponds to a structural difference value between the difference threshold and 0.35; moderate conflict corresponds to a value between 0.35 and 0.6; and severe conflict corresponds to a value greater than 0.6. If the structural difference value is greater than the preset difference threshold of 0.2 but does not exceed 0.35, the case to be compared is marked as mild conflict; if the structural difference value is greater than 0.35 but does not exceed 0.6, it is marked as moderate conflict; and if the structural difference value is greater than 0.6, it is marked as severe conflict. The conflict grading result, along with the case number of the case to be compared, is stored in the grading record table.

[0064] It should be noted that the attenuation coefficient mapping table is pre-established during the system initialization phase. The mapping table uses the conflict classification result as the key and values ​​between 0 and 1 as the corresponding attenuation coefficients. The attenuation coefficient corresponding to the mild conflict level is 0.85, reflecting that this type of conflict has a small impact on the self-consistency of the four diagnostic methods, and only a limited downward adjustment is made; the attenuation coefficient corresponding to the moderate conflict level is 0.65, reflecting that this type of conflict has significantly deviated from the self-consistent evidence chain; the attenuation coefficient corresponding to the severe conflict level is 0.4, reflecting that the clinical reference value of candidate cases under this type of conflict has dropped significantly. The attenuation coefficient values ​​of the above three levels are determined based on the expert scoring method of the impact of different conflict levels on diagnostic decisions in clinical diagnosis, and the attenuation coefficients between the levels maintain a monotonically decreasing relationship.

[0065] Specifically, the corresponding attenuation coefficient is retrieved from the attenuation coefficient mapping table according to the conflict classification results recorded in the classification record table. The retrieved attenuation coefficient is multiplied by the initial similarity of the case to be compared, and the adjusted similarity value is used as the target similarity of the case to be compared.

[0066] For example, if the initial similarity of a case to be compared is 0.82 and the structural difference value is 0.28, falling into the mild conflict category, then the target similarity is 0.82 × 0.85 = 0.697; if the initial similarity of another case to be compared is 0.78 and the structural difference value is 0.72, falling into the severe conflict category, then the target similarity is 0.78 × 0.4 = 0.312.

[0067] In one possible implementation, for cases to be compared that are determined to have no pathogenesis conflict, i.e., cases whose structural difference value is not greater than the preset difference threshold of 0.2, the initial similarity value of the case to be compared is retained as is and directly transmitted as its target similarity without any downgrading.

[0068] Preferably, the reduced target similarity and the transmitted target similarity are merged and summarized according to the case number of the cases to be compared, forming the target similarity result set at the case level. The target similarity result set uses the case number as the index item, and also retains the corresponding initial similarity, conflict classification result, attenuation coefficient and target similarity values, which can be directly referenced in subsequent sorting and result recommendation stages.

[0069] It is understood that, in addition to using the aforementioned fixed values, the attenuation coefficient mapping table can also be updated periodically as an offline adjustable item. During the update process, the values ​​are adjusted based on the statistical results of the consistency of diagnosis in the historical medical case database. The attenuation coefficient for mild conflict is selected between 0.8 and 0.9, the attenuation coefficient for moderate conflict is selected between 0.6 and 0.7, and the attenuation coefficient for severe conflict is selected between 0.35 and 0.45. The attenuation coefficients between the levels maintain a monotonically decreasing relationship. After the update is completed, the new values ​​cover the aforementioned fixed values ​​and take effect in subsequent adjustment stages.

[0070] Step S106: Sort all candidate cases according to the target similarity corresponding to each candidate case. Candidate cases that are not used as the cases to be compared are sorted using the initial similarity as the target similarity. Select the candidate cases with higher ranking as the matching results.

[0071] For candidate cases in the candidate case set that are not considered for comparison, the initial similarity scores already obtained between the candidate cases and the target case are directly passed through as the target similarity scores. These scores are then merged and summarized with the target similarity score set at the level of the cases to be compared, forming a target similarity summary table covering the entire candidate case set. Based on the target similarity scores of each candidate case in the target similarity summary table, the candidate cases are sorted in descending order to obtain a candidate case ranking sequence. A preset recommendation quota is set, with the top-ranked candidate cases selected from this sequence as the matching results.

[0072] In one implementation, for candidate cases in the candidate case set that are not included in the cases to be compared (i.e., those outside the quantile range in the initial similarity descending order), the initial similarity values ​​already obtained between the candidate case and the target case are transmitted as their target similarity, without further pathogenesis-level comparison and conflict determination. The transmitted target similarity and the target similarity result set at the case-to-case level are merged and summarized by case number to form a target similarity summary table covering the entire candidate case set.

[0073] Specifically, for each record in the target similarity table, its target similarity value is read and sorted in descending order of target similarity value. When the rankings are the same, the record with the higher initial similarity is given priority. If the initial similarities are still the same, the records are further sorted in ascending order of conflict classification results, i.e., no-conflict entries are given priority over slightly conflicted entries, slightly conflicted entries are given priority over moderately conflicted entries, and moderately conflicted entries are given priority over severely conflicted entries, thus obtaining the candidate case ranking sequence. The ranking sequence uses the case number as the index and retains three fields: target similarity, initial similarity, and conflict classification result. The conflict classification result field of the transparent candidate cases is set to a no-conflict flag, while the conflict classification result field of the cases to be compared is filled in according to their actual classification value.

[0074] Preferably, the preset recommendation quota is set in the form of a fixed number of entries, based on the conventional range of the number of medical records required by doctors for diagnosis and reference in clinical practice. This ensures both the sufficiency of reference information and avoids information overload. For example, the top 20 candidate medical records in the candidate medical record ranking sequence can be extracted as matching results; the 1st to 20th candidate medical records in the candidate medical record ranking sequence can also be extracted as matching results. For different clinical search scenarios, the preset recommendation quota can also include 10 entries for quick reference and 30 entries for wide-area search. The matching results are returned in the order of the ranking sequence along with the medical record number, target similarity, and conflict classification results. The conflict classification result field corresponding to the candidate medical record is returned with a no-conflict indicator.

[0075] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the concept of this application. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A method for matching the similarity of traditional Chinese medicine medical records based on multiple features, characterized in that, The method includes: The four diagnostic dimensions feature data of the target medical case are obtained, the TCM pathogenesis knowledge graph is called, the pathogenesis nodes are matched according to the four diagnostic dimensions feature data, and the first pathogenesis node set and its topology structure corresponding to the target medical case are extracted. Based on the TCM pathogenesis knowledge graph, the constraint relationships between each pathogenesis node are obtained, a pre-stored set of candidate cases is obtained, and the four diagnostic dimensions feature data of each candidate case in the set of candidate cases are obtained to determine the initial similarity between each candidate case and the target case. According to the preset screening conditions, candidate cases that meet the initial similarity conditions are selected from the candidate case set as cases to be compared. The TCM pathogenesis knowledge graph is called, and pathogenesis nodes are matched according to the four diagnostic dimensions feature data of the cases to be compared, and a second pathogenesis node set and its topology structure are extracted and formed. Based on the aforementioned constraints, the topological structure of the first set of pathogenesis nodes is compared with the topological structure of the second set of pathogenesis nodes to determine whether there is a pathogenesis conflict between the first set of pathogenesis nodes and the second set of pathogenesis nodes. When there is a conflict in the pathogenesis, the initial similarity is adjusted according to the degree of conflict to obtain the target similarity; when there is no conflict in the pathogenesis, the initial similarity is used as the target similarity. All candidate cases are sorted according to the target similarity corresponding to each candidate case. Candidate cases that are not used as the cases to be compared are sorted using the initial similarity as the target similarity. The candidate cases with the higher ranking are selected as the matching results.

2. The method for matching the similarity of traditional Chinese medicine medical records based on multiple features according to claim 1, characterized in that, The acquisition of the four diagnostic dimensions feature data of the target medical case includes: Based on the chief complaint dimension, symptom description and duration of illness are extracted; based on the pulse dimension, pulse position, pulse rate and pulse shape are extracted to complete pulse encoding; based on the tongue dimension, tongue color and tongue coating thickness and moisture attributes are extracted to complete tongue encoding; based on the consultation dimension, cold and heat preferences, sweating amount and bowel characteristics are extracted to obtain the structured four diagnostic features of the target case.

3. The method for matching the similarity of traditional Chinese medicine medical records based on multiple features according to claim 1, characterized in that, The process of calling upon the TCM pathogenesis knowledge graph and matching pathogenesis nodes based on the four diagnostic dimensions feature data includes: Using the location, nature, and progression of the disease as the basic attributes of the pathogenesis nodes, each feature item is mapped to the corresponding pathogenesis node through a standardized dictionary of TCM terminology. In the case where a single feature item is associated with multiple candidate nodes, the node with the highest frequency is selected as the hit node corresponding to the feature item based on the historical co-occurrence frequency. The historical co-occurrence frequency is the number of times the node and the feature item co-occurs based on the statistics of historical medical cases during the atlas construction stage. When all hit nodes are located within the same connected component of the TCM pathogenesis knowledge graph, all hit nodes are taken as necessary nodes, and a minimum connected subgraph covering all necessary nodes is generated from the TCM pathogenesis knowledge graph. The intermediate nodes in the minimum connected subgraph are taken as connecting nodes. The hit nodes and the connecting nodes together constitute the first pathogenesis node set. The edges in the minimum connected subgraph are weighted according to the historical co-occurrence frequency to obtain the first pathogenesis node set and its topology.

4. The method for matching the similarity of traditional Chinese medicine medical records based on multiple features according to claim 1, characterized in that, The step of obtaining the constraint relationships between each pathogenesis node based on the TCM pathogenesis knowledge graph includes: The constraint relationships between each pathogenesis node are retrieved from the TCM pathogenesis knowledge graph. The constraint relationships include synergistic relationships and exclusionary relationships. The synergistic relationships are marked according to the co-occurrence frequency and the proportion of the same syndrome in historical medical cases. The exclusionary relationships are marked according to the TCM syndrome differentiation theory of cold-heat opposition and deficiency-excess opposition, thus obtaining a constraint relationship table between pathogenesis nodes. The constraint relationship table uses pathogenesis node pairs as index items, synergistic or exclusionary relationships as corresponding relationship categories, and the co-occurrence frequency and the proportion of occurrence of the same syndrome obtained from the annotation as the weight field of the synergistic relationship.

5. The method for matching the similarity of traditional Chinese medicine medical records based on multiple features according to claim 1, characterized in that, The step of obtaining the four diagnostic dimensions feature data of the candidate case set and determining the initial similarity between each candidate case and the target case includes: The chief complaint, pulse, tongue appearance, and four diagnostic dimensions of each candidate case in the candidate case set are structured using the same triplet encoding method as the target case. The triplet codes of each dimension are concatenated into a four diagnostic feature vector in dimensional order. Preset weights are assigned to each of the four dimensions from high to low. The four diagnostic feature vectors of the target case and each candidate case are compared dimension by dimension and weighted summed using cosine similarity to determine the initial similarity.

6. The method for matching the similarity of traditional Chinese medicine medical records based on multiple features according to claim 1, characterized in that, The step of selecting candidate cases whose initial similarity meets the conditions from the candidate case set according to preset screening criteria as cases to be compared includes: The candidate case set is sorted in descending order according to the initial similarity value. A fixed percentage of the top-ranked segments are extracted from the descending sort results. Candidate cases within the segments are marked as cases to be compared. The remaining candidate cases do not participate in the subsequent pathogenesis-level comparison.

7. The method for matching the similarity of traditional Chinese medicine medical records based on multiple features according to claim 1, characterized in that, The step of calling the TCM pathogenesis knowledge graph, matching pathogenesis nodes based on the four diagnostic dimensions feature data of the case to be compared, and extracting and forming a second set of pathogenesis nodes and its topological structure includes: The medical records to be compared are normalized and mapped using a standardized dictionary of TCM terminology consistent with the target medical records. Each feature entry is mapped to the corresponding pathogenesis node in the TCM pathogenesis knowledge graph as the hit node. When all hit nodes are located in the same connected component of the TCM pathogenesis knowledge graph, all hit nodes are taken as necessary nodes, and a minimum connected subgraph covering all necessary nodes is generated from the TCM pathogenesis knowledge graph. The intermediate nodes along the path are taken as connecting nodes, and the hit nodes and the connecting nodes together constitute the second pathogenesis node set.

8. The method for matching the similarity of traditional Chinese medicine medical records based on multiple features according to claim 1, characterized in that, The step of comparing the topological structure of the first set of pathogenesis nodes with the topological structure of the second set of pathogenesis nodes based on the constraint relationship, and determining whether there is a pathogenesis conflict between the first set of pathogenesis nodes and the second set of pathogenesis nodes, includes: The pathogenesis nodes in the two sets of topologies are aligned according to the location, nature, and severity of the disease. Nodes with consistent basic attributes in the same attribute value system of the currently invoked TCM pathogenesis knowledge graph are marked as aligned nodes, and nodes that appear only on one side are marked as one-sided nodes. Retrieve the relationship entries involving the alignment node and the single-sided node from the constraint relationship, and record the node pairs with simultaneous exclusion relationships and node pairs marked as cooperative relationships but missing associated edges in a set of topologies into the conflict count entries. For associated edges connecting the same pair of aligned nodes, compare the difference between the category and weight of the associated edges; If the alignment node pair has an associated edge only in one set of topologies, then the associated edge is directly recorded as a structural difference edge; Associative edges with inconsistent categories or weight differences exceeding a preset weight difference threshold are recorded as structural difference edges. The number of conflict count entries is divided by the total number of node pairs involved in the two sets of topologies, and the number of structural difference edges is divided by the total number of aligned node pairs involved in the two sets of topologies. Then, the edges are weighted and summed according to preset weighting coefficients corresponding to the number of conflict count entries and the number of structural difference edges, respectively, to obtain the structural difference value. When the structural difference value is greater than the preset difference threshold, it is determined that there is a pathogenesis conflict.

9. A method for matching the similarity of traditional Chinese medicine medical records based on multiple features according to claim 8, characterized in that, When the structural difference value is greater than a preset difference threshold, a pathogenesis conflict is determined to exist, including: The structural difference value is read as a quantitative basis for the degree of conflict. The structural difference value is divided into three levels: mild conflict, moderate conflict and severe conflict according to the preset first level threshold and the second level threshold. Both the first level threshold and the second level threshold are higher than the preset difference threshold. The preset attenuation coefficient corresponding to the conflict classification result is retrieved from the pre-built and stored attenuation coefficient mapping table. The attenuation coefficient corresponding to the mild conflict classification is greater than the attenuation coefficient corresponding to the severe conflict classification. The retrieved attenuation coefficient is multiplied by the initial similarity of the case to be compared to obtain the target similarity of the case to be compared.

10. A method for matching the similarity of traditional Chinese medicine medical records based on multiple features according to claim 1, characterized in that, The process of ranking all candidate medical cases based on the target similarity corresponding to each candidate medical case includes: The target similarity of the cases to be compared is combined with the initial similarity of the candidate cases that were not considered as cases to be compared, to form a target similarity summary table covering the entire set of candidate cases; The target similarity values ​​corresponding to each candidate case in the target similarity table are sorted in descending order to obtain the candidate case ranking sequence. The top-ranked candidate cases are extracted from the candidate case ranking sequence according to a preset recommendation quota, which is a fixed positive integer number of cases set in advance.