Context reconstruction method and system based on parent-child document matching

By analyzing the document hierarchical structure and content characteristics, dynamic semantic alignment of child documents and parent documents, the problem of fragmentation of document context information and low version update efficiency is solved, and the efficient and intelligent reconstruction and update of documents is achieved.

CN120106083BActive Publication Date: 2025-08-12JIEHELIX (SHANGHAI) MEDICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510573612.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-08-12
Estimated Expiration
2045-05-06

AI Technical Summary

Technical Problem

Existing document processing technologies cannot effectively integrate associated documents, and lack in-depth mining of document hierarchical structure and semantic information, resulting in fragmented, incomplete document context information and inefficient version updates.

Method used

By obtaining the target parent document and its associated sub-document collection, parsing the document hierarchical structure and content characteristics, matching the hierarchical affiliation between the sub-document and the parent document, dynamic semantic alignment and redundancy elimination, generating an optimized version and triggering version updates.

Benefits of technology

It realizes accurate matching and semantic consistency of document context information, improves the readability and logic of document, and improves the automation level of version management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120106083B_ABST
    Figure CN120106083B_ABST
Patent Text Reader

Abstract

The present application provides a context reconstruction method and system based on parent-child document matching. First, the target parent document and its associated child document set are obtained. The child document set contains multiple child document units, each unit has a context paragraph and a paragraph identifier. Then, the target parent document is hierarchically analyzed to extract global structural features including paragraph level distribution and title nesting depth, as well as local content features including paragraph core word sequence and semantic coherence index. Then, the hierarchical affiliation parameters of the child document unit paragraph identifier and the parent document are determined, and the context paragraph is matched with the corresponding paragraph level. Then, based on the above features, the context paragraph is subjected to dynamic semantic alignment processing including paragraph boundary calibration and semantic redundancy elimination to generate a reconstructed context data block. Based on this, an optimized version of the target parent document is generated and output to the document storage system to trigger a version update operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and in particular to a context reconstruction method and system based on parent-child document matching. Background Art

[0002] In the current field of document processing and information management, with the explosive growth of information volume and the increasing complexity of document structures, how to efficiently and accurately reconstruct document contextual information to improve readability, logic, and maintainability has become a key issue that needs to be addressed. However, existing document processing technologies have significant limitations in this regard.

[0003] On the one hand, existing document processing methods often focus on parsing and processing single documents, while ignoring the hierarchical relationships and contextual connections that may exist between documents. In real applications, many documents do not exist in isolation, but rather are interconnected as parent and child documents, forming a complete information system. Existing technologies lack the ability to effectively integrate and process these linked documents, making it impossible to fully utilize the contextual information in child documents to enrich and improve the content of the parent document, resulting in fragmented and incomplete contextual information in the parent document.

[0004] On the other hand, even though some technologies attempt to process related documents, most often remain at the level of simple text splicing or content duplication, lacking in-depth exploration of the document's hierarchical structure and semantic information. These technologies are unable to accurately identify the hierarchical relationship between child documents and their parent documents, let alone accurately match and dynamically align the contextual paragraphs of the child documents based on this relationship. As a result, when reconstructing the parent document's contextual information, problems such as paragraph misalignment and semantic incoherence often occur, seriously affecting the document's quality and readability.

[0005] Furthermore, existing document processing technologies typically use static semantic analysis methods for semantic alignment, failing to dynamically adjust based on the document's hierarchical structure and content characteristics. This static semantic alignment method cannot effectively address semantic redundancy and fuzzy boundaries within documents, resulting in significant redundancy and ambiguity in the reconstructed contextual information, reducing the document's information density and usability.

[0006] Finally, when it comes to document version updates, existing technologies mostly rely on manual operations or simple automated scripts, lacking intelligent version update mechanisms. When the context of a parent document changes, there's no way to automatically generate an optimized version and trigger a version update in a timely manner. This leads to inefficient document version management and can easily lead to version confusion and information inconsistencies. Summary of the Invention

[0007] In view of this, the purpose of this application is to provide a context reconstruction method and system based on parent-child document matching.

[0008] According to a first aspect of the present application, a context reconstruction method based on parent-child document matching is provided, the method comprising:

[0009] Obtaining a target parent document and its associated sub-document set, wherein the sub-document set includes a plurality of sub-document units, each of which includes at least one context paragraph and a corresponding paragraph identifier;

[0010] Performing hierarchical structure analysis on the target parent document to extract global structural features and local content features of the target parent document, wherein the global structural features include paragraph hierarchical distribution information and title nesting depth information, and the local content features include paragraph core word sequences and semantic coherence indicators;

[0011] Determining a hierarchical affiliation parameter between the sub-document unit and the target parent document according to the paragraph identifier of the sub-document unit, and matching a context paragraph of the sub-document unit with a corresponding paragraph hierarchy of the target parent document based on the hierarchical affiliation parameter;

[0012] Based on the global structural features and the local content features, dynamic semantic alignment processing is performed on the context paragraphs of the sub-document unit to generate a reconstructed context data block, wherein the dynamic semantic alignment processing includes paragraph boundary calibration and semantic redundancy elimination;

[0013] An optimized version of the target parent document is generated according to the reconstruction context data block, and the optimized version is output to a document storage system to trigger a version update operation.

[0014] In a possible implementation of the first aspect, performing hierarchical structure parsing on the target parent document to extract global structural features and local content features of the target parent document includes:

[0015] Identifying a title tag sequence in the target parent document, and generating paragraph level distribution information according to the nesting level of the title tag sequence, wherein the paragraph level distribution information includes the starting position, the ending position and the corresponding title level number of each paragraph;

[0016] Performing semantic segmentation on each paragraph of the target parent document to extract a core word sequence of the paragraph, wherein the core word sequence of the paragraph is composed of words in the paragraph that meet a word frequency threshold and an inverse document frequency threshold;

[0017] Calculating a semantic coherence index between adjacent paragraphs, wherein the semantic coherence index is obtained by weighting the overlap of core word sequences of adjacent paragraphs and the cosine similarity of semantic vectors;

[0018] The title nesting depth information is determined according to the maximum value of the title level number, and the paragraph level distribution information, title nesting depth information, paragraph core word sequence and semantic coherence index are written into the structure feature cache and content feature cache respectively.

[0019] In a possible implementation of the first aspect, determining the hierarchical affiliation parameter between the sub-document unit and the target parent document based on the paragraph identifier of the sub-document unit includes:

[0020] Parsing the paragraph identifier of the sub-document unit, extracting the parent document reference number, target paragraph level number and paragraph position offset from the paragraph identifier;

[0021] Matching the paragraph level distribution information corresponding to the parent document reference number from the structural feature cache to determine the maximum position offset range allowed by the target paragraph level number;

[0022] If the paragraph position offset is within the maximum position offset range, then calculating the structural similarity and content overlap between the context paragraph of the sub-document unit and the corresponding paragraph level of the target parent document, wherein the structural similarity is determined by the consistency of the title level number and the paragraph length ratio, and the content overlap is determined by the number of overlapping words in the core word sequence of the paragraph and the change in the semantic coherence index;

[0023] A hierarchical affiliation parameter is generated according to the weighted sum of the structural similarity and the content overlap. If the hierarchical affiliation parameter exceeds a preset affiliation threshold, the sub-document unit is marked as a valid matching unit.

[0024] In a possible implementation of the first aspect, matching the context paragraph of the sub-document unit with the corresponding paragraph level of the target parent document based on the hierarchical affiliation parameter includes:

[0025] For each sub-document unit marked as a valid matching unit, extracting the paragraph core word sequence and semantic coherence index of the paragraph level corresponding to the target parent document from the content feature cache;

[0026] Performing synonym replacement detection on the context paragraph of the sub-document unit, generating a replacement word list, and updating the paragraph core word sequence according to the replacement word list;

[0027] Calculating the dynamic overlap between the updated paragraph core word sequence and the paragraph core word sequence at the paragraph level corresponding to the target parent document, wherein the dynamic overlap is obtained by adjusting word order consistency and word meaning similarity;

[0028] If the dynamic overlap degree is greater than or equal to a preset reconstruction threshold, the context paragraph of the sub-document unit is positionally bound to the corresponding paragraph level of the target parent document to generate a paragraph mapping relationship table.

[0029] In a possible implementation of the first aspect, the performing dynamic semantic alignment processing on the context paragraphs of the sub-document unit based on the global structural features and the local content features to generate a reconstructed context data block includes:

[0030] Determining, based on the paragraph mapping relationship table, the paragraph level position at which the context paragraph of the sub-document unit needs to be inserted into the target parent document;

[0031] Obtaining semantic coherence indicators of adjacent paragraphs at the paragraph level from the structural feature cache, and calculating insertion compatibility between the context paragraph and the adjacent paragraph, wherein the insertion compatibility is determined by the core word overlap rate and semantic vector direction consistency of the previous and next paragraphs;

[0032] If the insertion compatibility exceeds a preset compatibility threshold, the paragraph boundary of the context paragraph is calibrated, wherein the paragraph boundary calibration includes deleting the core word sequence repeated in the adjacent paragraph and adjusting the transition conjunctions of the paragraph starting sentence;

[0033] Eliminate semantic redundancy on the calibrated context paragraph to obtain the processed context paragraph;

[0034] The processed context paragraph is encapsulated into a reconstructed context data block, and a version identifier and a timestamp are added to the reconstructed context data block.

[0035] In a possible implementation of the first aspect, eliminating semantic redundancy on the calibrated context paragraph to obtain a processed context paragraph includes:

[0036] Extract all sentences in the calibrated context paragraph to generate a sentence set;

[0037] Performing semantic role labeling on each sentence in the sentence set to extract the subject-verb-object structure and modifying components of the sentence;

[0038] Calculate the semantic overlap between any two sentences, where the semantic overlap is determined by subject-verb-object structure consistency and modifier similarity;

[0039] If the semantic overlap between two sentences exceeds a preset overlap threshold, the sentence with a higher density of core words is retained and the other sentence is deleted;

[0040] The remaining sentences are checked for logical order, and the sentence arrangement order is adjusted according to the global structural features of the target parent document so that the semantic coherence index of adjacent sentences reaches a preset coherence threshold, thereby obtaining a processed context paragraph.

[0041] In a possible implementation of the first aspect, outputting the optimized version to a document storage system to trigger a version update operation includes:

[0042] Parsing all reconstruction context data blocks in the optimized version, and extracting a version identifier and a timestamp of each reconstruction context data block;

[0043] Acquire the current version metadata of the target parent document from the document storage system, wherein the current version metadata includes a set of historical version identifiers and a last updated timestamp;

[0044] If the timestamp of the optimized version is later than the last updated timestamp, the optimized version is compared with the current version to generate a difference content report, which includes the number of newly added paragraphs, the positions of modified paragraphs, and the identifiers of deleted paragraphs;

[0045] Generate a version update instruction according to the difference content report, wherein the version update instruction includes incremental update data and a rollback verification code;

[0046] The version update instruction is sent to the document storage system, so that the document storage system replaces the target paragraph according to the incremental update data and verifies the integrity of the replaced paragraph according to the rollback check code.

[0047] In a possible implementation of the first aspect, sending the version update instruction to the document storage system so that the document storage system replaces the target paragraph according to the incremental update data and verifies the integrity of the replaced paragraph according to the rollback check code includes:

[0048] Creating a temporary version branch in the document storage system, and writing the incremental update data into the temporary version branch;

[0049] Performing an integrity check on the temporary version branch, the integrity check including a section identifier continuity check and a semantic logic conflict detection;

[0050] If the integrity check passes, the temporary version branch is merged into the main version branch, and the last update timestamp is updated;

[0051] If a semantic logic conflict is detected, the write operation of the temporary version branch is undone according to the rollback verification code, and a manual intervention process is triggered.

[0052] In a possible implementation of the first aspect, before obtaining the target parent document and its associated child document set, the method further includes:

[0053] Configuring a document association rule library, wherein the document association rule library defines matching conditions for parent and child documents, wherein the matching conditions include file format consistency, subject keyword overlap rate, and author authority identifier;

[0054] Monitor the document input channel and, when a new document is detected to be uploaded, extract metadata features of the new document, wherein the metadata features include a creator identifier, a document subject tag, and a format type;

[0055] Matching metadata features of the new document with metadata features of an existing parent document according to the document association rule library, and if a match is successful, adding the new document to the child document set of the corresponding parent document;

[0056] If the match fails, create an independent parent document identifier for the new document and initialize its child document collection to be empty;

[0057] The configuration document association rule base includes:

[0058] Define file format consistency rules, which require that parent and child documents have the same format type and the same version compatibility identifier;

[0059] Setting a topic keyword overlap rate threshold, wherein the topic keyword overlap rate threshold is dynamically adjusted based on topic distribution statistics of the historical document collection;

[0060] Bind author permission identifiers so that the creator identifier of a child document must be included in the list of authorized editors of the parent document;

[0061] Assign a weight coefficient to each matching condition, and determine the matching priority of the parent and child documents based on the weighted sum of the weight coefficients;

[0062] When multiple parent documents meet the matching conditions, the parent document with the highest matching priority is selected for association.

[0063] According to the second aspect of the present application, a context reconstruction system is provided, which includes a machine-readable storage medium and a processor. The machine-readable storage medium stores machine-executable instructions. When the processor executes the machine-executable instructions, the context reconstruction system implements the aforementioned context reconstruction method based on parent-child document matching.

[0064] According to a third aspect of the present application, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When the computer-executable instructions are executed, the aforementioned context reconstruction method based on parent-child document matching is implemented.

[0065] According to any of the above aspects, the technical effects of this application are:

[0066] The embodiment of the present application realizes the intelligent processing of the whole process from document structure analysis to content semantic alignment by constructing a context reconstruction method based on parent-child document matching, significantly improves the accuracy and efficiency of document context reconstruction, and provides an innovative technical solution for document content optimization and version update. Specifically, by obtaining the target parent document and its associated sub-document set, and parsing the context paragraphs and paragraph identifiers in the sub-document unit, the hierarchical affiliation between documents can be accurately grasped. On this basis, the hierarchical structure of the target parent document is parsed and processed to extract global structural features and local content features, which not only reveals the macro-architecture of the document, but also deeply analyzes the micro-semantics of the paragraph, providing multi-dimensional feature support for the dynamic semantic alignment of the context paragraph. By matching the context paragraph of the sub-document unit with the corresponding paragraph level of the target parent document through the hierarchical affiliation parameters, the precise positioning of cross-document paragraphs is achieved, effectively avoiding the dislocation and omission of context information. Furthermore, the context paragraphs of the sub-document units are dynamically semantically aligned based on global structural and local content features. By calibrating paragraph boundaries and eliminating semantic redundancy, the semantic coherence and consistency of the reconstructed context data blocks are ensured, significantly improving the readability and logicality of the document content. Finally, an optimized version of the target parent document is generated based on the reconstructed context data blocks, triggering a version update operation. This effectively addresses the problems of contextual information fragmentation and semantic inconsistency in traditional document processing methods, and improves the automation and intelligence level of document processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without any creative work.

[0068] Figure 1 A schematic diagram of a process for a context reconstruction method based on parent-child document matching provided in an embodiment of the present application is shown;

[0069] Figure 2A schematic diagram of the component structure of a context reconstruction system for implementing the above-mentioned context reconstruction method based on parent-child document matching provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0070] The following describes the embodiments of the present application in conjunction with the accompanying drawings. It should be understood that the embodiments described below in conjunction with the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0071] Those skilled in the art will appreciate that, unless expressly stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the features, information, data, steps, operations, elements and / or components presented, but do not exclude implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the present technical field. It should be understood that when an element is said to be "connected" or "coupled" to another element, the element can be directly connected or coupled to the other element, or it can refer to that the element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling, and the term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" can be implemented as "A", or as "B", or as "A and B".

[0072] In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail with reference to the accompanying drawings. The following description of several exemplary embodiments will illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be repeated.

[0073] Figure 1 The following is a flow chart of a context reconstruction method and system based on parent-child document matching provided by an embodiment of the present application. It should be understood that in other embodiments, the order of some steps in the context reconstruction method based on parent-child document matching of this embodiment can be shared, or some steps can be omitted or maintained, depending on actual needs. The detailed steps of the context reconstruction method based on parent-child document matching include:

[0074] Step S110: obtaining a target parent document and its associated sub-document set, wherein the sub-document set includes a plurality of sub-document units, and each sub-document unit includes at least one context paragraph and a corresponding paragraph identifier.

[0075] In this embodiment, taking the field of medical data retrieval as an example, the target parent document can be a review document on the diagnosis and treatment standards of a certain disease. For example, the target parent document revolves around the diagnosis and treatment of heart disease, covering many aspects such as the diagnosis methods and treatment methods of heart disease. The associated sub-document set is composed of many research reports, case analysis and other documents related to the diagnosis and treatment of heart disease. Each sub-document unit, taking a research report on the therapeutic effect of a new drug for heart disease as an example, contains a context paragraph describing the drug experimental process, such as the dosage of the drug, the screening criteria for experimental subjects, etc. At the same time, each paragraph has a corresponding paragraph identifier, such as "P1-001" represents the first paragraph in the report describing the drug dosage, "P1-002" represents the second paragraph describing the screening criteria for experimental subjects, etc. These sub-document units together constitute a sub-document set.

[0076] Step S120: performing hierarchical structure analysis on the target parent document to extract global structural features and local content features of the target parent document, wherein the global structural features include paragraph hierarchical distribution information and title nesting depth information, and the local content features include paragraph core word sequences and semantic coherence indicators.

[0077] Next, the hierarchical structure of this summary document on the diagnosis and treatment of heart disease is parsed.

[0078] Step S121: Identify the title tag sequence in the target parent document, and generate paragraph level distribution information according to the nesting level of the title tag sequence, wherein the paragraph level distribution information includes the starting position, ending position and corresponding title level number of each paragraph.

[0079] For example, in this document summarizing the diagnostic and treatment standards for heart disease, the title tag sequence may be like "1. Diagnostic methods for heart disease", "1.1 Clinical symptom diagnosis", "1.2 Instrument detection diagnosis", etc. By identifying these title tag sequences, paragraph level distribution information is generated according to their nesting levels. For example, the starting position of the paragraph corresponding to "1. Diagnostic methods for heart disease" is assumed to be at the 100th character of the document, and the ending position is at the 500th character, and its title level number is 1; the starting position of the paragraph corresponding to "1.1 Clinical symptom diagnosis" is at the 501st character, and the ending position is at the 800th character, and the title level number is 2. In this way, the starting and ending positions of each paragraph and the corresponding title level number are determined in detail to form the paragraph level distribution information.

[0080] Step S122: performing semantic segmentation processing on each paragraph of the target parent document to extract a core word sequence of the paragraph, wherein the core word sequence of the paragraph is composed of words in the paragraph that meet a word frequency threshold and an inverse document frequency threshold.

[0081] Take the paragraph "1.1 Clinical Symptom Diagnosis" as an example and perform semantic segmentation on it. Assume that the word frequency threshold is set to 5 and the inverse document frequency threshold is set to 0.2. The paragraph contains the following: "Common clinical symptoms of heart disease patients include chest pain, dyspnea, and palpitations, with chest pain being a prominent symptom." After processing, words such as "chest pain," "dyspnea," and "palpitations" that meet the word frequency threshold of 5 or more and the inverse document frequency threshold greater than 0.2 constitute the core word sequence of the paragraph.

[0082] Step S123: Calculating the semantic coherence index between adjacent paragraphs. The semantic coherence index is obtained by weighting the overlap of core word sequences of adjacent paragraphs and the cosine similarity of semantic vectors.

[0083] Continuing with the example of the document reviewing heart disease diagnosis and treatment standards, assume that the adjacent paragraphs are "1.1 Clinical Symptom Diagnosis" and "1.2 Instrumental Diagnosis." First, calculate the overlap between the core word sequences of these two paragraphs. For example, the core word sequence of "1.1 Clinical Symptom Diagnosis" is ["chest pain," "dyspnea," "palpitations"], while the core word sequence of "1.2 Instrumental Diagnosis" is ["electrocardiogram," "cardiac ultrasound," "chest pain"], with the overlapping word being "chest pain." Assume the overlap is 1 / 3 (the number of overlapping words divided by the number of core words in "1.1 Clinical Symptom Diagnosis"). Next, calculate the cosine similarity of the semantic vectors. Here, assume that the cosine similarity between the semantic vectors of these two paragraphs is 0.6. Then, through weighted calculation, assuming that the weights are 0.4 (coincidence weight) and 0.6 (semantic vector cosine similarity weight), the semantic coherence index is 0.4*1 / 3+0.6*0.6=0.4*0.333+0.6*0.6=0.133+0.36=0.493.

[0084] Step S124: determining the title nesting depth information according to the maximum value of the title level number, and writing the paragraph level distribution information, title nesting depth information, paragraph core word sequence and semantic coherence index into the structural feature cache and content feature cache respectively.

[0085] In a document reviewing heart disease diagnosis and treatment guidelines, assuming the maximum title level number is 3, for example, "1. Diagnostic Methods for Heart Disease" (Level 1) - "1.1 Clinical Symptom Diagnosis" (Level 2) - "1.1.1 Characteristics of Chest Pain" (Level 3), the title nesting depth is 3. The previously obtained paragraph level distribution information, title nesting depth information, core word sequences for each paragraph, and semantic coherence indicators for adjacent paragraphs are written to the structural feature cache and content feature cache, respectively, for use in subsequent steps.

[0086] Step S130: Determine the hierarchical affiliation parameters between the sub-document unit and the target parent document according to the paragraph identifier of the sub-document unit, and match the context paragraph of the sub-document unit with the corresponding paragraph level of the target parent document based on the hierarchical affiliation parameters.

[0087] Then, the operation is performed by taking the sub-document unit as an example, which is a detailed case analysis report on a specific treatment method for heart disease.

[0088] Step S131: Parse the paragraph identifier of the sub-document unit, and extract the parent document reference number, target paragraph level number and paragraph position offset from the paragraph identifier.

[0089] Assume that the paragraph identifier of the case analysis report is "P2-003-10-20", where "P2" represents the parent document reference number, corresponding to the review document of the heart disease diagnosis and treatment standards; "003" represents the target paragraph level number, which is assumed to correspond to a level under "2. Treatment methods for heart disease" in the review document; "10" is the paragraph position offset, indicating the offset relative to the starting position of the target paragraph level.

[0090] Step S132: Match the paragraph level distribution information corresponding to the parent document reference number from the structural feature cache to determine the maximum position offset range allowed by the target paragraph level number.

[0091] From the information previously written to the structural feature cache, find the paragraph level distribution information for the heart disease diagnosis and treatment standard review document corresponding to the parent document reference number "P2." Assuming that the paragraph level "2. Treatment of heart disease" starts at character 1500 and ends at character 2500, according to predefined rules (for example, setting the maximum offset range to 10% of the paragraph length at that level), the maximum position offset allowed for the target paragraph level number is from character 1500 - (2500-1500) * 0.1 = 1400 to character 1500 + (2500-1500) * 0.1 = 1600.

[0092] Step S133: If the paragraph position offset is within the maximum position offset range, then calculate the structural similarity and content overlap between the context paragraph of the sub-document unit and the corresponding paragraph level of the target parent document, wherein the structural similarity is determined by the consistency of the title level number and the paragraph length ratio, and the content overlap is determined by the number of overlapping words in the paragraph core word sequence and the change in the semantic coherence index.

[0093] If the paragraph position offset of 10 falls within the maximum position offset range described above, structural similarity is calculated. Assuming the target paragraph level number is 3, the corresponding sub-document level number is also 3, the title level number consistency is 1 (completely consistent), the sub-document context paragraph length is 200 characters, and the corresponding paragraph level paragraph length in the target parent document is 500 characters. The paragraph length ratio is 200 / 500 = 0.4, resulting in a structural similarity of (1 + 0.4) / 2 = 0.7. Content overlap is calculated. The sub-document context paragraph core word sequence is ["specific drug", "treatment effect", "recovery status"], the corresponding paragraph level core word sequence in the target parent document is ["specific drug", "treatment process", "complications"], the number of overlapping words is 1, and assuming the change in the semantic coherence index between adjacent paragraphs is 0.1 (calculated by comparing with adjacent paragraphs), the content overlap is 1 / 3 + 0.1 = 0.333 + 0.1 = 0.433.

[0094] Step S134: generating a hierarchical affiliation parameter according to the weighted sum of the structural similarity and the content overlap; if the hierarchical affiliation parameter exceeds a preset affiliation threshold, marking the sub-document unit as a valid matching unit.

[0095] Assuming the structural similarity weight is 0.6 and the content overlap weight is 0.4, the hierarchical affiliation parameter is 0.6*0.7+0.4*0.433=0.42+0.173=0.593. The preset affiliation threshold is assumed to be 0.5. Since 0.593 is greater than 0.5, the sub-document unit is marked as a valid matching unit.

[0096] Step S135: for each sub-document unit marked as a valid matching unit, extract the paragraph core word sequence and semantic coherence index of the paragraph level corresponding to the target parent document from the content feature cache.

[0097] Taking the sub-document unit marked as a valid matching unit as an example, the core word sequence of the paragraph corresponding to the paragraph level (assuming it is the "2.1 Drug Treatment" level) of the review document of the cardiology diagnosis and treatment standards is extracted from the content feature cache, such as ["names of various drugs", "dosage", "side effects of drugs"] and the semantic coherence index (for example, the semantic coherence index with the adjacent level paragraph is 0.5).

[0098] Step S136: Perform synonym replacement detection on the context paragraph of the sub-document unit, generate a replacement word list, and update the paragraph core word sequence according to the replacement word list.

[0099] In a sub-document context paragraph about a specific medication, for example, the paragraph reads, "This special-effect medication is significantly effective in treating heart disease." Synonym replacement testing reveals that "special-effect medication" is a synonym for "drug" in the target parent document's core word sequence, "Names of Various Medications." This generates a replacement word list ["special-effect medication" - "drug"]. The core word sequence of the paragraph is then updated based on this replacement word list, replacing "special-effect medication" with "drug." The updated core word sequence becomes ["drug," "treatment effect," "recovery status"].

[0100] Step S137: Calculate the dynamic overlap between the updated paragraph core word sequence and the paragraph core word sequence at the paragraph level corresponding to the target parent document, wherein the dynamic overlap is obtained by adjusting the word order consistency and the word meaning similarity.

[0101] The updated paragraph core word sequence is ["drug", "treatment effect", "recovery status"]. The corresponding paragraph-level core word sequence in the target parent document is ["various drug names", "drug dosage", "drug side effects"]. To calculate word order consistency, assuming that the position difference of the same word "drug" in the two sequences is 0.6 (out of a maximum score of 1), according to predefined rules. To calculate word sense similarity, the semantic similarity between "treatment effect" and "drug side effects" is assumed to be 0.3, and the semantic similarity between "recovery status" and "drug dosage" is assumed to be 0.2. Using a weighted calculation (assuming a weight of 0.6 for word order consistency and 0.4 for word sense similarity), the dynamic overlap is 0.6*0.6+0.4*(0.3+0.2) / 2=0.36+0.4*0.25=0.36+0.1=0.46.

[0102] Step S138: If the dynamic overlap degree is greater than or equal to a preset reconstruction threshold, the context paragraph of the sub-document unit is positionally bound to the corresponding paragraph level of the target parent document to generate a paragraph mapping relationship table.

[0103] The preset reconstruction threshold is assumed to be 0.4. Since 0.46 is greater than or equal to 0.4, the context paragraph of the sub-document unit is positionally bound to the "2.1 Drug Therapy" level in the heart disease diagnosis and treatment standard review document, and a paragraph mapping relationship table is generated to record the specific position of the sub-document unit paragraph "P2-003" corresponding to the target parent document "2.1 Drug Therapy" level.

[0104] Step S140: Based on the global structural features and the local content features, dynamic semantic alignment processing is performed on the context paragraphs of the sub-document unit to generate a reconstructed context data block, wherein the dynamic semantic alignment processing includes paragraph boundary calibration and semantic redundancy elimination.

[0105] Next, let's take the sub-document unit context paragraph for which location binding has been established as an example.

[0106] Step S141: According to the paragraph mapping relationship table, determine the paragraph level position of the target parent document into which the context paragraph of the sub-document unit needs to be inserted.

[0107] According to the generated paragraph mapping relationship table, it is determined that the context paragraph of the sub-document unit about a specific drug treatment needs to be inserted into a specific position under the "2.1 Drug Treatment" level of the heart disease diagnosis and treatment standard review document, assuming it is in the middle of the paragraph at this level.

[0108] Step S142: obtaining the semantic coherence index of the adjacent paragraphs at the paragraph level position from the structural feature cache, and calculating the insertion compatibility between the context paragraph and the adjacent paragraph, wherein the insertion compatibility is determined by the core word overlap rate and semantic vector direction consistency of the previous and next paragraphs.

[0109] Obtain the semantic coherence index for the adjacent paragraphs at the insertion position at the "2.1 Drug Therapy" level from the structural feature cache. Assume that the core word sequence of the previous paragraph is ["drug R&D background," "R&D team"], the core word sequence of the subsequent paragraph is ["clinical trial process," "test results"], and the core word sequence of the sub-document unit context paragraph is ["drug ingredients," "therapeutic effect"]. Calculate the core word overlap ratio between the previous paragraph and the sub-document unit context paragraph. If there are no overlapping words, the overlap ratio is 0; calculate the core word overlap ratio between the subsequent paragraph and the sub-document unit context paragraph. If there are no overlapping words, the overlap ratio is 0. Assume that, using a certain semantic vector calculation method, the semantic vector directional consistency is 0.7 (out of a maximum score of 1). Using a weighted calculation (assuming a weight of 0.4 for the core word overlap ratio and 0.6 for the semantic vector directional consistency), the insertion compatibility is 0.4*(0+0) / 2+0.6*0.7=0.42.

[0110] Step S143: If the insertion compatibility exceeds a preset compatibility threshold, the paragraph boundary of the context paragraph is calibrated, and the paragraph boundary calibration includes deleting the core word sequence repeated with the adjacent paragraph and adjusting the transition conjunctions of the paragraph starting sentence.

[0111] The preset compatibility threshold is assumed to be 0.4. Since 0.42 is greater than 0.4, the paragraph boundary of the context paragraph is calibrated. For example, if the starting sentence of the sub-document unit context paragraph is found to be "This special medicine has a unique ingredient", if the adjacent paragraph already mentions "drug" related content, the repeated core word "drug" is deleted and the starting sentence is adjusted to "This special-effect item with a unique ingredient has". At the same time, appropriate transitional conjunctions are added according to semantic logic to make the connection with the adjacent paragraph more natural.

[0112] Step S144: performing semantic redundancy elimination on the calibrated context paragraph to obtain a processed context paragraph.

[0113] Step S1441: extract all sentences in the calibrated context paragraph to generate a sentence set.

[0114] The calibrated context paragraph content is "This special item with a unique ingredient has a good therapeutic effect. It can effectively relieve the symptoms of heart disease. This effect has been verified in clinical trials." Extract all sentences and generate a sentence set ["This special item with a unique ingredient has a good therapeutic effect.", "It can effectively relieve the symptoms of heart disease.", "This effect has been verified in clinical trials."].

[0115] Step S1442: performing semantic role labeling on each sentence in the sentence set, and extracting the subject-verb-object structure and modifying components of the sentence.

[0116] For the first sentence, "This special product with a unique ingredient has a good therapeutic effect," semantic role annotation is performed. The subject-verb-object structure is "product (subject) - has (verb) - effect (object)," and the modifiers are "this unique ingredient's" and "good." For the second sentence, "It can effectively relieve heart disease symptoms," the subject-verb-object structure is "it (subject) - relieve (verb) - symptoms (object)," and the modifiers are "can effectively" and "heart disease." For the third sentence, "This effect has been verified in clinical trials," the subject-verb-object structure is "effect (subject) - verified (verb)," and the modifiers are "this" and "in clinical trials."

[0117] Step S1443: Calculate the semantic overlap between any two sentences, where the semantic overlap is determined by subject-verb-object structure consistency and modifying component similarity.

[0118] Calculate the semantic overlap between the first and second sentences. For consistency in subject-verb-object structure, the subject "item" and "it" (referring to an item) are somewhat related, so consistency is assumed to be 0.6. The predicate "have" and "relieve" are different, so consistency is 0. The object "effect" and "symptom" are different, so consistency is 0. For modifier similarity, the similarity between "this unique component" and "can be effective" is assumed to be 0.2. Using a weighted calculation (assuming a weight of 0.6 for subject-verb-object consistency and a weight of 0.4 for modifier similarity), the semantic overlap is 0.6*(0.6+0+0) / 3+0.4*0.2=0.12+0.08=0.2. Calculating semantic overlap between the other sentences is similar.

[0119] Step S1444: If the semantic overlap between two sentences exceeds a preset overlap threshold, the sentence with a higher core word density is retained and the other sentence is deleted.

[0120] The default overlap threshold is assumed to be 0.3. Since the semantic overlap between the first and second sentences is 0.2, which is less than 0.3, no deletion is performed. Assuming that the semantic overlap between other sentences exceeds 0.3, such as two sentences, calculate the core word density. Assuming that the first sentence has 3 core words and a sentence length of 20 characters, the core word density is 3 / 20 = 0.15; the second sentence has 4 core words and a sentence length of 25 characters, the core word density is 4 / 25 = 0.16. The second sentence with a higher core word density is retained, and the first sentence is deleted.

[0121] Step S1445: performing a logical sequence check on the remaining sentences, adjusting the sentence arrangement order according to the global structural features of the target parent document so that the semantic coherence index of adjacent sentences reaches a preset coherence threshold, and obtaining a processed context paragraph.

[0122] The remaining sentences are logically checked according to the global structural features of the target parent document "2.1 Drug Treatment". Assuming that a certain semantic coherence calculation method is used, the sentence order is adjusted so that the semantic coherence index of adjacent sentences reaches the preset coherence threshold (assuming it is 0.5), and finally the processed context paragraph is obtained.

[0123] Step S145: Encapsulate the processed context paragraph into a reconstructed context data block, and add a version identifier and a timestamp to the reconstructed context data block.

[0124] The processed context paragraphs about the specific drug treatment are encapsulated into a reconstructed context data block, and a version identifier and a timestamp are added to the reconstructed context data block.

[0125] Continuing with the example of a document summarizing heart disease diagnosis and treatment guidelines and its related subdocuments, we encapsulate the processed context paragraphs regarding specific medications into a reconstructed context data block. During this process, we must ensure the integrity and standardization of the encapsulation so that the data block can be accurately identified and processed by subsequent operations.

[0126] Next, add a version identifier. The version identifier can be a string combination with predefined rules, which is used to uniquely identify the version information of the reconstruction context data block. For example, the rule for setting the version identifier is "V" plus the last two digits of the year, the two digits of the month, the two digits of the day, and a self-incrementing three-digit serial number. Assuming that the current processing time is October 15, 2024, and this is the fifth reconstruction context data block generated that day, the version identifier can be set to "V241015005". Such a version identifier contains both time information and a self-incrementing serial number, which makes it easier to distinguish and manage different versions of data blocks in subsequent processes.

[0127] A timestamp is then added, recording the precise time when the reconstruction context data block was generated. The timestamp can use a common time format, such as a time count in milliseconds. For example, the timestamp is the number of milliseconds that have elapsed from a fixed starting point (such as January 1, 1970, 00:00:00 UTC) to the moment the data block was generated. Assuming the reconstruction context data block was generated at 14:30:15:200 milliseconds on October 15, 2024, using the appropriate time calculation method (for example, converting the year, month, day, hour, minute, second, and millisecond to milliseconds and then adding them together), the number of milliseconds that have elapsed from January 1, 1970, 00:00:00 UTC, to this moment is 1718405415200. This value serves as the timestamp for the reconstruction context data block.

[0128] Step S150: Generate an optimized version of the target parent document according to the reconstructed context data block, and output the optimized version to a document storage system to trigger a version update operation.

[0129] In the context of a document summarizing cardiac diagnosis and treatment guidelines, an optimized version of the target parent document is generated based on the previously generated reconstructed context data block. Specifically, the reconstructed context data block is accurately inserted into the corresponding paragraph-level position of the target parent document, according to the position determined by the paragraph mapping table. For example, if it was previously determined that the reconstructed context data block regarding a specific drug treatment should be inserted into a specific location under the "2.1 Drug Treatment" level, the data block is inserted there, thus forming an optimized version of the target parent document.

[0130] Step S151: Parse all reconstruction context data blocks in the optimized version and extract the version identifier and timestamp of each reconstruction context data block.

[0131] For the generated optimized version of the target parent document, the software begins parsing all reconstructed context data blocks within it. For example, using the previously encapsulated reconstructed context data block about a specific medication as an example, the software extracts the version identifier "V241015005" and the timestamp "1718405415200" according to the encapsulation format and rules. This extraction process is repeated for each reconstructed context data block, ensuring accurate version and time information is obtained for each data block.

[0132] Step S152: obtaining the current version metadata of the target parent document from the document storage system, wherein the current version metadata includes a set of historical version identifiers and a last update timestamp.

[0133] Assume that a document storage system uses a common storage structure to manage document version information. In the scenario of a document reviewing cardiology diagnosis and treatment guidelines, the storage location corresponding to the target parent document is found in the document storage system, and the current version metadata is obtained from it. The historical version identifier set may be a list containing multiple version identifiers, such as ["V241010001", "V241012003", "V241014004"], each representing a version generated at a different time. The last update timestamp records the time of the last update operation on the target parent document, assuming it is "1718321000000", also expressed as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

[0134] Step S153: If the timestamp of the optimized version is later than the last updated timestamp, the optimized version is compared with the current version to generate a difference content report, which includes the number of newly added paragraphs, the positions of modified paragraphs, and the identifiers of deleted paragraphs.

[0135] Compare the timestamp "1718405415200" of the reconstructed context data block in the optimized version with the last update timestamp "1718321000000" obtained from the document storage system. Because "1718405415200" is greater than "1718321000000", that is, the timestamp of the optimized version is later than the last update timestamp, a difference comparison is required.

[0136] During the diff comparison process, the number of newly added paragraphs is first determined. For example, through structural analysis of the optimized version and the current version, it is found that the optimized version has a new paragraph because a reconstructed context data block about a specific drug treatment has been inserted, so the number of newly added paragraphs is 1.

[0137] Then determine the position of the modified paragraph. Check the impact of inserting the reconstruction context data block on the positions of the surrounding paragraphs in the optimized version. Assume that there are paragraphs A and B under the "2.1 Drug Treatment" level. After inserting the reconstruction context data block, the position of paragraph B moves backward. The specific position of the movement can be determined by calculating the document character position. For example, the original starting position of paragraph B is at the 3000th character in the document. After inserting the reconstruction context data block, the starting position of paragraph B becomes the 3500th character. Then the modified paragraph position information is recorded as paragraph B moving from the 3000th character to the 3500th character.

[0138] Finally, determine the deleted paragraph identifiers. After comparison, if no paragraphs were deleted in the optimized version, the deleted paragraph identifier list will be empty. If there were deletions, such as when a paragraph in the current version was deleted in the optimized version due to duplicate content, the paragraph identifier will be recorded. For example, if the paragraph identifier is "P3-007," the deleted paragraph identifier will be recorded as ["P3-007"]. This information is compiled to generate a content difference report.

[0139] Step S154: Generate a version update instruction according to the difference content report, wherein the version update instruction includes incremental update data and a rollback verification code.

[0140] Generates version update instructions based on the difference content report. The incremental update data primarily comes from the reconstructed context data block and the modifications identified during the difference comparison. For example, the incremental update data includes the reconstructed context data block for a specific drug treatment and the modified paragraph position information (e.g., moving paragraph B from character 3000 to character 3500).

[0141] A rollback checksum is generated to ensure a rollback to the previous version if an issue arises during the update process. This rollback checksum can be generated based on a predefined algorithm, such as a hash calculation of key content from the optimized and current versions. Key components of the optimized and current versions (such as the core document content and version identifier) are first combined. For example, the combined content is "Heart Disease Diagnosis and Treatment Guidelines Summary Document Body + V241015005 + V241014004." This is then hashed using a common hash algorithm (such as SHA-256) to generate a fixed-length hash value, assuming it is "0x123abcdef45678901234567890abcdef12345678901234567890abcdef4567890." This hash value serves as the rollback checksum. The incremental update data and the rollback checksum are combined to form the version update instruction.

[0142] Step S155: Send the version update instruction to the document storage system, so that the document storage system replaces the target paragraph according to the incremental update data, and verifies the integrity of the replaced paragraph according to the rollback check code.

[0143] The generated version update instruction is sent to the document storage system. After receiving the instruction, the document storage system starts to execute the update operation.

[0144] Step S1551: Create a temporary version branch in the document storage system, and write the incremental update data into the temporary version branch.

[0145] The document storage system first creates a temporary version branch within its internal structure. This temporary version branch acts as an independent storage space, temporarily storing data during the update process. Incremental update data is then written to this temporary version branch. For example, incremental update data such as the reconstructed context data block for a specific drug treatment and information about paragraph position changes are accurately written to the storage location corresponding to the temporary version branch, ensuring data integrity and accuracy.

[0146] Step S1552: performing an integrity check on the temporary version branch, wherein the integrity check includes a paragraph identifier continuity check and a semantic logic conflict detection.

[0147] Perform a section identifier continuity check to see if the identifiers for all sections in the temporary version branch are in the expected order. For example, if the temporary version branch has section identifiers "P1-001," "P1-002," and "P1-003," check to see if they are sequential and continuous, without skipping numbers. If there are skipping numbers, such as missing "P1-002," the section identifier continuity check fails.

[0148] Perform semantic logic conflict detection to analyze whether the semantic logic relationship between each paragraph in the temporary version branch is reasonable. Taking the review document of the cardiology diagnosis and treatment standards as an example, check whether the semantic logic of the surrounding paragraphs is consistent after the reconstruction context data block about specific drug treatment is inserted. For example, whether the inserted content is logically consistent with the description of drug treatment in the previous and next paragraphs, and whether there are contradictory statements. For example, if the previous paragraph mentions that the applicable symptom of a certain drug is A, and the inserted reconstruction context data block says that the applicable symptom of the drug is B, and A and B contradict each other, then there is a semantic logic conflict, and the semantic logic conflict detection fails.

[0149] Step S1553: If the integrity check passes, the temporary version branch is merged into the main version branch, and the last update timestamp is updated.

[0150] If both the paragraph identifier continuity check and the semantic logic conflict detection pass, it means that the data in the temporary version branch is complete and logically reasonable. At this point, the document storage system merges the temporary version branch into the main version branch, updating the main version branch to the latest state. At the same time, the last update timestamp is updated to the time of the current operation. For example, assuming that the current operation time is 14:35:00 on October 15, 2024, the number of milliseconds converted from 00:00:00 UTC on January 1, 1970 is 1718405700000, and this value is updated as the last update timestamp of the target parent document in the document storage system.

[0151] Step S1554: If a semantic logic conflict is detected, the write operation of the temporary version branch is canceled according to the rollback verification code, and a manual intervention process is triggered.

[0152] If a semantic logic conflict is detected during the integrity check, the document storage system undoes the write operation to the temporary version branch based on the previously generated rollback checksum. Specifically, the rollback checksum is compared with the previously stored data in the storage system and restored. For example, using the rollback checksum "0x123abcdef45678901234567890abcdef12345678901234567890abcdef4567890," the system finds the version data from before the update and restores the temporary version branch to its pre-update state. Simultaneously, a manual intervention process is triggered, notifying relevant personnel (such as document administrators or domain experts) to resolve the semantic logic conflict. Relevant personnel can review the difference report and the data from the temporary version branch to analyze the cause of the conflict and make manual adjustments to ensure the accuracy and logical integrity of the document content.

[0153] Before obtaining the target parent document and its associated child document set, the method further includes: step S210: configuring a document association rule library, the document association rule library defines matching conditions for parent and child documents, the matching conditions including file format consistency, subject keyword overlap rate and author authority identifier.

[0154] In the overall process of medical data retrieval, a document association rule base must be configured before obtaining the target parent document and its associated child document collection. For example, for documents related to heart disease diagnosis and treatment, file format consistency rules require that parent and child documents have the same format type and consistent version compatibility identifiers. For example, if the parent document is in PDF format and version 1.5, then the child documents must also be in PDF format and between version 1.4 and 1.6 (the specified version compatibility range).

[0155] The threshold of the subject keyword overlap rate is dynamically adjusted through the subject distribution statistics of the historical document collection. Suppose that a subject analysis is performed on the past 100 historical documents related to the diagnosis and treatment of heart disease, and the subject keywords of each document are extracted. For example, the frequently appearing subject keywords in these documents include "heart disease", "treatment", "diagnosis", etc. Through statistical analysis, it is found that the documents related to "heart disease treatment" account for 60%, and the documents related to "heart disease diagnosis" account for 40%. Based on these statistical results, the threshold of the subject keyword overlap rate is dynamically adjusted. If the current focus is on document associations in the treatment aspect, the threshold of the subject keyword overlap rate is set to 0.6, that is, the subject keyword overlap rate of the child document and the parent document must reach 0.6 or above to meet the matching conditions.

[0156] Bind author permissions so that the creator identifier of a subdocument must be included in the parent document's authorized editor list. For example, if the parent document's authorized editor list is ["DoctorSmith", "DoctorJohnson", "ResearcherLi"], then only subdocuments with a creator identifier that is one of these will qualify.

[0157] A weight coefficient is assigned to each matching condition, and the matching priority of parent and child documents is determined based on the weighted sum of the weight coefficients. Assume that the file format consistency weight coefficient is 0.3, the subject keyword overlap weight coefficient is 0.5, and the author permission identifier weight coefficient is 0.2. When determining the matching priority of a child document with a parent document, assuming that the file format consistency score of the child document and the parent document is 1 (complete consistency), the subject keyword overlap score is 0.7, and the author permission identifier score is 1 (the child document creator is in the authorized editor list), the matching priority is 0.3×1+0.5×0.7+0.2×1=0.3+0.35+0.2=0.85. When multiple parent documents meet the matching conditions, the parent document with the highest matching priority is selected for association.

[0158] Step S220: monitoring the document input channel, and when a new document upload is detected, extracting metadata features of the new document, the metadata features including the creator identifier, document subject tag, and format type.

[0159] In a medical data retrieval system, document input channels are continuously monitored. For example, when a new document related to heart disease is uploaded, this event is immediately captured. Metadata features of the new document are then extracted. For example, a newly uploaded research report on a new treatment for heart disease is used as an example. The creator identifier is assumed to be "ResearcherWang." Document subject tags are extracted by analyzing the document content and may include "new treatment for heart disease, efficacy evaluation," etc. The format type is detected as PDF.

[0160] Step S230: matching the metadata features of the new document with the metadata features of the existing parent document according to the document association rule library; if the match is successful, adding the new document to the child document set of the corresponding parent document.

[0161] The metadata features of the newly uploaded document are matched against the metadata features of the parent document in the document association rule library. For example, a parent document on heart disease treatment exists in PDF format, version 1.5, with subject keywords such as "heart disease treatment" and "drug therapy," and a list of authorized editors: ["DoctorSmith," "DoctorJohnson," "ResearcherLi," "ResearcherWang"]. The newly uploaded document is in PDF format, meeting the file format consistency requirement. The subject keyword overlap ratio between the new document's subject tags "new heart disease treatments, efficacy evaluation" and the parent document's subject keywords, such as "heart disease treatment," is calculated to be 0.7, exceeding the set threshold of 0.6. The creator identifier "ResearcherWang" is in the parent document's list of authorized editors. Therefore, the match is successful, and the newly uploaded research report on new heart disease treatments is added to the parent document's collection of child documents.

[0162] Step S240: If the matching fails, an independent parent document identifier is created for the new document, and its child document set is initialized to empty.

[0163] Suppose a new document is uploaded about research on the genetic causes of a rare heart disease, and there's no matching parent document for it. The file format is DOCX, which doesn't match the PDF format used by most parent documents related to heart disease diagnosis and treatment. Even though the subject keywords overlap, the low file format consistency score means the overall match priority is lower than that of other parent documents, and the match fails. In this case, a separate parent document identifier, such as "ParentDoc-001," is created for this new document, and its child document collection is initialized to empty, pending subsequent uploads of matching child documents.

[0164] Figure 2 A context reconstruction system 100 provided in an embodiment of the present application is shown, including a processor 1001, a memory 1003 and program code stored in the memory 1003. The processor 1001 executes the above program code to implement the steps of the context reconstruction method based on parent-child document matching.

[0165] Figure 2 The context reconstruction system 100 shown includes: a processor 1001 and a memory 1003. The processor 1001 and the memory 1003 are connected, for example, via a bus 1002. Optionally, the context reconstruction system 100 may further include a transceiver 1004, which can be used for data exchange between the context reconstruction system and other context reconstruction systems, such as data transmission and / or data reception. It should be noted that in actual scheduling, the number of transceivers 1004 is not limited to one, and the structure of the context reconstruction system 100 does not constitute a limitation on the embodiments of the present application.

[0166] Processor 1001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 1001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, or a combination of a DSP and a microprocessor.

[0167] Bus 1002 may include a path for transmitting information between the aforementioned components. Bus 1002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. Bus 1002 may be divided into an address bus, a data bus, a control bus, and other components.

[0168] The memory 1003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage medium, other magnetic storage device, or any other medium that can be used to have or store program code and can be read by a computer, without limitation herein.

[0169] The memory 1003 is used to store program codes for executing the embodiments of the present application, and the execution is controlled by the processor 1001. The processor 1001 is used to execute the program codes stored in the memory 1003 to implement the steps shown in the above method embodiments.

[0170] An embodiment of the present application provides a computer-readable storage medium having program code stored thereon. When the program code is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0171] It should be understood that, although each operation step is indicated by arrows in the flow chart of the embodiment of the present application, the order of implementation of these steps is not limited to the order indicated by the arrows. Unless otherwise clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flow chart can be performed in other orders based on demand. In addition, some or all of the steps in each flow chart can include multiple sub-steps or multiple stages according to actual implementation scenario, and some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage in these sub-steps or stages can also be executed at different times respectively. Under different scenarios at the execution time, the order of execution of these sub-steps or stages can be flexibly configured based on demand, and the embodiment of the present application does not limit this.

[0172] The above is only an optional implementation method for some implementation scenarios of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of this application, other similar implementation methods based on the technical ideas of this application also fall within the protection scope of the embodiments of this application.

Claims

1. A context reconstruction method based on parent-child document matching, characterized in that: The method comprises: Obtaining a target parent document and its associated sub-document set, wherein the sub-document set includes a plurality of sub-document units, each of which includes at least one context paragraph and a corresponding paragraph identifier; Performing hierarchical structure analysis on the target parent document to extract global structural features and local content features of the target parent document, wherein the global structural features include paragraph hierarchical distribution information and title nesting depth information, and the local content features include paragraph core word sequences and semantic coherence indicators; Determining a hierarchical affiliation parameter between the sub-document unit and the target parent document according to the paragraph identifier of the sub-document unit, and matching a context paragraph of the sub-document unit with a corresponding paragraph hierarchy of the target parent document based on the hierarchical affiliation parameter; Based on the global structural features and the local content features, dynamic semantic alignment processing is performed on the context paragraphs of the sub-document unit to generate a reconstructed context data block, wherein the dynamic semantic alignment processing includes paragraph boundary calibration and semantic redundancy elimination; An optimized version of the target parent document is generated according to the reconstruction context data block, and the optimized version is output to a document storage system to trigger a version update operation.

2. The context reconstruction method based on parent-child document matching according to claim 1 is characterized in that: The performing hierarchical structure analysis on the target parent document to extract global structural features and local content features of the target parent document includes: Identifying a title tag sequence in the target parent document, and generating paragraph level distribution information according to the nesting level of the title tag sequence, wherein the paragraph level distribution information includes the starting position, the ending position and the corresponding title level number of each paragraph; Performing semantic segmentation on each paragraph of the target parent document to extract a core word sequence of the paragraph, wherein the core word sequence of the paragraph is composed of words in the paragraph that meet a word frequency threshold and an inverse document frequency threshold; Calculating a semantic coherence index between adjacent paragraphs, wherein the semantic coherence index is obtained by weighting the overlap of core word sequences of adjacent paragraphs and the cosine similarity of semantic vectors; The title nesting depth information is determined according to the maximum value of the title level number, and the paragraph level distribution information, title nesting depth information, paragraph core word sequence and semantic coherence index are written into the structure feature cache and content feature cache respectively.

3. The context reconstruction method based on parent-child document matching according to claim 2 is characterized in that: The step of determining the hierarchical affiliation parameter between the sub-document unit and the target parent document according to the paragraph identifier of the sub-document unit includes: Parsing the paragraph identifier of the sub-document unit, extracting the parent document reference number, target paragraph level number and paragraph position offset from the paragraph identifier; Matching the paragraph level distribution information corresponding to the parent document reference number from the structural feature cache to determine the maximum position offset range allowed by the target paragraph level number; If the paragraph position offset is within the maximum position offset range, then calculating the structural similarity and content overlap between the context paragraph of the sub-document unit and the corresponding paragraph level of the target parent document, wherein the structural similarity is determined by the consistency of the title level number and the paragraph length ratio, and the content overlap is determined by the number of overlapping words in the core word sequence of the paragraph and the change in the semantic coherence index; A hierarchical affiliation parameter is generated according to the weighted sum of the structural similarity and the content overlap. If the hierarchical affiliation parameter exceeds a preset affiliation threshold, the sub-document unit is marked as a valid matching unit.

4. The context reconstruction method based on parent-child document matching according to claim 3 is characterized in that: The matching of the context paragraph of the sub-document unit with the corresponding paragraph level of the target parent document based on the level affiliation parameter includes: For each sub-document unit marked as a valid matching unit, extracting the paragraph core word sequence and semantic coherence index of the paragraph level corresponding to the target parent document from the content feature cache; Performing synonym replacement detection on the context paragraph of the sub-document unit, generating a replacement word list, and updating the paragraph core word sequence according to the replacement word list; Calculating the dynamic overlap between the updated paragraph core word sequence and the paragraph core word sequence at the paragraph level corresponding to the target parent document, wherein the dynamic overlap is obtained by adjusting word order consistency and word meaning similarity; If the dynamic overlap degree is greater than or equal to a preset reconstruction threshold, the context paragraph of the sub-document unit is positionally bound to the corresponding paragraph level of the target parent document to generate a paragraph mapping relationship table.

5. The context reconstruction method based on parent-child document matching according to claim 4 is characterized in that: The step of performing dynamic semantic alignment processing on the context paragraphs of the sub-document unit based on the global structural features and the local content features to generate a reconstructed context data block includes: Determining, based on the paragraph mapping relationship table, the paragraph level position at which the context paragraph of the sub-document unit needs to be inserted into the target parent document; Obtaining semantic coherence indicators of adjacent paragraphs at the paragraph level from the structural feature cache, and calculating insertion compatibility between the context paragraph and the adjacent paragraph, wherein the insertion compatibility is determined by the core word overlap rate and semantic vector direction consistency of the previous and next paragraphs; If the insertion compatibility exceeds a preset compatibility threshold, the paragraph boundary of the context paragraph is calibrated, wherein the paragraph boundary calibration includes deleting the core word sequence repeated in the adjacent paragraph and adjusting the transition conjunctions of the paragraph starting sentence; Eliminate semantic redundancy on the calibrated context paragraph to obtain the processed context paragraph; The processed context paragraph is encapsulated into a reconstructed context data block, and a version identifier and a timestamp are added to the reconstructed context data block.

6. The context reconstruction method based on parent-child document matching according to claim 5, characterized in that: The semantic redundancy elimination of the calibrated context paragraph to obtain a processed context paragraph includes: Extract all sentences in the calibrated context paragraph to generate a sentence set; Performing semantic role labeling on each sentence in the sentence set to extract the subject-verb-object structure and modifying components of the sentence; Calculate the semantic overlap between any two sentences, where the semantic overlap is determined by subject-verb-object structure consistency and modifier similarity; If the semantic overlap between two sentences exceeds a preset overlap threshold, the sentence with a higher density of core words is retained and the other sentence is deleted; The remaining sentences are checked for logical order, and the sentence arrangement order is adjusted according to the global structural features of the target parent document so that the semantic coherence index of adjacent sentences reaches a preset coherence threshold, thereby obtaining a processed context paragraph.

7. The context reconstruction method based on parent-child document matching according to claim 1, characterized in that: Outputting the optimized version to a document storage system to trigger a version update operation includes: Parsing all reconstruction context data blocks in the optimized version, and extracting a version identifier and a timestamp of each reconstruction context data block; Acquire the current version metadata of the target parent document from the document storage system, wherein the current version metadata includes a set of historical version identifiers and a last updated timestamp; If the timestamp of the optimized version is later than the last updated timestamp, the optimized version is compared with the current version to generate a difference content report, which includes the number of newly added paragraphs, the positions of modified paragraphs, and the identifiers of deleted paragraphs; Generate a version update instruction according to the difference content report, wherein the version update instruction includes incremental update data and a rollback verification code; The version update instruction is sent to the document storage system, so that the document storage system replaces the target paragraph according to the incremental update data and verifies the integrity of the replaced paragraph according to the rollback check code.

8. The context reconstruction method based on parent-child document matching according to claim 7 is characterized in that: The step of sending the version update instruction to the document storage system so that the document storage system replaces the target paragraph according to the incremental update data and verifies the integrity of the replaced paragraph according to the rollback check code includes: Creating a temporary version branch in the document storage system, and writing the incremental update data into the temporary version branch; Performing an integrity check on the temporary version branch, the integrity check including a section identifier continuity check and a semantic logic conflict detection; If the integrity check passes, the temporary version branch is merged into the main version branch, and the last update timestamp is updated; If a semantic logic conflict is detected, the write operation of the temporary version branch is undone according to the rollback verification code, and a manual intervention process is triggered.

9. The context reconstruction method based on parent-child document matching according to claim 1, characterized in that: Before obtaining the target parent document and its associated child document set, the method further includes: Configuring a document association rule library, wherein the document association rule library defines matching conditions for parent and child documents, wherein the matching conditions include file format consistency, subject keyword overlap rate, and author authority identifier; Monitor the document input channel and, when a new document is detected to be uploaded, extract metadata features of the new document, wherein the metadata features include a creator identifier, a document subject tag, and a format type; Matching metadata features of the new document with metadata features of an existing parent document according to the document association rule library, and if a match is successful, adding the new document to the child document set of the corresponding parent document; If the match fails, create an independent parent document identifier for the new document and initialize its child document collection to be empty; The configuration document association rule base includes: Define file format consistency rules, which require that parent and child documents have the same format type and the same version compatibility identifier; Setting a topic keyword overlap rate threshold, wherein the topic keyword overlap rate threshold is dynamically adjusted based on topic distribution statistics of the historical document collection; Bind author permission identifiers so that the creator identifier of a child document must be included in the list of authorized editors of the parent document; Assign a weight coefficient to each matching condition, and determine the matching priority of the parent and child documents based on the weighted sum of the weight coefficients; When multiple parent documents meet the matching conditions, the parent document with the highest matching priority is selected for association.

10. A context reconstruction system, characterized in that: The method comprises a processor and a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by the processor, the context reconstruction method based on parent-child document matching according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Medical data document classification and marking system

    CN119621972A

  • LLM-based document structuring automatic processing method and system

    CN119782503A