A multi-sub-table electronic form automatic parsing method based on multi-agent workflow

By using a multi-agent workflow architecture to automatically parse and generate spreadsheet analysis reports, the problem of insufficient automation and traceability in existing technologies is solved, and efficient and controllable multi-sub-spreadsheet parsing and analysis report generation is achieved.

CN121659929BActive Publication Date: 2026-04-14HUA DATA TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUA DATA TECH (SHANGHAI) CO LTD
Filing Date
2026-02-04
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies struggle to automate the parsing and generate traceable analysis reports when dealing with complex spreadsheets with multiple worksheets, subsheets, and multi-level headers. Furthermore, existing solutions rely on manual configuration or lack controllable and reproducible computational logic, resulting in low efficiency and a high risk of errors.

Method used

A multi-agent workflow-based approach is adopted to construct document parsing agents, business analysis agents, tabulation agents, charting agents, and report arrangement agents. Combined with a full-link management mechanism for task identification, the entire process from uploading spreadsheets to generating analysis reports is automated.

Benefits of technology

It improves the automation of complex spreadsheet parsing and indicator calculation, generates standardized and rigorous analysis reports, reduces human intervention, enhances the traceability and reproducibility of results, and has good scalability and versatility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121659929B_ABST
    Figure CN121659929B_ABST
Patent Text Reader

Abstract

The application provides a multi-sublist electronic form automatic analysis method based on a multi-agent workflow, and relates to the technical field of form analysis. The multi-sublist electronic form automatic analysis method based on the multi-agent workflow comprises the following steps: an entry agent is used to create an analysis task corresponding to an original report form; a document analysis agent is used to identify sublists in the original report form; structured sublist data is organized according to business perspectives to form different perspective data; each business perspective data is cleaned, aggregated and index calculated to generate structured analysis results; a tabulation agent and a charting agent are used to generate analysis icons; and the obtained analysis text and icons are aggregated to generate a complete analysis report file. The application can improve the automation degree and consistency of complex electronic form analysis, index calculation and report generation, and improve the traceability and reviewability of the results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of table parsing technology, and in particular to an automatic parsing method for multi-sub-table spreadsheets based on a multi-agent workflow. Background Technology

[0002] In applications such as enterprise operation and management, regulatory compliance, and asset management, a large amount of core data is summarized and transferred in the form of spreadsheets (such as Excel files). Typical reports usually contain multiple worksheets, and each worksheet contains multiple sub-tables with different business meanings, and have complex structures such as multi-level headers and merged cells.

[0003] In existing technologies, the main approaches are as follows:

[0004] Traditional ETL tools or BI systems require manual configuration of rules for each report, including the start and end rows and columns of sub-tables, the number of header rows, and the meaning of fields, before data is extracted into a data warehouse for analysis. This approach heavily relies on manual rule configuration, resulting in high maintenance costs when migrating to new reports or new versions of reports, and making it difficult to quickly adapt to various spreadsheet formats.

[0005] Using spreadsheets as input, a Single Large Language Model (LLM) is used to perform end-to-end analysis and natural language summarization of the reports. While this method can automatically generate textual conclusions to some extent, it suffers from problems such as difficulty in precisely controlling the calculation logic, difficulty in reproducing indicator values, and the susceptibility to "illusory data," which is not conducive to rigorous and traceable analysis of key business indicators.

[0006] Some systems attempt to write report parsing logic into a fixed program, hard-coding the parsing of spreadsheets with specific formats, such as reading a specific worksheet and certain rows / columns. This type of implementation can meet the needs of a single project in the short term, but it lacks versatility and cannot handle complex situations where "a worksheet contains multiple sub-sheets and the header structure changes with the version".

[0007] In summary, existing technologies, when handling complex spreadsheets with multiple worksheets, subsheets, and multi-level headers, either heavily rely on manual rule configuration or lack controllable and reproducible computational logic, making it difficult to achieve an automated end-to-end process from raw reports to structured analysis reports. Especially when generating comprehensive reports that include text analysis, statistical tables, and graphical visualizations, existing solutions often require manual intervention in multiple stages, resulting in low efficiency and a high risk of errors. Summary of the Invention

[0008] To overcome the shortcomings of existing technologies, such as the difficulty in automatically parsing multi-sub-spreadsheets, the difficulty in controlling and reproducing the indicator calculation process, and the reliance on manual processing for analysis report generation, this invention proposes an automatic parsing method for multi-sub-spreadsheets based on a multi-agent workflow. By introducing a multi-agent workflow architecture, it can not only automatically parse complex spreadsheet structures, but also perform indicator calculations and result arrangement in a controllable and traceable manner, thereby automatically generating standardized and rigorous analysis reports.

[0009] This invention constructs multiple functional intelligent agents (including document parsing intelligent agent, business analysis intelligent agent, tabulation intelligent agent, charting intelligent agent, variable aggregation intelligent agent, and report arrangement intelligent agent), introduces a full-link management mechanism for task identification, and a unified intermediate data structure oriented towards the business perspective. This enables full-process automation from spreadsheet uploading, automatic table splitting and header recognition, to multi-perspective business analysis, chart generation, and report arrangement. As a result, it improves the automation level and consistency of complex spreadsheet parsing, indicator calculation, and report generation, and enhances the traceability and verifiability of the results.

[0010] In a first aspect, the present invention provides a method for automatic parsing of multi-sub-table spreadsheets based on multi-agent workflow, comprising the following steps:

[0011] S1. Task initialization: Use the entry agent to create an analysis task corresponding to the original report, generate a task identifier task_id, and store the original report file in an isolated directory identified by task_id;

[0012] S2. Multi-sub-table parsing: Use a document parsing agent to read the report file corresponding to task_id, automatically identify the sub-tables; parse to obtain the column names and content keywords of the sub-tables, convert the sub-tables into structured data objects, and then classify the sub-tables according to the preset business perspective;

[0013] S3. Construct intermediate data structure file_dict: Organize structured sub-table data according to business perspective to form different perspective data, which is used for data transfer and status management between document parsing, business analysis, tabulation and chart making and report arrangement.

[0014] S4. Multi-agent business analysis: Based on the data input, indicator calculation rules and natural language generation templates of each business perspective, configure one or more business analysis agents to clean, aggregate and calculate indicators for each business perspective, and generate structured analysis results.

[0015] S5. Multi-perspective tabulation and graphing: Using a tabulation agent, multi-dimensional statistical tables are generated based on preset fields from different perspectives; using a graphing agent, the data output by the business analysis agent is converted into an object name-index value dictionary structure, and corresponding analysis images are generated.

[0016] S6. Result Aggregation: Unify and aggregate the output results of multiple business analysis agents and tabulation agents to form a structured set of variables;

[0017] S7. Generate the final analysis report: Based on the preset report structure template and the output of step S6, generate a complete analysis report file and store it corresponding to the task_id.

[0018] As a further improvement of the present invention, the specific steps of step S2 include:

[0019] Sub-table identification: Scan each worksheet in the report file row by row, and identify the start and end areas of each logical sub-table based on features such as empty rows, empty columns, table header patterns, or merged cells;

[0020] Sub-table parsing: Identify single-level or multi-level headers of sub-tables and construct single-level or multi-level column identifiers;

[0021] Sub-table classification: The parsed sub-tables are converted into structured data objects, including data frame objects or intermediate two-dimensional array structures, and then the sub-tables are classified.

[0022] As a further improvement of the present invention, the multi-level column identifier is constructed by combining the complete column names through concatenation or multi-level indexing.

[0023] As a further improvement of the present invention, the preset business perspective and corresponding key fields in step S2 include:

[0024] From a revenue-related metrics perspective, key fields include: revenue, invoice amount, and invoice amount.

[0025] Customer service and complaint metrics perspective, key fields: number of complaints, service tickets;

[0026] Cost and profit perspective, key fields: cost, profit, target value;

[0027] From an inventory operations perspective, key fields are: inventory balance and inventory turnover days.

[0028] From a risk control perspective, key fields include: number of overdue days and number of defaults.

[0029] From a project management perspective, key fields are: project name and budget execution rate.

[0030] As a further improvement of the present invention, in step S3, the intermediate data structure includes:

[0031] Task identifier task_id;

[0032] A viewpoint dataset, each viewpoint including at least: viewpoint name, viewpoint type, structured dataset and its metadata;

[0033] Source tracking information includes: worksheet name, sub-table area location information, table header hierarchy, field semantic mapping relationship and classification basis;

[0034] Intermediate product reference information includes: structured data file paths or references, image file paths, table text content or references, and a set of chapter-level variables used for report formatting.

[0035] As a further improvement of the present invention, the viewpoint data set is divided into multiple sub-views according to data hierarchy or dimension, and the division dimensions include: region dimension, organization dimension and time dimension.

[0036] As a further improvement of the present invention, the process of constructing the intermediate data structure includes:

[0037] Summarize the structured data objects, sub-table location information, and table header structure information corresponding to each sub-table;

[0038] Business perspective classification and mapping: Using a document parsing agent, each sub-table is classified based on the business perspective configuration. When multiple business perspectives match at the same time, the target perspective is selected according to the preset priority or matching confidence, and the classification basis is recorded for traceability.

[0039] Subview splitting: For data sets with different analytical granularities or different statistical calibers under the same business perspective, the perspective data is organized into multiple subviews according to preset splitting rules;

[0040] Meta information and source tracking are written: The worksheet name, sub-table range, table header hierarchy, field semantic mapping relationship, classification confidence and key basis are written into the source tracking information field to achieve the traceability and verifiability of subsequent indicator calculation and report output;

[0041] Intermediate Product Reference Registration: Register the storage path or reference of structured data, tabulation output text or reference, and graph output file path in the intermediate product reference information field, and store them in association with task_id for unified reading and reuse by subsequent business analysis agents, graphing agents and report arrangement agents.

[0042] As a further improvement of the present invention

[0043] The business perspective configuration includes: field keyword set, field semantic mapping rules, priority rules, and conflict handling rules;

[0044] The criteria for classifying these perspectives include: column name characteristics, header keywords, cell content patterns, and merged cell structure characteristics.

[0045] As a further improvement of the present invention, in step S4,

[0046] The natural language generation template includes indicator calculation formulas and multiple placeholders to fill in the calculated key indicators and object names to form structured analysis paragraphs.

[0047] The business analysis agent invokes a large language model to perform calculations under template constraints and generates analysis results.

[0048] The analysis results include: natural language analysis paragraphs, a set of structured indicators, and a key-value dictionary for subsequent tabulation or graphing.

[0049] As a further improvement of the present invention, in step S4, the business analysis intelligent agent includes:

[0050] Sales analysis AI: Calculates the percentage of annual target achieved, horizontal city comparison, and internal growth rate comparison based on sales volume, annual target value, and year-on-year growth rate.

[0051] Complaint Analysis Intelligent Agent: Calculates the total number of complaints, the number of complaints from different channels, and the year-on-year change based on the number of complaints, the number of complaints from different channels, and the complaint statistics broken down by category;

[0052] Profit Analysis Intelligent Agent: Calculates profit completion rate and internal profit growth or decline based on overall profit, annual target value, system ranking, internal profit of the listed company and year-on-year change data.

[0053] As a further improvement of the present invention, in step S4, multiple different business analysis agents are configured for the same business perspective according to the needs of management topics or analysis granularity.

[0054] As a further improvement of the present invention, in step S5,

[0055] The statistical tables include: a cross-regional profit comparison table, a revenue statistics table cross-referenced by time and region, an inventory and turnover days statistics table by category and warehouse, and a risk exposure distribution table by risk level and asset class.

[0056] The images analyzed include: line charts, bar charts, column charts, pie charts, and stacked charts.

[0057] As a further improvement of the present invention, in step S6, the structured variable set includes: sales analysis text, complaint analysis text, profit analysis text, complaint statistics table text, profit comparison table text, and related image file paths or reference information.

[0058] As a further improvement of the present invention, in step S7, the chapter settings of the analysis report include:

[0059] Chapter 1: Overall Business Overview;

[0060] Chapter Two: Revenue and Profit Analysis;

[0061] Chapter Three: Customer Service and Complaint Analysis;

[0062] Chapter Four: Inventory Operations Analysis;

[0063] Chapter Five: Risk Control Analysis;

[0064] Chapter Six: Project Execution and Budget Analysis.

[0065] Secondly, the present invention provides an automatic parsing system for multi-sub-table spreadsheets based on a multi-agent workflow, wherein the modules in the system operate collaboratively to implement the steps of the method described in the first aspect, and the system includes:

[0066] The document access module is used to receive spreadsheets and generate task identifiers (task_id).

[0067] The document parsing intelligent agent module is used for parsing multiple worksheets and subsheets, as well as recognizing table headers.

[0068] The intermediate data management module is used to build and maintain intermediate data structures;

[0069] The business analysis intelligent agent cluster module includes an electricity sales analysis intelligent agent, a complaint analysis intelligent agent, and a profit analysis intelligent agent;

[0070] The tabulation agent module is used to generate markup language tables;

[0071] The mapping intelligence module is used to generate business analysis images;

[0072] The variable aggregation agent module is used to aggregate various analysis results;

[0073] The report orchestration agent module is used to generate the final analysis report;

[0074] The task management and storage module is used to uniformly manage intermediate files and final results during the task process based on task_id.

[0075] As a further improvement of the present invention, the scheduling and collaboration methods of each module include: multi-agent workflow engine method, microservice architecture or inter-process communication method;

[0076] Among them, the multi-agent workflow engine approach includes: each agent is triggered in series or in parallel as a node, and data transmission and state management are carried out between workflow nodes through task identifiers and intermediate data structures;

[0077] Module deployment methods include: deployment on the server or in the cloud, or deployment on the local system.

[0078] Thirdly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory, characterized in that the processor executes the computer program to implement the steps of the method described in the first aspect.

[0079] Fourthly, the present invention provides a computer program product that, when executed by a processor, implements the steps of the method described in the first aspect.

[0080] Compared with the prior art, the present invention has at least the following beneficial effects:

[0081] (1) Automatically parse complex multi-sub-table reports:

[0082] The document parsing intelligence agent in this invention can automatically identify multiple worksheets in a spreadsheet and multiple sub-sheet areas in a single worksheet, and supports the identification and restoration of multi-level headers, reducing reliance on manual configuration of parsing rules and improving adaptability to different report formats.

[0083] (2) A unified intermediate data structure oriented towards business perspective:

[0084] By constructing a unified intermediate data structure, the original report data is elevated from a "physical layout perspective" to a "business semantic perspective," which facilitates the reuse of different business analysis agents and is beneficial for the decoupling and expansion of multiple business modules.

[0085] (3) Large-scale model business analysis based on template constraints:

[0086] The business analysis agent generates text under the constraints of preset natural language templates and indicator calculation rules. This not only utilizes the understanding and generation capabilities of the large language model, but also ensures that the indicator calculation logic is controllable and reproducible, reducing the risk of inconsistent results and "illusion data".

[0087] (4) Multi-agent collaboration and task-level state management:

[0088] This invention uses task identifiers to unify and associate intermediate results generated at each stage of document parsing, business analysis, tabulation, charting, and report arrangement, achieving end-to-end traceability under multi-agent collaboration; and effectively avoiding mutual contamination of files and data between different tasks in concurrent task scenarios.

[0089] (5) Automatically generate integrated text and graphics analysis reports:

[0090] The report editing agent can automatically insert text analysis, statistical tables, and image files associated with task identifiers to generate structured, highly readable reports that integrate text and graphics, reducing the workload of manual report writing and improving overall analysis efficiency.

[0091] (6) Good scalability and versatility:

[0092] The multi-agent workflow architecture and intermediate data structure design of this invention have good scalability. In addition to indicators such as electricity sales, complaints, and profits, it can be extended to other industries and business scenarios. It is only necessary to add or replace the corresponding business analysis agents and templates. Attached Figure Description

[0093] Figure 1 This is a flowchart of an automatic parsing method for multi-sub-table spreadsheets based on multi-agent workflow disclosed in this invention;

[0094] Figure 2 A schematic diagram illustrating multi-sub-table parsing and header recognition for a document parsing agent;

[0095] Figure 3 This is a schematic diagram of a multi-agent workflow structure;

[0096] Figure 4 A schematic diagram illustrating the indicator calculation and template filling for business analysis intelligent agents;

[0097] Figure 5 This is a schematic diagram of the report's layout and output structure;

[0098] Figure 6 A flowchart illustrating the process of generating the final analysis report for the report orchestration agent;

[0099] Figure 7 This is a schematic diagram illustrating the application of a multi-agent workflow-based approach in a multi-industry business analysis platform. Detailed Implementation

[0100] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Steps S1, S2… in the described embodiments of the present invention do not limit the scope of execution of the present invention; the various models, simulation environments, and software described in the present invention are not considered as the only limiting methods of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0101] In this invention, computer device / equipment / system refers to a related entity applied to a computer, such as hardware, a combination of hardware and software, software, or software in execution. More specifically, for example, software includes, but is not limited to, a process running on a processor, a processor, an object, executable software, an execution thread, a program, and / or a computer. Furthermore, an application program or script running on a server, and the server itself, can also be software. One or more software programs may be in an execution process and / or thread, and the software may be localized on one computer and / or distributed across two or more computers, and may be run on various computer-readable media.

[0102] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0103] In a first aspect, the present invention provides an embodiment of an automatic parsing method for multi-sub-table spreadsheets based on a multi-agent workflow, such as... Figure 1 As shown, the specific process can be as follows:

[0104] S1. Task initialization and report retrieval;

[0105] Generate task identifiers, receive spreadsheet files uploaded by users, and store the files with task identifiers.

[0106] S2. The document parsing agent performs multi-sub-table parsing and table header recognition;

[0107] The document parsing agent performs multiple worksheet traversals on the spreadsheet, and for each worksheet:

[0108] Automatically identify the start and end rows of multiple sub-tables by detecting empty rows, empty columns, and content patterns;

[0109] For each sub-table, identify one or more header layers and construct single or multiple column identifiers;

[0110] The data from the sub-tables is converted into structured data objects (such as data frames) and categorized into different business perspectives based on column content characteristics and preset business rules.

[0111] S3. Construct a unified intermediate data structure;

[0112] The structured sub-table data mentioned above is organized into a unified intermediate data structure according to preset business dimensions. This intermediate data structure is used for data transfer and status management between document parsing, business analysis, table and chart creation, and report compilation. The intermediate data structure is used to abstract the "physical layout perspective" (worksheet / sub-table / rows and columns) of the original spreadsheet into a "business semantic perspective" (business theme / indicator system / analysis granularity), so as to enable multi-agent reuse, decoupling, and expansion.

[0113] The intermediate data structure includes at least one or more business perspective data entries. Each business perspective data entry carries a structured data set related to that perspective, field semantic mapping, metadata required for indicator calculation, and source tracking information.

[0114] For example, in the context of power operation analysis, perspectives include electricity sales, customer service and complaints, and costs and revenues / profits. Specifically:

[0115] First-hand business perspective data is used for operational indicator analysis.

[0116] Second business perspective data is used for customer service metrics analysis;

[0117] Third-party business perspective data is used for cost and benefit analysis.

[0118] The third business perspective can be further divided into sub-views such as the overall view, the inter-provincial comparison view, and the city-level unit view, which are used to carry structured data sets and calculation results under different levels, different statistical standards, or different object granularities.

[0119] The specific steps for constructing intermediate data include:

[0120] S31. Intermediate data structure definition:

[0121] The unified intermediate data structure (e.g., file_dict) is a structured object organized around task identification and business perspectives. It is used to transfer data and metadata between various agents involved in document parsing, business analysis, tabulation and charting, and report compilation. The file_dict must include at least the following fields:

[0122] (1) task_id: Task identifier, used to run through the entire process and to uniformly associate and isolate intermediate products at each stage;

[0123] (2) Views: A collection of business perspectives. Each perspective includes at least a perspective name, perspective type, structured data set and its metadata.

[0124] (3) proofance: Source tracking information, including worksheet name, sub-table area location information, table header hierarchy, field semantic mapping relationship and necessary classification basis;

[0125] (4) artifacts: intermediate artifact reference information, including structured data file paths or references, image file paths, table text content or references, and chapter-level variable sets used for report layout, etc.

[0126] The viewpoint data set can be a data frame, a two-dimensional array, or its serialized form (such as JSON, Parquet, CSV), and can be split into multiple sub-views according to time dimension, organization dimension, or region dimension to support multi-granularity statistics, horizontal comparison, or hierarchical analysis scenarios.

[0127] S32. Construction method:

[0128] The construction of intermediate data structures includes the following processes:

[0129] (1) Structured result aggregation: After the document parsing agent completes the identification of multiple worksheets and their sub-worksheet areas, restores the header hierarchy and performs structured transformation, it obtains the structured data object (e.g., data frame) corresponding to each sub-worksheet, as well as the sub-worksheet location information and header structure information.

[0130] (2) Business perspective classification and mapping: The document parsing agent classifies each sub-table based on the preset business perspective configuration. The business perspective configuration includes at least a set of field keywords, field semantic mapping rules, priority rules and conflict handling rules. The classification criteria can be determined by comprehensively considering column name features, table header keywords, cell content patterns, and merged cell structure features. When multiple business perspectives match at the same time, the target perspective is selected according to the preset priority or matching confidence, and the classification criteria are recorded for traceability.

[0131] (3) Subview splitting: For data sets with different analytical granularities or different statistical calibers under the same business perspective, the perspective data is organized into multiple subviews according to the preset splitting rules (e.g., splitting by time dimension, organization dimension, region dimension or level dimension).

[0132] (4) Write metadata and source tracking: Write the worksheet name, sub-table range, table header hierarchy, field semantic mapping relationship, classification confidence and key basis into the proofance field to achieve the traceability and verifiability of subsequent indicator calculation and report output;

[0133] (5) Intermediate product reference registration: Register the storage path or reference of structured data, tabulation output text or reference, and plot output file path to the artifacts field and store them in association with task_id for unified reading and reuse by subsequent business analysis agents, plotting agents and report arrangement agents.

[0134] S4. Business analysis intelligent agent cluster execution template constraint analysis;

[0135] Utilizing multiple business analytics agents, based on data from different perspectives within a unified intermediate data structure, they respectively execute:

[0136] Perform indicator calculations and sorting statistics on data from the first business perspective, and generate first-perspective analysis paragraphs based on preset natural language templates;

[0137] Perform item / quantity statistics, classification and summary, and year-on-year change calculation on the second business perspective data, and generate second perspective analysis paragraphs based on preset natural language templates;

[0138] The system performs overall profit, target completion rate, ranking, and hierarchical changes analysis on data from a third-party business perspective, and generates third-party analysis paragraphs based on preset natural language templates.

[0139] The natural language template predefines indicator relationships and calculation rules, and the business analysis agent fills in specific values ​​and object names under these constraints.

[0140] S5, the tabulation and graphing agent generates structured tables and visualizations;

[0141] Using a tabulation agent, data from the second business perspective, the third business perspective, and other data are generated into multi-dimensional statistical tables according to a preset field order, and then output in a markup language format (such as Markdown tables).

[0142] The mapping agent converts the dictionary structure of "object name-index value" output by the analysis agent into a visual image file and stores it in association with the task identifier.

[0143] S6. The variable aggregation agent performs result aggregation and naming;

[0144] The outputs of multiple business analysis agents and tabulation agents are aggregated and labeled as structured fields such as first business perspective analysis text, second business perspective analysis text, third business perspective analysis text, second business perspective statistical table, and third business perspective comparison table, forming a unified set of variables required for report compilation; wherein, the name and number of the structured fields can be expanded or adjusted according to the business perspective configuration.

[0145] S7. The report orchestration agent generates the final analysis report;

[0146] The report arrangement agent automatically arranges the analytical text, statistical tables, and image file references associated with task identifiers from the perspective of each business according to the chapter structure based on the preset report template, generates a complete analysis report file, and provides the report as task output to users for access or download.

[0147] Example 1: A clash of perspectives on electricity sales, customer service and complaints, and costs and benefits / profits within a power operation analysis scenario; such as... Figure 1 The flowchart shown includes the following steps:

[0148] Step S101: Task initialization and report acquisition.

[0149] The workflow system receives the target spreadsheet file uploaded by the user, generates a globally unique task identifier (task_id) through the task initialization agent, and stores the spreadsheet file according to this task identifier. The task_id is used throughout the entire process of subsequent parsing, analysis, charting, and report generation to uniformly associate and manage intermediate products.

[0150] Step S102: The document parsing agent performs multi-sub-table parsing and table header recognition.

[0151] The document parsing agent reads the spreadsheet file corresponding to the task identifier and iterates through each worksheet. For each worksheet, multiple sub-sheet areas are automatically identified using the following method:

[0152] Different data blocks are divided into candidate sub-table regions by detecting consecutive empty rows and columns;

[0153] By using features such as key field matching, merged cell pattern recognition, and row and column distribution, candidate areas are filtered and corrected to obtain multiple logical sub-tables;

[0154] Within each sub-table area, single-level or multi-level column identifiers are constructed by identifying one or more rows of table headers; in multi-level table header scenarios, complete column names can be combined through joins or multi-level indexes.

[0155] After parsing, each sub-table is converted into structured data formats such as data frames, and categorized into corresponding business perspectives based on column names and content keywords, such as electricity sales-related, complaint-related, and profit-related.

[0156] Step S103: Construct a unified intermediate data structure file_dict.

[0157] like Figure 3 This invention organizes the aforementioned structured data into a unified intermediate data structure, file_dict, for data transfer and status management between stages such as document parsing, business analysis, tabulation and charting, and report compilation. The file_dict includes, but is not limited to:

[0158] file_dict["sell"]: A dataset used for electricity sales-related analysis;

[0159] file_dict["complaint"]: A dataset used for complaint-related analysis;

[0160] file_dict["profit"]: A composite structure used for profit-related analysis, which can be further broken down into subviews such as the overall profit view, inter-provincial comparison view, and city-level view.

[0161] The file_dict["profit"] can be represented as a list or an object containing multiple subfields. The first view is used for inter-provincial profit comparison, and the second view is used for profit analysis within city-level units.

[0162] The above business perspectives can correspond to operational indicator analysis, customer service analysis, cost and revenue analysis, etc. The specific perspective name can be determined by the business perspective configuration and is not limited to a specific industry or indicator system.

[0163] Step S104: The business analysis agent cluster performs template constraint analysis.

[0164] See Figure 4 This invention establishes multiple business analysis agents, including an electricity sales analysis agent, a complaint analysis agent, and a profit analysis agent. Each agent performs analysis tasks based on the corresponding business perspective data in file_dict.

[0165] The electricity sales analysis agent reads indicators such as electricity sales, annual target value, and year-on-year growth rate from file_dict["sell"]. Based on the preset natural language template, it calculates the annual target percentage, horizontal city comparison, and self-growth comparison, and fills the specific values ​​into the template placeholders to generate the electricity sales analysis paragraph.

[0166] The complaint analysis agent reads the number of complaints from each unit, the number of complaints from different channels, and the complaint statistics by category from file_dict["complaint"]. It calculates indicators such as the total number of complaints, the number of complaints from different channels, and the year-on-year change, and generates complaint analysis paragraphs based on the complaint analysis template.

[0167] The profit analysis agent reads data such as overall profit, annual target value, system ranking, internal profit of the listed company and year-on-year changes from different views of file_dict["profit"]. It calculates the profit completion rate, internal profit growth or decline, and generates profit analysis paragraphs based on the profit analysis template.

[0168] The template predefines the indicator calculation formula and text expression structure. Under the constraints of the template, the business analysis agent calls the large language model to perform calculations and generation, so that the generated conclusions are both automated and ensure the controllability and reproducibility of the calculation logic.

[0169] Step S105: The tabulation and mapping agent generates structured tables and visualizations.

[0170] Using a tabulation agent, multi-dimensional complaint statistics tables can be generated based on complaint-related data, such as sorting by company name, different complaint channels, and various business indicators, and the results can be output as a table text in markup language format (such as a Markdown table); inter-provincial comparison tables can also be generated based on profit-related data.

[0171] Using a mapping agent, the system reads "unit name - indicator value" key-value pairs from the dictionary structure output by the electricity sales analysis agent and the profit analysis agent, and converts them into graphical visualizations. For example, it creates a bar chart based on city electricity sales and a positive / negative bar chart based on the profits within each city. The generated image files are stored by task_id.

[0172] Step S106: The variable aggregation agent aggregates the results.

[0173] The variable aggregation agent unifies and aggregates the outputs of multiple business analysis agents and tabulation agents to form a structured set of variables, including but not limited to:

[0174] Electricity sales analysis text;

[0175] Complaint analysis text;

[0176] Profit analysis text;

[0177] Complaint statistics form text;

[0178] Profit comparison table text;

[0179] Image file paths or reference information related to the task.

[0180] This aggregation process only renames, groups, and summarizes the output results, without changing their business meaning or content.

[0181] Step S107: The report orchestration agent generates the final analysis report.

[0182] See Figure 6 The report arrangement agent inserts the analysis text, markup language tables, and image references provided by the variable aggregation agent into the corresponding positions according to the preset report structure template, such as dividing it into chapters like "Complaint Analysis", "Electricity Sales Analysis", and "Profit Analysis", and generates a complete analysis report file.

[0183] The report file is generated in Markdown format and includes text content, tables, and image references. It can be further converted to PDF, HTML, or other formats. The report file is stored along with a corresponding task_id and returned to the user through the workflow system.

[0184] Example 2: An extended example for a multi-industry business analysis platform;

[0185] Based on Embodiment 1, this embodiment provides an extended implementation for a multi-industry business analysis platform to illustrate the universality and scalability of the method of the present invention in different business areas and under different indicator systems.

[0186] like Figure 7 As shown in the figure, this embodiment provides an application example of a method for automatic parsing and intelligent analysis report generation of multi-sub-table spreadsheets based on multi-agent workflow in a multi-industry business analysis platform, including the following steps S201 to S206.

[0187] Step S201: Multi-tenancy and business perspective configuration.

[0188] The platform predefines several general business perspectives in the system, such as "revenue metrics perspective", "customer service and complaint metrics perspective", and "cost and profit metrics perspective". At the same time, it supports tenant users to add custom business perspectives through the configuration interface or configuration file, such as "inventory operation perspective", "risk control perspective" and "project management perspective".

[0189] During the configuration phase, tenant users can configure the following metadata for one or more types of report templates:

[0190] (1) Possible worksheet names or name keywords;

[0191] (2) Common column names or column name keywords in various sub-tables and their corresponding business meanings;

[0192] (3) The mapping relationship between each business perspective and the sub-table data, as well as optional priorities, matching rules, etc.

[0193] The above configuration information is stored in a structured form and is used to drive the business classification and perspective mapping process of the subsequent document parsing agent.

[0194] Step S202: Industry report access and task creation.

[0195] In this embodiment, when the platform receives a multi-worksheet spreadsheet file uploaded by a tenant, the entry agent creates a corresponding analysis task, generates a task identifier (task_id), and stores the original report file in an isolated directory identified by the task_id.

[0196] Subsequently, the entry agent passes the task identifier and report file path to the document parsing agent, triggering the subsequent multi-sub-table parsing and view mapping process.

[0197] This step enables task-level isolation and file resource management in multi-tenant, multi-task scenarios.

[0198] Step S203: The document parsing agent performs multi-sub-table parsing and business perspective mapping.

[0199] In step S203, the document parsing agent can adopt a similar technical process to step S102 in Embodiment 1 to uniformly parse multiple worksheet reports, which specifically includes but is not limited to:

[0200] (1) Read each worksheet in the spreadsheet, scan each worksheet row by row, and automatically identify the start and end areas of multiple logical sub-tables based on features such as empty rows, empty columns, table header patterns or merged cells.

[0201] (2) Perform header identification for each sub-table, supporting single-row headers and multi-row headers, and combine multi-level headers into a unique column identifier;

[0202] (3) Convert each sub-table into a structured data form, such as a data frame object or an intermediate two-dimensional array structure.

[0203] In multi-industry scenarios, the document parsing agent further integrates the business perspective configuration in step S201 to perform business semantic judgment and perspective classification on the identified sub-tables, for example:

[0204] Sub-tables containing fields such as "income", "revenue", and "invoice amount" are categorized as revenue-related indicator data.

[0205] Sub-tables containing fields such as "number of complaints" and "service tickets" are categorized as customer service and complaint-related metrics data.

[0206] Sub-tables containing fields such as "cost", "profit", and "target value" are categorized as cost and profit perspective data;

[0207] Sub-tables containing fields such as "inventory balance" and "turnover days" are categorized as inventory operations perspective data;

[0208] Sub-tables containing fields such as "number of overdue days" and "number of defaults" are categorized as risk control perspective data;

[0209] Sub-tables containing fields such as "Project Name" and "Budget Execution Rate" are categorized as project management perspective data.

[0210] After completing the above classification, the document parsing agent constructs an intermediate data structure, file_dict, oriented towards multiple perspectives, according to a preset data organization method. For example:

[0211] file_dict["revenue"]: Data from the perspective of revenue and related metrics;

[0212] file_dict["customer_service"]: Data from the perspective of customer service and complaints;

[0213] file_dict["cost_profit"]: Cost and profit data;

[0214] file_dict["inventory"]: Inventory operation data;

[0215] file_dict["risk"]: Data from a risk control perspective;

[0216] file_dict["project"]: Data from a project management perspective;

[0217] And other perspective fields that are expanded based on the actual industry.

[0218] From some perspectives, file_dict can be further divided into multiple subviews to hold structured data of different levels or dimensions, such as splitting by region, organization, or time dimension.

[0219] Step S204: Multi-agent business analysis and indicator generation.

[0220] In step S204, the workflow engine automatically schedules business analysis agents bound to each business perspective based on the perspective fields in file_dict to perform business indicator calculations and natural language analysis on data from different perspectives.

[0221] Specifically, for each business perspective, one or more business analytics agents can be configured, and each business analytics agent includes at least:

[0222] (1) Input conventions for the corresponding view data in file_dict, including required fields, required subviews, etc.;

[0223] (2) Calculation rules for indicators from this perspective, such as the calculation rules for year-on-year, month-on-month and target completion rate from the perspective of revenue, the calculation rules for inventory turnover rate and stockout rate from the perspective of inventory, and the calculation rules for risk exposure and default rate from the perspective of risk.

[0224] (3) A natural language generation template corresponding to this perspective, which contains multiple placeholders to fill in the calculated key indicators and object names to form a structured analysis paragraph.

[0225] During runtime, the business analytics agent cleans, aggregates, and calculates metrics on the data corresponding to the viewpoint in `file_dict`, and generates structured analysis results based on preset templates. These results may include natural language analysis paragraphs, a set of structured metrics, and a key-value dictionary for subsequent tabulation or charting.

[0226] Through the above design, this embodiment allows tenants to configure multiple different business analytics agents for the same business perspective, in order to adapt to the needs of different management themes or different analytical granularities.

[0227] Step S205: Generation of multi-view tabulation and graphing results.

[0228] In step S205, the workflow engine further triggers the invocation of the tabulation agent and the graphing agent based on the structured results output by the business analysis agent, in order to generate statistical tables and visualizations that can be directly presented.

[0229] Specifically:

[0230] (1) The table-making agent can generate report tables in preset formats for different business perspectives. For example, it can generate a revenue statistics table with cross-time and regional dimensions under the revenue perspective, an inventory and turnover days statistics table with category and warehouse dimensions under the inventory operation perspective, and a risk exposure distribution table with risk level and asset category under the risk perspective.

[0231] (2) The charting agent can generate different types of visualization graphics, such as line charts, bar charts, column charts, pie charts or stacked charts, based on the "object name-index value" dictionary output by the business analysis agent, and store the generated image files in the directory identified by task_id.

[0232] Both tabulation and mapping agents can receive input data according to a unified data interface agreement, thereby enabling component-level reuse and cross-perspective reuse.

[0233] Step S206: Automatic compilation and output of multi-industry comprehensive analysis reports.

[0234] In step S206, the report orchestration agent uniformly orchestrates the multi-perspective analysis results, statistical tables, and images generated in steps S204 and S205 to generate a comprehensive analysis report for tenant enterprises.

[0235] Specifically, the report organization agent can organize content from multiple business perspectives into different chapters based on pre-configured report templates, for example:

[0236] Chapter 1: Overall Business Overview;

[0237] Chapter Two: Revenue and Profit Analysis;

[0238] Chapter Three: Customer Service and Complaint Analysis;

[0239] Chapter Four: Inventory Operations Analysis;

[0240] Chapter Five: Risk Control Analysis;

[0241] Chapter Six: Project Execution and Budget Analysis.

[0242] When generating a report, the report orchestration agent reads the corresponding analytical text, tabular data, and image files from intermediate storage based on the task identifier (task_id), inserts them into the reserved positions in the report template in a uniform format, and forms a comprehensive analytical report file containing multiple perspectives and industry modules. The generated report file can be in markup language, a downloadable document, or other formats suitable for long-term archiving and secondary processing, and is stored in a directory identified by the task_id.

[0243] Secondly, the present invention provides an embodiment of an automatic parsing system for multi-sub-table spreadsheets based on a multi-agent workflow, wherein the modules in the system operate collaboratively to implement the steps of the method described in the first aspect, and the system includes:

[0244] The document access module is used to receive spreadsheets and generate task identifiers;

[0245] The document parsing intelligent agent module is used for parsing multiple worksheets and subsheets, as well as recognizing table headers.

[0246] The intermediate data management module is used to build and maintain intermediate data structures such as file_dict;

[0247] The business analysis intelligent agent cluster module includes an electricity sales analysis intelligent agent, a complaint analysis intelligent agent, and a profit analysis intelligent agent, etc.

[0248] The tabulation agent module is used to generate markup language tables;

[0249] The mapping intelligence module is used to generate business indicator images;

[0250] The variable aggregation agent module is used to aggregate various analysis results;

[0251] The report orchestration agent module is used to generate the final analysis report;

[0252] The task management and storage module is used to uniformly manage intermediate files and final results during the task process based on task_id.

[0253] The aforementioned modules can be scheduled and collaborated through a multi-agent workflow engine, with each agent triggered in series or in parallel as nodes. Workflow nodes exchange data and manage their states through task identifiers and intermediate data structures. Alternatively, they can be implemented through a microservice architecture or inter-process communication. Those skilled in the art can deploy some modules on a server or in the cloud, and others on a local system, depending on the actual deployment environment; this invention does not limit this.

[0254] Thirdly, the present invention provides an embodiment of a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the first aspect.

[0255] Fourthly, the present invention provides a computer program product embodiment, which, when executed by a processor, implements the steps of the method described in the first aspect.

Claims

1. A method for automatic parsing of multi-sub-table spreadsheets based on multi-agent workflow, characterized in that, Includes the following steps: S1. Task initialization: Use the entry agent to create an analysis task corresponding to the original report, generate a task identifier task_id, and store the original report file in an isolated directory identified by task_id; S2. Multi-sub-table parsing: Use a document parsing agent to read the report file corresponding to task_id, automatically identify the sub-tables; parse to obtain the column names and content keywords of the sub-tables, convert the sub-tables into structured data objects, and then classify the sub-tables according to the preset business perspective; S3. Construct an intermediate data structure `file_dict` for data transfer and status management between document parsing, business analysis, tabulation and charting, and report compilation; among which... The intermediate data structure includes: task identifier (task_id), viewpoint data set, source tracking information, and intermediate artifact reference information; The process of constructing the intermediate data structure includes: summarizing the structured data objects, sub-table location information, and table header structure information corresponding to each sub-table; classifying each sub-table based on the business perspective configuration; splitting the sub-views according to the preset splitting rules; writing the metadata into the source tracking information field; registering the intermediate product reference information into the intermediate product reference information field and storing it in association with the task_id; S4. Multi-agent business analysis: Based on the data input, indicator calculation rules and natural language generation templates of each business perspective, configure one or more business analysis agents to clean, aggregate and calculate indicators for each business perspective, and generate structured analysis results. S5. Multi-perspective tabulation and graphing: Using a tabulation agent, multi-dimensional statistical tables are generated based on preset fields from different perspectives; using a graphing agent, the data output by the business analysis agent is converted into an object name-index value dictionary structure, and corresponding analysis images are generated. S6. Result Aggregation: Unify and aggregate the output results of multiple business analysis agents and tabulation agents to form a structured set of variables; S7. Generate the final analysis report: Based on the preset report structure template and the output of step S6, generate a complete analysis report file and store it corresponding to the task_id.

2. The method according to claim 1, characterized in that, The specific steps of step S2 include: Sub-table identification: Scan each worksheet in the report file row by row, and identify the start and end areas of each logical sub-table based on features such as empty rows, empty columns, table header patterns, or merged cells; Sub-table parsing: Identify single-level or multi-level headers of sub-tables and construct single-level or multi-level column identifiers; Sub-table classification: The parsed sub-tables are converted into structured data objects, including data frame objects or intermediate two-dimensional array structures, and then the sub-tables are classified.

3. The method according to claim 2, characterized in that, The multi-level column identifier is constructed by combining the complete column names through concatenation or multi-level indexing.

4. The method according to claim 1, characterized in that, The preset business perspective and corresponding key fields in step S2 include: From a revenue-related metrics perspective, key fields include: revenue, invoice amount, and invoice amount. Customer service and complaint metrics perspective, key fields: number of complaints, service tickets; Cost and profit perspective, key fields: cost, profit, target value; From an inventory operations perspective, key fields are: inventory balance and inventory turnover days. From a risk control perspective, key fields include: number of overdue days and number of defaults. From a project management perspective, key fields are: project name and budget execution rate.

5. The method according to claim 1, characterized in that, In step S3, the intermediate data structure includes: Task identifier task_id; A viewpoint dataset, each viewpoint including at least: viewpoint name, viewpoint type, structured dataset and its metadata; Source tracking information includes: worksheet name, sub-table area location information, table header hierarchy, field semantic mapping relationship and classification basis; Intermediate product reference information includes: structured data file paths or references, image file paths, table text content or references, and a set of chapter-level variables used for report formatting.

6. The method according to claim 5, characterized in that, The viewpoint data set is divided into multiple sub-views according to data hierarchy or dimension. The division dimensions include: regional dimension, organizational dimension, and time dimension.

7. The method according to claim 5, characterized in that, The process of constructing intermediate data structures also includes: Classification and mapping from a business perspective: using document parsing intelligent agents Categorize perspectives When multiple business perspectives match simultaneously, the target perspective is selected according to preset priority or matching confidence level, and the classification basis is recorded for traceability. Subview splitting refers to organizing data from the same business perspective into multiple subviews that have different analytical granularities or different statistical standards. Writing metadata into the source tracking information field includes writing the worksheet name, sub-table range, table header hierarchy, field semantic mapping relationship, classification confidence level and key basis into the source tracking information field, so as to achieve the traceability and verifiability of subsequent indicator calculation and report output; The intermediate product reference information registration includes: registering the storage path or reference of structured data, the tabulation output text or reference, and the plotting output file path into the intermediate product reference information field, and storing them in association with task_id, for unified reading and reuse by subsequent business analysis agents, plotting agents and report arrangement agents.

8. The method according to claim 7, characterized in that, The business perspective configuration includes: field keyword set, field semantic mapping rules, priority rules, and conflict handling rules; The criteria for classifying these perspectives include: column name characteristics, header keywords, cell content patterns, and merged cell structure characteristics.

9. The method according to claim 1, characterized in that, In step S4 The natural language generation template includes indicator calculation formulas and multiple placeholders to fill in the calculated key indicators and object names to form structured analysis paragraphs. The business analysis agent invokes a large language model to perform calculations under template constraints and generates analysis results. The analysis results include: natural language analysis paragraphs, a set of structured indicators, and a key-value dictionary for subsequent tabulation or graphing.

10. The method according to claim 1, characterized in that, In step S4, the business analysis intelligent agent includes: Sales analysis AI: Calculates the percentage of annual target achieved, horizontal city comparison, and internal growth rate comparison based on sales volume, annual target value, and year-on-year growth rate. Complaint Analysis Intelligent Agent: Calculates the total number of complaints, the number of complaints from different channels, and the year-on-year change based on the number of complaints, the number of complaints from different channels, and the complaint statistics broken down by category; Profit Analysis Intelligent Agent: Calculates profit completion rate and internal profit growth or decline based on overall profit, annual target value, system ranking, internal profit of the listed company and year-on-year change data.

11. The method according to claim 1, characterized in that, In step S4, multiple different business analysis agents are configured for the same business perspective according to the needs of management topics or analysis granularity.

12. The method according to claim 1, characterized in that, In step S5 The statistical tables include: a cross-regional profit comparison table, a revenue statistics table cross-referenced by time and region, an inventory and turnover days statistics table by category and warehouse, and a risk exposure distribution table by risk level and asset class. The images analyzed include: line charts, bar charts, column charts, pie charts, and stacked charts.

13. The method according to claim 1, characterized in that, In step S6, the structured set of variables includes: sales analysis text, complaint analysis text, profit analysis text, complaint statistics table text, profit comparison table text, and related image file paths or reference information.

14. The method according to claim 1, characterized in that, In step S7, the chapter settings of the analysis report include: Chapter 1: Overall Business Overview; Chapter Two: Revenue and Profit Analysis; Chapter Three: Customer Service and Complaint Analysis; Chapter Four: Inventory Operations Analysis; Chapter Five: Risk Control Analysis; Chapter Six: Project Execution and Budget Analysis.

15. A multi-sub-spreadsheet automatic parsing system based on multi-agent workflow, wherein the modules in the system operate collaboratively to implement the steps of the method described in any one of claims 1-14, the system comprising: The document access module is used to receive spreadsheets and generate task identifiers (task_id). The document parsing intelligent agent module is used for parsing multiple worksheets and subsheets, as well as recognizing table headers. The intermediate data management module is used to build and maintain intermediate data structures; The business analysis intelligent agent cluster module includes an electricity sales analysis intelligent agent, a complaint analysis intelligent agent, and a profit analysis intelligent agent; The tabulation agent module is used to generate markup language tables; The mapping intelligence module is used to generate business analysis images; The variable aggregation agent module is used to aggregate various analysis results; The report orchestration agent module is used to generate the final analysis report; The task management and storage module is used to uniformly manage intermediate files and final results during the task process based on task_id.

16. The system according to claim 15, characterized in that, The scheduling and collaboration methods for each module include: multi-agent workflow engine, microservice architecture, or inter-process communication. Among them, the multi-agent workflow engine approach includes: each agent is triggered in series or in parallel as a node, and data transmission and state management are carried out between workflow nodes through task identifiers and intermediate data structures; Module deployment methods include: deployment on the server or in the cloud, or deployment on the local system.

17. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1-14.

18. A computer program product, characterized in that, When executed by a processor, the computer program implements the steps of the method described in any one of claims 1-14.

Citation Information

Patent Citations

  • Electric power material supply chain system based on intelligent operation center and construction and application thereof

    CN112488487A

  • Multi-agent-based self-adaptive budget report generation method

    CN120449839A