Automatic construction and intelligent retrieval method of traditional Chinese medicine oncology medical record knowledge graph
Patent Information
- Application Number
- CN202611254338.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-10-20
AI Technical Summary
如果现有知识图谱数据模式只能使用相同的节点类型和关系类型记录这两个命题,而没有单独的位置保存上述语义差异,那么两个原本含义不同的医学命题在转换后就可能形成相同或无法区分的图结构
[0019]本发明通过比较源语义结构与图侧恢复语义结构,识别不同原始医学语义经知识图谱数据模式编码后形成的非单射语义碰撞,使构图阶段即可发现图结构无法承载的语义差异,减少不同医学命题被错误表示为同一结构的情况,提高知识图谱语义表达的一致性和可靠性。通过从原始医学命题中形成包含医学实体、语义角色、实体关系及依赖方向的源语义结构,并对多候选语义结构进行约束筛选,使构图前的医学语义差异具有明确的结构化参照,减少文本表达差异对后续编码判断造成的误差,提高源语义结构形成过程的一致性。
Smart Images

Figure FT_1
Abstract
Description
Technical Field
[0001] This invention relates to the field of information retrieval and knowledge graph construction technology, and in particular to a method for the automatic construction and intelligent retrieval of knowledge graphs of traditional Chinese medicine oncology medical records. Background Technology
[0002] Traditional Chinese medicine (TCM) oncology medical records typically document a patient's symptoms, syndromes, treatments, prescriptions, and the corresponding relationships between these elements. Existing knowledge graph construction methods generally begin by identifying medical entities such as symptoms, syndromes, treatments, and prescriptions from the medical record text. Then, the relationships between these entities are extracted. Following pre-defined node types, relationship types, and connection rules, the medical content in the medical record is converted into nodes and relationships in a knowledge graph. After construction, the system primarily performs queries based on the nodes, relationships, and connection structures already stored in the knowledge graph. For example, it can search for a corresponding syndrome based on a specific symptom, or further search for related treatments and prescriptions based on a syndrome.
[0003] However, the medical meaning in TCM oncology case studies does not entirely depend on the specific medical entities present. The same symptoms, syndromes, or prescriptions may play different roles in different case studies, and the direction and dependencies between entities may also differ. For example, two original medical propositions may both contain the same symptoms and syndromes, but one proposition might express a symptom as a condition for judging a syndrome, while the other might express that the symptom is a manifestation of a change in the syndrome. If the existing knowledge graph data model can only record these two propositions using the same node and relation types, without a separate location to store the aforementioned semantic differences, then two originally different medical propositions may form identical or indistinguishable graph structures after transformation. In this case, even if the preceding medical entity identification and entity relation extraction are error-free, the subsequent system can only see the already formed graph structure and cannot recover the differences lost in the original case studies from the graph.
[0004] Therefore, the technical problem solved by this invention is: how to identify the loss of semantic information caused by the formation of identical or indistinguishable graph structures due to insufficient data pattern expression capabilities in different original medical semantics during the knowledge graph construction process. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of existing technologies by providing an automatic construction and intelligent retrieval method for knowledge graphs of TCM oncology medical records, thereby solving the technical problems mentioned in the background section.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] The method for automatically constructing and intelligently retrieving a knowledge graph of TCM oncology medical records includes the following steps:
[0008] S1. Obtain snapshots of TCM oncology medical case texts and knowledge graph data patterns, determine the original medical propositions from the text, and form the source semantic structure based on medical entities, semantic roles, entity relationships, and dependency directions;
[0009] S2. Encode the source semantic structure into candidate graph structures according to the data pattern snapshot. Under the condition of isolating the original medical propositions, form the graph-side semantic structure based only on the candidate graph structures.
[0010] S3. Compare different source semantic structures and their graph-recovered semantic structures. When there are differences in semantic roles, entity relationships or dependency directions in the source semantic structures and the graph-recovered semantic structures cannot represent these differences, determine non-injective semantic collisions and determine the minimum indistinguishable semantic dimension.
[0011] S4. Determine the structural bearing position based on the least indistinguishable semantic dimension, perform local data pattern fission on the structural bearing position to form fission candidate data patterns, and re-encode the two colliding parties to obtain the fission candidate graph structure.
[0012] S5. Based solely on the structure of the fission candidate graph, a semantic structure for restoring the graph side after fission is formed. When it can distinguish between the two colliding parties, the fission candidate data pattern is solidified, and a knowledge graph of TCM oncology medical records is constructed accordingly and retrieved according to structured search conditions; otherwise, the unrestored semantic differences are fed back to S3.
[0013] S1 specifically includes: reading TCM oncology medical case texts and the current knowledge graph data pattern snapshot; unifying the character format of the medical case texts while retaining negative words, conditional words, pronouns, and prescription addition / subtraction expressions; dividing the original medical proposition candidate units based on text boundaries and relation trigger words; identifying medical entities based on terminology mapping records in the data pattern snapshot; determining semantic roles, entity relationships, and dependency directions by combining relation trigger words, character positions, and entity type connection rules; filtering for cases with multiple candidate semantic structures based on the number of records with role conflicts, direction conflicts, and relationships without textual basis; organizing medical entities, semantic roles, entity relationships, and dependency directions into source semantic structures; verifying the completeness of relation endpoints, semantic roles, and dependency directions; and outputting the source semantic structure set and the current knowledge graph data pattern snapshot.
[0014] S2 specifically includes: mapping medical entities, semantic roles, entity relationships, and dependency directions in the source semantic structure to node types, role positions, relationship types, and connection sequences according to the current knowledge graph data pattern snapshot, forming a candidate graph structure, and recording source semantic content that does not have a corresponding structural carrying position; isolating the original medical proposition, loading only the node types, role positions, relationship types, relationship connection directions, and connection sequences in the candidate graph structure, and organizing node adjacencies, relationship endpoints, and connection sequences in parallel through FPGA to form a graph-side structure record; restoring entity types, semantic roles, entity relationships, and dependency directions only based on the graph-side structure record to form a graph-side restored semantic structure, and establishing a ternary correspondence record of the source semantic structure, candidate graph structure, and graph-side restored semantic structure according to the proposition identifier.
[0015] S3 specifically includes: performing structural normalization on the source semantic structure and graph-side restored semantic structure in the ternary correspondence record; reordering and numbering entity types, semantic roles, entity relationships, and dependency directions; and screening suspected collision proposition pairs where the source semantics differ but the graph-side restored result cannot characterize the difference; verifying the missing semantic differences and structural carrying status of suspected collision proposition pairs, eliminating structural reading anomalies and multiple candidate ambiguities; establishing non-injective semantic collision records when the difference does not form an independent structural carrying position and cannot be re-determined by the graph-side restored semantic structure; testing the candidate difference set in ascending order of the number of missing semantic difference items, determining the smallest indistinguishable semantic dimension that cannot be further distinguished between the two colliding parties after deleting any member, and outputting the corresponding structural carrying position status.
[0016] S4 specifically includes: locating semantic role positions, relation type positions, or connection rule positions in the current knowledge graph data pattern snapshot based on the least indistinguishable semantic dimension; forming candidate fission operations for the located semantic role positions, relation type positions, or connection rule positions, while limiting the range of data patterns unrelated to the current collision to remain unchanged; executing candidate fission operations in temporary data pattern copies, sequentially optimizing strategies based on whether independent structural bearing positions are obtained from the least indistinguishable semantic dimension, the number of modified structural bearing positions, and whether unrelated structural constraint samples maintain the original encoded structure, to form fission candidate data patterns; recoding the source semantic structures of both colliding parties based on the fission candidate data patterns, and performing structural bearing position matching, relation endpoint connection, and connection rule checks through FPGA to form the fission candidate graph structure and recoded consistency state.
[0017] S5 specifically includes: For the fission candidate graph structure indicating that the recoded consistency state indicates a complete structural mapping, under the condition of isolating the original medical proposition, graph-side semantic recovery is performed again based only on node type, role position, relation type, relation connection direction, and connection sequence to form a fission-recovered graph-side semantic structure; the fission-recovered graph-side semantic structure is compared with the corresponding source semantic structure. When the two sides of the collision are distinguishable on the minimum indistinguishable semantic dimension and the unrelated structural constraint samples maintain the original node type, relation type, relation connection direction, and connection sequence, the fission candidate data pattern is determined to have passed the verification. Otherwise, the unrecovered semantic differences or affected structural positions are fed back to the previous step; the verified fission candidate data pattern is solidified, a TCM oncology medical record knowledge graph and structured index are constructed, and retrieval is performed based on entity text, entity type, semantic role, relation type, and logical connection conditions.
[0018] The beneficial effects of this invention are as follows:
[0019] This invention identifies non-injective semantic collisions formed after different original medical semantics are encoded using knowledge graph data patterns by comparing the source semantic structure and the graph-recovered semantic structure. This allows for the discovery of semantic differences that the graph structure cannot support during the graph construction stage, reducing the possibility of different medical propositions being incorrectly represented as the same structure, and improving the consistency and reliability of the semantic expression of the knowledge graph. By forming a source semantic structure containing medical entities, semantic roles, entity relationships, and dependency directions from the original medical propositions, and by constraining and filtering multiple candidate semantic structures, the differences in medical semantics before graph construction have a clear structured reference, reducing errors caused by differences in textual expression in subsequent encoding judgments and improving the consistency of the source semantic structure formation process.
[0020] This invention generates candidate graph structures by taking snapshots of fixed data patterns and performs graph-side semantic recovery based solely on the actual graph structure while isolating the original medical proposition. This prevents information not carried by the graph structure from being reintroduced from the original text, thus accurately exposing semantic information loss during the graph construction process and improving the accuracy and repeatability of graph structure expressive capability detection. By standardizing the comparison between the source semantic structure and the graph-side recovered semantic structure, and determining the minimum indistinguishable semantic dimension in ascending order of the number of lost semantic differences, this invention distinguishes non-injective semantic collisions from entity recognition errors and structural reading anomalies. Simultaneously, it narrows down the range of data patterns that need subsequent adjustment and reduces judgment errors caused by irrelevant structures participating in fission processing.
[0021] This invention locates structural bearing positions using the least indistinguishable semantic dimension and employs a strategy-optimized screening method for local data pattern fission. Combined with FPGA parallel processing, it completes structural bearing position matching, relation endpoint connection, and connection rule checking. This concentrates pattern adjustments on the collision-corresponding structural range, reducing the simultaneous modification of irrelevant nodes, relations, and connection rules, thus improving the consistency and processing stability of data pattern adjustments. By performing graph-side semantic recovery on the fission candidate graph structure again, while simultaneously verifying whether collision semantics are distinguishable and whether irrelevant structures remain unchanged, only verified fission candidate data patterns are solidified. This ensures that newly added structural bearing positions can stably enter subsequent graph construction and retrieval processes, reducing the impact of semantic collision residues and irrelevant structural changes on the consistency of retrieval results. Attached Figure Description
[0022] Figure 1 This is a flowchart of the automatic construction and intelligent retrieval method for a knowledge graph of traditional Chinese medicine oncology medical records according to the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
[0024] Example: Figure 1 As shown in the figure, this embodiment provides a method for automatic construction and intelligent retrieval of knowledge graphs of TCM oncology medical records, including the following steps:
[0025] S1. Obtain snapshots of TCM oncology medical case texts and knowledge graph data patterns, determine the original medical propositions from the text, and form the source semantic structure based on medical entities, semantic roles, entity relationships, and dependency directions;
[0026] S2. Encode the source semantic structure into candidate graph structures according to the data pattern snapshot. Under the condition of isolating the original medical propositions, form the graph-side semantic structure based only on the candidate graph structures.
[0027] S3. Compare different source semantic structures and their graph-recovered semantic structures. When there are differences in semantic roles, entity relationships or dependency directions in the source semantic structures and the graph-recovered semantic structures cannot represent these differences, determine non-injective semantic collisions and determine the minimum indistinguishable semantic dimension.
[0028] S4. Determine the structural bearing position based on the least indistinguishable semantic dimension, perform local data pattern fission on the structural bearing position to form fission candidate data patterns, and re-encode the two colliding parties to obtain the fission candidate graph structure.
[0029] S5. Based solely on the structure of the fission candidate graph, a semantic structure for restoring the graph side after fission is formed. When it can distinguish between the two colliding parties, the fission candidate data pattern is solidified, and a knowledge graph of TCM oncology medical records is constructed accordingly and retrieved according to structured search conditions; otherwise, the unrestored semantic differences are fed back to S3.
[0030] S1 specifically includes the following sub-steps:
[0031] S110. Obtain TCM oncology medical record texts and form original medical proposition candidate units. Use electronic medical record systems, medical record databases, or authorized imported medical record files as the source of TCM oncology medical record texts. Read the main text of the medical record through database query interface, file import interface, or structured data interface. At the same time, read the currently enabled data mode of the knowledge graph to form a snapshot of the current knowledge graph data mode.
[0032] The current knowledge graph data schema snapshot includes at least an entity type table, a relation type table, semantic role carrying positions, entity type connection rules, terminology mapping records corresponding to the entity type table, and relation trigger word records corresponding to the relation type table, and is configured with a unique data schema version identifier. The terminology mapping records are used to record the correspondence between symptom, syndrome, treatment, and prescription terminology strings and entity types, while the relation trigger word records are used to record predicates, prepositions, and conjunctions in the original medical propositions that clearly indicate the direction of relationships or dependencies between entities.
[0033] The medical record text is uniformly converted to a UTF-8 character sequence, retaining document identifiers, paragraph numbers, sentence numbers, and character start and end offsets. Character offsets are represented as non-negative integers starting from the first character of the document and have no physical units. This step is triggered when a medical record is first imported or when the medical record text is updated, and no fixed sampling period is set.
[0034] When performing format preprocessing on the main text of medical records, only full-width and half-width punctuation, consecutive whitespace characters, and line break marks are standardized. Negative words, degree words, transition words, conditional words, pronouns, and descriptions of prescription additions and subtractions are not deleted, nor are different medical terms forcibly replaced with the same standard terminology in this step. Processing stops and the missing text status is recorded when the main text is empty; when a local character cannot be decoded, its character position is preserved and an unresolvable mark is set, prohibiting the combination of medical propositions across this position.
[0035] Subsequently, the initial text boundaries are determined sequentially using sentence-ending punctuation, semicolons, colons, and relational trigger words. It is then checked whether each side of the boundary can form a complete expression containing at least one medical entity and its semantic function. Phrases that cannot independently express medical relationships are merged into the adjacent text. This forms the original medical proposition candidate units.
[0036] Original medical propositions refer to the smallest continuous text range in the original medical record that can independently express at least one symptom, syndrome, treatment method, or prescription entity and its semantic role, or can independently express the relationship between two medical entities. Its boundary is determined by whether the medical relationship is complete, and is not mechanically equivalent to the period boundary in natural language. S110 outputs a set of candidate units of original medical propositions with proposition identifiers, original text character ranges, and document identifiers, as well as a snapshot of the current knowledge graph data pattern with a fixed version identifier. The former is input into S120 for semantic processing, while the latter remains unchanged in the processing of S110 to S530 and serves as the common basis for comparing data patterns in S120, S210, and subsequent processes.
[0037] S120: Perform semantic processing on the original medical proposition candidate units to form records of medical entities, semantic roles, entity relationships, and dependency directions. Receive the original medical proposition candidate units output from S110 and a snapshot of the current knowledge graph data pattern, and locate the medical entities in the candidate unit character sequences based on the terminology mapping records therein. Semantic processing refers to the process of performing structured recognition, encoding, recovery, or comparison around medical entities, semantic roles, entity relationships, and dependency directions. The specific fields and judgment rules used in each step are defined by the corresponding step.
[0038] For each medical entity, record the entity text, entity type, start and end positions of characters, and candidate semantic roles. When multiple terms match within the same character range, prioritize retaining the term record with the longer character range. Records with the same character range but different entity types are all retained as candidates and not directly deleted. Semantic roles are used to distinguish between the described object, conditional object, acting object, and result object. Their determination is not solely based on the entity name but on the positional relationship between the entity and relation trigger words, conditional connector words, result connector words, and contextual references.
[0039] The proposition identifier, entity number, entity type, character position, and relation trigger word position are written into the FPGA input buffer. The FPGA enumerates entity pairs that satisfy the entity type connection rules in parallel according to the same proposition identifier, and outputs candidate entity pairs, candidate relation types, and relation connection directions. The FPGA only performs deterministic comparisons of character positions, entity types, and connection rules, and does not output the final medical semantic judgment. The processor further confirms the entity relations and dependency directions based on the original relation trigger words and semantic roles. When the same original medical proposition contains more than two entity relations, the combination order between each entity relation is determined according to the relation trigger words, connectors, and character positions, forming a combined dependency record. The combined dependency is a multi-relation combination form when the same original medical proposition contains more than two entity relations, used to record the relation combination order formed by two or more entity relations according to the semantic connection order.
[0040] When multiple feasible candidate semantic structures exist, policy optimization is performed. In this embodiment, policy optimization does not specifically refer to the machine learning model that needs to be trained, but rather to selecting candidate results according to the evaluation metrics, comparison order, and constraints explicitly defined in the current step when multiple executable candidate results exist, without using undisclosed weights, thresholds, or training parameters. The following calculation is performed for the candidate semantic structure Q:
[0041]
[0042] in, The number of candidate semantic structure conflicts; The number of records whose semantic roles do not match the original predicates or conjunctions is determined by comparing the semantic role records, relation trigger words, and character positions item by item. The number of records whose dependency direction is inconsistent with the original indicated direction is determined by comparing the dependency direction records, relation trigger words, and character positions item by item; The number of entity relationship records for which the textual basis cannot be found within the current original medical proposition character range is determined by verifying each entity relationship record against the corresponding original medical proposition character range. , and All are dimensionless non-negative integers.
[0043] Priority retention The smallest; multiple candidates Multiple candidate states are retained when they are identical, without artificially adding extra weight. If the character position, relation trigger word, semantic role record, dependency direction record, or entity relationship record used for calculating the corresponding evaluation metric are missing, the corresponding candidate will not participate in the evaluation metric comparison.
[0044] When the FPGA does not output candidate entity pairs but the original text contains explicit relation trigger words, the processor supplements the candidates by connecting the entities that are closest to the trigger word and whose entity types are legal. S120 outputs medical entity records, semantic role records, entity relationship records, dependency direction records, combined dependency records, and unresolved multi-candidate tags, all of which are input into S130 to form the source semantic structure.
[0045] S130: Form the source semantic structure and complete the consistency check before entering the candidate graph encoding. Receive the medical entity records, semantic role records, entity relationship records, dependency direction records, composite dependency records, and unresolved multi-candidate tags output from S120. For each original medical proposition, establish the source semantic structure according to a unified field order:
[0046]
[0047] in, Let i be the source semantic structure of the i-th original medical proposition. A collection of medical entities This is a set of correspondences between medical entities and semantic roles. For a set of entity relations, This is the set of dependency directions corresponding to entity relations, including the combined dependency records formed when there are more than two entity relations for the same original medical proposition; all of the above sets are discrete structure data without physical units, and their sources are the records corresponding to S120 in sequence.
[0048] The source semantic structure is used to preserve the structural information that distinguishes the original semantics of medical propositions before knowledge graph encoding; it is not equivalent to the subsequent candidate graph structure. For unresolved multiple candidate tags, if multiple candidates differ only in their textual form but... , , , If they are completely identical, they are merged into the same source semantic structure; if any semantic role, entity relationship or dependency direction is different, multiple source semantic structure candidates are formed respectively and bound to the same proposition identifier, and no mandatory decision is made in the S1 stage.
[0049] The source semantic element refers to any discrete record item among the medical entities, semantic roles, entity relations, and dependency direction records that constitute the source semantic structure. The dependency direction records include combined dependency records formed in the case of multiple relations.
[0050] Then, a structural integrity check is performed: both ends of each entity relationship must be able to... The corresponding entity is found, and each semantic role must be bound to a registered entity, and each dependency direction must correspond to a registered entity relationship. If there are any missing entities, return to S120 to re-parse the corresponding original medical proposition candidate unit, and do not output an incomplete source semantic structure. For propositions that still cannot form a complete source semantic structure after re-parse, record the semantic parsing abnormal state and stop its current round of processing, without proceeding to S210.
[0051] After successful verification, the source semantic structure is saved in a structured record format consisting of "proposition identifier, entity set, semantic role set, entity relationship set, and dependency direction set." The dependency direction set includes combined dependency records formed when the same original medical proposition has more than two entity relationships. The current knowledge graph data pattern snapshot obtained in S110 and unchanged in this round of processing, along with its version identifier, is also output. The final output of S130 is the source semantic structure set and the current knowledge graph data pattern snapshot, both of which serve as direct inputs to S210. The source semantic structure also serves as the original reference for S310 to determine whether semantic differences have been lost before graph construction. Its content must not be modified in subsequent steps and can only be read through the proposition identifier.
[0052] S2 specifically includes the following sub-steps:
[0053] S210: Generate candidate graph structures based on the source semantic structure and the current knowledge graph data pattern snapshot. Receive the source semantic structure and the current knowledge graph data pattern snapshot output from S130, and first verify the data pattern version identifier; even if the data pattern of the formal knowledge graph is updated during encoding, continue to use the fixed snapshot passed in from S130 to complete this round of processing, avoiding the impact of different data pattern versions on the same non-injective semantic collision judgment.
[0054] In this embodiment, the structural carrying position refers to the structural position in the knowledge graph data pattern that can independently record a semantic difference, including the semantic role field in the node or entity relationship, the relationship type position used to distinguish the entity relationship, and the connection rule branch used to distinguish the dependency direction or combination order. The role position refers to the structural field in the knowledge graph node or entity relationship used to record the semantic role; the connection sequence refers to the order in which entity relationships are connected in the candidate graph structure according to the dependency direction.
[0055] The processor performs semantic processing, mapping medical entities in the source semantic structure to node types allowed by the current knowledge graph data pattern snapshot, mapping entity relations to relation types, and determining the start node, end node, and connection sequence based on the dependency direction. Semantic roles in the source semantic structure are written into node role bits or relation role bits when there is a corresponding structure carrying position in the current knowledge graph data pattern snapshot. When there is no corresponding structure carrying position, no new fields should be created temporarily, and the "uncarried" state should be set in the encoding mapping record.
[0056] When the same semantic structure can form multiple legal codes, strategy optimization is used to compare each coding candidate. :
[0057]
[0058] in, The structural cost of the k-th encoding candidate; The number of source semantic elements that do not have corresponding structural carrying positions is determined by matching the source semantic elements in the source semantic structure with the structural carrying positions in the current knowledge graph data pattern snapshot item by item. The number of connections that violate the entity type connection rules is determined by comparing the entity connections in the candidate codes with the entity type connection rules in the current knowledge graph data pattern snapshot item by item; The number of new connections added to the candidate encoding but not present in the source semantic structure is determined by comparing the connections in the candidate encoding with the existing entity relationships and dependency directions in the source semantic structure item by item. , and All are dimensionless non-negative integers.
[0059] Priority retention and The smallest encoding candidate is selected; all candidates with the same structural cost are retained. If no encoding candidate satisfies the entity type connection rule, the corresponding source semantic structure is recorded as an encoding anomaly, and the process returns to S130 to verify the correspondence between the source semantic structure and the entity type and relation type between the current knowledge graph data mode snapshot. The encoding anomaly will not proceed to S220 until it is eliminated, nor will it be considered as a non-injective semantic collision judgment object. S210 outputs the valid candidate graph structure, the corresponding encoding mapping record, the proposition identifier, the candidate graph structure number, and the current knowledge graph data mode snapshot version identifier, which serve as the input to S220.
[0060] S220: Isolate the original medical proposition and extract the structural information actually carried by the candidate graph structure. After receiving the candidate graph structure, encoding mapping record, proposition identifier and candidate graph structure number output by S210, establish an independent graph-side recovery working area for each candidate graph structure.
[0061] The graph-side recovery workspace only loads the actual node numbers, node types, roles, relation types, relation connection directions, and connection sequences in the candidate graph structure. It does not load the original medical proposition text and character positions from S110, nor does it load the source semantic content in S130 that is not encoded by the candidate graph structure. This ensures that subsequent recovery results cannot use the original text to fill in the missing information. Graph-side recovery refers to retrieving the semantic information that the knowledge graph structure itself can express, which is different from rereading the original medical records and extracting semantics again.
[0062] Candidate graph structures are converted into node record streams and relation record streams according to the candidate graph structure number. Node records include at least the candidate graph structure number, node number, node type, and actual role position. Relation records include at least the starting node number, ending node number, relation type, relation connection direction, and connection sequence. Fields are encoded using integers or enumerations and have no physical units.
[0063] The processor sends the record stream to the FPGA, which performs node adjacency unpacking, incoming and outgoing edge organization, role pairing, and continuous relation chain sorting in parallel according to the candidate graph structure number. When the on-chip resources of the FPGA are insufficient to load all candidate graph structures at the same time, the records are sent in batches with the complete candidate graph structure as the boundary, without splitting the two endpoints of the same entity relationship; each batch carries the candidate graph structure number and the number of records, and the processor checks the integrity of the returned records accordingly.
[0064] If the entity relationship endpoints do not exist, the candidate graph structure numbers are inconsistent, or the number of returned records is inconsistent with the input declaration, the results of this batch are discarded and the data is read again once. If a consistent structure still cannot be formed after the second reading, the processor performs software structure reorganization according to the same node and relationship rules, and records the recovery status as "FPGA abnormal but software structure reorganization effective".
[0065] If the software structure cannot form a complete endpoint and connection sequence, it is recorded as "structure reading error", and the corresponding candidate graph structure will not enter S230. S220 outputs role position records, relation connection direction records, connection sequence records, and candidate graph structure numbers, collectively referred to as graph-side structure records, and maintains an index association with the S210 encoded mapping records, serving as the sole semantic recovery structure input for S230.
[0066] S230: Based on the graph-side structure records, form the graph-side semantic structure recovery and establish the correspondence before and after graph construction. Receive the graph-side structure records output in S220, and perform semantic processing according to the same current knowledge graph data mode snapshot used in S210: first, recover the medical entity type from the node type; then, recover the semantic role from the actual existing role position; then, recover the entity relationship from the relationship type, starting node, and ending node; finally, recover the dependency direction that can be clearly obtained from the graph structure based on the relationship connection direction and connection sequence.
[0067] For source semantic content marked as "not carried" in the S210 encoded mapping record and which does not have an actual structural carrying position in the candidate graph structure, it is uniformly recorded as "unrecoverable" and it is forbidden to consult the original medical proposition to complete it. A graph-side recovery semantic structure is formed for the i-th candidate graph structure, and its field order is consistent with the S130 source semantic structure, recording the recovery entity set, recovery semantic role set, recovery entity relationship set, and recovery dependency direction set in sequence.
[0068] The multiple candidate graph structures with equal structural costs retained in S210 are each formed into independent graph-side recovery semantic structures, which are not merged or ranked in this step. When there is an "FPGA abnormality but software structure rectification is effective" state, it is allowed to continue forming graph-side recovery semantic structures and save the recovery state; structural reading abnormality records are not included in subsequent collision judgment.
[0069] Finally, a ternary correspondence record of "source semantic structure - candidate graph structure - graph-side restored semantic structure" is established according to the proposition identifier. The candidate graph structure number, encoding mapping record, unbearable state, restored state and current knowledge graph data mode snapshot version identifier are stored in the ternary correspondence record.
[0070] S230 outputs a ternary correspondence record, which serves as the sole input to S310. S310 does not reread the original medical record text, but only determines whether the semantic structures of different sources have lost their distinguishability after the snapshot encoding of the current knowledge graph data mode based on the ternary correspondence record.
[0071] S3 specifically includes the following sub-steps:
[0072] S310. Perform structural normalization on the ternary correspondence records and filter suspected non-injective semantic collision pairs. Receive the ternary correspondence records output from S230, and first remove candidate graph structures whose recovery state is abnormal. To avoid cross-proposition comparison distortion caused by using local entity numbers for different original medical propositions, perform structural normalization on each source semantic structure and graph-side recovered semantic structure.
[0073] Specifically, the records are first sorted according to entity type, semantic role, connection level with other entities, entity relationship type, and relationship connection direction. Records at the same level are then sorted according to their first connection position in the corresponding structure. Local structure numbers starting from 1 are reassigned according to the sorting results. Entity relationships only refer to the normalized local structure numbers, thus forming a normalized structure comparison record.
[0074] For cases where multiple equivalent numbering orders exist due to the completely symmetrical structure, equivalent normalized records are generated separately, and any record that can form the same structural representation is used as the basis for distinguishability comparison, without collision conclusions arising from the numbering selection itself. The processor sends multiple normalized graph-side recovered semantic structures to the FPGA, and the FPGA compares node types, role bits, entity relations, and relation connection directions in parallel, filtering proposition pairs with the same graph-side recovered structure or those insufficient to represent the original differences in the source semantic structure.
[0075] The processor then compares the normalized source semantic structure with the normalized graph-recovered semantic structure for each candidate proposition pair, and obtains:
[0076]
[0077] in, Let be the set of semantic differences lost between the i-th and j-th propositions during the graph construction process. , The normalized source semantic structure, , To restore the semantic structure of the normalized graph, This represents the set of inconsistent records between two normalized discrete structures in terms of entity type, semantic role, entity relationship, and dependency direction. Each quantity is a discrete set without physical units. Records that are not considered collision candidates are excluded if there are no differences between the source semantic structures. When empty, it means that all the original differences can be recovered from the graph structure; When not empty, suspected non-injective semantic collision pairs are formed. S310 outputs suspected collision proposition pairs, source semantic difference set, graph-side recovered semantic difference set, and lost semantic difference set, which are used as inputs to S320.
[0078] S320. Confirm non-injective semantic collisions and eliminate extraction errors, structure reading errors, and multiple candidate ambiguities. Receive the suspected collision proposition pairs and the set of lost semantic differences output from S310. For each lost semantic difference, check its source in the source semantic structure of S130, and query the encoding mapping record stored in the ternary correspondence record of S230 to confirm whether the difference has a corresponding structural carrying position in the current knowledge graph data pattern snapshot.
[0079] If the corresponding semantic content already exists in the candidate graph structure but has not been recovered due to the failure of reading in S220 or S230, it is not considered a non-injective semantic collision, and the structure is reorganized in S220. If the difference comes from multiple candidate semantic structures retained in S120, and these candidates have different graph-side recovered semantic structures after S2, it belongs to the semantic ambiguity of the original medical proposition and is not treated as a data pattern expression loss.
[0080] A non-injective semantic collision is confirmed only when there is at least one structural difference between the two source semantic structures that can change the semantic role, entity relationship, or dependency direction, and this difference does not form a structural carrier position in the candidate graph structure that can independently represent the difference, and the difference cannot be re-determined based solely on the semantic structure restored from the two graph sides after isolating the original medical proposition.
[0081] In this embodiment, non-injective semantic collision refers to the formation of candidate graph structure representations that are identical or indistinguishable from source semantic differences after two or more different source semantic structures are encoded by the same current knowledge graph data pattern snapshot. This is distinguished from entity recognition errors, entity relationship extraction errors, and differences in textual expression of the same medical semantics.
[0082] After confirmation, a non-injective semantic collision record is established, which includes at least the collision proposition identifier, candidate graph structure number, set of missing semantic differences, current knowledge graph data pattern snapshot version identifier, and the corresponding structure carrying position status. Strategy optimization only groups according to the structure category corresponding to the missing semantic differences to reduce the enumeration range of the S330 candidate set without changing the collision confirmation conclusion. S320 outputs the non-injective semantic collision record and its set of missing semantic differences, which serve as the input to S330.
[0083] S330. Determine the minimum indistinguishable semantic dimension and form a local data pattern fission positioning input. Receive the non-injective semantic collision record output from S320, and establish a candidate semantic dimension set for each lost semantic difference according to semantic role difference, entity relationship difference, or dependency direction difference, along with its current structural bearing position state.
[0084] The minimum indistinguishable semantic dimension refers to the smallest set of semantic differences that, while keeping the data pattern portion unrelated to the current non-injective semantic collision unchanged, possesses independent structural distinguishability. This means that after recoding, the colliding parties form a distinguishable graph representation of the smallest set of semantic differences, and whose members cannot be further deleted according to set inclusion relationships. Its "minimum" is determined by set inclusion relationships, not by manual importance, empirical weights, or probability thresholds.
[0085] The strategy optimization performs temporary distinguishing tests in increments according to the number of differences contained in the candidate set: when the current non-injective semantic collision contains m missing semantic differences, first test all candidate sets containing only 1 difference; if none of them can make the two sides of the collision form different temporary structural representations, then test all candidate sets containing 2 differences; and so on, until the first candidate set that can make the two sides of the collision form distinguishable temporary structural representations appears.
[0086] During the testing process, no formal node fields, relation types, or connection rules are established. Instead, different temporary distinguishing codes are assigned only to the semantic differences being tested to simulate whether the two colliding parties can be distinguished if the difference can be recorded independently.
[0087] In the first successful set hierarchy, each candidate set is re-verified by deleting its members one by one. If the set can still be distinguished after deleting any member, it is further reduced until the smallest candidate set with no more members that can be deleted is obtained. If there are multiple smallest candidate sets, the one with fewer existing structural bearing locations is retained first; if there are still multiple equivalent sets, all of them are retained and submitted to S4 for actual fission verification.
[0088] For differences where there is no corresponding structural carrier position in the current knowledge graph data pattern snapshot, a "missing structural carrier position" marker is set, and its directly associated semantic roles, entity relationships, or dependency directions are recorded. The formally added structural form is not predefined in S330. S330 outputs the collision proposition identifier, candidate graph structure number, minimum indistinguishable semantic dimension, and the corresponding existing structural carrier position or missing structural carrier position marker, which are used as direct inputs to S410.
[0089] S4 specifically includes the following sub-steps:
[0090] S410. Determine the local data pattern fission location based on the minimum indistinguishable semantic dimension and form candidate fission operations. Receive the collision proposition identifier, candidate graph structure number, minimum indistinguishable semantic dimension, and structure bearing position status output from S330, and simultaneously call the current knowledge graph data pattern snapshot version identifier stored in the ternary correspondence record of S230.
[0091] First, verify the proposition identifier, candidate graph structure number, and data mode version identifier. If any of them are inconsistent, terminate the current fission and return to S330 for repositioning. It is forbidden to execute the same collision record for different data mode versions.
[0092] Then semantic processing is performed: if the least indistinguishable semantic dimension is manifested as two semantic roles of the same entity type sharing the same role bit in the current knowledge graph data pattern snapshot, then the corresponding role bit is determined as the location to be split structure carried; if it is manifested as two entity relations in the source semantic structure being encoded as the same relation type, then the corresponding relation type location is determined as the location to be split structure carried; if it is manifested as different dependency directions or combined dependencies being compressed by the same connection rule, then the corresponding connection rule branch is determined as the location to be split structure carried.
[0093] When a "missing structural bearing position" marker exists, the existing semantic role position, entity relationship position, or connection rule position directly corresponding to the semantic difference is used as the starting point for local modification. Candidate sub-positions capable of independently bearing the difference are allowed to be added under the structural level to which this position belongs, without expanding to data pattern regions unrelated to the collision. Local data pattern fission refers to splitting or adding independent structural bearing positions only to the smallest structural range that generates the current non-injective semantic collision, enabling different source semantics that originally shared the same structural bearing position to be encoded using different graph structures, distinguishing them from the overall reconstructed knowledge graph data pattern. S410 forms one or more candidate fission operations for each smallest indistinguishable semantic dimension, recording the fission object, the original structural bearing position, the candidate new structural bearing position, the affected collision proposition identifier, and the data pattern range that must remain unchanged, and outputs a set of candidate fission operations as input to S420.
[0094] S420: Optimize the strategy for candidate fission operations and form fission candidate data patterns. Receive the candidate fission operation set output from S410, copy a snapshot of the current knowledge graph data pattern for each candidate fission operation to form a temporary data pattern copy, and apply all candidate modifications to the copy first, without immediately altering the formal knowledge graph data pattern.
[0095] Semantic role-based fission, based on the role differences determined in S410, splits the original shared role-carrying position into sub-positions that map to different source semantic roles; entity relationship-based fission splits the original shared relationship-carrying position into relationship sub-positions that can map to the relationship differences between the colliding parties; dependency direction or composite dependency-based fission splits the original connection rules into connection rule branches that can clearly maintain the connection direction or combination order of different relationships. Candidate graph structures that are unrelated to the current non-injective semantic collision but use the original structure-carrying position to be fissioned are defined as unrelated structure constraint samples.
[0096] The strategy optimization selects candidate fission operations according to a three-level determination rule: Level 1 checks whether the minimum indistinguishable semantic dimension determined by S330 has obtained an independent structural bearing position in the candidate data pattern, and candidates with unbearable differences are directly eliminated; Level 2 compares the number of structural bearing positions in the modified data pattern and prioritizes retaining those with fewer positions; Level 3 selects the aforementioned irrelevant structural constraint samples from the ternary correspondence records saved by S230 for simulated encoding. If the candidate fission forces the irrelevant structural constraint sample to change any of the following: original node type, original relation type, original relation connection direction, or original connection sequence, then the candidate is eliminated.
[0097] When multiple candidates simultaneously satisfy the above Level 3 rules, they are all entered into S430 without introducing undisclosed weights. If none of the candidates simultaneously satisfy the requirements of independent bearing and preservation of irrelevant structures, the scope of modification is not expanded, but the corresponding failed structure positions and collision records are fed back to S330 to redetermine the minimum indistinguishable semantic dimension. S420 outputs fission candidate data patterns, which include at least the data pattern version identifier, fission position, structure bearing position after fission, the range of data patterns that remain unchanged, the corresponding irrelevant structure constraint sample number, and the collision proposition identifier, as input to S430.
[0098] S430: Re-encode the two colliding parties according to the fission candidate data pattern and generate the fission candidate graph structure. Receive the fission candidate data pattern output by S420, call the corresponding source semantic structure of S130 through the collision proposition identifier, and call the S210 encoding mapping record stored in the ternary correspondence record of S230 through the same proposition identifier; during the re-encoding process, the graph-side restored semantic structure must not be read to supplement the source semantic content, ensuring that the re-encoding input still comes from the source semantic structure saved before graph construction.
[0099] For medical entities, semantic roles, entity relationships, and dependency directions that are unrelated to the fission position, the original encoding position of S210 is retained according to the encoding mapping record; only the source semantic content corresponding to the smallest indistinguishable semantic dimension determined by S330 is remapped according to the independent structure bearing position formed by S420.
[0100] The processor sends the proposition identifier, source semantic element number, data pattern version identifier, target structure carrier position, and connection rules to the FPGA. The FPGA executes structure carrier position matching, relation endpoint connection, relation connection direction generation, and data pattern constraint checking in parallel. If the FPGA finds that the same source semantic element is mapped to a mutually exclusive structure carrier position, relation endpoints are missing, or the connection rules after fission are invalid, it returns the corresponding exception field. The processor marks the corresponding fission candidate data pattern as recoding failure and returns S420. When FPGA resources are insufficient, mapping is performed in batches according to the complete source semantic structure without changing the structure mapping rules. A mutually exclusive structure carrier position refers to two or more structure carrier positions that the same source semantic element cannot be mapped to simultaneously according to the current knowledge graph data pattern constraints.
[0101] After the structure mapping is successful, the processor assembles the fission candidate graph structure and checks whether the two parties in the original non-injective semantic collision have formed at least one structural difference directly generated by the smallest indistinguishable semantic dimension in terms of role position, relation type, relation connection direction, or connection sequence; if no structural difference is formed, the recoding is also deemed to have failed. The check is only used to confirm that the fission content has been actually written into the candidate graph structure, and does not determine in advance whether the non-injective semantic collision has been eliminated.
[0102] When the structural bearing position matching, relation endpoint connection, and connection rule checks all pass, and the fission content has been written into the fission candidate graph structure, the recoding consistency status is recorded as "structural mapping complete"; if any anomaly exists, the recoding consistency status is recorded as "recoding failure". S430 outputs the fission candidate data pattern, its one-to-one corresponding fission candidate graph structure, collision proposition identifier, and recoding consistency status as direct input to S510.
[0103] S5 specifically includes the following sub-steps:
[0104] S510. Under the condition of isolating the original medical proposition, perform graph-side semantic recovery on the fission candidate graph structure again. Receive the fission candidate data pattern, fission candidate graph structure, collision proposition identifier, and recoding consistency status output by S430. Only process records whose recoding consistency status indicates that the structure mapping is complete; return to S420 for records that fail to be recoded.
[0105] To ensure that this re-examination uses the same data source and recovery criteria as S230, the processor establishes an independent graph-side recovery work area, loading only the node type, actual role position, relationship type, relationship connection direction, connection sequence, and fission candidate data pattern in the fission candidate graph structure. It does not load the original medical proposition text, nor does it load the source semantic content in S130 that has not yet been actually carried by the fission candidate graph structure.
[0106] The node record stream and relationship record stream are sent to the FPGA using the same field format as S220. The FPGA performs node adjacency expansion, role bit matching, incoming and outgoing edge organization, and connection sequence generation in parallel. When FPGA resources are insufficient, the data is read in batches according to the complete fission candidate graph structure. When an interface abnormality occurs, the data is read again once.
[0107] If the FPGA reread still fails, the processor performs software recovery according to the same deterministic structure organization rules as S220. When the software recovery is successful, the recovery status is recorded as "FPGA failure but software recovery is effective". If the software recovery still cannot determine the complete endpoint and connection sequence, it is recorded as "recovery read failure" and the processor returns to S430 to re-check the encoding.
[0108] The processor then performs semantic processing, sequentially recovering entity types, semantic roles, entity relationships, and dependency directions from the fission candidate graph structure to form the post-fission graph-side restored semantic structure. Any content in the fission candidate graph structure that lacks an actual structural location is recorded as unrecoverable and cannot be read from the source semantic structure for completion. S510 outputs the post-fission graph-side restored semantic structure, fission candidate data pattern, collision proposition identifier, and recovery status, which serve as the comparison input for S520.
[0109] S520: Verify whether the fission candidate data pattern simultaneously recovers the collision semantic differences and maintains the stability of the irrelevant structure. Receive the semantic structure recovered from the fission graph output in S510, and call the source semantic structure corresponding to S130, the minimum indistinguishable semantic dimension determined in S330, and the irrelevant structure constraint samples recorded in S420 through the collision proposition identifier.
[0110] Records with a recovery status of "Recovery Read Abnormal" are not included in the comparison. First, the semantic structure of the graph side after the fission of the two sides of the original non-injective semantic collision is compared, and it is checked whether the minimum indistinguishable semantic dimension determined by S330 has formed a difference that can be independently recovered by the graph structure. Then, the structural comparison before and after fission is performed on the samples with irrelevant structural constraints to check whether their original node type, original relation type, original relation connection direction and original connection sequence remain unchanged.
[0111] Define the fission verification result as:
[0112]
[0113] Where V represents the fission verification result, either true or false; For the collision elimination state, it is true only if the two original colliding parties can be distinguished by the semantic structure recovered from the graph side after the split in the minimum indistinguishable semantic dimension; otherwise, it is false. To preserve the state of unrelated structures, a value is taken as true only if all unrelated structural constraint samples have not changed the original node type, original relation type, original relation connection direction, and original connection sequence due to this fission; otherwise, a value is taken as false. None of the quantities have physical units and do not involve numerical thresholds, denominators, or artificial weights.
[0114] When the newly added structural differences after fission do not correspond to the minimum indistinguishable semantic dimension determined by S330, even if the colliding parties have formed other structural differences, it still results in... The value is set to false to avoid using irrelevant new structures as the basis for collision elimination. The corresponding fission candidate data pattern passes verification only when V is true.
[0115] If multiple candidates pass simultaneously and cannot be distinguished, they remain in parallel and are not solidified. If the result is false, the unrecovered semantic difference feedback S330 will be used to redetermine the minimum indistinguishable semantic dimension; For truth If the result is false, the affected irrelevant structural constraint samples and their corresponding fission locations are fed back to S420 to reselect candidate fission operations. S520 outputs the verified fission candidate data patterns and the corresponding semantic structure restored from the graph after fission, which serves as the input to S530.
[0116] S530: Solidify the verified fission candidate data patterns and construct a TCM oncology medical record knowledge graph and retrieval structure based on them. Receive the verified fission candidate data patterns, the restored semantic structure of the graph after fission, and collision proposition identifiers output from S520. For data patterns that have been optimized and determined to be unique candidates according to the S520 strategy, generate a new data pattern version identifier for them; for candidates that are still parallel and lack a definitive technical basis for further differentiation, do not arbitrarily select one, but suspend the formal solidification of the corresponding collision structure and retain the candidate state.
[0117] During the solidification process, the data schema range defined by S420 is inherited and remains unchanged. Only the locations of locally fission structures that can eliminate non-injective semantic collisions, verified by S520, are written into the formal knowledge graph data schema. Subsequently, the verified source semantic structures are encoded into formal nodes, entity relationships, and connection structures according to the updated knowledge graph data schema, and corresponding proposition identifiers and data schema version identifiers are retained for formal nodes and entity relationships. The retrieval structure establishes a structured index with at least entity text, entity type, semantic role, relationship type, proposition identifier, and data schema version identifier.
[0118] When a user submits structured search criteria, the search criteria must include at least one of entity text, entity type, semantic role, relation type, and AND or OR logical connectors used to combine multiple criteria. When a user submits natural language search criteria, the term mapping record and relation trigger word record in the current knowledge graph data model of S110 are reused, and the natural language search criteria are converted into structured search criteria according to the entity location and relation recognition method disclosed in S120, without calling any undisclosed models.
[0119] When performing a search, candidate nodes are first located based on entity text or entity type; if semantic role conditions exist, only nodes whose role positions match the search conditions are retained; if relation type conditions exist, the search is expanded to adjacent nodes along the specified relation type and its relation connection direction; multiple search conditions are executed with intersection or union operations according to AND and OR logical connectors, and finally the proposition identifier, entity node, entity relation and corresponding data pattern version that meet the conditions are returned.
[0120] Since the two parties in the original non-injective semantic collision have obtained independently recoverable structural bearing positions through local data pattern fission, the retrieval conditions formed by the same entity text or the same entity type can continue to distinguish the previously indistinguishable medical semantics based on semantic roles, entity relationships, or connection structures.
[0121] Subsequent additions or modifications to TCM oncology medical records will re-enter the processing chain from S110, and a new round of S110 to S530 will be executed using the current knowledge graph data pattern snapshot that is fixed at that time. If a non-injective semantic collision occurs again after the new source semantic structure is encoded in S2, it will continue to enter S310 to S530 to determine the new minimum indistinguishable semantic dimension, split the local data pattern, and re-verify and solidify it, instead of directly overwriting the formal structure that has already been verified.
[0122] This forms a unified technical loop encompassing "formation of original medical propositions, establishment of source semantic structure, candidate graph encoding, graph-side recovery, non-injective semantic collision identification, determination of the minimum indistinguishable semantic dimension, local data pattern fission, verification through graph-side recovery, data pattern solidification, and structured retrieval."
[0123] The number of records, sets, state variables, and comparison results involved in the above formulas are all determined according to the data sources and calculation rules defined in each corresponding step; among them, the number of records and state variables are dimensionless data, and set operations and logical judgments do not involve manually set empirical weights, probability thresholds, or unpublished training parameters.
[0124] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0125] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0126] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for automatically constructing and intelligently retrieving a knowledge graph of traditional Chinese medicine oncology medical records, characterized in that: Includes the following steps: S1. Obtain snapshots of TCM oncology medical case texts and knowledge graph data patterns, determine the original medical propositions from the text, and form the source semantic structure based on medical entities, semantic roles, entity relationships, and dependency directions; S2. Encode the source semantic structure into candidate graph structures according to the data pattern snapshot. Under the condition of isolating the original medical propositions, form the graph-side semantic structure based only on the candidate graph structures. S3. Compare different source semantic structures and their graph-recovered semantic structures. When there are differences in semantic roles, entity relationships or dependency directions in the source semantic structures and the graph-recovered semantic structures cannot represent these differences, determine non-injective semantic collisions and determine the minimum indistinguishable semantic dimension. S4. Determine the structural bearing position based on the minimum indistinguishable semantic dimension, perform local data pattern fission on the structural bearing position to form fission candidate data patterns, and re-encode the two colliding parties to obtain the fission candidate graph structure.
2. The method for automatic construction and intelligent retrieval of knowledge graph of traditional Chinese medicine oncology medical records according to claim 1, characterized in that, Also includes: S5. Based solely on the structure of the fission candidate graph, a semantic structure for restoring the graph side after fission is formed. When it can distinguish between the two colliding parties, the fission candidate data pattern is solidified, and a knowledge graph of TCM oncology medical records is constructed accordingly and retrieved according to structured search conditions; otherwise, the unrestored semantic differences are fed back to S3.
3. The method for automatic construction and intelligent retrieval of knowledge graph of traditional Chinese medicine oncology medical records according to claim 1, characterized in that, S1 specifically includes: Read the TCM oncology medical case text and the current knowledge graph data pattern snapshot, unify the character format of the medical case text and retain negative words, conditional words, pronouns and prescription addition and subtraction expressions, and divide the original medical proposition candidate units according to the text boundary and relation trigger words; Medical entities are identified based on term mapping records in the data pattern snapshot. Semantic roles, entity relationships, and dependency directions are determined by combining relation trigger words, character positions, and entity type connection rules. In cases where there are multiple candidate semantic structures, the records are filtered according to the number of records with role conflicts, direction conflicts, and relationships without textual basis.
4. The method for automatic construction and intelligent retrieval of knowledge graph of traditional Chinese medicine oncology medical records according to claim 3, characterized in that, Also includes: Organize medical entities, semantic roles, entity relationships, and dependency directions into source semantic structures, verify the integrity of relation endpoints, semantic roles, and dependency directions, and output the source semantic structure set and a snapshot of the current knowledge graph data pattern.
5. The method for automatic construction and intelligent retrieval of knowledge graph of traditional Chinese medicine oncology medical records according to claim 1, characterized in that, S2 specifically includes: Based on the current knowledge graph data model snapshot, the medical entities, semantic roles, entity relationships and dependency directions in the source semantic structure are mapped to node types, role positions, relationship types and connection sequences to form candidate graph structures, and the source semantic content that does not have a corresponding structure carrying position is recorded. The original medical proposition is isolated, and only the node type, role position, relationship type, relationship connection direction and connection sequence in the candidate graph structure are loaded. The node adjacency, relationship endpoint and connection sequence are sorted in parallel by FPGA to form a graph side structure record. Based solely on the graph-side structure record, entity types, semantic roles, entity relationships, and dependency directions are recovered to form the graph-side restored semantic structure. A ternary correspondence record of source semantic structure, candidate graph structure, and graph-side restored semantic structure is established according to the proposition identifier.
6. The method for automatic construction and intelligent retrieval of knowledge graph of traditional Chinese medicine oncology medical records according to claim 1, characterized in that, S3 specifically includes: The source semantic structure and graph-side restored semantic structure in the ternary correspondence record are structurally normalized. The entity type, semantic role, entity relationship and dependency direction are reordered and numbered. Suspected collision proposition pairs with differences in source semantics but which cannot be represented by graph-side restored results are screened. Verify the missing semantic differences and structural bearing status of suspected collision proposition pairs, eliminate structural reading anomalies and multiple candidate ambiguities, and establish non-injective semantic collision records when the differences do not form independent structural bearing positions and the semantic structure cannot be recovered and re-determined from the graph side.
7. The method for automatic construction and intelligent retrieval of knowledge graph of traditional Chinese medicine oncology medical records according to claim 6, characterized in that, Also includes: The candidate difference set is tested in ascending order of the number of missing semantic difference items. The smallest indistinguishable semantic dimension is determined after deleting any member, and the corresponding structural bearing position state is output.
8. The method for automatic construction and intelligent retrieval of knowledge graph of traditional Chinese medicine oncology medical records according to claim 1, characterized in that, S4 specifically includes: Based on the least indistinguishable semantic dimension, locate the semantic role position, relation type position, or connection rule position in the current knowledge graph data pattern snapshot. Form candidate fission operations for the located semantic role position, relation type position, or connection rule position, and limit the range of data patterns that are not related to the current collision to remain unchanged. Candidate fission operations are performed in temporary data pattern replicas respectively. The strategies are optimized in sequence according to whether the independent structural bearing position is obtained by the least indistinguishable semantic dimension, the number of structural bearing positions modified, and whether the unrelated structural constraint samples maintain the original coding structure, so as to form fission candidate data patterns. Based on the fission candidate data pattern, the source semantic structure of the two colliding parties is re-encoded. The structure carrier position matching, relation endpoint connection and connection rule check are performed by FPGA to form the fission candidate graph structure and re-encoded consistency state.
9. The method for automatic construction and intelligent retrieval of knowledge graph of traditional Chinese medicine oncology medical records according to claim 2, characterized in that, S5 specifically includes: For the fission candidate graph structure whose recoded consistency state indicates that the structural mapping is complete, under the condition of isolating the original medical proposition, the graph-side semantic recovery is performed again based only on the node type, role position, relation type, relation connection direction and connection sequence to form the fission graph-side recovered semantic structure. The semantic structure restored by the graph after fission is compared with the corresponding source semantic structure. If the two sides of the collision are distinguishable in the minimum indistinguishable semantic dimension and the unrelated structural constraints keep the original node type, relation type, relation connection direction and connection sequence, the fission candidate data pattern is determined to pass the verification. Otherwise, the unrestored semantic differences or the affected structural positions are fed back to the previous step.
10. The method for automatic construction and intelligent retrieval of knowledge graph of traditional Chinese medicine oncology medical records according to claim 9, characterized in that, Also includes: The validated fission candidate data patterns are solidified, a knowledge graph and structured index of TCM oncology medical records are constructed, and retrieval is performed based on entity text, entity type, semantic role, relationship type and logical connection conditions.