Multi-agent collaborative reasoning method and device for complex business documents, equipment and medium
Patent Information
- Application Number
- CN202611141760.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2046-07-30
AI Technical Summary
[0005]本申请的主要目的在于提供一种面向复杂业务文档的多智能体协同推理方法、装置、设备及介质,旨在解决如何搭建三级智能体协同架构实现复杂业务文档高效精准处理的技术问题
[0016]本申请通过搭建路由、提取、校验三级智能体架构,先对原始文档解析获得内容与版面两类解析数据,路由智能体完成分类与任务分发,提取智能体开展语义提取并输出候选结果与置信度数据,校验智能体分级校验生成错误样本,再由搭载三类协同规则的规则引擎完成闭环协同优化。有益效果为实现文档精细化分类调度与分层校验,提升文档信息提取准确率,满足复杂文档高并发自动化处理需求。
Smart Images

Figure CN122657926B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a multi-agent collaborative reasoning method, apparatus, device, and medium for complex business documents. Background Technology
[0002] The current mainstream in the industry adopts a single-agent processing architecture that combines traditional OCR recognition with large models. Some multi-agent solutions only implement basic task decomposition, relying on independent modules to complete document recognition and field extraction operations in sequence, and relying on fixed business rules to carry out simple content verification.
[0003] The existing solution lacks a specialized three-tiered intelligent agent architecture for routing, extraction, and verification. It also lacks a multi-dimensional feature fusion classification mechanism and priority scheduling logic, making it impossible to accurately bind classification results and extraction modules. Furthermore, it lacks hierarchical verification logic and error classification handling methods, resulting in low industrial availability of extraction results. It is not configured with a collaborative rule system that includes triggering, association, and data interoperability, and it lacks a reverse closed-loop optimization mechanism triggered by error sample thresholds. As a result, the system cannot autonomously improve its accuracy with business accumulation, and the entire processing architecture needs to be reconstructed for new business scenarios, leading to high costs for scenario expansion.
[0004] Therefore, how to build a three-level intelligent agent collaborative architecture and provide supporting collaborative rules and reverse feedback closed-loop mechanisms to achieve efficient and accurate processing of complex business documents has become an urgent problem to be solved. Summary of the Invention
[0005] The main purpose of this application is to provide a multi-agent collaborative reasoning method, device, equipment and medium for complex business documents, aiming to solve the technical problem of how to build a three-level intelligent agent collaborative architecture to achieve efficient and accurate processing of complex business documents.
[0006] To achieve the above objectives, this application proposes a multi-agent collaborative reasoning method for complex business documents, including: Obtain the original complex business document and perform basic parsing on the original complex business document to obtain document parsing data, wherein the document parsing data includes document content data and document layout data; Based on the document parsing data, a preset routing agent performs multi-dimensional feature classification and task distribution to obtain classification results and task distribution instructions. The classification results include document business type, page structure, language type, table format, seal position, and core field type. Based on the classification results and the task distribution instructions, a preset extraction agent performs semantic understanding and structured extraction on the document parsing data to obtain structured candidate results and extraction confidence data; Based on the structured candidate results and the extracted confidence data, hierarchical verification and error correction are performed through a preset verification agent to obtain verification results and error sample data; Based on the verification results and the error sample data, a three-level intelligent agent collaborative reasoning and closed-loop optimization are performed through a preset collaborative rule engine to obtain collaborative reasoning decision results and intelligent agent collaborative state parameters. The preset collaborative rule engine includes triggering rules, association rules, and data communication rules. The collaborative reasoning decision results include the document core information extraction results after collaborative verification and intelligent agent collaborative optimization instructions.
[0007] In one embodiment, the step of performing multi-dimensional feature classification and task distribution based on the document parsing data through a preset routing agent to obtain classification results and task distribution instructions includes: The document content data in the document parsing data is extracted by a preset routing agent to obtain the initial document business tags. The preset routing agent performs multi-scale geometric feature analysis on the document layout data in the document parsing data to obtain layout feature labels. The preset routing agent performs weighted fusion of the initial document business tags and the layout feature tags to construct a multi-dimensional feature vector, wherein the multi-dimensional features include document business type features, layout structure features, language type features, table shape features, seal position features, and core field type features; The preset routing agent maps the multi-dimensional feature vectors to a preset business category space based on a preset feature matching algorithm to obtain the classification result. Based on the initial document business tags and layout feature tags, multiple documents to be processed are sorted and scheduled according to preset task priority scheduling rules to obtain a scheduling queue; Based on the scheduling queue and the initial document business tags, a one-to-one binding relationship is established between the classification results and the adaptation module of the preset extraction agent to obtain the task distribution instruction.
[0008] In one embodiment, the step of establishing a one-to-one binding relationship between the classification results and the adaptation module of the preset extraction agent based on the scheduling queue and the initial document business tags to obtain the task distribution instruction includes: Based on the document service type in the initial document service tag, query the mapping relationship table between the preset service type and the extracted adaptation module to obtain the target adaptation module identifier; Based on the target adaptation module identifier and the layout feature label, the target extraction module corresponding to the preset extraction agent is determined, and the target extraction module information is obtained; Based on the document processing priority and document processing order in the scheduling queue, timing constraint information is generated, wherein the timing constraint information includes high-priority document processing timing and normal-priority document processing timing. Based on the timing constraint information and the target extraction module information, the module calling order is locked according to the document processing order in the scheduling queue to obtain the module calling sequence; A module call instruction is generated based on the module call sequence and the classification result, wherein the module call instruction includes a target extraction module identifier, an input data identifier, and a time sequence execution identifier; The task distribution instruction is generated based on the module call instruction and the timing constraint information, so that the preset extraction agent calls the corresponding target extraction module to perform information extraction according to the task distribution instruction and the timing constraint information.
[0009] In one embodiment, the step of performing semantic understanding and structured extraction on the document parsing data through a preset extraction agent based on the classification result and the task distribution instruction to obtain structured candidate results and extracted confidence data includes: According to the task distribution instruction, the classification results and document parsing data are input into the preset extraction agent to obtain extraction strategy information; Based on the extraction strategy information, the preset extraction agent performs semantic understanding on the document content data in the document parsing data to obtain semantic understanding results, wherein the semantic understanding results include semantic representations of the core information of the document. Based on the semantic understanding results, the core information of the document is processed by the preset extraction agent to obtain preliminary structured data, wherein the preliminary structured data includes core field names and field values; Based on the preliminary structured data, the extraction confidence score of each field is calculated by the preset extraction agent to obtain extraction confidence score data, wherein the extraction confidence score data includes the confidence score value of each field; Based on the preliminary structured data and the extracted confidence data, the preset extraction agent generates structured candidate results according to a preset standardized data exchange format. Fields in the structured candidate results whose extraction confidence is lower than a preset confidence threshold are marked as fields to be verified.
[0010] In one embodiment, the step of performing hierarchical verification and error correction through a preset verification agent based on the structured candidate results and the extracted confidence data to obtain verification results and error sample data includes: Based on the structured candidate results and the extracted confidence data, a hierarchical verification process of a preset verification agent is triggered to perform a first-level format verification on the structured candidate results, thereby obtaining the first-level verification result. Based on the first-level verification result, perform a second-level logical consistency verification on the fields that pass the first-level verification to obtain the second-level verification result; Based on the results of the second-level verification, the fields that pass the second-level verification are subjected to the third-level business rule verification to obtain the third-level verification results and verification exception information; Based on the first-level verification result, the second-level verification result, the third-level verification result, and the verification exception information, verification results and error sample data are generated, wherein the error sample data includes a verification failure field and a corresponding error type identifier.
[0011] In one embodiment, the step of generating verification results and error sample data based on the first-level verification result, the second-level verification result, the third-level verification result, and the verification anomaly information includes: Based on the verification anomaly information, minor error fields and serious error fields are obtained. The minor error fields include format error fields, calculation precision error fields, and minor expression error fields. The serious error fields include serious format error fields, serious logical error fields, and core clause error fields. Based on the minor error field, the preset verification agent calls the correction rules in the preset business rule library to automatically correct it, and obtain the corrected field data; Based on the critical error field, an anomaly is marked by a preset verification agent, and the reason for the error is noted after the field to obtain manually reviewed and marked data. Based on the corrected field data, the manually reviewed marker data, and the field data that passed all three levels of verification, verification results and error sample data are generated.
[0012] In one embodiment, the step of performing three-level agent collaborative reasoning and closed-loop optimization through a preset collaborative rule engine based on the verification result and the error sample data to obtain collaborative reasoning decision results and agent collaborative state parameters includes: Based on the erroneous sample data, calculate the cumulative number of erroneous samples; When the cumulative number of erroneous samples reaches a preset feedback trigger threshold, the erroneous sample data is sent to a preset extraction agent to obtain optimized extraction agent parameters. Based on the verified field data and the corrected field data in the verification results, core information extraction results are generated according to a preset standardized data exchange format. Based on the optimized extracted agent parameters and the core information extraction results, an agent collaborative optimization instruction is generated through the association rules in the preset collaborative rule engine. The agent collaborative optimization instruction includes an extracted agent parameter update instruction and a verified agent rule adjustment instruction. Based on the core information extraction results and the intelligent agent collaborative optimization instructions, data is encapsulated and transmitted through the data interoperability rules in the preset collaborative rule engine to obtain collaborative reasoning decision results. Based on the optimized extracted agent parameters and the agent collaboration optimization instructions, the triggering conditions between agents at each level are updated through the triggering rules in the preset collaboration rule engine to obtain agent collaboration state parameters.
[0013] Furthermore, to achieve the above objectives, this application also proposes a multi-agent collaborative reasoning device for complex business documents, the multi-agent collaborative reasoning device for complex business documents comprising: The document parsing module is used to acquire the original complex business document and perform basic parsing on the original complex business document to obtain document parsing data, wherein the document parsing data includes document content data and document layout data. The routing agent module is used to perform multi-dimensional feature classification and task distribution based on the document parsing data through a preset routing agent, and obtain classification results and task distribution instructions. The classification results include document business type, page structure, language type, table form, seal position and core field type. The extraction agent module is used to perform semantic understanding and structured extraction on the document parsing data through a preset extraction agent based on the classification results and the task distribution instructions, so as to obtain structured candidate results and extraction confidence data; The verification agent module is used to perform hierarchical verification and error correction based on the structured candidate results and the extracted confidence data through a preset verification agent, so as to obtain verification results and error sample data. The feedback optimization module is used to perform three-level intelligent agent collaborative reasoning and closed-loop optimization through a preset collaborative rule engine based on the verification results and the error sample data, to obtain collaborative reasoning decision results and intelligent agent collaborative state parameters. The preset collaborative rule engine includes triggering rules, association rules and data communication rules. The collaborative reasoning decision results include the document core information extraction results after collaborative verification and intelligent agent collaborative optimization instructions.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the multi-agent collaborative reasoning method for complex business documents as described above.
[0015] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the multi-agent collaborative reasoning method for complex business documents as described above.
[0016] This application constructs a three-tiered intelligent agent architecture encompassing routing, extraction, and verification. First, the original document is parsed to obtain two types of data: content and layout. The routing agent performs classification and task distribution. The extraction agent performs semantic extraction and outputs candidate results and confidence data. The verification agent performs hierarchical verification and generates error samples. Finally, a rule engine equipped with three types of collaborative rules completes closed-loop collaborative optimization. The beneficial effects include enabling refined document classification, scheduling, and hierarchical verification, improving the accuracy of document information extraction, and meeting the needs of high-concurrency automated processing of complex documents. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the first embodiment of the multi-agent collaborative reasoning method for complex business documents in this application. Figure 2 This is a flowchart illustrating the second embodiment of the multi-agent collaborative reasoning method for complex business documents in this application. Figure 3 This is a schematic diagram of the module structure of the multi-agent collaborative reasoning device for complex business documents in this application; Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the multi-agent collaborative reasoning method for complex business documents in the embodiments of this application.
[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0022] Currently, the mainstream industry approach employs traditional OCR recognition or a single-agent processing architecture combining OCR with a large model. Some multi-agent solutions only implement basic task decomposition, relying on independent modules to sequentially complete document recognition and field extraction operations, and using fixed business rules for simple content verification. Existing solutions lack a professional division of labor architecture among routing, extraction, and verification agents, and lack multi-dimensional feature fusion classification mechanisms and priority scheduling logic, making it impossible to accurately bind classification results and extraction modules. They also lack hierarchical verification logic and error classification handling methods, resulting in low industrial usability of extraction results. Furthermore, they lack a collaborative rule system that includes triggering, association, and data interoperability, and there is no reverse closed-loop optimization mechanism triggered by error sample thresholds. The system cannot autonomously improve accuracy with business accumulation, and new business scenarios require a complete reconstruction of the processing architecture, leading to high costs for scenario expansion. Therefore, how to build a three-level agent collaborative architecture and provide supporting collaborative rules and a reverse feedback closed-loop mechanism to achieve efficient and accurate processing of complex business documents has become an urgent problem to be solved.
[0023] Based on the above, this application also provides a multi-agent collaborative reasoning method for complex business documents. This method is implemented in a complex business document intelligent processing system, which integrates three functional entities: a routing agent, an extraction agent, and a verification agent. The system first parses the original document to generate parsed data. Then, relying on the routing agent, it completes multi-dimensional feature classification and task distribution. The extraction agent performs semantic structured extraction based on the distribution instructions. The verification agent performs hierarchical verification to generate error samples. Finally, a rule engine with embedded three types of collaborative rules links the three agents to complete closed-loop collaborative optimization. (Refer to...) Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the multi-agent collaborative reasoning method for complex business documents in this application.
[0024] In this embodiment, the multi-agent collaborative reasoning method for complex business documents includes steps S10 to S50: Step S10: Obtain the original complex business document and perform basic parsing on the original complex business document to obtain document parsing data.
[0025] It should be noted that the original complex business documents are those used in the industry's daily business processes, i.e., non-standard documents containing unconventional layouts such as cross-page tables with mixed Chinese and English text. These documents suffer from complex formatting issues such as seal obscuring and field misalignment, making content reading impossible using simple recognition methods. The document parsing data is the summary information output after basic parsing, including document content data and document layout data. Document content data records all text and field information within the document, i.e., substantive business text such as customer names and accounts. Document layout data records information related to the document's page layout, i.e., table formatting, language distribution, seal location, and other layout-related content.
[0026] Specifically, first, the system receives raw, complex business documents (such as scanned copies of contracts, electronic letters of credit, or images of customs declarations in international trade) from the business system or upload interface, reads the binary stream data of the documents, and identifies the document format type. Second, it performs basic parsing on the raw, complex business documents, extracting document content data (including text characters, table cell content, and key field text) and document layout data (including page area division, table position coordinates, seal position areas, column layout structure, and language type distribution). The content data and layout data are then organized according to a preset data structure. Finally, the organized content data and layout data are merged into document parsing data, which is output to the subsequent routing agent as classification input. This is done because the subsequent routing agent needs both the document's content data and layout data to accurately determine the document's business type and layout characteristics. For example, in a scanned copy of a foreign trade sales contract, only by simultaneously identifying the textual content of the monetary clause (content data) and the layout location of the cross-page table (layout data) can the routing agent classify it as a "foreign trade sales contract" and mark it with the "cross-page table" feature, thereby triggering the correct extraction strategy. If only the textual content is extracted while ignoring the layout structure, the routing agent will be unable to distinguish between a multi-column letter of credit and a single-column ordinary contract, leading to classification errors and task distribution deviations.
[0027] Step S20: Based on the document parsing data, perform multi-dimensional feature classification and task distribution through a preset routing agent to obtain classification results and task distribution instructions.
[0028] It should be noted that the preset routing agent is an intelligent processing unit with document feature recognition and logical scheduling capabilities. This unit embeds multiple classification rules and scheduling strategies, that is, it determines the business category of the input document by analyzing its attribute features, and then decides which extraction agent should perform in-depth analysis on the document. Multi-dimensional feature classification, based on document parsing data, performs comprehensive feature extraction and classification operations from six levels: document business type, layout structure, language type, table format, seal location, and core field type. This comprehensive scanning achieves accurate profiling and recognition of the features of complex business documents. The classification results include document business type, layout structure, language type, table format, seal location, and core field type. The task distribution instruction is an execution scheduling control signal output by the preset routing agent, which clearly indicates which extraction agent module a specific document should be routed to for processing.
[0029] Specifically, firstly, content data and layout data are separated from the document parsing data. These data are then input into a lightweight document classifier built into the pre-defined routing agent to extract six core features (including document business type features, layout structure features, language type features, table format features, seal location features, and core field type features) to form a feature vector. Secondly, based on the feature vector, a pre-defined feature matching algorithm is used to identify the business attributes (e.g., whether it is a letter of credit, customs declaration, or purchase contract) and layout features (e.g., whether it is a multi-page table or a single-page table, and whether it is purely Chinese or a mix of Chinese and English) of the original complex business documents, obtaining preliminary classification labels and layout feature labels. Simultaneously, multiple documents to be processed are sorted and scheduled according to pre-defined task priority scheduling rules (e.g., setting letters of credit and customs declarations as high priority, ordinary contracts as medium priority, and document maintenance documents as low priority), resulting in a scheduling queue. Finally, based on the scheduling queue and preliminary classification labels, a one-to-one binding relationship is established between the classification results and the adaptation modules of the preset extraction agents, generating task distribution instructions so that the preset extraction agents can call the corresponding target extraction modules to perform information extraction according to the task distribution instructions. This is done because documents of different business types have drastically different core fields and layout characteristics. For example, an international trade letter of credit contains SWIFT message fields and mixed Chinese and English content, while a domestic trade procurement contract contains only Chinese terms regarding amount and delivery date. If a general extraction module is used for uniform processing, the differences in field formats will lead to extraction misalignment and decreased accuracy. Through specialized model-specific binding and distribution, letters of credit are automatically routed to extraction modules specifically trained for SWIFT message field recognition, and contracts are routed to extraction modules specifically designed for handling amount and delivery date. This avoids the accuracy bottleneck of general models and ensures that urgent documents are processed first through priority scheduling, meeting the timeliness requirements of high-concurrency business scenarios.
[0030] Step S30: Based on the classification results and task distribution instructions, the document parsing data is semantically understood and structured extracted by a preset extraction agent to obtain structured candidate results and extraction confidence data.
[0031] It should be noted that step S30 includes: inputting the classification results and document parsing data into a preset extraction agent according to the task distribution instruction to obtain extraction strategy information; performing semantic understanding on the document content data in the document parsing data through the preset extraction agent according to the extraction strategy information to obtain semantic understanding results; performing structured processing on the core information of the document through the preset extraction agent according to the semantic understanding results to obtain preliminary structured data; calculating the extraction confidence of each field through the preset extraction agent according to the preliminary structured data to obtain extraction confidence data, wherein the extraction confidence data includes the confidence value of each field; generating structured candidate results according to a preset standardized data exchange format through the preset extraction agent based on the preliminary structured data and the extraction confidence data, wherein fields in the structured candidate results with extraction confidence lower than a preset confidence threshold are marked as fields to be verified.
[0032] It's important to understand that the preset extraction agent is a functional unit within the three-tier collaborative architecture responsible for information extraction, essentially performing document semantic parsing based on a private large-scale model. Extraction strategy information is the execution plan generated by the preset extraction agent in conjunction with document attributes, specifically field extraction execution rules adapted to the current document type. Semantic understanding results are the information content produced by the preset extraction agent through parsing the document text, including semantic representations of the document's core information. Preliminary structured data is data obtained by splitting and organizing based on semantic representations, including core field names and values. Extraction confidence data is data summarized after calculating the extraction reliability for each field; it's used to filter fields with substandard extraction performance and provides a basis for marking fields to be verified. Fields to be verified are business fields whose extraction confidence does not reach the preset critical standard, meaning fields whose extraction stability cannot meet usage requirements.
[0033] Specifically, first, the classification result and document parsing data are input into a preset extraction agent according to a task distribution instruction, so that the preset extraction agent determines extraction strategy information according to the document service type and layout structure, wherein the extraction strategy information includes an extraction field list, field positioning rules, and a semantic understanding priority. This is because the core fields of different types of documents vary greatly; for example, a letter of credit requires the extraction of the issuing bank, beneficiary, and SWIFT message fields, while a foreign trade sales contract requires the extraction of the buyer and seller, amount, and delivery date. If a unified extraction strategy is adopted, the SWIFT message fields in the letter of credit will be missed by the sales contract extraction module, and the delivery date clause in the sales contract will also be ignored by the letter of credit module, resulting in the loss of key information. Next, according to the extraction strategy information, the preset extraction agent performs semantic understanding on the document content data to identify the semantic representation of the core information of the document, for example, identifying "Beneficiary: ABC Trading Co., Ltd." as the semantic representation of the beneficiary field, and identifying "USD 100,000.00" as the semantic representation of the amount field. This is because the expression forms of the same field in business documents are highly diverse; for example, the amount may be written as "One Hundred Thousand Yuan in Full", "100,000 RMB" or "USD 100k". Relying only on keyword matching will misjudge "100,000 RMB" as a US dollar amount, and only through semantic understanding can its true meaning be accurately identified based on the currency unit in the context. Then, according to the semantic understanding result, the preset extraction agent performs structured processing on the core information of the document, converting unstructured text and table content into preliminary structured data, wherein the preliminary structured data includes core field names and field values, for example, "Beneficiary: ABC Trading Co., Ltd.", "Amount: USD 100,000.00". This is because the original document content exists in the form of natural language paragraphs or semi-structured tables, and cannot be directly connected to the enterprise business system. For example, the beneficiary information in a letter of credit may be scattered in three positions: the title paragraph, the main text paragraph, and the signature paragraph. The structured processing aggregates it into a unified key-value pair form to realize data standardization. Then, according to the preliminary structured data, the preset extraction agent calculates the extraction confidence of each field to obtain extraction confidence data, wherein the extraction confidence data includes the confidence value of each field, for example, the confidence of the printed amount figure is 96%, while the confidence of the beneficiary name blocked by a seal is 82%. This is because there is a significant difference in the extraction reliability of different fields: the model has high certainty in identifying clearly printed fields, while it has high uncertainty in judging blurred, blocked or handwritten fields. Quantification through confidence can distinguish high-reliability fields from low-reliability fields, so as to avoid resource waste caused by adopting the same verification strength for all fields.Finally, based on the preliminary structured data and extracted confidence data, a pre-defined extraction agent generates structured candidate results according to a pre-defined standardized data exchange format. Fields in the structured candidate results with extraction confidence scores below a pre-set confidence threshold are marked as fields to be verified. For example, a monetary field with a confidence score of 88% is marked as a field to be verified if it is below the 90% threshold, while a beneficiary field with a confidence score of 96% is directly approved. This is because fields below the threshold pose a higher risk of error; if they were directly fed into the business system, it could lead to incorrect fund transfers or misinterpretations of contract terms. Threshold filtering automatically transmits high-risk fields to the verification agent for review, while high-confidence fields directly enter the subsequent process, achieving tiered processing and precise verification, improving overall processing efficiency while ensuring accuracy.
[0034] Step S40: Based on the structured candidate results and extracted confidence data, perform hierarchical verification and error correction through a preset verification agent to obtain verification results and error sample data.
[0035] It should be noted that step S40 includes: First, based on the structured candidate results and extracted confidence data, triggering the hierarchical verification process of the preset verification agent, performing first-level format verification on the structured candidate results to obtain the first-level verification result. It is important to understand that the preset verification agent is the processing unit responsible for result verification and error handling in the three-level agent architecture, that is, it completes the verification work based on a vertical domain-specific business rule library. The hierarchical verification process is the execution logic of the verification agent checking data in segments, that is, carrying out multiple rounds of verification operations sequentially in a hierarchical order from shallow to deep. Specifically, first, based on the structured candidate results and extracted confidence data, triggering the hierarchical verification process of the preset verification agent, reading each field in the structured candidate results and its corresponding extracted confidence value, automatically marking fields with extracted confidence values lower than a preset confidence threshold as high-risk fields, and marking fields with extracted confidence values higher than a preset confidence threshold as regular fields, while simultaneously starting the hierarchical verification engine to prepare for step-by-step verification. This is done because the quality of the fields extracted by the agent varies. Applying the same validation strength to all fields would lead to over-validation of high-confidence fields, wasting computational resources, and also cause low-confidence fields to miss hidden errors due to insufficient validation depth. Triggering tiered validation using confidence data allows for differentiated processing. Secondly, a first-level format validation is performed on the structured candidate results, checking the format of field values field by field. For example, it checks whether the date field conforms to the preset date format rules of "YYYY-MM-DD" or "YYYY / MM / DD", whether the amount field contains illegal characters or decimal places exceed the preset number of digits, whether the bank account number field length matches the preset account length rules, and whether the phone number field contains non-numeric characters. Fields that do not conform to the format rules are recorded as format-abnormal fields, and fields that conform to the format rules are recorded as format-normal fields. Finally, the fields with abnormal formatting and the fields with normal formatting are summarized into the first-level validation results. The first-level validation results include a list of fields that passed format validation and a list of fields that failed format validation. Fields in the list of fields that failed format validation will be marked as fields to be corrected and will directly enter the automatic correction process. Fields in the list of fields that passed format validation will be pushed to the second-level logical consistency validation.
[0036] Secondly, based on the results of the first-level validation, a second-level logical consistency validation is performed on the fields that passed the first-level validation to obtain the second-level validation results. Specifically, firstly, the list of fields that passed the format validation in the first-level validation results is read, and the related field groups between each field are extracted (e.g., the total amount field and the itemized amount field in the contract, the opening date field and the validity period field in the letter of credit, and the shipment period field and the document presentation period field in the letter of credit). Logical consistency comparison is performed on each group of related fields. Secondly, the numerical logical relationship and business logical relationship between the related fields are checked for consistency. For example, it is checked whether the total contract amount equals the sum of the itemized amounts, whether the validity period of the letter of credit is later than the opening date and earlier than the shipment period, whether the names of the buyer and seller are consistent in different fields, and whether the payment method and currency type match (e.g., the currency corresponding to the letter of credit payment method should be an internationally accepted currency rather than a currency limited to domestic circulation). Fields with consistent logical relationships are recorded as logically consistent fields, and fields with contradictory logical relationships are recorded as logically abnormal fields. This is done because even correctly formatted fields may contain deep-seated logical errors. For example, a foreign trade sales contract might extract a total amount of "USD 100,000.00," while the three sub-amounts are "USD 30,000.00," "USD 40,000.00," and "USD 25,000.00," totaling $95,000 instead of $100,000. If only the first-level format validation is performed, all four amount fields will conform to the USD format specification, but there will be a logical discrepancy of $5,000. This error, if directly fed into the business system, will lead to financial settlement discrepancies. Finally, logically consistent fields and logically abnormal fields are aggregated into the second-level validation results. Logically abnormal fields are marked as fields to be corrected and enter the automatic correction or manual review process, while logically consistent fields are pushed to the third-level business rule validation.
[0037] Then, based on the results of the second-level verification, the fields that passed the second-level verification are subjected to third-level business rule verification to obtain the third-level verification results and verification exception information. Specifically, the list of logically consistent fields in the second-level verification results is read, and a vertical domain-specific business rule library (such as a letter of credit rule library in the field of international trade, or a foreign exchange management rule library) is loaded. The logically consistent fields are entered into the business rule library for matching and verification, such as checking whether the issuing bank's SWIFT code extracted from the letter of credit exists in the international bank standard directory, checking whether the contract amount exceeds the single transaction limit threshold under this trade type, checking whether the commodity code in the customs declaration matches the customs tariff code column, and checking whether the tax rate in the invoice complies with the current tax law. Secondly, based on the matching results of the business rule library, fields that comply with the business rules are recorded as business compliant fields, and fields that do not comply with the business rules are recorded as business exception fields, and corresponding verification exception information is generated. For example, when the SWIFT code matching fails, "Issuing bank code does not exist in the standard directory" is recorded; when the amount exceeds the limit, "Contract amount exceeds the preset trade limit" is recorded; when the commodity code does not match, "Commodity code does not match the tariff code column" is recorded. This is done because format and logic validation can only ensure that fields appear correct and are numerically consistent, but they cannot guarantee that the content of the fields is legal and compliant in real business scenarios. For example, the SWIFT code of the issuing bank extracted from a letter of credit might be "ABCDUS33," which conforms to the 8-digit alphanumeric combination rule and is logically consistent with other date fields in the letter of credit. However, if this code is not a real bank code, the first two levels of validation will be completely unable to identify it, while the third level can intercept such errors by comparing it with the standard bank directory. Similarly, the port of delivery extracted from a foreign trade contract might be "a fictitious port name," which logically does not contradict other fields. However, if the port is not a legally recognized port in international trade according to the business rule base, the third level can mark it as abnormal. Finally, the business-compliant fields and the business-abnormal fields are summarized into the third-level validation results, and the validation exception information corresponding to the business-abnormal fields is summarized into validation exception information. The business-abnormal fields will be marked as fields to be corrected or manually reviewed, while the business-compliant fields will enter the final structured result generation process.
[0038] Finally, based on the results of the first-level, second-level, and third-level verifications, and the verification anomaly information, verification results and error sample data are generated. The error sample data includes fields that failed verification and their corresponding error type identifiers. Specifically, this includes: identifying minor and major error fields based on the verification anomaly information; minor error fields including format errors, calculation precision errors, and minor expression errors; and major error fields including major format errors, major logical errors, and core clause errors; automatically correcting minor error fields by calling correction rules from a pre-defined business rule base using a pre-defined verification agent; marking major error fields with anomalies and indicating the error reason after the field, resulting in manually reviewed and marked data; and generating verification results and error sample data based on the corrected field data, the manually reviewed and marked data, and the field data that passed all three levels of verification. Specifically, firstly, the verification anomaly information is read, and each business anomaly field is analyzed for its error type and severity. Fields with errors belonging to format errors, calculation precision errors, or minor expression deviations are classified as minor error fields, while fields with errors belonging to serious format errors, serious logical errors, or core clause errors are classified as serious error fields. This is done because errors of different severity require differentiated handling strategies. For example, an extra decimal place in an amount field (e.g., "USD 100,000.000") is a minor format error and can be directly corrected to "USD 100,000.00" according to the rules. However, a difference of more than 50% between the total contract amount and the sum of the itemized amounts constitutes a serious logical error; direct automatic correction might mask the true business risk, requiring manual intervention to determine whether the error is in the extraction process or in the original contract itself. Secondly, for minor errors, a pre-defined validation agent automatically corrects them by calling the corresponding correction rules from the pre-defined business rule base. For example, it standardizes date formats from "2024 / 01 / 15" to "2024-01-15", reduces the number of decimal places in amounts from three to two, and unifies the difference between "RMB One Hundred Thousand Yuan" and "100,000.00 RMB" into a standardized numerical format. The corrected fields are then recorded as corrected field data. This is done because minor errors have clear correction rules and do not introduce new business risks. Manual review of all these errors would result in a large amount of low-value work. Automatic correction through the rule base significantly improves processing efficiency while ensuring accuracy. For instance, in international trade, thousands of documents are processed daily; if every date format difference required manual confirmation, it would severely slow down the workflow.Then, for fields with serious errors, a pre-defined verification agent marks them as anomalies and notes the reason for the error after the field name. For example, after "Issuing Bank SWIFT Code: ABCD123", the error is noted as "Reason for error: SWIFT code length is less than 8 characters, suspected truncation or blurry original document". After the conflict record between "Total Contract Amount: USD 500,000.00" and "Sum of Item Amounts: USD 300,000.00", the error is noted as "Reason for error: The difference between the total amount and the item amount is USD 200,000, which is logically inconsistent". The marked fields are recorded as manually reviewed marked data. Finally, the corrected field data, manually reviewed marked data, and field data that have passed all three levels of verification are summarized and integrated to generate verification results. The verification results include a final list of fields that passed, a list of automatically corrected fields, and a list of manually reviewed fields. At the same time, the original error data of minor and serious error fields and their corresponding error type identifiers are summarized as error sample data, which is used for subsequent feedback to the extraction agent for optimization.
[0039] Step S50: Based on the verification results and error sample data, perform three-level agent collaborative reasoning and closed-loop optimization through the preset collaborative rule engine to obtain collaborative reasoning decision results and agent collaborative state parameters.
[0040] It should be noted that step S50 includes: calculating the cumulative number of error samples based on the error sample data; when the cumulative number of error samples reaches a preset feedback trigger threshold, sending the error sample data to a preset extraction agent to obtain optimized extraction agent parameters; generating core information extraction results according to a preset standardized data exchange format based on the verified field data and corrected field data in the verification results; generating agent collaborative optimization instructions based on the optimized extraction agent parameters and core information extraction results through association rules in a preset collaborative rule engine, wherein the agent collaborative optimization instructions include extraction agent parameter update instructions and verification agent rule adjustment instructions; encapsulating and transmitting data through data interoperability rules in a preset collaborative rule engine based on the core information extraction results and agent collaborative optimization instructions to obtain collaborative reasoning decision results; updating the triggering conditions between agents at all levels through triggering rules in a preset collaborative rule engine based on the optimized extraction agent parameters and agent collaborative optimization instructions to obtain agent collaborative state parameters.
[0041] It's important to understand that error sample data refers to the information related to abnormal fields obtained through the verification process, specifically a collection of information recording the error content and error type identifiers of the recorded fields. The pre-defined collaborative rule engine includes trigger rules, association rules, and data exchange rules. The collaborative reasoning decision results include the extracted core information of the document after collaborative verification and the agent's collaborative optimization instructions.
[0042] Specifically, firstly, error sample data is read, and the error samples are categorized and counted according to error type. The number of error samples is then accumulated to determine whether the accumulated number of each type of error reaches a preset feedback trigger threshold (e.g., optimization is triggered when a certain type of error accumulates 10 times). This is done because if the extraction agent is immediately triggered to optimize every time an individual error occurs, the system will frequently enter the training state, interrupting normal business processing. Furthermore, individual errors may be caused by abnormal quality of the original document itself rather than model defects. By setting an accumulated threshold, occasional noise can be filtered out, systematic error patterns can be identified, and optimization resources can be ensured only for frequently occurring error types. Secondly, when the accumulated number of error samples of a certain type reaches the preset feedback trigger threshold, the error sample data of the corresponding category is sent back to the preset extraction agent. After receiving the error samples, the extraction agent analyzes the root cause of the error (e.g., it is found that SWIFT code truncation is due to insufficient long string recognition window length, and decimal place deviation in amount is due to confusion between the thousands separator and the decimal point). Based on this, the model parameters or recognition rules are adjusted to obtain the optimized extraction agent parameters. This approach is adopted because erroneous samples directly reflect the weaknesses of the extraction agent in real-world business scenarios. For example, if the issuing bank names of 10 consecutive letters of credit are truncated to the first 8 characters, it indicates that the model's truncation threshold for long text fields is set too short. By using erroneous samples as negative examples to fine-tune the model through reverse feedback, this defect can be specifically corrected, achieving a closed-loop optimization of "error detection → root cause analysis → parameter correction". Then, the field data that passed all three levels of validation and the automatically corrected field data are extracted from the validation results and structured and encapsulated according to a preset standardized data exchange format (such as JSON format) to generate core information extraction results, which include field names, field values, validation status identifiers, and data source identifiers. Then, based on the optimized extraction agent parameters and core information extraction results, collaborative optimization instructions are generated through association rules in the preset collaborative rule engine. The extraction agent parameter update instruction notifies the routing agent to update classification feature weights (e.g., after SWIFT code extraction optimization, the routing agent needs to increase its sensitivity to long string fields). The verification agent rule adjustment instruction notifies the verification agent to update verification thresholds (e.g., after improved amount extraction accuracy, the verification agent can tighten its tolerance for amount deviation from ±1% to ±0.5%). This is done because the three levels of agents do not operate independently. Optimizing the extraction agent's parameters directly affects the routing agent's classification strategy and the verification agent's verification standards. For example, after the extraction agent fixes the decimal place recognition problem, the verification agent's original anomaly marking rules for "three decimal places" need to be relaxed accordingly; otherwise, a large number of false alarms will occur. By generating cross-agent collaborative optimization instructions through association rules, the parameters of each module within the architecture are updated in a coordinated manner.Then, based on the core information extraction results and the agent collaborative optimization instructions, data is encapsulated and transmitted through the data interoperability rules in the preset collaborative rule engine. Business data (core information extraction results) and system configuration data (collaborative optimization instructions) are packaged according to a preset data packet format and sent to the enterprise business system and the agent's internal state management module through a standardized interface to obtain the collaborative reasoning decision result. This is done because the collaborative reasoning decision result needs to carry two types of information simultaneously: one is the final usable data for the business layer (such as the structured result of a letter of credit), and the other is the optimized configuration data for the system layer (such as the parameter update values of each agent). Unified encapsulation through data interoperability rules ensures that these two types of information are not lost or confused during transmission. For example, after receiving the JSON data packet, the business system reads the "data" field to obtain the letter of credit information, and the agent management module reads the "config" field to obtain the parameter update instructions. Finally, based on the optimized extracted agent parameters and agent collaboration optimization instructions, the triggering conditions between agents at each level are updated using triggering rules in the preset collaboration rule engine. For example, the confidence threshold for the routing agent to trigger the extraction agent is increased from 0.85 to 0.90 (due to optimized extraction accuracy), and the cumulative error threshold for the verification agent to trigger reverse feedback is reduced from 10 times to 8 times (because earlier intervention in optimization is possible after the overall system stability is enhanced). The updated triggering conditions are recorded as agent collaboration state parameters. By dynamically adjusting the triggering conditions, the collaboration architecture continuously evolves adaptively with business progress, and the updated triggering conditions are solidified as agent collaboration state parameters for subsequent processing to read and execute.
[0043] This embodiment constructs a three-tiered intelligent agent architecture encompassing routing, extraction, and verification. First, the original document is parsed to obtain two types of data: content and layout. The routing agent performs classification and task distribution. The extraction agent performs semantic extraction and outputs candidate results and confidence data. The verification agent performs hierarchical verification and generates error samples. Finally, a rule engine equipped with three types of collaborative rules completes closed-loop collaborative optimization. The beneficial effects include enabling refined document classification, scheduling, and hierarchical verification, improving the accuracy of document information extraction, and meeting the needs of high-concurrency automated processing of complex documents.
[0044] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 The multi-agent collaborative reasoning method for complex business documents, step S20, further includes steps S201 to S206: Step S201: Extract key semantic features from the document content data in the document parsing data using a preset routing agent to obtain initial document business tags.
[0045] Specifically, the pre-defined routing agent incorporates a lightweight document classifier to perform word segmentation and stop word filtering on document content data, obtaining a candidate word set. Based on a pre-defined business keyword library, it performs matching and retrieval on the candidate word set, identifying business type keywords (such as letter of credit, issuing bank, beneficiary, purchase contract, delivery date) and core field type identifiers (such as bank account number, monetary value, date information), forming a semantic feature vector. The semantic feature vector is then compared with a pre-defined standard feature template, which is pre-constructed according to different business types, including the weight distribution of high-frequency keywords and field type combination patterns for that business type. The business type with the highest similarity is selected as the initial document business type, generating an initial document business label. For example, when the semantic feature vector contains both keywords such as "beneficiary" and "SWIFT," and the core field type includes bank account number and monetary value, the matching model outputs the initial document business label. This initial document business label serves as the foundational anchor for subsequent layout feature recognition, enabling the routing agent to call the layout structure feature library for the corresponding business type, achieving a gradual improvement in classification accuracy.
[0046] Step S202: Perform multi-scale geometric feature analysis on the document layout data in the document parsing data through a preset routing agent to obtain layout feature labels.
[0047] Specifically, firstly, a pre-defined routing agent reads page-level geometric information from the document layout data, identifying the total number of pages, page size, and continuity indicators between pages to determine if there are cross-page tables (i.e., page combinations where the starting and ending pages of a table are different). Secondly, it extracts region-level geometric features within the page, including the row and column coordinate distribution of text blocks, the connectivity of table border segments (to determine whether a table has borders or not), the number of text columns (to determine whether a multi-column or single-column layout is used based on the horizontal projection distribution of text blocks), and the geometric position of the stamp area (to determine whether the stamp is located within the text area through connected component analysis). (Is it a domain or a blank area?) Then, the extracted multi-scale geometric features are matched with a pre-built layout feature template library, which is constructed in advance according to different layout types and includes the geometric feature thresholds and spatial distribution patterns of each type of layout. Finally, the layout type with the highest matching degree is selected as the layout feature label. For example, when a table border line segment spans two pages and a circular connected region exists in the text area, the layout feature label "split-page table + text area stamp" is output. When a text block in a single page is distributed in three horizontal columns and there is no table border, the layout feature label "multi-column layout + plain text" is output. The reason for performing multi-scale geometric feature analysis is that the layout structure of different business documents varies significantly. For example, letters of credit often use a split-page table format with the stamp located in a blank area, while procurement contracts are mostly single-page multi-column layouts with the stamp covering the text area. These layout differences cannot be distinguished by text content alone. By analyzing geometric features at three scales—page level, region level, and element level—the layout structure can be accurately identified, providing a basis for the subsequent extraction agent to call the extraction strategy for the corresponding layout.
[0048] Step S203: The initial document business tags and layout feature tags are weighted and fused by a preset routing agent to construct a multi-dimensional feature vector.
[0049] It should be noted that the multi-dimensional features include document business type features, page layout features, language type features, table form features, seal location features, and core field type features.
[0050] Specifically, the routing agent weightedly fuses the initial document business tags and layout feature tags to construct a multi-dimensional feature vector. First, it reads the initial document business tags to extract document business type features and core field type features, and reads the layout feature tags to extract layout structure features, language type features, table shape features, and seal position features, resulting in six feature dimensions. Second, these are weighted according to a preset weighting rule; for example, in this embodiment, the document business type feature has a weight of 0.35, the layout structure feature has a weight of 0.20, the language type feature has a weight of 0.15, and the table shape feature, seal position feature, and core field type feature each have a weight of 0.10. The normalized values of each dimension are multiplied by their corresponding weights and then summed to construct the multi-dimensional feature vector.
[0051] Step S204: The preset routing agent maps multi-dimensional feature vectors to a preset business category space based on a preset feature matching algorithm to obtain the classification result.
[0052] Specifically, first, the multi-dimensional feature vector is read, and the weighted values of the six feature dimensions are extracted (i.e., weighted values of document business type, layout structure, language type, table form, seal position, and core field type). The multi-dimensional feature vector is then input into a preset feature matching algorithm. The preset feature matching algorithm has a built-in preset business category space containing multiple standard feature vector templates, each corresponding to a business category (e.g., letter of credit, foreign trade sales contract, customs declaration). Each template is pre-built according to the six feature dimensions and stored in a template database. Second, the similarity between the multi-dimensional feature vector and each standard feature vector template is calculated using a weighted cosine similarity calculation method. The six-dimensional values of the multi-dimensional feature vector are multiplied by the six-dimensional values of the corresponding template (i.e., the corresponding values are multiplied and then summed), and then divided by the product of the magnitudes of the two vectors (i.e., the product of the square roots of the sum of the squares of the six-dimensional values of each vector). This yields the similarity score for each business category. Finally, the business category with the highest similarity score is selected as the classification result. The business category identifier (e.g., letter of credit), layout structure identifier (e.g., double-page table), language type identifier (e.g., mixed Chinese and English), table format identifier (e.g., double-page table with borders), seal location identifier (e.g., seal in blank area), and core field type identifier (e.g., bank account number + SWIFT message field) are combined and output to obtain the complete classification result. The reason for combining all six dimensions of identifiers instead of just outputting the business category is that the subsequent extraction agent needs to know both "what kind of business it is" and "what the layout looks like" in order to call the correct extraction module. For example, simply providing "letter of credit" is insufficient to determine the extraction strategy. It is necessary to provide "double-page table + mixed Chinese and English + borders + seal in blank area + bank account number + SWIFT message field" so that the extraction agent can call the adaptation module specifically for handling double-page table mixed Chinese and English letter of credit. If the layout structure or language type information is missing, the extraction agent may call the extraction module for a single-page pure Chinese contract, resulting in the omission of the SWIFT clause or incorrect recognition of the bank account number format.
[0053] Step S205: Based on the initial document business tags and layout feature tags, sort and schedule multiple documents to be processed according to the preset task priority scheduling rules to obtain a scheduling queue.
[0054] Specifically, first, the business tags and layout feature tags of the initial document are read, and the business type identifier of each document (such as letter of credit, customs declaration, foreign trade sales contract, domestic trade purchase contract, bank account opening permit) is extracted from the business tags of the initial document. The complexity identifier of each document (such as cross-page table, multi-column layout, mixed Chinese and English layout) is extracted from the layout feature tags. The business type identifier and complexity identifier are then input into the preset task priority scheduling rule engine. Secondly, based on the preset task priority scheduling rules, multiple documents to be processed are assigned priority values: documents marked as urgent documents, such as letters of credit and customs declarations, are assigned high priority; documents marked as regular documents, such as foreign trade sales contracts and ordinary purchase contracts, are assigned medium priority; and documents marked as non-urgent documents, such as file maintenance documents and expired filing documents, are assigned low priority. At the same time, auxiliary sorting is performed based on complexity labels: documents marked as high complexity, such as multi-page tables and mixed Chinese and English text, are placed at the top of the same priority level, while documents marked as low complexity, such as plain text and single-page tables, are placed at the bottom of the same priority level, thus obtaining the priority score and sorting weight of each document. This is done because there are significant time-sensitive differences in international trade. For example, letters of credit involve cross-border payment deadlines, and delays in processing may lead to bank refusal to pay or late payment fees. Customs declarations involve customs clearance time limits, and delays may result in goods being held up at ports and incurring high storage fees. In contrast, document maintenance documents are only for historical archiving and have no time pressure. Prioritizing these documents ensures that urgent documents are processed first. At the same time, documents with higher complexity (such as multi-page forms of letters of credit) take longer to process, and pre-processing them can prevent them from further delaying the overall batch processing time due to queuing. For example, when 100 documents arrive simultaneously, 10 letters of credit (split-page tables with mixed Chinese and English text) and 5 customs declarations (single-page tables with only Chinese text) are marked as high priority. Letters of credit, due to their higher complexity, are ranked higher within the same priority group, while customs declarations are ranked lower. 30 foreign trade sales contracts (multi-column layout with mixed Chinese and English text) are marked as medium priority. 55 document maintenance documents (plain text with only Chinese text) are marked as low priority. The final scheduling queue order is: 10 letters of credit → 5 customs declarations → 30 foreign trade sales contracts → 55 document maintenance documents. Finally, based on priority scores and sorting weights, multiple documents to be processed are queued according to a preset concurrent processing capacity (e.g., processing 100 documents simultaneously), generating a scheduling queue. The scheduling queue contains the processing order identifier, priority identifier, and expected processing time slot allocation information for each document.The reason for generating a scheduling queue containing expected processing time slot allocation information is that enterprise-level document processing systems need to support high-concurrency scenarios. Time slot allocation can assign high-priority documents to time slots with sufficient computing resources, avoiding low-priority documents occupying core processing time slots and causing urgent documents to wait. For example, letters of credit can be allocated to millisecond-level response time slots, and document maintenance documents can be allocated to idle time slots, thereby achieving optimal allocation of system resources and efficient guarantee of core business.
[0055] Step S206: Based on the scheduling queue and the initial document business tags, establish a one-to-one binding relationship between the classification results and the adaptation module of the preset extraction agent to obtain the task distribution instruction.
[0056] It should be noted that step S206 includes: querying the mapping relationship table between the preset business type and the extraction adaptation module based on the document business type in the initial document business tag to obtain the target adaptation module identifier; determining the corresponding target extraction module in the preset extraction agent based on the target adaptation module identifier and the layout feature tag to obtain the target extraction module information; generating time-series constraint information based on the document processing priority and document processing order in the scheduling queue, wherein the time-series constraint information includes the high-priority document processing time sequence and the ordinary-priority document processing time sequence; locking the module calling order according to the document processing order in the scheduling queue based on the time-series constraint information and the target extraction module information to obtain the module calling sequence; generating a module calling instruction based on the module calling sequence and the classification result, wherein the module calling instruction includes the target extraction module identifier, the input data identifier, and the time-series execution identifier; generating a task distribution instruction based on the module calling instruction and the time-series constraint information, so that the preset extraction agent calls the corresponding target extraction module to perform information extraction according to the task distribution instruction and the time-series constraint information.
[0057] Specifically, firstly, the business type identifier in the business tag of the initial document is read, and the corresponding adaptation module identifier is retrieved in the preset mapping relationship table (e.g., "Letter of Credit" corresponds to "Letter of Credit Dedicated Extraction Module A", and "Foreign Trade Sales Contract" corresponds to "Contract General Extraction Module B"). The retrieved adaptation module identifier is output as the target adaptation module identifier. Secondly, the layout structure identifier (e.g., "Split-page table", "Multi-column layout"), language type identifier (e.g., "Chinese-English mixed layout", "Pure Chinese"), and table form identifier (e.g., "With borders", "Without borders") in the layout feature tag are read. The sub-modules that match the layout features are retrieved in the module family corresponding to the target adaptation module identifier (e.g., "Split-page table Chinese-English mixed layout sub-module A1" and "Single-page pure Chinese sub-module A2" are included under Letter of Credit Dedicated Extraction Module A). The matched sub-module identifier, module input interface specification, and module output format specification are combined into the target extraction module information. Then, based on the document processing priority and order in the scheduling queue, timing constraint information is generated. This timing constraint information includes the processing timeline for high-priority documents (such as the start and end timestamps and maximum waiting time for letters of credit and customs declarations) and the processing timeline for ordinary-priority documents (such as the start and end timestamps and flexible buffer timelines for regular contracts and archival documents). The reason for generating this timing constraint information is that, based on the timing constraint information and the target extraction module information, the module call order is locked according to the document processing order in the scheduling queue, resulting in a module call sequence. Specifically, the documents in the scheduling queue are grouped by priority; within the high-priority group, they are arranged in descending order of complexity; within the ordinary-priority group, they are arranged in ascending order of submission time. Each document is bound to the corresponding target extraction module information, generating a module call sequence that is hierarchically prioritized and executed sequentially for documents of the same priority, for example, "Letter of Credit A1 → Letter of Credit A2 → Customs Declaration B1 → Contract C1 → Contract C2 → Archival Document D1". Then, based on the module call sequence and classification results, module call instructions are generated. These instructions include the target extraction module identifier (e.g., "Letter of Credit Spread Table English-Chinese Mixed Submodule A1"), the input data identifier (e.g., "Document ID_001_parse Data Packet"), and the timing execution identifier (e.g., "High Priority_Time Slot T0_Deadline 100ms"). Finally, the module call instructions are batched into task distribution instruction packages. Each package contains a list of module call instructions for all documents in that batch and global timing constraint parameters (e.g., total time limit for high-priority batches, resource quota for ordinary-priority batches). These packages are sent to the preset extraction agent via a standardized interface. After parsing the instruction packages, the extraction agent sequentially calls the target extraction modules according to batch priority and timing identifier to complete the information extraction.The reason for encapsulating module call instructions into task distribution instruction packages instead of sending them one by one is that in enterprise-level scenarios, the number of concurrent documents is large (e.g., ≥100 documents). Sending them one by one would generate a lot of communication overhead and interface call latency. Batch encapsulation can reduce the number of network round trips. At the same time, global timing constraint parameters enable the extraction agent to perform resource scheduling within the batch autonomously, thereby improving the overall throughput efficiency while ensuring the priority strategy.
[0058] This embodiment extracts semantic features of document content and geometric features of the layout from a routing agent, obtaining two types of feature labels. These labels are weighted and fused to construct a six-dimensional feature vector, which is then mapped using a feature matching algorithm to obtain the document classification result. Simultaneously, a scheduling queue is generated based on the feature labels and priority scheduling rules. The classification result is precisely bound to the extraction agent's adaptation module, generating task distribution instructions. The beneficial effects include achieving accurate dual-dimensional classification of document content and layout, ensuring orderly scheduling of multiple documents, enabling dedicated adaptation and distribution of business documents and processing modules, and improving the accuracy of complex document processing and overall scheduling efficiency.
[0059] Based on the first embodiment of this application, this application also provides a multi-agent collaborative reasoning device for complex business documents. Please refer to... Figure 3 The device includes: The document parsing module 10 is used to obtain the original complex business document and perform basic parsing on the original complex business document to obtain document parsing data, which includes document content data and document layout data.
[0060] The routing agent module 20 is used to perform multi-dimensional feature classification and task distribution based on document parsing data through a preset routing agent, and obtain classification results and task distribution instructions. The classification results include document business type, page structure, language type, table form, seal position and core field type.
[0061] The extraction agent module 30 is used to perform semantic understanding and structured extraction on the document parsing data through a preset extraction agent based on the classification results and task distribution instructions, so as to obtain structured candidate results and extraction confidence data.
[0062] The verification agent module 40 is used to perform hierarchical verification and error correction based on the structured candidate results and extracted confidence data through a preset verification agent, so as to obtain the verification results and error sample data.
[0063] The feedback optimization module 50 is used to perform three-level intelligent agent collaborative reasoning and closed-loop optimization through a preset collaborative rule engine based on the verification results and error sample data, to obtain collaborative reasoning decision results and intelligent agent collaborative state parameters. The preset collaborative rule engine includes triggering rules, association rules and data communication rules. The collaborative reasoning decision results include the document core information extraction results after collaborative verification and intelligent agent collaborative optimization instructions.
[0064] The multi-agent collaborative reasoning device for complex business documents provided in this application employs the multi-agent collaborative reasoning method for complex business documents described in the above embodiments, and can solve the technical problem of how to build a three-level agent collaborative architecture to achieve efficient and accurate processing of complex business documents. Compared with the prior art, the beneficial effects of the multi-agent collaborative reasoning device for complex business documents provided in this application are the same as those of the multi-agent collaborative reasoning method for complex business documents provided in the above embodiments, and other technical features in the multi-agent collaborative reasoning device for complex business documents are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0065] This application provides a multi-agent collaborative reasoning device for complex business documents. The multi-agent collaborative reasoning device for complex business documents includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the multi-agent collaborative reasoning method for complex business documents in the above embodiment 1.
[0066] The following is for reference. Figure 4 This document illustrates a structural schematic diagram of a multi-agent collaborative reasoning device suitable for implementing embodiments of this application for complex business documents. The multi-agent collaborative reasoning device for complex business documents in embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The multi-agent collaborative reasoning device for complex business documents shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0067] like Figure 4As shown, a multi-agent collaborative reasoning device for complex business documents may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the multi-agent collaborative reasoning device for complex business documents. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows multi-agent collaborative reasoning devices for complex business documents to communicate wirelessly or wiredly with other devices to exchange data. Although various multi-agent collaborative reasoning devices for complex business documents are shown in the figures, it should be understood that implementation or possession of all of them is not required. More or fewer may be implemented alternatively.
[0068] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0069] The multi-agent collaborative reasoning device for complex business documents provided in this application, employing the multi-agent collaborative reasoning method for complex business documents described in the above embodiments, can solve the technical problem of how to build a three-level agent collaborative architecture to achieve efficient and accurate processing of complex business documents. Compared with the prior art, the beneficial effects of the multi-agent collaborative reasoning device for complex business documents provided in this application are the same as those of the multi-agent collaborative reasoning method for complex business documents provided in the above embodiments, and other technical features in this multi-agent collaborative reasoning device for complex business documents are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0070] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0071] 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.
[0072] This application provides a computer-readable medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the multi-agent collaborative reasoning method for complex business documents in the above embodiments.
[0073] The computer-readable medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor devices, or any combination thereof. More specific examples of computer-readable media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable medium may be any tangible medium containing or storing a program that can be executed by instructions, used by a device, or used in conjunction with it. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0074] The aforementioned computer-readable medium may be included in a multi-agent collaborative reasoning device for complex business documents; or it may exist independently and not be assembled into a multi-agent collaborative reasoning device for complex business documents.
[0075] The aforementioned computer-readable medium carries one or more programs that, when executed by a multi-agent collaborative reasoning device for complex business documents, enable the device to write computer program code for performing the operations of this application in one or more programming languages or a combination thereof. These programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0076] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of this application. In this regard, all blocks in the flowcharts or block diagrams may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated 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 all blocks in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using dedicated hardware-based implementations that perform the specified functions or operations, or using a combination of dedicated hardware and computer instructions.
[0077] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0078] The readable medium provided in this application is a computer-readable medium, which stores computer-readable program instructions (i.e., computer programs) for executing the aforementioned multi-agent collaborative reasoning method for complex business documents. This solves the technical problem of how to build a three-level agent collaborative architecture to achieve efficient and accurate processing of complex business documents. Compared with the prior art, the beneficial effects of the computer-readable medium provided in this application are the same as those of the multi-agent collaborative reasoning method for complex business documents provided in the above embodiments, and will not be elaborated upon here.
[0079] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the multi-agent collaborative reasoning method for complex business documents as described above.
[0080] The computer program product provided in this application can solve the technical problem of how to build a three-level intelligent agent collaborative architecture to achieve efficient and accurate processing of complex business documents. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the multi-agent collaborative reasoning method for complex business documents provided in the above embodiments, and will not be repeated here.
[0081] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A multi-agent collaborative reasoning method for complex business documents, characterized in that, The method includes: Obtain the original complex business document and perform basic parsing on the original complex business document to obtain document parsing data, wherein the document parsing data includes document content data and document layout data; Based on the document parsing data, a preset routing agent performs multi-dimensional feature classification and task distribution to obtain classification results and task distribution instructions. The classification results include document business type, page structure, language type, table format, seal position, and core field type. Based on the classification results and the task distribution instructions, a preset extraction agent performs semantic understanding and structured extraction on the document parsing data to obtain structured candidate results and extraction confidence data; Based on the structured candidate results and the extracted confidence data, hierarchical verification and error correction are performed through a preset verification agent to obtain verification results and error sample data; Based on the verification results and the error sample data, a three-level intelligent agent collaborative reasoning and closed-loop optimization are performed through a preset collaborative rule engine to obtain collaborative reasoning decision results and intelligent agent collaborative state parameters. The preset collaborative rule engine includes triggering rules, association rules and data communication rules. The collaborative reasoning decision results include the document core information extraction results after collaborative verification and intelligent agent collaborative optimization instructions. The step of performing three-level agent collaborative reasoning and closed-loop optimization through a preset collaborative rule engine based on the verification results and the error sample data to obtain collaborative reasoning decision results and agent collaborative state parameters includes: Based on the erroneous sample data, calculate the cumulative number of erroneous samples; When the cumulative number of erroneous samples reaches a preset feedback trigger threshold, the erroneous sample data is sent to a preset extraction agent to obtain optimized extraction agent parameters. Based on the verified field data and the corrected field data in the verification results, core information extraction results are generated according to a preset standardized data exchange format. Based on the optimized extracted agent parameters and the core information extraction results, an agent collaborative optimization instruction is generated through the association rules in the preset collaborative rule engine. The agent collaborative optimization instruction includes an extracted agent parameter update instruction and a verified agent rule adjustment instruction. Based on the core information extraction results and the intelligent agent collaborative optimization instructions, data is encapsulated and transmitted through the data interoperability rules in the preset collaborative rule engine to obtain collaborative reasoning decision results. Based on the optimized extracted agent parameters and the agent collaboration optimization instructions, the triggering conditions between agents at each level are updated through the triggering rules in the preset collaboration rule engine to obtain agent collaboration state parameters.
2. The method as described in claim 1, characterized in that, The step of performing multi-dimensional feature classification and task distribution based on the document parsing data through a preset routing agent to obtain classification results and task distribution instructions includes: The document content data in the document parsing data is extracted by a preset routing agent to obtain the initial document business tags. The preset routing agent performs multi-scale geometric feature analysis on the document layout data in the document parsing data to obtain layout feature labels. The preset routing agent performs weighted fusion of the initial document business tags and the layout feature tags to construct a multi-dimensional feature vector, wherein the multi-dimensional features include document business type features, layout structure features, language type features, table shape features, seal position features, and core field type features; The preset routing agent maps the multi-dimensional feature vectors to a preset business category space based on a preset feature matching algorithm to obtain the classification result. Based on the initial document business tags and layout feature tags, multiple documents to be processed are sorted and scheduled according to preset task priority scheduling rules to obtain a scheduling queue; Based on the scheduling queue and the initial document business tags, a one-to-one binding relationship is established between the classification results and the adaptation module of the preset extraction agent to obtain the task distribution instruction.
3. The method as described in claim 2, characterized in that, The step of establishing a one-to-one binding relationship between the classification results and the adaptation module of the preset extraction agent based on the scheduling queue and the initial document business tags to obtain the task distribution instruction includes: Based on the document service type in the initial document service tag, query the mapping relationship table between the preset service type and the extracted adaptation module to obtain the target adaptation module identifier; Based on the target adaptation module identifier and the layout feature label, the target extraction module corresponding to the preset extraction agent is determined, and the target extraction module information is obtained; Based on the document processing priority and document processing order in the scheduling queue, timing constraint information is generated, wherein the timing constraint information includes high-priority document processing timing and normal-priority document processing timing. Based on the timing constraint information and the target extraction module information, the module calling order is locked according to the document processing order in the scheduling queue to obtain the module calling sequence; A module call instruction is generated based on the module call sequence and the classification result, wherein the module call instruction includes a target extraction module identifier, an input data identifier, and a time sequence execution identifier; The task distribution instruction is generated based on the module call instruction and the timing constraint information, so that the preset extraction agent calls the corresponding target extraction module to perform information extraction according to the task distribution instruction and the timing constraint information.
4. The method as described in claim 1, characterized in that, The step of performing semantic understanding and structured extraction on the document parsing data through a preset extraction agent based on the classification results and the task distribution instructions to obtain structured candidate results and extracted confidence data includes: According to the task distribution instruction, the classification results and document parsing data are input into the preset extraction agent to obtain extraction strategy information; Based on the extraction strategy information, the preset extraction agent performs semantic understanding on the document content data in the document parsing data to obtain semantic understanding results, wherein the semantic understanding results include semantic representations of the core information of the document. Based on the semantic understanding results, the core information of the document is processed by the preset extraction agent to obtain preliminary structured data, wherein the preliminary structured data includes core field names and field values; Based on the preliminary structured data, the extraction confidence score of each field is calculated by the preset extraction agent to obtain extraction confidence score data, wherein the extraction confidence score data includes the confidence score value of each field; Based on the preliminary structured data and the extracted confidence data, the preset extraction agent generates structured candidate results according to a preset standardized data exchange format. Fields in the structured candidate results whose extraction confidence is lower than a preset confidence threshold are marked as fields to be verified.
5. The method as described in claim 1, characterized in that, The step of performing hierarchical verification and error correction through a preset verification agent based on the structured candidate results and the extracted confidence data to obtain verification results and error sample data includes: Based on the structured candidate results and the extracted confidence data, a hierarchical verification process of a preset verification agent is triggered to perform a first-level format verification on the structured candidate results, thereby obtaining the first-level verification result. Based on the first-level verification result, perform a second-level logical consistency verification on the fields that pass the first-level verification to obtain the second-level verification result; Based on the results of the second-level verification, the fields that pass the second-level verification are subjected to the third-level business rule verification to obtain the third-level verification results and verification exception information; Based on the first-level verification result, the second-level verification result, the third-level verification result, and the verification anomaly information, verification results and error sample data are generated, wherein the error sample data includes a verification failure field and a corresponding error type identifier.
6. The method as described in claim 5, characterized in that, The step of generating verification results and error sample data based on the first-level verification result, the second-level verification result, the third-level verification result, and the verification anomaly information includes: Based on the verification anomaly information, minor error fields and serious error fields are obtained. The minor error fields include format error fields, calculation precision error fields, and minor expression error fields. The serious error fields include serious format error fields, serious logical error fields, and core clause error fields. Based on the minor error field, the preset verification agent calls the correction rules in the preset business rule library to automatically correct it, and obtain the corrected field data; Based on the critical error field, an anomaly is marked by a preset verification agent, and the reason for the error is noted after the field to obtain manually reviewed and marked data. Based on the corrected field data, the manually reviewed marker data, and the field data that passed all three levels of verification, verification results and error sample data are generated.
7. A multi-agent collaborative reasoning device for complex business documents, characterized in that, The apparatus is applied to the multi-agent collaborative reasoning method for complex business documents as described in any one of claims 1 to 6, and the apparatus comprises: The document parsing module is used to acquire the original complex business document and perform basic parsing on the original complex business document to obtain document parsing data, wherein the document parsing data includes document content data and document layout data. The routing agent module is used to perform multi-dimensional feature classification and task distribution based on the document parsing data through a preset routing agent, and obtain classification results and task distribution instructions. The classification results include document business type, page structure, language type, table form, seal position and core field type. The extraction agent module is used to perform semantic understanding and structured extraction on the document parsing data through a preset extraction agent based on the classification results and the task distribution instructions, so as to obtain structured candidate results and extraction confidence data; The verification agent module is used to perform hierarchical verification and error correction based on the structured candidate results and the extracted confidence data through a preset verification agent, so as to obtain verification results and error sample data. The feedback optimization module is used to perform three-level intelligent agent collaborative reasoning and closed-loop optimization through a preset collaborative rule engine based on the verification results and the error sample data, to obtain collaborative reasoning decision results and intelligent agent collaborative state parameters. The preset collaborative rule engine includes triggering rules, association rules and data communication rules. The collaborative reasoning decision results include the document core information extraction results after collaborative verification and intelligent agent collaborative optimization instructions.
8. A multi-agent collaborative reasoning device for complex business documents, characterized in that, The device includes: a memory, a processor, and a multi-agent collaborative reasoning program for complex business documents stored in the memory and running on the processor, the multi-agent collaborative reasoning program for complex business documents being configured to implement the steps of the multi-agent collaborative reasoning method for complex business documents as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores a multi-agent collaborative reasoning program for complex business documents. When the processor executes the multi-agent collaborative reasoning program for complex business documents, it implements the steps of the multi-agent collaborative reasoning method for complex business documents as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Improved sun-bonnet for horses
US100000A
Improvement in carbureters
US200000A
Unstructured document multi-modal analysis and semantic metadata deep extraction method based on multi-agent collaboration
CN121722915A
Form filling system and method based on collaborative optimization of intelligent rule engine and intelligent agent
CN122222753A