A multi-format document parsing and verifying method, system and program product

By employing a multi-format document parsing and verification method, utilizing Markdown-formatted intermediate documents and a large language model, combined with directed acyclic graphs and hybrid strategies, the problem of low efficiency and false positives/false negatives in report review is solved, achieving efficient and accurate multi-format document review.

CN121859835BActive Publication Date: 2026-07-21HUA DATA TECH (SHANGHAI) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUA DATA TECH (SHANGHAI) CO LTD
Filing Date
2026-03-16
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies rely on human experts or a single text extraction engine for report review, resulting in low efficiency, inconsistent standards, high omission rates, difficulty in handling cross-domain content and complex logical structures in multi-format documents, and a single review engine is unable to handle the false detection and missed detection problems of multimodal information.

Method used

A multi-format document parsing and verification method is adopted. By converting documents into a unified Markdown format intermediate document, and using an indicator extraction layer based on an abstract base class and a large language model, combined with directed acyclic graphs and hybrid strategy verification logic, the automatic review of multi-format documents is achieved.

Benefits of technology

It significantly improves the efficiency and accuracy of reviewing complex reports, maintains the integrity of the document's logical structure, reduces false positives and false negatives, supports rapid rule configuration and expansion, and improves the usability and traceability of review conclusions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121859835B_ABST
    Figure CN121859835B_ABST
Patent Text Reader

Abstract

The application provides a multi-format document parsing and verification method, system and program product, and relates to the technical field of document processing and intelligent verification. The method adopts a layered modular architecture, including: a document parsing layer selects a parsing strategy according to the document type and complexity, and uniformly converts multiple format documents such as PDF, Word and Excel into a Markdown intermediate format; an index extraction layer extracts structured data from the intermediate document and integrates it into a unified JSON format using an abstract base class and a dynamic Prompt optimization mechanism, realizing complete decoupling of data extraction and rule verification; and a rule verification layer dynamically loads business rules by scanning independent files, constructs a rule-dependent directed acyclic graph, and determines the execution order using topological sorting. The application effectively solves the problems of high data and rule coupling, high maintenance cost and poor expandability in existing systems, realizes the hot plug, automatic management of dependencies and multi-document concurrent processing of rules, and significantly improves the reusability and execution efficiency of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of document processing and intelligent verification technology, and in particular to a method, system and program product for parsing and verifying multi-format documents. Background Technology

[0002] As an important carrier for information collection, analysis and presentation, the accuracy, completeness and compliance of reports directly affect the effectiveness of decision-making and supervision; in scenarios such as scientific research results and enterprise operation analysis, report review is a key link to ensure the quality of content.

[0003] Existing report review technologies typically rely on human experts, single text extraction, or a single review engine. For human expert review, under conditions of massive reports, cross-domain content, or complex logical structures, human review is prone to problems such as low efficiency, inconsistent interpretation, and increased omission rate.

[0004] Secondly, actual reports often exist in multiple formats such as Word, PDF, and WPS, and the content often contains multimodal information such as text, tables, images, and formulas. The reports vary significantly in terms of layout structure, scanning quality, chart clarity, and irregular elements such as seals / signatures. This makes it easy to make false detections and missed detections when relying on a single text extraction or a single review engine, in the stages of "field location and extraction", "cross-regional semantic association", and "joint review of text-image consistency / compliance".

[0005] Therefore, we propose a method, system, and program product for parsing and verifying multi-format documents; the information disclosed in the background section is only for enhancing the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this invention is to address the shortcomings of existing technologies by providing a method, system, and program product for parsing and verifying multi-format documents, thereby resolving the technical problems mentioned in the background section.

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] A method for parsing and validating multi-format documents includes the following steps:

[0009] Step S1: Receive input documents in multiple formats, select a parsing strategy based on document type and complexity, and convert the input documents into a unified Markdown format intermediate document;

[0010] Step S2: Call the indicator extraction layer based on the abstract base class to process the Markdown format intermediate document, convert the generated intermediate representation into structured data, and integrate the structured information of all input documents into a unified JSON format data structure;

[0011] Step S3: Scan the independent rule files to dynamically load business rules, construct a directed acyclic graph based on rule dependency information, and determine the rule execution order through topology sorting;

[0012] Step S4: Execute the verification logic of the business rules based on the JSON format data structure according to the execution order, and detect rule conflicts during the execution process;

[0013] Step S5: Summarize the verification results and conflict detection results of all business rules, and generate a verification report that includes verification conclusions and explanations of reasons.

[0014] The specific parsing strategy selected in step S1 is as follows: for Word and Excel documents, the text and table structure are extracted using a standard library; for PDF documents, if it is a simple structured document, the text is extracted directly; if it is a scanned document or a complex document, the traditional Pipeline parsing including layout detection and OCR is performed or the visual language model is called for parsing.

[0015] The traditional Pipeline parsing process sequentially performs layout detection, mathematical formula localization, optical character recognition, and table parsing, and then reassembles the results of each step into Markdown format.

[0016] In step S2, the abstract base class defines the construct method and the extract method; the construct method is used to generate regular expression matching results or large language model Prompt, and the extract method is used to convert the generated intermediate representation into structured JSON data.

[0017] When a large language model is invoked, a dynamic Prompt generation mechanism is executed: document features are analyzed to dynamically select extracted fields, Few-shot examples are matched according to document type, cross-document context is injected, and the Prompt format is automatically iteratively optimized based on the model response.

[0018] The Prompt is iteratively updated by quantitatively evaluating the model output results through the extraction of quality evaluation scores; the specific calculation formula for the quality evaluation scores is as follows:

[0019] ;

[0020] Furthermore, the formula for iteratively updating the Prompt based on the extracted quality evaluation score is as follows:

[0021] ;

[0022] in, This indicates the extraction of quality evaluation scores. This indicates the accuracy of the structured output format. This indicates the score for logical consistency between fields. Indicates the coverage of the target field; Preset weighting coefficients; To update the step size, The prompt word indicating the t-th iteration. The prompt word indicates the (t+1)th iteration. This indicates the gradient of the extracted rating with respect to the cue words.

[0023] The steps in S3 for constructing the directed acyclic graph and determining the execution order include: extracting rule dependency metadata to construct an adjacency list, using depth-first search to detect cyclic dependencies, generating an execution sequence through topological sorting, and identifying rule groups without dependencies for parallel labeling.

[0024] In step S4, the verification logic employs a hybrid strategy: logical calculation is used to verify numerical calculation rules, while a large language model is invoked to verify semantic consistency rules. The system calculates a unified verification score that integrates the numerical verification and semantic judgment results. When the unified verification score is greater than a preset verification pass threshold T2, the rule is deemed to have passed verification. The specific formula for calculating the unified verification score is as follows:

[0025] ;

[0026] in, This indicates a unified verification score. The score is obtained by verifying the logical calculation; This indicates that a large language model generates semantic vectors. Represents a regular semantic vector. This represents the function for calculating cosine similarity. It sets the preset weight coefficients; and when executed, it passes the verification results of the preceding rules to the current rule.

[0027] The rule conflict detection in step S4 includes identifying logical conflicts, data conflicts, and priority conflicts; for conflicts, they are automatically resolved according to preset priority or timestamp strategies, or marked for manual review.

[0028] A multi-format document parsing and verification system, comprising:

[0029] The document parsing module is configured to receive input documents in various formats, select a parsing strategy based on the document type and complexity, and convert the input documents into a unified Markdown format intermediate document.

[0030] The indicator extraction module is configured to call the indicator extraction layer based on the abstract base class to process the Markdown format intermediate document, convert the generated intermediate representation into structured data, and integrate the structured information of all input documents into a unified JSON format data structure.

[0031] The rules management module is configured to scan independent rule files to dynamically load business rules, construct a directed acyclic graph based on rule dependency information, and determine the rule execution order through topological sorting.

[0032] The verification execution module is configured to execute the verification logic of the business rules based on the JSON format data structure according to the execution order, and to detect rule conflicts during the execution process;

[0033] The results summary module is configured to summarize the verification results and conflict detection results of all business rules and generate a verification report that includes verification conclusions and explanations of the reasons.

[0034] A computer program product includes computer program code, which, when run on a computer, enables the computer to implement the aforementioned method for parsing and verifying multi-format documents.

[0035] The beneficial effects of this invention are as follows:

[0036] This invention achieves automated review of complex reports by jointly parsing page layout models, OCR models, and multimodal large models, combined with the collaborative processing of regular expressions, object recognition models, and large models. This overcomes the low efficiency of manual review and the limitations of single models, significantly expanding the scope of review and improving the review effectiveness of complex reports. Through precise differentiation and partitioning of table areas, image areas, formula areas, and text areas, and by reorganizing the parsing results according to the layout order, it effectively maintains the integrity of the document's logical structure, reduces parsing errors caused by complex layouts, and provides stable input for subsequent field extraction and rule review.

[0037] This invention abandons traditional static rule extraction in the structured indicator extraction stage, innovatively introducing a dynamic prompt generation and iteration mechanism based on an abstract base class. By combining document features and few-shot examples to construct prompt words, and introducing a quantitative extraction scoring model that includes format correctness, logical consistency, and field coverage, it achieves gradient feedback and automatic iteration on the output of the large model. This enables the system to adaptively optimize data extraction quality without manual intervention, significantly improving the accuracy and robustness of converting unstructured text to a unified JSON format. Simultaneously, in the rule verification stage, it utilizes a directed acyclic graph (DAG) to achieve deadlock detection and concurrent scheduling, and innovatively integrates logical calculation scoring and semantic vector cosine similarity to construct a unified verification scoring system, effectively addressing the blind spots of traditional rule engines in complex semantic judgment.

[0038] This invention designs the rule base as a structure of "rule content + implementation method" and automatically maps it to different engines such as code logic, large language models or multimodal models for execution based on field type and logical complexity. It also supports storage in structured forms such as JSON / XML, making the rules configurable, scalable and reusable, significantly reducing the cost of cross-scenario adaptation and maintenance. The review results of each rule (pass / warning / error and reason) are summarized and integrated to form a final review report, which facilitates problem location and review and improves the usability and traceability of the review conclusions. Attached Figure Description

[0039] Figure 1 This is a schematic diagram of the multi-format document parsing and verification method of the present invention;

[0040] Figure 2 This is a schematic diagram of the framework of a multi-format document parsing and verification system according to the present invention. Detailed Implementation

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

[0042] Example 1: As Figure 1 As shown, this embodiment provides a method for parsing and verifying multi-format documents, specifically including the following steps:

[0043] S1. Document Parsing and Standardization: This step aims to convert multi-format input documents into a standardized intermediate format, specifically including the following sub-steps:

[0044] S110. The document type and complexity recognition system receives input documents and reads the file extension and header information to identify the document type. For PDF type input documents, it further analyzes their internal structure (such as whether they contain text layers, image resolution, and layout complexity) and classifies them as "simple structured PDF" or "complex / scanned PDF".

[0045] S120, Lightweight Parsing of Simple Documents: For input documents identified as Word, Excel, or simple structured PDFs, a lightweight parsing library is used for processing. Specifically, python-docx is used to extract paragraphs and tables from Word documents, pandas is used to extract sheet data from Excel documents, pdfplumber is used to extract text layer data from simple PDFs, and the extracted content is directly converted into Markdown format intermediate documents;

[0046] S130, Deep Intelligent Parsing of Complex Documents: For input documents identified as complex or scanned PDFs, the parsing path is selected according to the preset configuration: Path 1 executes the traditional Pipeline method, performing four independent steps in sequence: layout detection, mathematical formula localization, optical character recognition (OCR), and table parsing; Path 2 calls the Visual Language Model (VLM) to perform end-to-end semantic understanding of the document pages. Regardless of the path used, the recognition results are ultimately reconstructed into a Markdown format intermediate document.

[0047] S140: Generate a unified intermediate document. Standardize and clean all the parsing results output from S120 and S130 to ensure that all input documents (regardless of their original format) are eventually converted into Markdown format intermediate documents with a unified heading level, list structure, and table format, serving as the sole input source for subsequent processing.

[0048] Furthermore, to improve the stability and repeatability of document parsing path selection, a document complexity quantification model is introduced in step S110. The document parsing module calculates the document complexity score based on page structure features:

[0049] ;

[0050] in, This indicates the document complexity score. Indicates the number of image regions. Indicates the number of table regions. Indicates the page density parameter. This represents the probability value of the scanned item; The system will calculate the preset weighting coefficients. Compared with the preset document complexity threshold T1, when If T1 is greater than or equal to 1, the deep intelligent parsing path described in S130 is automatically selected; otherwise, the lightweight parsing path described in S120 is executed. By introducing the above-mentioned quantitative calculation, the parsing strategy selection is transformed from an experience-based judgment into a computable decision-making process, thereby improving the consistency and automation of complex document processing.

[0051] S2. Structured Metric Extraction: This step aims to extract and structure business data from intermediate documents, specifically including the following sub-steps:

[0052] S210. Initializing the Extractor and Intermediate Representation: Based on the abstract base class `BaseExtractor`, specific extractor instances are initialized according to the business type. The `construct()` method of the extractor is called to process the Markdown format intermediate document: for non-Large Language Model (LLM) scenarios, regular expressions or anchors are generated; for Large Language Model (LLM) scenarios, a Prompt (hint word) for model invocation is constructed.

[0053] S220, Dynamic Prompt Optimization (for LLM scenarios): When constructing the Prompt, a dynamic optimization mechanism is executed: First, the characteristics of the Markdown format intermediate document (such as the number of tables and text length) are analyzed; second, the fields to be extracted are dynamically selected based on the characteristics; third, Few-shot examples are matched and inserted based on the document type; finally, historical data across documents is injected to enhance the context.

[0054] S230. Execute extraction and intermediate result acquisition. Extraction logic: For non-LLM scenarios, directly apply regular expression matching to acquire data; for LLM scenarios, send the optimized Prompt generated in S220 to the large language model and receive the text response returned by the model. If the LLM response has a format error, automatically trigger the iterative optimization mechanism to retry, ultimately obtaining intermediate representation data.

[0055] S240: Generate a unified JSON format data structure by calling the extractor's extract() method, which converts the intermediate representation data obtained in S230 into a structured data object that conforms to the business definition. The system iterates through all input documents, merges and cleans the extraction results of each document, and finally generates a unified JSON format data structure containing all key information.

[0056] Furthermore, in the dynamic Prompt optimization process of step S220, an extraction quality evaluation function is introduced to quantitatively evaluate the model output results. The extraction score is calculated as follows:

[0057] ;

[0058] in, This indicates the accuracy of the structured output format; Consistency represents the score for logical consistency between fields. This represents the target field coverage rate, where W1, W2, and W3 are preset weight coefficients. This indicates that a quality evaluation score is extracted; the system iteratively updates the Prompt based on the score results.

[0059] ;

[0060] in, To update the step size, The prompt word indicating the t-th iteration. The prompt word indicates the (t+1)th iteration. This indicates the gradient (or amount of change) of the extracted rating with respect to the cue words.

[0061] Through the above optimization mechanism, the Prompt generation process has quantifiable optimization goals, which can continuously improve the extraction accuracy and stability, thereby improving the quality of structured data generation.

[0062] S3. Dynamic Rule Loading and Dependency Building: This step aims to establish the logical order of rule execution, and specifically includes the following sub-steps:

[0063] S310, Rule File Scanning and Dynamic Loading: When the system starts or refreshes, it uses RuleLoader to scan the independent rule files (rule_*.py) in the specified directory. It then dynamically loads all rule classes that implement the unified check() interface using reflection, reads rule metadata (including rule ID, description, and dependencies), and enables hot-plugging of rules.

[0064] S320. Constructing a Directed Acyclic Graph (DAG) for Rule Dependencies: Parse the rule dependencies (dependencies field) obtained in S310, and construct a rule dependency graph with rules as nodes and dependencies as edges. The system uses an adjacency list data structure to store this graph, establishing the logical reference relationships between rules.

[0065] S330. Circular Dependency Detection and Verification: A depth-first search (DFS) algorithm is performed on the constructed rule dependency graph to detect the existence of reverse edges. If a closed-loop path (i.e., a circular dependency) is found, an exception is immediately thrown and the loading process is terminated to prevent runtime deadlock; if no closed loop is found, the dependency relationship is confirmed to be valid.

[0066] S340. Topological Sorting and Execution Sequence Generation: The valid rule dependency graph is topologically sorted to generate a linear rule execution sequence, ensuring that all dependent rules (parent nodes) are executed before the rules that depend on them (child nodes). Simultaneously, rule groups with an in-degree of 0 or no paths between them are identified and marked as parallel execution groups to optimize subsequent execution efficiency.

[0067] Furthermore, in step S320, the rule dependencies are formalized into a directed graph model:

[0068] ;

[0069] ;

[0070] Where V represents the set of rules and E represents the set of dependencies. and This represents a specific business rule node in the rule set V. The system calculates the in-degree (v) of a node based on a graph structure and identifies the set of rules that can be executed in parallel based on the following conditions:

[0071] ;

[0072] Subsequently, the topological sorting function TopoSort(G) is executed on graph G to generate an execution sequence. By transforming the rule relationships into a graph computation model, the rule loading and execution order has a clear mathematical expression, improving the technical determinism and scalability of the rule management module.

[0073] S4. Rule Validation and Conflict Detection This step aims to perform validation logic and ensure result consistency, specifically including the following sub-steps:

[0074] S410, the hybrid strategy verification execution traverses the rules according to the execution sequence generated in S340. For simple rules of numerical or logical type, code logic (such as regular expressions and equation calculations) is used for verification; for complex rules of semantic type, a large language model is called for semantic judgment. During execution, the verification results of previous rules are passed to the current rule through the dependency_results parameter;

[0075] S420. Real-time rule conflict detection: Immediately after the rule execution is completed, multi-dimensional conflict detection is performed on the verification results. Detection types include: logical conflict (different rules reach opposite conclusions on the same indicator), data conflict (different rules have inconsistent requirements for the same data item), and priority conflict (rules with the same priority have mutually exclusive results).

[0076] S430 Automatic Conflict Resolution and Marking: For conflicts detected by S420, the system handles them according to a preset strategy: if a high-priority rule exists, the high-priority result is automatically adopted; if automatic decision-making is not possible (e.g., the timestamp strategy fails), the conflict status is marked as "pending manual review," and the rule ID and specific description involved in the conflict are recorded.

[0077] S440. Generate the validation conclusion for each rule. Combine the execution results and conflict resolution results of the combined rules to generate the final status object for each rule. This object contains: validation conclusion (Pass / Fail / Review), detailed explanation of the reasons, execution timestamp, and relevant conflict information.

[0078] Furthermore, in the hybrid strategy verification process of step S410, a unified verification scoring function is introduced to integrate the numerical verification results with the semantic judgment results:

[0079] ;

[0080] in This indicates a unified verification score. The score is obtained from logical calculations or equation verification. The semantic consistency score is calculated as follows:

[0081] ;

[0082] in The model generates semantic vectors. Represents the semantic vector of the rule. , These are preset weighting coefficients. This represents the cosine similarity calculation function. The system is based on... The rule is determined by a preset verification threshold T2 to determine whether the rule passes verification, thereby expanding the rule execution process from a single logical judgment to a computable multi-dimensional fusion decision mechanism.

[0083] S5. Results Summary and Task Management This step aims to output the final report and manage concurrent tasks, specifically including the following sub-steps:

[0084] S510. Validation Result Collection and Aggregation: Collect all individual rule validation conclusions generated in S440. Calculate the total number of rules, the number of passed rules, the number of failed rules, and the number of rules pending review, aggregating the scattered validation information into a structured result set.

[0085] S520: Generate a complete verification report. Based on the aggregated result set, generate the final verification report. The report includes: a list of input documents, metadata on processing time, a summary of the data structure in a unified JSON format, a detailed list of rule verifications, and a dedicated conflict detection report.

[0086] S530, Task Queue Encapsulation and Distribution: The complete processing flow from S1 to S520 is encapsulated into an independent task unit (Task). Using task queue mechanisms such as Celery, this task unit is distributed to background Worker nodes;

[0087] S540, multi-threaded concurrency and progress synchronization: Worker nodes utilize multi-threaded or distributed resources to execute task units concurrently. During the execution of each key node from S1 to S5, the processing progress (such as "parsing completed", "extraction in progress", "verification completed") is synchronized to the backend storage in real time for users to query.

[0088] Furthermore, in the result summarization process of step S510, a statistical indicator calculation model is introduced to quantitatively analyze the verification results:

[0089] ;

[0090] ;

[0091] ;

[0092] in Indicates the verification pass rate. Indicates the verification failure rate. Indicates the rule conflict rate. These represent the number of rules that passed, failed, and conflicted, respectively. This indicates the total number of rules. Based on the above statistical indicators, the system dynamically adjusts task scheduling priorities and uses the results as scheduling parameters for task queue distribution in S530, thereby achieving adaptive concurrency management and execution efficiency optimization for verification tasks.

[0093] Example 2: Figure 2 As shown, this embodiment provides a multi-format document parsing and verification system, including:

[0094] The document parsing module is configured to receive input documents in various formats, select a parsing strategy based on the document type and complexity, and convert the input documents into a unified Markdown format intermediate document.

[0095] The indicator extraction module is configured to call the indicator extraction layer based on the abstract base class to process the Markdown format intermediate document, convert the generated intermediate representation into structured data, and integrate the structured information of all input documents into a unified JSON format data structure.

[0096] The rules management module is configured to scan independent rule files to dynamically load business rules, construct a directed acyclic graph based on rule dependency information, and determine the rule execution order through topological sorting.

[0097] The verification execution module is configured to execute the verification logic of the business rules based on the JSON format data structure according to the execution order, and to detect rule conflicts during the execution process;

[0098] The results summary module is configured to summarize the verification results and conflict detection results of all business rules and generate a verification report that includes verification conclusions and explanations of the reasons.

[0099] Example 3: This example provides a computer program product, which includes computer program code. When the computer program code is run on a computer, the computer implements the multi-format document parsing and verification method of Example 1.

[0100] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.

[0101] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0102] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for parsing and verifying multi-format documents, characterized in that, Includes the following steps: Step S1: Receive input documents in multiple formats, select a parsing strategy based on document type and complexity, and convert the input documents into a unified Markdown format intermediate document; Step S2: Call the indicator extraction layer based on the abstract base class to process the Markdown format intermediate document, convert the generated intermediate representation into structured data, and integrate the structured information of all input documents into a unified JSON format data structure; Step S3: Scan the independent rule files to dynamically load business rules, construct a directed acyclic graph based on rule dependency information, and determine the rule execution order through topology sorting; Step S4: Execute the verification logic of the business rules based on the JSON format data structure according to the execution order, and detect rule conflicts during the execution process; Step S5: Summarize the verification results and conflict detection results of all business rules, and generate a verification report that includes verification conclusions and explanations of reasons. In step S2, the abstract base class defines the construct method and the extract method; the construct method is used to generate regular expression matching results or large language model Prompt, and the extract method is used to convert the generated intermediate representation into structured JSON data. When a large language model is invoked, a dynamic Prompt generation mechanism is executed: document features are analyzed to dynamically select extracted fields, Few-shot examples are matched according to document type, cross-document context is injected, and the Prompt format is automatically iteratively optimized based on the model response. The Prompt is iteratively updated by quantitatively evaluating the model output results through the extraction of quality evaluation scores; the specific calculation formula for the quality evaluation scores is as follows: ; Furthermore, the formula for iteratively updating the Prompt based on the extracted quality evaluation score is as follows: ; in, This indicates the extraction of quality evaluation scores. This indicates the accuracy of the structured output format; Consistency represents the score for logical consistency between fields. This represents the target field coverage; w1, w2, and w3 are preset weight coefficients. To update the step size, The prompt word indicating the t-th iteration. The prompt word indicates the (t+1)th iteration. This indicates the gradient of the extracted score with respect to the cue words; In step S4, the verification logic employs a hybrid strategy: logical calculation is used to verify numerical calculation rules, while a large language model is invoked to verify semantic consistency rules. The system calculates a unified verification score that integrates the numerical verification and semantic judgment results. When the unified verification score is greater than a preset verification pass threshold T2, the rule is deemed to have passed verification. The specific formula for calculating the unified verification score is as follows: ; in, This indicates a unified verification score. The score is obtained by verifying the logical calculation; This indicates that a large language model generates semantic vectors. This represents the regular semantic vector, and cosine represents the cosine similarity calculation function. It sets the preset weight coefficients; and when executed, it passes the verification results of the preceding rules to the current rule.

2. The method for parsing and verifying multi-format documents according to claim 1, characterized in that, The specific parsing strategy selected in step S1 is as follows: for Word and Excel documents, the text and table structure are extracted using a standard library; for PDF documents, if it is a simple structured document, the text is extracted directly; if it is a scanned document or a complex document, the traditional Pipeline parsing including layout detection and OCR is performed or the visual language model is called for parsing.

3. The method for parsing and verifying multi-format documents according to claim 2, characterized in that, The traditional Pipeline parsing process sequentially performs layout detection, mathematical formula localization, optical character recognition, and table parsing, and then reassembles the results of each step into Markdown format.

4. The method for parsing and verifying multi-format documents according to claim 1, characterized in that, The steps in S3 for constructing the directed acyclic graph and determining the execution order include: extracting rule dependency metadata to construct an adjacency list, using depth-first search to detect cyclic dependencies, generating an execution sequence through topological sorting, and identifying rule groups without dependencies for parallel labeling.

5. The method for parsing and verifying multi-format documents according to claim 2, characterized in that, The rule conflict detection in step S4 includes identifying logical conflicts, data conflicts, and priority conflicts. Conflicts can be resolved automatically based on preset priorities or timestamp strategies, or marked for manual review.

6. A multi-format document parsing and verification system, employing the multi-format document parsing and verification method according to any one of claims 1 to 5, characterized in that, include: The document parsing module is configured to receive input documents in various formats, select a parsing strategy based on the document type and complexity, and convert the input documents into a unified Markdown format intermediate document. The indicator extraction module is configured to call the indicator extraction layer based on the abstract base class to process the Markdown format intermediate document, convert the generated intermediate representation into structured data, and integrate the structured information of all input documents into a unified JSON format data structure. The rules management module is configured to scan independent rule files to dynamically load business rules, construct a directed acyclic graph based on rule dependency information, and determine the rule execution order through topological sorting. The verification execution module is configured to execute the verification logic of the business rules based on the JSON format data structure according to the execution order, and to detect rule conflicts during the execution process; The results summary module is configured to summarize the verification results and conflict detection results of all business rules and generate a verification report that includes verification conclusions and explanations of the reasons.

7. A computer program product, characterized in that, The computer program product includes computer program code, which, when run on a computer, enables the computer to implement a multi-format document parsing and verification method as described in any one of claims 1 to 5.