Document processing method and apparatus based on multi-stage large model workflow, device, and medium

By segmenting documents into blocks and iteratively calling large language models through a multi-stage large model workflow, the problems of lost information at the end of documents and difficulty in disassembling nested structures in existing technologies are solved, and the automatic generation and standardization of standard operation process documents are realized.

CN123159353APending Publication Date: 2026-11-24INNOVATION QIZHI TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611475753.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing SOP generation schemes based on large language models suffer from problems such as loss of key information at the end of the document, difficulty in disassembling complex nested fault structures, non-standard output results, unstable format, information redundancy, and low degree of automation.

Method used

A multi-stage large model workflow is adopted. By processing documents in blocks, the large language model is called repeatedly to extract fault information, expand and complete the structure, and improve the content, so as to generate standard operation process documents.

Benefits of technology

It improves the standardization and readability of fault information extraction, realizes end-to-end automated generation from raw text to usable SOPs, reduces the probability of process interruption, and improves the convenience and reliability of generated documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123159353A_ABST
    Figure CN123159353A_ABST
Patent Text Reader

Abstract

This application provides a document processing method, apparatus, device, and medium based on a multi-stage large-model workflow, relating to the field of document processing technology. The method includes: dividing the document to be processed into blocks to obtain multiple text blocks; using a large language model to extract fault information from each text block to obtain a list of structured objects; identifying target structured objects in the structured object list that have nested fault type relationships, expanding each target structured object into multiple structured objects with independent fault type fields, and filling in preset field spaces to obtain a flattened list of structured objects; using the large language model to improve the content of each structured object, generating a standard operating procedure document. This application avoids long document truncation and structural instability in single-round extraction, thereby improving the standardization of fault information extraction and enhancing the convenience and reliability of generating readable standard operating procedure documents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of document processing technology, and more specifically, to a document processing method, apparatus, device, and medium based on a multi-stage large-scale workflow. Background Technology

[0002] As the scale of operations and maintenance (O&M) services continues to expand, unstructured text data such as O&M documents and fault reports are constantly increasing. The generation of Standard Operating Procedures (SOPs) still primarily relies on manual reading and organization by technical personnel, which is inefficient and cannot meet the needs of large-scale SOP generation. Therefore, utilizing large language models to automatically extract fault information from documents and generate SOPs has become an important development direction in this field.

[0003] However, existing SOP generation solutions based on large language models mostly use a single large model to process the entire document end-to-end directly. This type of technology has the following shortcomings: On the one hand, due to the limited context window length of the large model, long documents are truncated during the input stage, and key information at the end of the document is easily lost, making it difficult to guarantee the integrity of information extraction; on the other hand, single-round generation is difficult to accurately decompose complex nested fault structures in the document (such as a fault scenario containing multiple sub-fault types), and the output results often have problems such as missing fields and chaotic object nesting. Due to the non-standard structure of the extracted information, it cannot be directly used by subsequent processes, making it difficult to automatically generate readable process documents. Summary of the Invention

[0004] The purpose of this application is to provide a document processing method, apparatus, device, and medium based on a multi-stage large model workflow, so as to improve the standardization of fault information extraction and facilitate the automatic generation of readable standard operation process documents.

[0005] Firstly, embodiments of this application provide a document processing method based on a multi-stage large-model workflow, including: The document to be processed is divided into blocks to obtain multiple text blocks; The large language model is called repeatedly to extract fault information from each text block to obtain a list of structured objects; wherein, the list of structured objects includes at least one structured object, and each structured object includes a fault type field and at least one of a fault cause field and a solution field; Identify target structured objects in the structured object list that have nested fault types, expand each target structured object into multiple structured objects with independent fault type fields, and fill in the preset field space for the expanded structured objects to obtain a flattened structured object list. The large language model is called repeatedly to improve the content of each structured object in the flat structured object list, and a standard operation process document is generated based on the improved flat structured object list.

[0006] In this embodiment, by dividing the document to be processed into blocks and then repeatedly calling the large language model to extract, format, and improve the structured information in stages, the truncation of long documents and the instability of the structure in a single round of extraction can be avoided, thereby improving the standardization of fault information extraction and the convenience and reliability of generating readable standard operation process documents.

[0007] In some embodiments, the cyclic calling of the large language model to extract fault information from each text block yields a list of structured objects, including: Record and dynamically accumulate the list of extracted fault information in real time; When extracting the current text block, the extracted structured object is deduplicated based on the list of extracted fault information, and the deduplicated structured object is added to the list of structured objects.

[0008] In this embodiment of the application, by recording and dynamically accumulating the list of extracted fault information in real time and deduplicating the current extraction results, it is possible to avoid the same fault type being repeatedly extracted in different text blocks, thereby simplifying the structured object list, reducing subsequent redundant processing and information chaos.

[0009] In some embodiments, the step of deduplicating the currently extracted structured object based on the already extracted fault information list when extracting the current text block includes: When extracting the current text block, the list of extracted fault information is incorporated into the prompt words of the large language model in this call, so as to guide the large language model to extract the fault types and their fault information that have not been included, and to supplement the fault information corresponding to the included fault types.

[0010] In this embodiment of the application, by incorporating the list of extracted fault information into prompt words to guide the large language model, it is possible to prioritize the extraction of unrecorded fault types and supplement the recorded fault information, thereby improving the completeness of fault information coverage and consistency across text blocks.

[0011] In some embodiments, expanding each of the target structured objects into multiple structured objects with independent fault type fields includes: Add a hierarchy identifier to each expanded structured object; wherein the hierarchy identifier is used to indicate the hierarchy relationship between the expanded structured object and the target structured object; The generation of standard operating procedure documents includes: Based on the hierarchical identifier, structured objects with hierarchical relationships are used to generate document content in an associated form, which is then used as a component of the standard operating procedure document.

[0012] In this embodiment of the application, by adding hierarchical identifiers to the expanded structured objects and generating associated document content accordingly, the hierarchical relationship between nested fault structures can be preserved, thereby making the document hierarchy clear and improving readability and traceability.

[0013] In some embodiments, the method further includes: Identify conflicting structured objects in the list of structured objects or the list of flattened structured objects; wherein, the conflicting structured objects are multiple structured objects that have the same fault type field and whose other fields are inconsistent except for the fault type field; Based on a preset conflict handling strategy, conflict handling is performed on each of the conflicting structured objects to obtain an updated structured object; The conflict resolution strategy includes at least one of the following: Voting is conducted based on the number of times the conflict content of each conflict structured object appears in the document to be processed. The target update content is determined based on the voting results, and the conflict structured objects are merged and updated based on the target update content. The large language model is invoked to adjudicate the conflict content of each conflict structured object, the target update content is determined based on the adjudication result, and the conflict structured objects are merged and updated based on the target update content.

[0014] In this embodiment of the application, by identifying structured objects with the same fault type but inconsistent other fields, and by using occurrence count voting or large language model adjudication fusion update, the discrepancies in the extraction results across text blocks can be eliminated, thereby outputting structured information with consistent content and higher accuracy.

[0015] In some embodiments, the step of dividing the document to be processed into multiple text blocks includes: Identify the semantic boundaries of the document to be processed, and divide the document into blocks based on the semantic boundaries to obtain multiple text blocks; wherein, the semantic boundaries include at least one of paragraph boundaries, list item boundaries, and fault description start and end markers.

[0016] In this embodiment of the application, by identifying semantic boundaries such as paragraph boundaries, list item boundaries, and fault description start and end markers and dividing the text into blocks accordingly, it is possible to avoid cutting off from the middle of a single key piece of information, thereby ensuring the semantic integrity of the text block and further improving the accuracy of fault information extraction.

[0017] In some embodiments, identifying the semantic boundaries of the document to be processed and segmenting the document based on the semantic boundaries to obtain multiple text blocks includes: Identify the semantic boundaries of the document to be processed, and divide the document into blocks based on the semantic boundaries to obtain multiple initial text blocks; Calculate the semantic continuity index of any adjacent initial text blocks; wherein the semantic continuity index includes at least one of text vector similarity, topic continuity, and heading hierarchy structure; Two adjacent initial text blocks whose semantic continuity index exceeds a preset threshold are merged, and the merged text block and the unmerged initial text block are used as the plurality of text blocks.

[0018] In this embodiment, by calculating the semantic continuity index of adjacent initial text blocks and merging them when they exceed a preset threshold, it is possible to avoid the semantic continuity of text being split, thereby improving the semantic integrity of text blocks and controlling the number of blocks, while taking into account both extraction quality and processing efficiency.

[0019] Secondly, embodiments of this application provide a document processing apparatus based on a multi-stage large-model workflow, comprising: The text chunking module is used to divide the document to be processed into multiple text chunks. The information extraction module is used to repeatedly call the large language model to extract fault information from each text block and obtain a list of structured objects; wherein, the list of structured objects includes at least one structured object, and each structured object includes a fault type field and at least one of a fault cause field and a solution field; The nested expansion module is used to identify target structured objects in the structured object list that have nested fault type relationships, expand each target structured object into multiple structured objects with independent fault type fields, and fill in the preset field space for the expanded structured objects to obtain a flattened structured object list. The document generation module is used to repeatedly call the large language model to improve the content of each structured object in the flat structured object list, and generate a standard operation process document based on the improved flat structured object list.

[0020] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, can implement the method described in any embodiment of the first aspect.

[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the method described in any embodiment of the first aspect.

[0022] Fifthly, embodiments of this application provide a computer program product, the computer program product including a computer program, wherein when the computer program is executed by a processor, it can implement the method described in any embodiment of the first aspect. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart illustrating a document processing method based on a multi-stage large model workflow provided in this application embodiment; Figure 2 A schematic diagram of the structure of a document processing device based on a multi-stage large model workflow provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0026] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0027] It should be noted that existing standard operating procedure document generation solutions have the following main shortcomings: 1. The existing method of manually writing SOPs requires professional technicians to invest a lot of time reading and understanding the documents. With the rapid increase in the number of operation and maintenance documents, the manual method can no longer meet the needs of large-scale SOP generation. At the same time, different personnel have different understandings and descriptions of the same fault, resulting in inconsistent SOP formats and varying quality, making it difficult to ensure the standardization and consistency of standard operating procedures.

[0028] 2. Extraction methods based on keyword matching or regular expressions heavily rely on pre-set thesaurus and templates. These methods cannot effectively identify fault information with diverse expressions and strong contextual dependencies (such as implicit fault causes or indirectly described solutions), resulting in the omission or misjudgment of a large amount of key information. The recall and accuracy rates are difficult to meet practical requirements.

[0029] 3. Existing solutions that directly use large language models to extract SOPs from the entire long document in one go are limited by the context window length of the large model. The long document is truncated during the input stage, resulting in the loss of key information at the end. At the same time, single-round generation is difficult to accurately decompose complex nested fault structures (such as a fault scenario containing multiple sub-fault types), and the output format is unstable, often resulting in problems such as missing fields, chaotic type nesting, and JSON parsing failures. Subsequent manual proofreading and correction are required.

[0030] 4. Existing text segmentation methods use a fixed number of characters or sentences for segmentation, which easily cuts a complete fault description (including fault phenomena, cause analysis, and solution steps) in the middle, resulting in incomplete semantics in the segmented text. Subsequent processing modules cannot accurately extract complete fault elements based on fragmented information, causing information loss and extraction errors.

[0031] 5. Existing solutions lack dedicated format correction and deduplication mechanisms after information extraction. The extracted fault type JSON objects often have problems such as inconsistent structure, missing fields, and duplicate fault types. Direct output will lead to a messy SOP document structure and redundant content, which seriously affects readability and usability.

[0032] 6. Existing technologies mostly remain at the level of extracting structured information, failing to automatically convert the extracted JSON format fault information into a document format that conforms to human reading habits. Manual formatting and content polishing are still required, making it impossible to achieve full automation of the SOP generation process.

[0033] To address at least one of the problems existing in the prior art, this application provides a document processing method based on a multi-stage large model workflow. By decomposing the SOP extraction task of the document to be processed into four stages: block processing, fault information extraction, format correction, content improvement, and document generation, each stage assumes a single responsibility. The output of the previous stage serves as the input of the next stage. By refining and standardizing the output, the uncertainty of the large language model output is constrained within a controllable range, thereby effectively improving the standardization of fault information extraction and enhancing the convenience and reliability of generating standard operating procedure documents.

[0034] like Figure 1 As shown in the embodiments of this application, a document processing method based on a multi-stage large model workflow is provided, which may include the following steps: S1. Divide the document to be processed into blocks to obtain multiple text blocks.

[0035] It should be noted that chunking refers to dividing the document to be processed into multiple text chunks, so that the length of each text chunk can fit the context window of the large language model. This controls the amount of data processed at one time while ensuring that the information of the document to be processed enters the processing flow as a whole, avoiding information truncation caused by directly inputting the entire document into the large language model.

[0036] Specifically, it can identify semantic boundaries in the document to be processed and prioritize segmentation at semantic boundaries; it can also first determine the length of the document to be processed and the preset upper limit of the single block length, and then segment the document to be processed into multiple text blocks according to the upper limit of the length, and the resulting text blocks are used as input for subsequent fault information extraction.

[0037] S2. The large language model is called repeatedly to extract fault information from each text block to obtain a list of structured objects. The list of structured objects includes at least one structured object, and each structured object includes a fault type field and at least one of a fault cause field and a solution field.

[0038] It should be noted that repeatedly calling the large language model to extract fault information means inputting text blocks one by one into the large language model, which then identifies the fault information recorded in the text block and encapsulates the identified fault information into a structured object.

[0039] Specifically, first, the first text block is input into the large language model to obtain the extraction result returned by the large language model. This extraction result consists of one or more structured objects containing fault information, and these structured objects are added to the structured object list. Then, the same processing is performed on each subsequent text block in turn, looping until all text blocks have been processed. It should be understood that each structured object includes at least a fault type field, and at least one of a fault cause field and a solution field, where the fault type field records the name or category of the fault, the fault cause field records the cause of the fault, and the solution field records the method or steps used to resolve the fault.

[0040] For example, the structured object obtained from fault information extraction can also include a remarks field, that is, four fields in total: fault type, fault cause, solution, and remarks. When calling the large language model for fault information extraction, the prompt word engineering can force the large language model to output a structured object containing the above fields, so that the field structure of the extraction result is consistent. In addition, when parsing the output of the large language model, a parsing layer fallback mechanism can be set: when the output result is missing information of a certain field, a default value is filled for that field; when the character type of a field does not match the expected type, a forced type conversion is performed. This implementation can prevent parsing errors from causing the processing flow to be interrupted, ensuring the stable operation of the cyclic extraction process.

[0041] S3. Identify target structured objects in the structured object list that have nested fault type relationships, expand each target structured object into multiple structured objects with independent fault type fields, and fill in the preset field space for the expanded structured objects to obtain a flattened structured object list.

[0042] It should be noted that nested fault types refer to a situation where a structured object contains sub-structured objects with independent fault type fields. For example, a fault scenario object may contain multiple sub-fault type objects. Structured objects with nested fault types are identified as target structured objects. Pre-defined field spaces refer to the field locations reserved for structured objects for supplementing and improving data content in subsequent stages. For example, a structured object can be a JSON object.

[0043] Specifically, the list of structured objects is traversed to identify target structured objects with nested fault types; for each target structured object, its nested sub-structured objects are expanded into multiple structured objects with independent fault type fields; the expanded structured objects are then filled with pre-defined field spaces; after expansion and filling, a flattened list of structured objects is obtained, in which each structured object contains only one fault type.

[0044] For example, assuming there is a structured object in the structured object list with a fault type of "network fault," which contains two nested sub-fault types: "DNS resolution failure" and "link interruption," the structured object corresponding to the "network fault" fault type is identified as the target structured object. After expansion, three structured objects with independent fault type fields are obtained: "network fault," "DNS resolution failure," and "link interruption." Preset field spaces are then filled for each of these expanded structured objects. In one embodiment, the fields corresponding to the preset field spaces include fault level, processing priority, and associated systems, etc., used to reserve data space for the next stage of content completion.

[0045] In some embodiments, after the format correction step in step S3, the total number of structured objects in the flattened structured object list can be counted, and this total number can be used as a verification indicator for parsing completeness: the returned total number is compared with the expected number; if the total number reaches the expected number, the parsing is considered complete; if the total number is less than the expected number, it is determined that there are omissions in the extraction process, which can trigger the re-extraction of the corresponding text blocks, or generate prompt information for manual review. This implementation method, together with the parsing layer fallback mechanism in the extraction stage, constitutes a multi-layered protection, improving the stability of the process when faced with occasional output deviations from a large language model.

[0046] S4. The large language model is called repeatedly to improve the content of each structured object in the flat structured object list, and a standard operation process document is generated based on the improved flat structured object list.

[0047] It should be noted that content improvement refers to supplementing and optimizing the content of the structured objects initially extracted from the large language model. For example, specific content may be added to the reserved preset field space, as well as more detailed operation steps, precautions, and language expression, so that the fault information used in the end is more complete, accurate and readable.

[0048] Specifically, taking each structured object in the flattened structured object list as a unit, the structured object is input into the large language model one by one. The large language model then refines the content of the structured objects, and this process is repeated until all structured objects are refined. After all the content is refined, the flattened structured object list with refined content is organized into a standard operating procedure document that can be read and published according to a predetermined document format.

[0049] For example, the structured object "DNS resolution failed" is improved by adding operational steps such as "check local DNS server configuration," "verify resolution results using the nslookup command," and "contact network administrator if necessary" by invoking a large language model, and adding precautions such as "back up the original configuration before modifying the configuration." Subsequently, the improved structured objects are organized into a standard operating procedure document, which contains specific handling procedures for each type of failure. In one embodiment, the standard operating procedure document can be generated in Markdown format, including heading levels, tables, code blocks, and bolding emphasis.

[0050] In some embodiments, the content improvement and document generation in step S4 can be implemented using a loop process combined with a dual content pool approach: while looping through the large language model to improve the content of each structured object, the improvement result is appended to both the JSON content pool and the Markdown content pool after each structured object is improved; after the loop ends, a complete structured JSON file is output based on the JSON content pool, and a standard operating procedure document in Markdown format is output based on the Markdown content pool. The structured JSON file facilitates system integration and subsequent data analysis, while the standard operating procedure document in Markdown format is easy for human readers and direct publishing. This implementation simultaneously outputs both machine-readable and human-readable formats, achieving an end-to-end automated closed loop from raw text to usable SOPs.

[0051] This application embodiment extracts, formats, and improves structured information in stages by dividing the document to be processed into blocks and then repeatedly calling a large language model. This avoids the problems of long document truncation and structural instability in single-round extraction, thereby improving the standardization of fault information extraction and the convenience and reliability of generating readable standard operation process documents.

[0052] In some embodiments, the large language model is called repeatedly to extract fault information from each text block, resulting in a list of structured objects, including: Record and dynamically accumulate the list of extracted fault information in real time; When extracting the current text block, the extracted structured object is deduplicated based on the list of extracted fault information, and the deduplicated structured object is added to the structured object list.

[0053] It should be noted that the extracted fault information list refers to a data set formed by real-time recording and dynamic accumulation of extracted fault information. Its content may include the extracted fault types and corresponding structured object identifiers, etc.

[0054] Specifically, during the process of repeatedly calling the large language model to extract fault information, after each text block is extracted, the fault information corresponding to the structured object obtained from that text block is accumulated and recorded in the list of extracted fault information. After extracting the current text block and obtaining the current extracted structured object, the extracted structured object is deduplicated based on the list of extracted fault information. That is, it is determined whether the fault information of the current structured object has been recorded in the list; if it has been recorded, it is determined to be a duplicate, and the current structured object is deduplicated (for example, skipping the duplicate item); finally, the deduplicated structured object is added to the structured object list, and the processing of subsequent text blocks continues.

[0055] For example, suppose text block A extracts a structured object with the fault type "database connection timeout", and this fault information is recorded in the list of extracted fault information; text block B extracts another structured object with the same fault type "database connection timeout". After comparing it with the list of extracted fault information, it is determined that the structured object is a duplicate of the recorded fault, so it is deduplicated and will not be added to the structured object list again. For example, the duplicate item can be skipped directly, or information can be added to the extracted structured objects of the same fault type based on the currently extracted fault information, thereby avoiding the same fault type being extracted repeatedly in different text blocks and simplifying the content of the structured object list.

[0056] Based on this, by recording and dynamically accumulating the list of extracted fault information in real time and deduplicating the current extraction results, it is possible to avoid the same fault type being extracted repeatedly in different text blocks, thereby simplifying the structured object list, reducing subsequent redundant processing and information chaos.

[0057] In some embodiments, when extracting the current text block, deduplication is performed on the currently extracted structured object based on the list of extracted fault information, including: When extracting the current text block, the list of extracted fault information is incorporated into the prompt words of the large language model in this call, so as to guide the large language model to extract the fault types and their fault information that have not been included, and to supplement the fault information corresponding to the included fault types.

[0058] Specifically, when extracting information from the current text block, at least part of the content of the extracted fault information list is incorporated into the prompt word when constructing the prompt word for this call to the large language model. This allows the large language model to refer to the extracted fault information when extracting fault information from the current text block. By referencing the extracted fault information list, the large language model is guided to prioritize extracting fault types and their information that have not yet been included. For fault types already included in the structured object list, the large language model supplements the fault information corresponding to the extracted structured objects of the same fault type by combining the content of the current text block. For example, it supplements the content of missing fault cause fields or solution fields.

[0059] It should be noted that if the fault type of the current structured object has been recorded in the list, no new object will be added. Instead, the content extracted now will be merged with the corresponding structured object in the list by field (for example, after adding missing fault cause / solution fields, the content will be written back and updated).

[0060] For example, assuming the list of extracted fault information incorporated into the prompt includes two fault types: "database connection timeout" and "insufficient disk space", the prompt can be constructed as: "The following is a list of extracted fault types: database connection timeout, insufficient disk space; the corresponding solutions are strategy A and strategy B, respectively. Please extract the fault information from the current text block: for the extracted fault types, supplement their fault causes and solutions based on the currently extracted fault information; for the unextracted fault types, please extract their fault type, fault cause, and solution completely." Based on this, the extraction of duplicate fault information is suppressed in the model output stage, and the fault information of the recorded faults is supplemented across different text blocks, which improves the completeness and consistency of fault information coverage.

[0061] In some embodiments, each target structured object is expanded into multiple structured objects with independent fault type fields, including: Add hierarchy identifiers to each expanded structured object; the hierarchy identifiers are used to indicate the hierarchical relationship between the expanded structured object and the target structured object; Generate standard operating procedure documentation, including: Based on hierarchical identifiers, structured objects with hierarchical relationships are used to generate document content in an associated format, which is then used as part of the standard operating procedure document.

[0062] It should be noted that a hierarchy identifier is a data identifier used to indicate the hierarchical relationship between the expanded structured object and the target structured object to which the expanded structured object belonged, such as a parent-child relationship identifier or a hierarchy depth identifier.

[0063] Specifically, when expanding each target structured object, a hierarchy identifier is added to each expanded structured object to indicate the hierarchical relationship between the expanded structured object and the target structured object; when generating the standard operating procedure document, based on the hierarchy identifier of each structured object, document content in an associated form is generated for structured objects with hierarchical relationships, and this part of the document content is used as a component of the standard operating procedure document.

[0064] For example, assuming "network failure" is the target structured object, it can be expanded to obtain two structured objects: "DNS resolution failure" and "link interruption". Hierarchical identifiers (such as parent identifiers or hierarchy depth indicators) pointing to "network failure" are added to the latter two respectively. When generating standard operating procedure documents, "DNS resolution failure" and "link interruption" are presented as sub-entries or subordinate chapters of "network failure" according to the hierarchical identifiers, so that the document retains the hierarchical structure information between failure types and improves the document's hierarchical clarity and information traceability.

[0065] In some embodiments, the method further includes: Identify conflicting structured objects in a list of structured objects or a list of flattened structured objects; where conflicting structured objects are multiple structured objects that have the same fault type field but inconsistent fields other than the fault type field. Based on the preset conflict handling strategy, conflict handling is performed on each conflicting structured object to obtain the updated structured object; The conflict resolution strategies include at least one of the following: Voting is conducted based on the number of times the conflict content of each conflict structured object appears in the document to be processed. The target update content is determined based on the voting results, and the conflict structured objects are merged and updated based on the target update content. The large language model is invoked to adjudicate the conflict content of each conflict structured object. Based on the adjudication result, the target update content is determined, and the conflict structured objects are merged and updated based on the target update content.

[0066] It should be noted that conflicting structured objects refer to multiple structured objects that have the same fault type field but differ in other fields besides the fault type field. In other words, under the same fault type, structured objects extracted from different text blocks or different sources have discrepancies in the content of fields such as fault cause and solution.

[0067] Specifically, after obtaining a list of structured objects or a flattened list of structured objects, multiple structured objects with the same fault type field but inconsistent other fields are identified as conflicting structured objects; conflict processing is performed on each conflicting structured object based on a preset conflict processing strategy to obtain updated structured objects.

[0068] Conflict handling strategies include at least the following two: 1. Voting based on the frequency of occurrence of conflict content of each conflict structured object in the document to be processed, determining the conflict content with the most occurrences as the target update content, and then merging and updating each conflict structured object based on the target update content; 2. Calling a large language model to adjudicate the conflict content of each conflict structured object, determining the adjudication result as the target update content, and then merging and updating each conflict structured object based on the target update content.

[0069] For example, the structured object extracted from text block A contains the fault information "database connection failed, fault reason field is connection exhaustion", and the structured object extracted from text block B contains the fault information "database connection failed, fault reason field is password expired". Both of them have the fault type field "database connection failed", but the specific content of the fault reason field is different. Therefore, these two structured objects are identified as conflicting structured objects.

[0070] To address this, a voting strategy can be employed, counting the occurrences of "connection exhaustion" and "password expired" in the documents to be processed. Content appearing more frequently is identified as the target update content, and the two conflicting structured objects are merged and updated into a single structured object where the fault cause field is the most frequently occurring content. Alternatively, a decision-making strategy can be used, inputting the conflicting content of the two structured objects into a large language model. The large language model, combined with the document context, determines the more reasonable fault cause and completes the merged update accordingly.

[0071] Based on this, by identifying structured objects with the same fault type but inconsistent other fields, and by using occurrence-based voting or large language model adjudication to merge and update, the discrepancies in the extraction results across text blocks can be eliminated, thereby outputting structured information with consistent content and higher accuracy.

[0072] In some embodiments, the document to be processed is divided into blocks to obtain multiple text blocks, including: Identify the semantic boundaries of the document to be processed, and divide the document into blocks based on the semantic boundaries to obtain multiple text blocks; wherein, the semantic boundaries include at least one of paragraph boundaries, list item boundaries, and fault description start and end markers.

[0073] It should be noted that semantic boundaries refer to natural separation positions in a document that maintain semantic integrity, including at least one of paragraph boundaries, list item boundaries, and fault description start and end markers. Specifically, a paragraph boundary is the end of a natural paragraph; a list item boundary is the separation position between list items; and a fault description start and end marker is the marker that marks the beginning or end of a fault description paragraph (e.g., the boundary of a fault description unit that uses "fault phenomenon," "fault cause," and "solution" as start and end identifiers).

[0074] Specifically, before segmenting, the semantic boundaries in the document to be processed are identified, and segmentation is performed preferentially at semantically complete locations based on these semantic boundaries, avoiding cutting the text in the middle of a single key piece of information (such as a complete fault description).

[0075] For example, the document to be processed contains the content "Fault phenomenon: Database connection failed; Fault cause: Connection count exhausted; Solution: Adjust the maximum number of connections". This fault description begins with "Fault phenomenon" and ends with "Solution", and its start and end marks are complete. When segmenting, this segment is identified as a semantically complete text block and is not cut in the middle, thereby avoiding semantic fragmentation caused by the "Solution" and other content being split into adjacent text blocks.

[0076] Based on this, by identifying semantic boundaries such as paragraph boundaries, list item boundaries, and fault description start and end markers, and dividing the text into blocks accordingly, it is possible to avoid cutting off from the middle of a single key piece of information, thereby ensuring the semantic integrity of the text block and further improving the accuracy of fault information extraction.

[0077] In some embodiments, the semantic boundaries of the document to be processed are identified, and the document to be processed is segmented based on the semantic boundaries to obtain multiple text blocks, including: Identify the semantic boundaries of the document to be processed, and divide the document into blocks based on the semantic boundaries to obtain multiple initial text blocks; Calculate the semantic continuity index of any adjacent initial text blocks; wherein the semantic continuity index includes at least one of text vector similarity, topic continuity and heading hierarchy structure; Two adjacent initial text blocks whose semantic continuity index exceeds a preset threshold are merged, and the merged text block and the unmerged initial text block are treated as multiple text blocks.

[0078] It should be noted that the initial text block refers to the text block obtained by first segmenting the document to be processed based on semantic boundaries. Semantic continuity metrics are indicators used to measure the semantic coherence of adjacent text blocks, including at least one of text vector similarity, topic continuity, and heading hierarchy structure, or a combination of these metrics. Specifically, text vector similarity is the similarity between adjacent text block vectors after converting text blocks into vectors; topic continuity is the coherence of adjacent text blocks in terms of topic word distribution; and heading hierarchy structure is the hierarchical relationship of the chapter titles to which the text blocks belong.

[0079] Specifically, the semantic boundaries of the document to be processed are first identified, and multiple initial text blocks are obtained by dividing the document into blocks based on the semantic boundaries; the semantic continuity index of any two adjacent initial text blocks is calculated; adjacent initial text blocks whose semantic continuity index exceeds a preset threshold are merged; and the merged text blocks and the unmerged initial text blocks are used together as multiple text blocks for subsequent steps.

[0080] For example, suppose two adjacent initial text blocks belong to adjacent content under the same subsection title "Network Fault Handling", and the text vector similarity between the two text blocks exceeds a preset threshold (e.g., 0.8). Then, the two initial text blocks are merged into one text block before entering the fault information extraction stage, so as to avoid information belonging to the same fault being split and processed, resulting in information fragmentation.

[0081] Based on this, by calculating the semantic continuity index of adjacent initial text blocks and merging them when they exceed a preset threshold, it is possible to avoid the fragmentation of semantically continuous text, thereby improving the semantic integrity of text blocks and controlling the number of blocks, thus balancing extraction quality and processing efficiency.

[0082] In some embodiments, the process of segmenting the document to be processed may also include dynamic control of the number of segments: after segmenting the document to be processed, the number of text segments is counted and compared with the preset upper limit of platform nodes. When the number of text segments exceeds the upper limit of platform nodes, the number of text segments is reduced by increasing the length of a single segment, merging adjacent text segments, adjusting the merging threshold of the semantic continuity index, etc., so that the number of segments does not exceed the upper limit of platform nodes (e.g., the upper limit of platform nodes is 1000), thereby optimizing processing efficiency while ensuring the integrity of fault information retrieval.

[0083] Compared with the prior art, the embodiments of this application have the following beneficial effects: 1. By segmenting long documents into blocks and cutting them at semantically complete locations, and merging semantically continuous text blocks when necessary, key information is prevented from being truncated or fragmented, thus improving the recall rate and completeness of fault information.

[0084] 2. By decomposing the extraction task into a phased controlled pipeline, and expanding and standardizing the structured objects and padding the field spaces after extraction, the output structure is standardized and uniform, improving the stability of the format.

[0085] 3. Through iterative content improvement and document generation, end-to-end automated generation of standard operating procedure documents, from raw text to ready-to-use documents, has been achieved.

[0086] 4. By using mechanisms such as parsing layer fallback, quantity verification, deduplication, and conflict handling, the probability of process interruption is reduced, and the consistency and conciseness of the output content are improved.

[0087] Please refer to Figure 2 , Figure 2 The diagram illustrates a block diagram of a document processing apparatus based on a multi-stage large model workflow, provided by some embodiments of this application. It should be understood that this document processing apparatus based on a multi-stage large model workflow is similar to the one described above. Figure 1 Corresponding to the method embodiments, it is able to execute the various steps involved in the above method embodiments. The specific functions of the document processing device based on the multi-stage large model workflow can be found in the description above. To avoid repetition, detailed descriptions are appropriately omitted here.

[0088] Figure 2The document processing apparatus based on a multi-stage large model workflow includes at least one software functional module that can be stored in memory or embedded in the document processing apparatus in the form of software or firmware. The document processing apparatus based on a multi-stage large model workflow includes: The text segmentation module 210 is used to segment the document to be processed into multiple text blocks. The information extraction module 220 is used to repeatedly call the large language model to extract fault information from each text block and obtain a list of structured objects. The list of structured objects includes at least one structured object, and each structured object includes a fault type field and at least one of a fault cause field and a solution field. The nested expansion module 230 is used to identify target structured objects in the structured object list that have nested fault type relationships, expand each target structured object into multiple structured objects with independent fault type fields, and fill in the preset field space for the expanded structured objects to obtain a flattened structured object list. The document generation module 240 is used to repeatedly call the large language model to improve the content of each structured object in the flat structured object list, and generate a standard operation process document based on the improved flat structured object list.

[0089] It is understood that the above-described device embodiments correspond to the method embodiments of this application. The document processing device based on a multi-stage large model workflow provided by the embodiments of this application can implement the document processing method based on a multi-stage large model workflow provided by any one of the method embodiments of this application.

[0090] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the aforementioned method, and will not be elaborated further here.

[0091] like Figure 3 As shown, some embodiments of this application provide an electronic device 300, which includes: a memory 310, a processor 320, and a computer program stored on the memory 310 and executable on the processor 320. When the processor 320 reads the program from the memory 310 via a bus 330 and executes the program, it can implement any of the methods included in the above-described document processing method based on a multi-stage large model workflow.

[0092] Processor 320 can process digital signals and may include various computing architectures. For example, it may be a complex instruction set computer architecture, a reduced instruction set computer architecture, or an architecture that implements multiple instruction set combinations. In some examples, processor 320 may be a microprocessor.

[0093] The memory 310 can be used to store instructions executed by the processor 320 or data related to the execution of instructions. These instructions and / or data may include code used to implement some or all of the functions of one or more modules described in the embodiments of this application. The processor 320 of the embodiments of this application can be used to execute the instructions in the memory 310 to implement the methods shown above. The memory 310 includes dynamic random access memory, static random access memory, flash memory, optical memory, or other memories well known to those skilled in the art.

[0094] Some embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, describes the method described in the method embodiments.

[0095] Some embodiments of this application also provide a computer program product that, when run on a computer, causes the computer to perform the methods described in the method embodiments.

[0096] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0097] It should be understood, in the several embodiments provided in this application, that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0098] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0099] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0100] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0101] 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.

[0102] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A document processing method based on a multi-stage large-scale workflow, characterized in that, include: The document to be processed is divided into blocks to obtain multiple text blocks; The large language model is called repeatedly to extract fault information from each text block to obtain a list of structured objects; wherein, the list of structured objects includes at least one structured object, and each structured object includes a fault type field and at least one of a fault cause field and a solution field; Identify target structured objects in the structured object list that have nested fault types, expand each target structured object into multiple structured objects with independent fault type fields, and fill in the preset field space for the expanded structured objects to obtain a flattened structured object list. The large language model is called repeatedly to improve the content of each structured object in the flat structured object list, and a standard operation process document is generated based on the improved flat structured object list.

2. The method according to claim 1, characterized in that, The loop calls the large language model to extract fault information from each text block, resulting in a list of structured objects, including: Record and dynamically accumulate the list of extracted fault information in real time; When extracting the current text block, the extracted structured object is deduplicated based on the list of extracted fault information, and the deduplicated structured object is added to the list of structured objects.

3. The method according to claim 2, characterized in that, The step of deduplicating the extracted structured object based on the already extracted fault information list during the extraction of the current text block includes: When extracting the current text block, the list of extracted fault information is incorporated into the prompt words of the large language model in this call, so as to guide the large language model to extract the fault types and their fault information that have not been included, and to supplement the fault information corresponding to the included fault types.

4. The method according to claim 1, characterized in that, The expansion of each target structured object into multiple structured objects with independent fault type fields includes: Add a hierarchy identifier to each expanded structured object; wherein the hierarchy identifier is used to indicate the hierarchy relationship between the expanded structured object and the target structured object; The generation of standard operating procedure documents includes: Based on the hierarchical identifier, structured objects with hierarchical relationships are used to generate document content in an associated form, which is then used as a component of the standard operating procedure document.

5. The method according to claim 1, characterized in that, The method further includes: Identify conflicting structured objects in the list of structured objects or the list of flattened structured objects; wherein, the conflicting structured objects are multiple structured objects that have the same fault type field and whose other fields are inconsistent except for the fault type field; Based on a preset conflict handling strategy, conflict handling is performed on each of the conflicting structured objects to obtain an updated structured object; The conflict resolution strategy includes at least one of the following: Voting is conducted based on the number of times the conflict content of each conflict structured object appears in the document to be processed. The target update content is determined based on the voting results, and the conflict structured objects are merged and updated based on the target update content. The large language model is invoked to adjudicate the conflict content of each conflict structured object, the target update content is determined based on the adjudication result, and the conflict structured objects are merged and updated based on the target update content.

6. The method according to claim 1, characterized in that, The document to be processed is divided into blocks to obtain multiple text blocks, including: Identify the semantic boundaries of the document to be processed, and perform block processing on the document to be processed based on the semantic boundaries to obtain multiple text blocks; wherein, the semantic boundaries include at least one of paragraph boundaries, list item boundaries, and fault description start and end markers.

7. The method according to claim 6, characterized in that, The process involves identifying the semantic boundaries of the document to be processed, and then segmenting the document into multiple text blocks based on these semantic boundaries, including: Identify the semantic boundaries of the document to be processed, and divide the document into blocks based on the semantic boundaries to obtain multiple initial text blocks; Calculate the semantic continuity index of any adjacent initial text blocks; wherein the semantic continuity index includes at least one of text vector similarity, topic continuity and heading hierarchy structure; Two adjacent initial text blocks whose semantic continuity index exceeds a preset threshold are merged, and the merged text block and the unmerged initial text block are used as the plurality of text blocks.

8. A document processing device based on a multi-stage large-scale workflow, characterized in that, include: The text chunking module is used to divide the document to be processed into multiple text chunks. The information extraction module is used to repeatedly call the large language model to extract fault information from each text block and obtain a list of structured objects; wherein, the list of structured objects includes at least one structured object, and each structured object includes a fault type field and at least one of a fault cause field and a solution field; The nested expansion module is used to identify target structured objects in the structured object list that have nested fault type relationships, expand each target structured object into multiple structured objects with independent fault type fields, and fill in the preset field space for the expanded structured objects to obtain a flattened structured object list. The document generation module is used to repeatedly call the large language model to improve the content of each structured object in the flat structured object list, and generate a standard operation process document based on the improved flat structured object list.

9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, can implement the method of any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the method as described in any one of claims 1-7.