Report generation method and device

By receiving reports and generating descriptions, obtaining target analysis ideas, determining dependent data tables and field values ​​from the database, and generating reports using large language models and task analysis tools, the problem of low automation and insufficient flexibility in existing technologies is solved, achieving efficient and accurate report generation.

CN121786098APending Publication Date: 2026-04-03WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing template-based report generation systems suffer from low automation and inflexibility, making them unable to adapt to various types of data, resulting in low report generation efficiency and accuracy.

Method used

The process involves receiving a report, generating a description, identifying a matching target analysis approach, determining dependent data tables and fields from the target database, retrieving field values ​​for each step indicated by the analysis approach, and ultimately generating the target report. A large language model is used to quickly match the analysis approach and data tables, combined with task analysis tools to retrieve field values.

Benefits of technology

It improves the efficiency and flexibility of report generation, ensures that the generated reports are based on verifiable evidence, avoids fabrication, and enhances the accuracy of report generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786098A_ABST
    Figure CN121786098A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information, and discloses a report generation method and device. Obtaining a target analysis thought matched with the report generation description; according to the report generation description and the target analysis thought, determining a dependency data table and a dependency field used for generating the target report; for any analysis step indicated by the target analysis thought, obtaining a field value of a dependency field corresponding to the analysis step from the dependency data table; and taking each analysis step indicated by the target analysis thought as each chapter of the target report, and forming the target report according to the dependency field corresponding to each analysis step and the field value of the dependency field. Therefore, the report generation efficiency and flexibility can be improved and the report generation accuracy can also be improved in a mode of generating the report from an analysis thought.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information technology, and in particular to a report generation method and apparatus. Background Technology

[0002] With the development of computer technology, more and more technologies are being applied in the financial sector, and the traditional financial industry is gradually transforming into Fintech. However, due to the security and real-time requirements of the financial industry, higher demands are also being placed on technology.

[0003] For example, with the improvement of data collection and storage capabilities in the financial industry, analyzing financial data and generating reports on demand has become a daily task for many financial professionals. Currently, report generation technology typically employs template-based systems. These systems rely on defined templates and rules, requiring users to manually select a template and input data according to the rules. The system then generates the report in a fixed format. Clearly, this approach necessitates users creating appropriate report templates in advance for various types of data. Furthermore, existing templates may not be suitable for newly generated data. Therefore, template-based report generation systems suffer from low automation and inflexibility. Summary of the Invention

[0004] This application provides a report generation method to improve the efficiency and flexibility of report generation.

[0005] In a first aspect, embodiments of this application provide a report generation method, the method comprising: receiving a report generation description; wherein the report generation description is used to instruct the generation of a target report based on a target database; obtaining a target analysis approach matching the report generation description from an analysis approach knowledge base; determining, based on the report generation description and the target analysis approach, a dependency data table and dependency fields for generating the target report from the target database; the dependency fields are used to determine the analysis metrics and / or analysis dimensions of the target report; for any analysis step indicated by the target analysis approach, obtaining the field value of the dependency field corresponding to the analysis step from the dependency data table; using each analysis step indicated by the target analysis approach as a chapter of the target report, and forming the target report based on the dependency fields and field values ​​corresponding to each analysis step.

[0006] In the above scheme, for the received report generation description, the process begins by obtaining a matching target analysis approach. Then, the dependent data tables and fields required to generate the target report are identified from the target database. Next, following each step indicated by the target analysis approach, the field values ​​of the dependent fields used in the current step are determined. Finally, each step indicated by the target analysis approach is used as a chapter in the target report, and the field values ​​of the dependent fields used in each previous step are filled into each chapter, thus forming the target report. This approach uses the analysis approach as a guide for report generation, and the data used to form the report depends on the data tables and fields in the target database, rather than arbitrarily imagining non-existent data. Therefore, generating reports based on the analysis approach improves the efficiency and flexibility of report generation, as well as its accuracy.

[0007] In one possible implementation method, obtaining the target analysis approach matching the report generation description from the analysis approach knowledge base includes: inputting the report generation description and a preset analysis approach knowledge base into a first large language model, and outputting a target report analysis pattern through the first large language model using a first prompt word; wherein, the preset analysis approach knowledge base includes multiple report analysis patterns, each report analysis pattern including a name of the report analysis pattern, a description example of the report analysis pattern, and an analysis approach; and using the analysis approach in the target report analysis pattern as the target analysis approach.

[0008] In the above scheme, by using the first major language model, the target report analysis pattern that matches the report generation description can be quickly determined from the threshold analysis idea knowledge base. Since the report analysis pattern contains analysis ideas, the analysis ideas in the target report analysis pattern can be used as the target analysis ideas that match the report generation description.

[0009] In one possible implementation method, determining the dependent data table and dependent fields for generating the target report from the target database based on the report generation description and the target analysis approach includes: inputting the report generation description, the target analysis approach, and the target database into a second large language model; and determining, through the second large language model, the dependent data table, indicator fields, and the dependent data table containing the indicator fields, as well as the dimension fields and the dependent data table containing the dimension fields, from the target database; the indicator fields are related to the analysis indicators indicated by the target analysis approach, and the dimension fields are related to the analysis dimensions indicated by the target analysis approach.

[0010] In the above solution, by using the second language model, the dependent data tables, indicator fields and their corresponding dependent data tables, dimension fields and their corresponding dependent data tables used to generate the target report can be quickly determined from the target database. Since the determined dependent data tables, indicator fields and dimension fields are to be used to generate the target report in the future, this will make the generated target report traceable and avoid the embarrassing problem of creating data out of thin air.

[0011] In one possible implementation method, the step of inputting the report generation description, the target analysis approach, and the target database into a second large language model, and using the second large language model to determine from the target database the dependent data tables, indicator fields, and dependent data tables containing the indicator fields, as well as dimension fields and their dependent data tables, for generating the target report, includes: inputting the report generation description, the report analysis mode to which the target analysis approach belongs, and N data tables in the target database into the second large language model; using a second prompt word, using the second large language model to determine from the target database multiple weakly dependent data tables related to the report generation description and related reasons; processing the data tables in the target database in batches of N data tables; inputting the report generation description, the report analysis mode to which the target analysis approach belongs, the target analysis approach, and the multiple weakly dependent data tables into the second large language model; using a third prompt word, using the second large language model to determine from the multiple weakly dependent data tables the dependent data tables, indicator fields, and dependent data tables containing the indicator fields, as well as dimension fields and their dependent data tables, for generating the target report.

[0012] In the above scheme, considering that the number of data tables in the target database is relatively large, this application proposes to first screen out some weakly dependent data tables. That is, the data tables in the target database are divided into batches of N data tables and the second language model is used to screen out these weakly dependent data tables. Then, for the screened weakly dependent data tables, the second language model can be used to further screen out the dependent data tables, indicator fields and the dependent data tables where the indicator fields are located, dimension fields and the dependent data tables where the dimension fields are located, which are used to generate the target report.

[0013] In one possible implementation, obtaining the field value of the dependency field corresponding to the analysis step from the dependency data table for any analysis step indicated by the target analysis approach includes: determining at least one analysis task to be executed in the analysis step for any analysis step indicated by the target analysis approach; and for any one of the at least one analysis task, invoking a task analysis tool matching the task type according to the task type to which the analysis task belongs, and obtaining the field value of the dependency field corresponding to the analysis task from the dependency data table through the task analysis tool.

[0014] In the above solution, each analysis step in the target analysis approach is broken down into individual analysis tasks in the data acquisition process. Then, for each analysis task, the field values ​​of the dependent fields corresponding to the analysis task can be quickly obtained from the dependent data table by calling the task analysis tool that matches the task type of the analysis task.

[0015] In one possible implementation method, the task type includes one or more of trend analysis, dimensional comparison analysis, indicator fluctuation attribution analysis, and trend prediction; the task analysis tool includes one or more of the Chatbi tool, attribution analysis tool, and trend prediction tool.

[0016] In one possible implementation method, determining at least one analysis task to be executed in any analysis step indicated by the target analysis approach includes: for any analysis step indicated by the target analysis approach, inputting the report generation description, the target analysis approach, the dependency data table, the dependency fields, and the list of executed tasks into a fourth language model; and outputting at least one analysis task to be executed in the analysis step and the dependency tasks of the at least one analysis task through the fourth language model using a fifth prompt word; wherein the list of executed tasks contains each analysis task corresponding to each analysis step executed before the analysis step.

[0017] In the above scheme, by controlling the planning time of subsequent analysis tasks to be completed when the preceding analysis tasks are finished, rather than planning all analysis tasks at the beginning, it is easier to see whether the planning of subsequent analysis tasks is comprehensive by combining the execution results of the preceding analysis tasks, thus improving the comprehensiveness of analysis task planning.

[0018] Secondly, embodiments of this application provide a report generation apparatus, comprising: a receiving unit for receiving a report generation description, wherein the report generation description is used to instruct the generation of a target report based on a target database; an acquisition unit for acquiring a target analysis approach matching the report generation description from an analysis approach knowledge base; a determining unit for determining, based on the report generation description and the target analysis approach, a dependency data table and dependency fields for generating the target report from the target database; the dependency fields are used to determine the analysis metrics and / or analysis dimensions of the target report; the acquisition unit is further configured to acquire, for any analysis step indicated by the target analysis approach, the field value of the dependency field corresponding to the analysis step from the dependency data table; and a generation unit for using each analysis step indicated by the target analysis approach as a chapter of the target report, and forming the target report based on the dependency fields and field values ​​corresponding to each analysis step.

[0019] Thirdly, embodiments of this application provide a computing device, including: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute any implementation method of the first aspect according to the obtained program.

[0020] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform any implementation method as described in the first aspect.

[0021] Fifthly, embodiments of this application provide a computer program product, the computer program product including computer-executable instructions, the computer-executable instructions being used to cause a computer to perform any implementation method as described in the first aspect. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A system architecture diagram for report generation applicable to embodiments of this application; Figure 2 A schematic diagram illustrating a report generation method provided in an embodiment of this application; Figure 3 A schematic diagram of a report generation device provided in an embodiment of this application; Figure 4 This is a schematic diagram of a computing device provided in an embodiment of this application. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] refer to Figure 1 This is a system architecture diagram for report generation applicable to the embodiments of this application. The system architecture diagram for report generation includes at least a terminal device 101 and a report generation system 102.

[0026] The terminal device 101 has a target application installed for report generation. This target application can be a pre-installed client, a web application, or a mini-program embedded in other applications. The terminal device 101 can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these.

[0027] The report generation system 102 serves as the backend server for the target application, providing services to it. The report generation system 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0028] Terminal device 101 and report generation system 102 can be connected directly or indirectly via wired or wireless communication, and this application does not impose any restrictions on this.

[0029] Terminal device 101 responds to the user's report generation operation by sending a report generation instruction to report generation system 102. Report generation system 102 receives a report generation description; wherein the report generation description is used to instruct the generation of a target report based on a target database; it retrieves a target analysis approach matching the report generation description from an analysis approach knowledge base; based on the report generation description and the target analysis approach, it determines the dependent data table and dependent fields used to generate the target report from the target database; the dependent fields are used to determine the analysis metrics and / or analysis dimensions of the target report; for any analysis step indicated by the target analysis approach, it retrieves the field value of the dependent field corresponding to the analysis step from the dependent data table; it uses each analysis step indicated by the target analysis approach as a chapter of the target report, and forms the target report based on the dependent fields and their field values ​​corresponding to each analysis step.

[0030] based on Figure 1 The system architecture diagram described above, and the embodiments of this application provide a flow chart for a report generation method, such as... Figure 2 As shown, the process of this method is as follows: Figure 1 The report generation system 102 shown executes the following steps: Step 201: Receive report and generate description.

[0031] The report generation description is used to instruct the generation of a target report based on the target database.

[0032] In this step, when a user wants to create a report, the user can input a description of the desired report into the terminal device 101 mentioned earlier. This description is the report generation description. The user can input the report generation description as text using the keyboard of the terminal device 101, or the user can verbally describe the content of the desired report to the terminal device 101, which will then convert the speech to text using the speech-to-text conversion component in the terminal device 101. Other methods can also be used to generate the report generation description; this application does not limit this approach.

[0033] For the report generation description entered by the user in the terminal device 101, the terminal device 101 can send it to the report generation system 102 of this application, and the corresponding report generation system 102 can receive the report generation description.

[0034] It should be noted that the report generation description needs to be based on a known data range. This known data range can be data in a database, which is the target database. The known data range can also be several data tables in a database. This application does not limit the known data range.

[0035] Examples of report generation descriptions could be "Please generate a report on sales performance in the first quarter of 2025", "Please analyze the reasons for the decline in sales performance in 2024 compared to 2023", or "Automatically predict sales performance in 2025 based on sales performance in 2024".

[0036] Step 202: Obtain the target analysis approach that matches the report generation description from the analysis approach knowledge base.

[0037] In this step, the analytical approach knowledge base can be prepared in advance and can include multiple analytical approaches. For the report generation description, the report generation system 102 can find an analytical approach that matches the report generation description from the analytical approach knowledge base and use that approach as the target analytical approach; or it can find multiple analytical approaches that match the report generation description from the analytical approach knowledge base and further verify them, such as manually verifying the multiple analytical approaches and using the most realistic one as the target analytical approach.

[0038] Step 203: Based on the report generation description and the target analysis approach, determine the dependent data tables and dependent fields used to generate the target report from the target database.

[0039] The dependency fields are used to determine the analytical metrics and / or analytical dimensions of the target report.

[0040] In this step, based on the received report generation description and the determined target analysis approach, the report generation system can determine the dependent data tables and dependent fields that can be used to generate the target report from the known scope of the target database. The dependent data tables can be understood as the data source tables used to generate the target report, that is, the data in the target report comes from the dependent data tables. The dependent fields can be understood as the various fields used for indicator analysis, or dimensional analysis, or indicator analysis and dimensional analysis in the target report. That is, the various indicator analyses and / or dimensional analyses performed in the target report are determined based on the dependent fields.

[0041] Step 204: For any analysis step indicated by the target analysis approach, obtain the field value of the dependency field corresponding to the analysis step from the dependency data table.

[0042] In this step, different analytical approaches will be used when processing different report generation descriptions. An analytical approach can be understood as a solution adapted to the content of the report generation description. This solution is general; for example, it might mainly outline the number of analytical steps required to process the report generation description and what each step entails.

[0043] The target analysis approach naturally includes at least one analysis step. For any analysis step indicated by the target analysis approach, the report generation system 102 can obtain the field value of the dependent field corresponding to the analysis step from the dependent data table, that is, obtain the specific values ​​of the analysis indicators and / or analysis dimensions required in the target report from the determined data source.

[0044] Step 205: Using each analysis step indicated by the target analysis approach as a chapter of the target report, the target report is formed based on the dependent fields and their values ​​corresponding to each analysis step.

[0045] In this step, since reports are generally created chapter by chapter, this application can use the analysis steps indicated by the target analysis approach as the chapters of the target report. Then, for the report content in any chapter, the dependent fields and their values ​​corresponding to the analysis steps in that chapter can be used to generate the final report content, i.e., the target report.

[0046] In the above scheme, for the received report generation description, the process begins by obtaining a matching target analysis approach. Then, the dependent data tables and fields required to generate the target report are identified from the target database. Next, following each step indicated by the target analysis approach, the field values ​​of the dependent fields used in the current step are determined. Finally, each step indicated by the target analysis approach is used as a chapter in the target report, and the field values ​​of the dependent fields used in each previous step are filled into each chapter, thus forming the target report. This approach uses the analysis approach as a guide for report generation, and the data used to form the report depends on the data tables and fields in the target database, rather than arbitrarily imagining non-existent data. Therefore, generating reports based on the analysis approach improves the efficiency and flexibility of report generation, as well as its accuracy.

[0047] Regarding step 201 above, before the report generation system 102 of this application receives the report generation description, the report generation system 102 initializes the following global state: { "Report Generation Description": null, "Analysis Mode": null, "Analysis Approach": null, "Filtered data table": [], "Relevant Indicators": [], "Relevant dimensions": [], "Task List": [], "List of executed tasks": [], "Task execution result": {}, "Data execution complete": false } When the report generation system 102 receives the report generation description "Please generate a report on sales performance in the first quarter of 2025", the report generation system 102 can save the report generation description to the global state. For example, the global state mentioned above can be updated to the following state: { Report generation description: "Please generate a report on sales performance for the first quarter of 2025". "Analysis Mode": null, "Analysis Approach": null, "Filtered data table": [], "Relevant Indicators": [], "Relevant dimensions": [], "Task List": [], "List of executed tasks": [], "Task execution result": {}, "Data execution complete": false } The main goal of step 202 is to identify the target analytical approach that matches the report generation description from the analytical approach knowledge base. This goal can be achieved in the following three ways: Before describing the three implementation methods, we can first provide an example of a report generation description and an analysis approach knowledge base: An example of a report generation description is: Please generate a report on sales in the first quarter of 2025.

[0048] Examples of report analysis patterns available in the analysis approach knowledge base are as follows: (1) Descriptive analysis report: Example: Please generate a report on sales performance for the first quarter of 2025. Analysis approach: Identify the main metrics described by the user, first use trend analysis to view the changes in the metrics over time, and then use dimensional comparison analysis to compare the metrics from different dimensions.

[0049] (2) Attribution analysis report: Example: Please analyze the reasons for the decline in sales in 2025 compared to 2024.

[0050] Analysis approach: Identify the main metrics described by users. The first step is to plan a trend analysis to view the changes in metrics over time. The second step is to plan a metric fluctuation attribution analysis task to identify the top 5 attribution dimensions. The third step is to plan a dimension comparison analysis task based on the attribution dimensions.

[0051] (3) Forecast Analysis Report: Example: Automatically predict sales for 2026 based on 2025 sales figures.

[0052] Analysis approach: Identify the main metrics described by the user. The first step is to plan how to use trend analysis to view the changes in the metrics over time. The second step is to use trend prediction tasks to make predictions.

[0053] Each report analysis mode includes the name of the report analysis mode, a description example of the report analysis mode, and the analysis approach. For example, in the content of (1) descriptive analysis report, "descriptive analysis report" is the name of the report analysis mode, "Example: Please generate a report on the sales situation in the first quarter of 2025" is a description example of the report analysis mode, and "Identify the main indicators described by the user, first use trend analysis to view the changes of the indicators from the time trend, and then use dimensional comparison analysis to compare the situation of the indicators from different dimensions" is the analysis approach in the descriptive analysis report report analysis mode.

[0054] It should be noted that the three types of report analysis models provided above are merely examples of the analysis approach knowledge base, and the specific analysis approach knowledge base is not limited to these three types of report analysis models.

[0055] Next, regarding the report generation description "Please generate a report on sales performance in the first quarter of 2025," this application will illustrate, with examples from the provided analytical approach knowledge base, how to determine a target analytical approach that matches this report generation description from the analytical approach knowledge base: Method 2021, keyword-based approach For example, the report generation description "Please generate a report on sales in the first quarter of 2025" contains the keywords "sales" and "report," but does not contain the keywords "decline" or "reasons" found in the attribution analysis report mode, nor the keywords "automatic prediction" found in the predictive analysis report mode. Therefore, after comprehensive comparison, the descriptive analysis report mode is the better match. This application can use the analytical approach from the descriptive analysis report mode—"identify the main indicators described by the user, first use trend analysis to view the changes in indicators over time, and then use dimensional comparison analysis to compare the indicators from different dimensions"—as the target analytical approach to match the report generation description "Please generate a report on sales in the first quarter of 2025."

[0056] Method 2022, a sentence-based expression method

[0057] For example, the sentence structure for the report generation description "Please generate a report on sales in the first quarter of 2025" can be abstracted as "Generate a report on...sales...", while the sentence structures for the description examples in the three report analysis modes mentioned above can be abstracted as follows: Descriptive analysis reports: Generate reports on... sales / expenses / revenue... Attribution Analysis Report: Analyzes the reasons for the decrease / increase in... sales / expenses / revenue... Forecast Analysis Report: Based on ... sales / expenses / revenue, forecast ... sales / expenses / revenue. Therefore, after comprehensive comparison, the descriptive analysis report model is the best match. For this purpose, this application can use the analytical approach of "identifying the main indicators described by the user, first using trend analysis to view the changes of the indicators from the time trend, and then using dimensional comparison analysis to compare the indicators from different dimensions" in the descriptive analysis report model as the target analytical approach to match the report generation description of "please generate a report on the sales situation in the first quarter of 2025".

[0058] Method 2023, based on a large language model

[0059] Optionally, obtaining the target analysis approach matching the report generation description from the analysis approach knowledge base includes: inputting the report generation description and the preset analysis approach knowledge base into a first large language model, and outputting a target report analysis mode through the first large language model using a first prompt word; wherein, the preset analysis approach knowledge base includes multiple report analysis modes, each report analysis mode including a name of the report analysis mode, a description example of the report analysis mode, and an analysis approach; and using the analysis approach in the target report analysis mode as the target analysis approach.

[0060] For example, a large language model is invoked, passing the report generation description and all files containing analysis ideas from a pre-defined knowledge base to the model. By setting prompt words, the large language model identifies the report analysis pattern that matches the report generation description and uses the analysis idea in the matched report analysis pattern as the target analysis idea. Here, the large language model invoked is the first large language model, and the prompt words set are the first prompt words.

[0061] The first prompt word can be exemplified as follows: You are a data analytics expert. Based on the user's report, generate a description, determine the report's analysis pattern, and identify the key metrics being described.

[0062] Analytical thinking knowledge base: {{Analysis of the document's content}} User description: "{{Report generation description}}" Require: 1. Match the report generation description with examples from the knowledge base of analytical approaches. 2. Identify the most suitable report analysis pattern 3. Identify the key metrics described by the user in the report generation description. Please return in JSON format: { Report Type: Descriptive Analysis Report / Attribution Analysis Report / Predictive Analysis Report "Analysis Approach": "Description of the Analysis Approach", } Suppose that the processing of the first language model can identify the report analysis mode corresponding to the report generation description "Please generate a report on the sales situation in the first quarter of 2025" as a descriptive analysis report. Then, based on this identified report analysis mode, the global state mentioned above can be updated again. Let the global state update be as follows: { Report generation description: "Please generate a report on sales performance for the first quarter of 2025". "Analysis Mode": "Descriptive Analysis Report", "Analysis Approach": "Identify the main metrics described by the user, first use trend analysis to view the changes in the metrics over time, then use dimensional comparison analysis to compare the metrics from different dimensions." "Filtered data table": [], "Relevant Indicators": [], "Relevant dimensions": [], "Task List": [], "List of executed tasks": [], "Task execution result": {}, "Data execution complete": false } Step 203 above mainly aims to retrieve the dependent data tables and fields used to generate the target report from the target database. This can be achieved in two ways: Method 2031, based on the report theme in the report generation description. The report generation description above, "Please generate a report on sales in the first quarter of 2025," focuses on sales. Therefore, it is understandable to find data tables related to "sales" in the target database, such as "Sales Amount Table," "Sales Quantity Table," and "Sales Product Table." These three example tables can be used as dependent data tables, and the "sales" related fields in these three tables can be used as dependent fields.

[0063] Method 2032, an implementation based on a large language model.

[0064] Optionally, determining the dependent data tables and dependent fields for generating the target report from the target database based on the report generation description and the target analysis approach includes: inputting the report generation description, the target analysis approach, and the target database into a second language model, and determining from the target database, the dependent data tables, indicator fields, and the dependent data tables containing the indicator fields, as well as the dimension fields and the dependent data tables containing the dimension fields, for generating the target report; the indicator fields are related to the analysis indicators indicated by the target analysis approach, and the dimension fields are related to the analysis dimensions indicated by the target analysis approach.

[0065] For example, a large language model is invoked, passing the report generation description, target analysis approach, and target database to the large model. The large language model then identifies from the target database the data tables used to generate the target report, the indicator fields in the data tables used to form the analytical metrics in the target report, and / or the dimension fields in the data tables used to form the analytical dimensions in the target report. It should be noted that the large language model here is the second large language model, and the data tables used to generate the target report are the dependent data tables.

[0066] Optionally, in step 2032 above, the step of inputting the report generation description, the target analysis approach, and the target database into a second large language model, and using the second large language model to determine from the target database the dependent data tables, indicator fields, and dependent data tables containing the indicator fields, as well as dimension fields and their dependent data tables, for generating the target report, includes: inputting the report generation description, the report analysis mode to which the target analysis approach belongs, and N data tables in the target database into the second large language model; using a second prompt word, using the second large language model to determine from the target database multiple weakly dependent data tables related to the report generation description and related reasons; processing the data tables in the target database in batches of N data tables; inputting the report generation description, the report analysis mode to which the target analysis approach belongs, the target analysis approach, and the multiple weakly dependent data tables into the second large language model; using a third prompt word, using the second large language model to determine from the multiple weakly dependent data tables the dependent data tables, indicator fields, and dependent data tables containing the indicator fields, as well as dimension fields and their dependent data tables, for generating the target report.

[0067] The following section will continue with the examples from the previous text to explain in detail how the dependency tables and dependency fields are determined.

[0068] First, a list of all data tables in the target database is read, with each batch consisting of 10 data tables. Then, the data tables, report generation description, and report analysis mode corresponding to the target analysis approach for each batch are input into a large language model. By setting prompt words, the large language model identifies the data tables related to the report generation description and explains why they are related, while excluding data tables that are not very relevant to the report generation description. Here, the large language model is the second large language model, the prompt words are the second prompt words, the identified data tables related to the report generation description are weakly dependent data tables, and the explanations for their relevance are the relevant reasons.

[0069] For example, the data for the i-th batch of processing is represented as follows: Batch i (Table 1-10): Table 1: Sales Details (sales_detail) - Fields: Order ID (bigint, primary key), Order Date (date), Sales Amount (decimal), Sales Province (varchar), Product ID (bigint) - Association: Associated with the product table via product ID, and with the user table via user ID. Table 2: Product Table (product_info) - Fields: Product ID (bigint, primary key), Product Name (varchar), Product Category (varchar), Product Price (decimal) - Association: Associated with the sales details report via product ID. ... (Total 10 tables) The second prompt word could be as follows: You are a data architecture expert. Based on the report generation description and report analysis pattern, identify which of the following 10 data tables are related to the user's report generation description.

[0070] Report requirements: {{Report generation description}}

[0071] Analysis Mode: {{Report Analysis Mode}}

[0072] Analysis approach: {{Analysis approach}}

[0073] Data table information (10 tables in total): {{Compressed Table Description}} Require: 1. Only return tables related to the report generation description. 2. For each relevant table, explain why it is relevant. Output format (JSON): { "Related Tables List": [ { "table_name": "table_name", "Relevance": "Why is this table relevant?" } ] } For example, the weakly dependent data tables identified after processing the first batch of 10 data tables using a large language model, along with the related reasons, can be illustrated as follows: Example results (first batch): { "Related Tables List": [ { Table Name: Sales Details Table "Relevance": This table contains sales amount and sales date, and is the core table for analyzing sales performance. }, { Table Name: Product Table "Relevance": Contains product information and can be used for dimensional comparison analysis. } ] } After identifying the weakly dependent data tables, the report generation system 102 of this application can further input the report generation description, the report analysis mode to which the target analysis approach belongs, the target analysis approach, and the weakly dependent data tables into the large language model. By setting prompt words, the large language model can determine the final data table, the final indicator fields and their dependent data tables, and the dimension fields and their dependent data tables from multiple weakly dependent data sets. The large language model used here is the second large language model, the set prompt words are the third prompt words, and the final data table is the dependent data table.

[0074] For example, here is an example of a third prompt word: You are a data architecture expert. Based on the report requirements, analysis model, and analysis approach, please identify the final data table from the following initially screened data tables, and identify the metrics and dimensions relevant to the user's questions.

[0075] Report requirements: {{Report generation description}}

[0076] Analysis Mode: {{Report Analysis Mode}}

[0077] Analysis approach: {{Analysis approach}}

[0078] Data table information after initial screening: {{Detailed structural description of all weakly dependent data tables}} Require: 1. Filter out the final data tables (keeping only the most essential tables). 2. Identify relevant indicators (numerical indicators used for analysis). 3. Identify relevant dimensions (categorical dimensions used for analysis) 4. Specify which table and field each metric and dimension comes from. Output format (JSON): { "Final Data Table": [ { "table_name": "table_name", "Table Structure": "Detailed structure of the table" } ], "Relevant Indicators": [ { "Indicator Name": "Indicator Name", "Source Table": "Table Name", "Source field": "Field name" } ], "Relevant Dimensions": [ { "Dimension Name": "Dimension Name", "Source Table": "Table Name", "Source field": "Field name" } ] } For example, the dependent data tables and indicator fields, dimension fields determined after processing all weakly dependent data tables through a large language model can be exemplified as follows: { "Final Data Table": [ { Table Name: Sales Details Table Table Structure: Order ID (bigint, primary key), Order Date (date), Sales Amount (decimal), Sales Province (varchar) } ], "Relevant Indicators": [ { "Indicator Name": "Sales Amount", "Source Table": "Sales Details Table", Source field: "Sales amount" } ], "Relevant Dimensions": [ { "Dimension Name": "Time Dimension", "Source Table": "Sales Details Table", "Source field": "Order date" }, { "Dimension Name": "Regional Dimension", "Source Table": "Sales Details Table", "Source field": "Province of sale" } ] } It should be noted that in the above example, the data table named "Sales Details Table" is the dependent data table, and the field whose source field is "Sales Amount" in the related indicators is the indicator field. The fact that the source table of the related indicators is "Sales Details Table" means that the dependent data table of the indicator field "Sales Amount" is "Sales Amount". The indicator whose name is "Sales Amount" in the related indicators means that the analysis indicator in the future target report is "Sales Amount".

[0079] In the relevant dimensions, the field whose source field is the order date is the dimension field. If the source table of the relevant dimension is the sales details table, it means that the data table that the order date dimension field depends on is the sales details table. If the dimension name of the relevant dimension is the time dimension, it means that one of the analysis dimensions in the target report to be formed in the future is time, that is, the future analysis can be carried out according to the time dimension.

[0080] In the relevant dimensions, the source field is the sales province, which is the dimension field. If the source table of the relevant dimensions is the sales details table, it means that the data table that the sales province dimension field depends on is the sales details table. If the dimension name of the relevant dimensions is the region dimension, it means that one of the analysis dimensions in the future target report is the region, that is, the future analysis can be carried out according to the region dimension.

[0081] After obtaining the dependency data table and dependency fields, this information can be used to update the latest global state mentioned earlier. For example, the global state can be updated as follows: { Report generation description: "Please generate a report on sales performance for the first quarter of 2025". "Analysis Mode": "Descriptive Analysis Report", "Analysis Approach": "Identify the main metrics described by the user, first use trend analysis to view the changes in the metrics over time, then use dimensional comparison analysis to compare the metrics from different dimensions." "Filtered data table": [ { Table Name: Sales Details Table "Table Structure": "..." } ], "Relevant Indicators": [ { "Indicator Name": "Sales Amount", "Source Table": "Sales Details Table", Source field: "Sales amount" } ], "Relevant Dimensions": [ { "Dimension Name": "Time Dimension", "Source Table": "Sales Details Table", "Source field": "Order date" }, { "Dimension Name": "Regional Dimension", "Source Table": "Sales Details Table", "Source field": "Province of sale" } ], "Task List": [], "List of executed tasks": [], "Task execution result": {}, "Data execution complete": false } For step 204 above, the main purpose is to obtain the field values ​​of the dependent fields corresponding to each analysis step from the dependent data table. For this objective, this application provides the following two implementation methods: Method 2041, Keyword-based approach For example, the analytical approach outlined in the previous example—"first use trend analysis to observe changes in indicators over time, then use dimensional comparison analysis to compare the indicators across different dimensions"—includes two analytical steps. The first step is "using trend analysis to observe changes in indicators over time," and the second step is "using dimensional comparison analysis to compare the indicators across different dimensions." Both steps aim to observe changes in indicators, but the first step focuses on how indicators change over time, while the second step focuses on how indicators change across different dimensions. Therefore, the core of the first step is time, and the core of the second step is different dimensions. For the first step, the corresponding dependent field is sales amount, and its value refers to the sales amount at different sales times. For the second step, the corresponding dependent field is sales amount, and its value refers to the sales amount across different dimensions. Referring back to the example where the dependent data table was a sales details table, the value of the dependent field in the second step refers to the sales amount in different regions.

[0082] Method 2042, Implementation based on task analysis tools

[0083] Optionally, obtaining the field value of the dependency field corresponding to the analysis step from the dependency data table for any analysis step indicated by the target analysis approach includes: determining at least one analysis task to be executed in the analysis step for any analysis step indicated by the target analysis approach; and for any analysis task among the at least one analysis task, calling a task analysis tool matching the task type according to the task type to which the analysis task belongs, and obtaining the field value of the dependency field corresponding to the analysis task from the dependency data table through the task analysis tool.

[0084] For example, as in the previous example, the target analysis approach of "first using trend analysis to view the changes in indicators over time, and then using dimensional comparison analysis to compare the indicators from different dimensions" includes two analysis steps: "first using trend analysis to view the changes in indicators over time" and "then using dimensional comparison analysis to compare the indicators from different dimensions." Taking the first analysis step as an example, it can be further broken down into at least one analysis task. For example, for the first analysis step, one analysis task could be "using trend analysis to view the changes in indicators daily," another analysis task could be "using trend analysis to view the changes in indicators weekly," and yet another analysis task could be "using trend analysis to view the changes in indicators monthly." Other analysis tasks in this analysis step will not be exemplified.

[0085] Next, for any analysis task in any analysis step, the task analysis tool that matches the task type can be invoked, and the field values ​​of the dependency fields corresponding to the analysis task can be obtained from the dependency data table through the task analysis tool.

[0086] Optionally, the task type includes one or more of trend analysis, dimensional comparison analysis, indicator fluctuation attribution analysis, and trend prediction; the task analysis tool includes one or more of Chatbi, attribution analysis, and trend prediction tools. The correspondence between task types and task analysis tools is as follows: trend analysis and dimensional comparison analysis both correspond to Chatbi, indicator fluctuation attribution analysis corresponds to attribution analysis tools, and trend prediction corresponds to trend prediction tools.

[0087] The following examples illustrate the various types of analysis tasks mentioned above: (1) Trend Analysis Task analysis tool: Chatbi Analysis objective: To view the sales figures for the first quarter on a monthly basis. Execution result: tabular data, such as SQL query result data. (2) Dimensional Comparison Analysis Task analysis tool: Chatbi Analysis objective: To compare first-quarter sales figures by region. Execution result: tabular data, such as SQL query result data. (3) Attribution analysis of indicator fluctuations Task analysis tools: Attribution analysis tools Analysis Objective: To analyze the reasons for the 30% year-on-year decline in the first quarter of 2025 compared to the first quarter of 2024. Execution result: tabular data, such as the top 5 attribution dimensions. (4) Trend prediction Task analysis tools: Trend prediction tools Analysis Objective: Based on data from the first quarters of 2024 and 2025, predict sales figures for the second quarter of 2025. Execution result: tabular data, such as predicted data. Furthermore, the following examples illustrate each of the task analysis tools mentioned above: (1) Chatbi tool Suppose the analysis task to be processed is "view sales figures by month," then the Chatbi tool can be used to handle this task. The Chatbi tool's processing logic is as follows: Step A1: Generate SQL query statement: Based on the current analysis task, dependent data tables and metrics in the global state, and dimension information, call the large model to generate an SQL query statement. The SQL query statement generation suggestions may include the following: You are an SQL generation expert. Please generate the SQL query statement based on the current analysis task.

[0088] User description: {{View sales figures by month}}

[0089] Related data tables: {{Related data tables}}

[0090] Relevant indicators: {{relevant indicators}}

[0091] Relevant dimensions: {{relevant dimensions}}

[0092] Require: 1. Based on the user description, select the appropriate data table from the related data tables. 2. Generate SQL queries using relevant metrics and dimensions. 3. Ensure the SQL syntax is correct. Please return to the SQL query statement.

[0093] Step A2, SQL Execution: Execute the generated SQL query statement and obtain the query results.

[0094] Step A3, SQL Exception Retry Mechanism: Check the SQL execution result. If there are exceptions, such as syntax errors, non-existent tables, or non-existent fields, re-invoke the large model with the following information and regenerate the SQL: 1. User input 2. Related data tables, metrics, and dimension information in the global state. 3. The SQL generated last time 4. SQL execution error messages You can retry a maximum of 3 times. If you still fail after 3 retries, return an error message.

[0095] The following are the SQL correction prompts used during retry: You are an SQL generation expert. The previously generated SQL failed to execute. Please correct the SQL based on the error message.

[0096] User description: {{Report generation description}}

[0097] Related data tables: {{Related data tables}}

[0098] Relevant indicators: {{relevant indicators}}

[0099] Relevant dimensions: {{relevant dimensions}}

[0100] Last generated SQL: {{Last generated SQL}}

[0101] Error message: {{SQL execution error message}}

[0102] Please return to the corrected SQL query statement.

[0103] Step A4, Unit Conversion: Perform a uniform unit conversion on the query results, automatically converting them to ten thousand or one hundred million.

[0104] Unit conversion rules: If the value is greater than or equal to 100,000,000 (100 million), convert it to 100 million and keep two decimal places. If the value is greater than or equal to 10,000 (ten thousand), convert it to ten thousand and keep two decimal places. If the value is less than 10000, keep the original value. For example: 150,000,000 → 150 million 15,000,000 → 15,000,000 1500 → 1500 Step A5, Return Results: Returns the SQL query results (units converted) and unit information.

[0105] Output format: { "Data Results": { "Month": ["2025-01", "2025-02", "2025-03"], Sales Amount: [100.00, 120.00, 150.00] }, "Company Information": { Sales Amount: "Ten Thousand" } } (2) Attribution analysis tools Suppose the analysis task is to "analyze the reasons for the 30% year-on-year decrease in sales revenue in Q1 2025 compared to Q1 2024". For this task, an attribution analysis tool can be used. The processing logic of the attribution analysis tool is as follows: Step B1: Generate Dimensional Comparison Statements: Provide the current analysis task, the related data tables and metrics in the global state, and the dimensional information to the large model. The large model will then output statements comparing the metrics under each dimension. The prompts for generating the dimensional comparison statements may include the following: You are a data analysis expert. Based on the current analysis task, please generate comparative statements for metrics across multiple dimensions.

[0106] User description: {{Analysis of the reasons for the 30% year-on-year decrease in sales revenue in Q1 2025 compared to Q1 2024}}

[0107] Related data tables: {{Related data tables}}

[0108] Relevant indicators: {{relevant indicators}}

[0109] Relevant dimensions: {{relevant dimensions}}

[0110] Require: 1. Generate comparison statements for multiple dimensions of metrics based on the dimensions in the related data table. 2. Each statement should be able to compare indicator values ​​between two time periods. 3. Returns an array in JSON format. Output format (JSON): { "List of Dimensional Comparison Statements": [ View Q1 2025 sales figures and Q1 2024 sales figures by region. View Q1 2025 sales figures and Q1 2024 sales figures by industry. View Q1 2025 sales figures and Q1 2024 sales figures by subsidiary. ] } Example output: { "List of Dimensional Comparison Statements": [ View Q1 2025 sales figures and Q1 2024 sales figures by region. View Q1 2025 sales figures and Q1 2024 sales figures by industry. "View Q1 2025 sales figures and Q1 2024 sales figures by subsidiary". View Q1 2025 and Q1 2024 sales figures by product category. View Q1 2025 sales figures and Q1 2024 sales figures by sales channel. ] } Step B2, Dimensional Data Acquisition: Iterate through the indicator comparison statements for each dimension, call the chatbi tool, pass in the statement, and obtain the data results.

[0111] For example: To use the Chatbi tool, enter: "View Q1 2025 sales figures and Q1 2024 sales figures by region". Results: Comparison of sales data for different regions over two time periods. Step B3, Attribution Analysis Calculation: For the comparison results of indicators in each dimension, call the attribution analysis algorithm (such as the attributer algorithm) to calculate the contribution of different dimension values ​​under this dimension.

[0112] Attribution analysis algorithm processing logic: For each dimension, calculate the contribution of each dimension value (e.g., "North China", "South China") to the change in the indicator. Record the dimensional values ​​of the top 3 contributions for each dimension. The contribution of a dimension is equal to the contribution of the dimension value that contributes the most within that dimension. For example, regarding the "region" dimension: North China's contribution: -15% Contribution from South China: -10% East China region's contribution: -5% The contribution of the "Region" dimension is -15% (taking the largest absolute value). The top 3 dimension values ​​are: North China (-15%), South China (-10%), and East China (-5%). Step B4, Return Results: Return the top 5 dimensions, and the top 3 dimension values ​​for each dimension.

[0113] Output format: { "List of Attribution Dimensions": [ { "Dimension Name": "Region", "Dimensional Contribution": 15.0 "top 3 dimension values": [ { "Dimension Value": "North China Region", Contribution: -15.0 }, { "Dimension Value": "South China Region", Contribution: -10.0 }, { "Dimension Value": "East China Region", Contribution: -5.0 } ] }, { "Dimension Name": "Industry", "Dimensional Contribution": 12.0 "top 3 dimension values": [ { "Dimension Value": "Manufacturing" Contribution: -12.0 }, { "Dimension Value": "Retail Industry", Contribution level: -8.0 }, { "Dimension Value": "Service Industry", Contribution level: -4.0 } ] }, ... ] } (3) Trend forecasting tools Suppose the analysis task is to "predict sales revenue from April to June 2026". This task can be handled using a trend forecasting tool. The processing logic of the trend forecasting tool is as follows: Step C1: Generate Trend Analysis Statement: Based on the current analysis task, the related data tables and indicators / dimensions in the global state, call the large model to generate a trend analysis statement to retrieve historical data. The prompts for generating the trend analysis statement may include the following: You are a data analysis expert. Based on the current analysis task, please generate a trend analysis statement to retrieve historical data.

[0114] User description: {{Predicted sales figures for April-June 2026}}

[0115] Related data tables: {{Related data tables}}

[0116] Relevant indicators: {{relevant indicators}}

[0117] Relevant dimensions: {{relevant dimensions}}

[0118] Require: 1. Determine the required historical data time range based on forecasting needs. 2. Generate a trend analysis statement to view the time trend of historical data. 3. The time frame should be long enough to allow for trend forecasting. Output format (JSON): { Trend Analysis Statement: "View sales figures from January 2025 to March 2026 by month." } Example output: { Trend Analysis Statement: "View sales figures from January 2025 to March 2026 by month." } Step C2, Historical Data Acquisition: Call the chatbi tool, pass in the trend analysis statement generated in the previous step, and obtain the historical data results.

[0119] For example: To access the Chatbi tool, enter: "View sales figures from January 2025 to March 2026 by month". Results: Monthly sales data from January 2025 to March 2026. Step C3, Trend Prediction: Call a time trend prediction algorithm (such as the Prophet algorithm), perform trend prediction based on the acquired historical data, and obtain and return the prediction results.

[0120] Trend prediction algorithm processing logic: Use historical data as training data The forecast timeframe (e.g., April-June 2026) is determined based on the projected demand. Prediction using time series forecasting algorithms such as Prophet. Returns the prediction results, including the predicted value and confidence interval (optional). Output format: { "Prediction Results": { "Time": ["2026-04", "2026-05", "2026-06"], Predicted values: [180.00, 200.00, 220.00] Unit: "ten thousand" "Confidence interval": { "Lower Boundary": [160.00, 180.00, 200.00], "Upper Boundary": [200.00, 220.00, 240.00] } }, Historical data: { "Time": ["2025-01", "2025-02", ..., "2026-03"], "Sales Revenue": [100.00, 120.00, ..., 170.00], Unit: "ten thousand" } } Through the examples of various types of analysis tasks and the examples of various task analysis tools, it is clearly explained how a specific task analysis tool is invoked to obtain the data desired by the analysis task.

[0121] Optionally, determining at least one analysis task to be executed in any analysis step indicated by the target analysis approach includes: for any analysis step indicated by the target analysis approach, inputting the report generation description, the target analysis approach, the dependency data table, the dependency fields, and the list of executed tasks into a fourth language model, and outputting at least one analysis task to be executed in the analysis step and the dependency tasks of the at least one analysis task through the fourth language model using a fifth prompt word; wherein, the list of executed tasks contains each analysis task corresponding to each analysis step executed before the analysis step.

[0122] For example, the report generation system of this application inputs the prompt words constructed as follows into the large language model. The large language model can output at least one analysis task that needs to be performed in a certain analysis step and the dependent tasks of the analysis task. The prompt word here is the fifth prompt word, and the large language model here is the fourth large language model.

[0123] The fifth prompt word is shown below: You are a data analysis planning expert. Based on user needs, analysis model, analysis approach, and a list of completed tasks, please plan 1-N data analysis tasks to be performed next.

[0124] User requirements: {{User requirements}}

[0125] Analysis Mode: {{Analysis Mode}}

[0126] Analysis approach: {{Analysis approach}}

[0127] The filtered data table: {{The filtered data table}}

[0128] Relevant indicators: {{relevant indicators}}

[0129] Relevant dimensions: {{relevant dimensions}}

[0130] List of executed tasks: {{List of executed tasks}}

[0131] Require: 1. Plan the task sequence based on the analysis approach. 2. Each task must be based on the available data tables and fields. 3. If execution results already exist, new tasks can be planned based on those results. 4. If all necessary tasks have been performed, there is no need to plan new tasks. Output format (JSON): { "Planned Task List": [ { "Task ID": "Unique identifier for the task", Task Type: Trend Analysis / Dimensional Comparison Analysis / Indicator Fluctuation Attribution Analysis / Trend Prediction "Execution Tools": "Chatbi tools / Attribution analysis tools / Trend prediction tools", "Execution Objective": "Specific objective description of the task", Task Status: "Pending Execution" "Dependent Tasks": ["Dependent Task IDs"] } ] } Example results (first planning, the list of executed tasks is empty): { "Planned Task List": [ { "Task ID": "task_001", Task Type: Trend Analysis "Execution tool": "chatbi tool", "Execution Objective": "View sales figures for the first quarter of 2025 on a monthly basis", Task Status: "Pending Execution" "Dependent Tasks": [] } ] } After obtaining the planned task list, the planned task list can be updated to the latest global state, as follows: { Report generation description: "Please generate a report on sales performance for the first quarter of 2025". "Analysis Mode": "Descriptive Analysis Report", "Analysis Approach": "Identify the main metrics described by the user, first use trend analysis to view the changes in the metrics over time, then use dimensional comparison analysis to compare the metrics from different dimensions." "Filtered data table": [ { Table Name: Sales Details Table "Table Structure": "..." } ], "Relevant Indicators": [ { "Indicator Name": "Sales Amount", "Source Table": "Sales Details Table", Source field: "Sales amount" } ], "Relevant Dimensions": [ { "Dimension Name": "Time Dimension", "Source Table": "Sales Details Table", "Source field": "Order date" }, { "Dimension Name": "Regional Dimension", "Source Table": "Sales Details Table", "Source field": "Province of sale" } ], "Task List": [ { "Task ID": "task_001", Task Type: Trend Analysis "Execution tool": "chatbi tool", "Execution Objective": "View sales figures for the first quarter of 2025 on a monthly basis", Task Status: "Pending Execution" "Dependent Tasks": [] } ], ... } Next, read the tasks with the status "pending execution" from the task list. For tasks with the status "pending execution", call the task analysis tool that matches the task type to obtain the data corresponding to the task, update the obtained data of the task to the latest global status, and update the status of the task to "completed".

[0132] The execution process of task_001, described above, is illustrated as follows: Since task_001 is a trend analysis task, following the correspondence between analysis tasks and task analysis tools described earlier, the chatbi tool is used here: Enter: "View sales figures for the first quarter of 2025 by month" Chatbi tool generates the following SQL: `SELECT DATE_FORMAT(Order Date, '%Y-%m') AS Month, SUM(Sales Amount) AS Sales Amount FROM Sales Details Table WHERE Order Date >= '2025-01-01' AND Order Date < '2025-04-01' GROUP BY DATE_FORMAT(Order Date, '%Y-%m') ORDER BY Month` Execute the SQL and get the results: { "Month": ["2025-01", "2025-02", "2025-03"], "Sales Amount": [1,000,000, 1,200,000, 1,500,000] } Update the obtained task results data to the latest global state, as follows: { Report generation description: "Please generate a report on sales performance for the first quarter of 2025". "Analysis Mode": "Descriptive Analysis Report", "Analysis Approach": "Identify the main metrics described by the user, first use trend analysis to view the changes in the metrics over time, then use dimensional comparison analysis to compare the metrics from different dimensions." "Filtered data table": [ { Table Name: Sales Details Table "Table Structure": "..." } ], "Relevant Indicators": [ { "Indicator Name": "Sales Amount", "Source Table": "Sales Details Table", Source field: "Sales amount" } ], "Relevant Dimensions": [ { "Dimension Name": "Time Dimension", "Source Table": "Sales Details Table", "Source field": "Order date" }, { "Dimension Name": "Regional Dimension", "Source Table": "Sales Details Table", "Source field": "Province of sale" } ], "Task List": [ { "Task ID": "task_001", Task Type: Trend Analysis "Execution tool": "chatbi tool", "Execution Objective": "View sales figures for the first quarter of 2025 on a monthly basis", Task Status: "Completed" "Execution result": { "Month": ["2025-01", "2025-02", "2025-03"], "Sales Amount": [1,000,000, 1,200,000, 1,500,000] } } ], "List of executed tasks": ["task_001"], "Task execution result": { "task_001": { "Month": ["2025-01", "2025-02", "2025-03"], "Sales Amount": [1,000,000, 1,200,000, 1,500,000] } }, "Data execution complete": false } If all tasks in the task list have been completed, but the data completion status is not specified, it is necessary to determine whether new tasks need to be planned.

[0133] For example, you can determine whether you need to plan a new task based on the following four pieces of information: 1. Report Generation Description 2. Target Analysis Approach 3. List of executed tasks 4. Results of the tasks already performed Example: After task_001 is completed, according to the analysis approach of "first using trend analysis to view the changes in indicators from the time trend, and then using dimensional comparison analysis to compare the indicators from different dimensions", it can be concluded that the trend analysis task has been completed, and the next step is to plan the dimensional comparison analysis task.

[0134] The new tasks proposed in the plan are as follows: { "Planned Task List": [ { "Task ID": "task_002", Task Type: Dimensional Comparison Analysis "Execution tool": "chatbi tool", "Execution Objective": "Compare sales figures for the first quarter of 2025 by region", Task Status: "Pending Execution" "Dependent Task": ["task_001"]} ] } Add the new task task_002 to the task list and continue execution.

[0135] If all necessary tasks have been completed and no new tasks need to be planned, update the "Data execution completed" status in the global state to "Yes".

[0136] The updated global state here is also the final global state: { ...(slightly) "Data processing complete": true, ... } Finally, when the data execution status in the global state is complete, the final report writing stage begins.

[0137] The system can generate prompts using the following report format, and utilize a large language model to create professional data analysis reports that include text and interactive charts.

[0138] Report generation prompt: You are a data analysis report writing expert. Please write a professional data analysis report based on the report generation description, target analysis approach, list of executed tasks, and data results.

[0139] User requirements: {{Report generation description}}

[0140] Analysis Mode: {{Report Analysis Mode}}

[0141] Analysis Approach: {{Target Analysis Approach}}

[0142] List of executed tasks: {{List of executed tasks}}

[0143] Task execution result: {{Task execution result}}

[0144] Require: 1. Generate concise HTML code, ensuring the code is complete and not truncated. Return only pure HTML code, without any other information.

[0145] 2. Organize the report structure according to the analytical approach, with each task corresponding to an analytical section.

[0146] 3. Each chapter contains: Chapter Title Chart showing the results of this task (using ECharts) Data Analysis Text Description 4. Use ECharts for chart display, ensure the correct CDN link is included, and add responsive design. 5. Ensure that the results of all tasks are presented in the report, and that charts and data are based on actual data; fabricated data is prohibited. The generated report includes: Report title and overview Trend Analysis Section (including charts and text descriptions of the execution results for task_001) The section on dimensional comparison and analysis includes charts and textual descriptions of the execution results for task_002. Summary and Recommendations Based on the same concept, embodiments of this application also provide a report generation apparatus, such as... Figure 3 As shown, the device includes: The receiving unit 301 is used to receive a report generation description; wherein the report generation description is used to instruct the generation of a target report based on the target database.

[0147] The acquisition unit 302 is used to acquire the target analysis idea that matches the report generation description from the analysis idea knowledge base.

[0148] The determining unit 303 is used to determine, from the target database, the dependent data table and dependent fields used to generate the target report based on the report generation description and the target analysis approach; the dependent fields are used to determine the analysis indicators and / or analysis dimensions of the target report.

[0149] The acquisition unit 302 is further configured to acquire, from the dependency data table the field value of the dependency field corresponding to the analysis step for any analysis step indicated by the target analysis approach.

[0150] The generation unit 304 is used to take each analysis step indicated by the target analysis approach as a chapter of the target report, and to form the target report according to the dependent fields and field values ​​corresponding to each analysis step.

[0151] Furthermore, for this device, the acquisition unit 302 is specifically used to input the report generation description and the preset analysis idea knowledge base into the first large language model, and output the target report analysis mode through the first large language model via the first prompt word; wherein, the preset analysis idea knowledge base includes multiple report analysis modes, each report analysis mode includes the name of the report analysis mode, a description example of the report analysis mode, and the analysis idea; and the analysis idea in the target report analysis mode is used as the target analysis idea.

[0152] Furthermore, for this device, the determining unit 303 is specifically used to input the report generation description, the target analysis approach, and the target database into a second large language model, and to determine from the target database, the dependent data table, indicator fields and the dependent data table where the indicator fields are located, and the dimension fields and the dependent data table where the dimension fields are located, for generating the target report; the indicator fields are related to the analysis indicators indicated by the target analysis approach, and the dimension fields are related to the analysis dimensions indicated by the target analysis approach.

[0153] Further, for this device, the determining unit 303 is specifically used to input the report generation description, the report analysis mode to which the target analysis approach belongs, and N data tables in the target database into the second large language model, and determine multiple weakly dependent data tables related to the report generation description and related reasons from the target database through the second large language model using a second prompt word; the data tables in the target database are processed in batches of N data tables; the report generation description, the report analysis mode to which the target analysis approach belongs, the target analysis approach, and the multiple weakly dependent data tables are input into the second large language model, and determine the dependent data tables used to generate the target report, the indicator fields and the dependent data tables where the indicator fields are located, and the dimension fields and the dependent data tables where the dimension fields are located from the multiple weakly dependent data tables through the second large language model using a third prompt word.

[0154] Furthermore, for this device, the acquisition unit 302 is specifically used to determine at least one analysis task to be executed in any analysis step indicated by the target analysis approach; for any analysis task among the at least one analysis task, according to the task type to which the analysis task belongs, call a task analysis tool that matches the task type, and obtain the field value of the dependency field corresponding to the analysis task from the dependency data table through the task analysis tool.

[0155] Furthermore, for this device, the task type includes one or more of trend analysis, dimensional comparison analysis, indicator fluctuation attribution analysis, and trend prediction; the task analysis tool includes one or more of the Chatbi tool, attribution analysis tool, and trend prediction tool.

[0156] Furthermore, for this device, the acquisition unit 302 is specifically used to input the report generation description, the target analysis approach, the dependency data table, the dependency fields, and the list of executed tasks into a fourth language model for any analysis step indicated by the target analysis approach, and output at least one analysis task to be executed in the analysis step and the dependent tasks of the at least one analysis task through the fourth language model via a fifth prompt word; wherein, the list of executed tasks contains each analysis task corresponding to each analysis step executed before the analysis step.

[0157] This application also provides a computing device, which may specifically be a desktop computer, portable computer, smartphone, tablet computer, personal digital assistant (PDA), etc. The computing device may include a central processing unit (CPU), memory, input / output devices, etc. Input devices may include a keyboard, mouse, touchscreen, etc., and output devices may include display devices, such as liquid crystal displays (LCDs) and cathode ray tubes (CRTs).

[0158] The memory may include read-only memory (ROM) and random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In this embodiment, the memory may be used to store program instructions for a report generation method; The processor is used to call program instructions stored in the memory and generate a program execution report according to the obtained method.

[0159] like Figure 4 The diagram shown is a schematic representation of a computing device provided in an embodiment of this application. The computing device includes: The processor 401, memory 402, transceiver 403, and bus interface 404 are provided; wherein the processor 401, memory 402, and transceiver 403 are connected via bus 405. The processor 401 is used to read the program in the memory 402 and execute the above-described report generation method; Processor 401 can be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. It can also be a hardware chip. The aforementioned hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The aforementioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0160] The memory 402 is used to store one or more executable programs and can store data used by the processor 401 when performing operations.

[0161] Specifically, the program may include program code, which includes computer operation instructions. Memory 402 may include volatile memory, such as random-access memory (RAM); memory 402 may also include non-volatile memory, such as flash memory, hard disk drive (HDD), or solid-state drive (SSD); memory 402 may also include combinations of the above types of memory.

[0162] Memory 402 stores the following elements: executable modules or data structures, or subsets thereof, or extended sets thereof: Operation instructions: This includes various operation instructions used to perform various operations.

[0163] Operating system: includes various system programs used to implement various basic business functions and handle hardware-based tasks.

[0164] Bus 405 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0165] Bus interface 404 can be a wired communication interface, a wireless bus interface, or a combination thereof. The wired bus interface can be, for example, an Ethernet interface. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. The wireless bus interface can be a WLAN interface.

[0166] This application also provides a computer-readable storage medium storing computer-executable instructions for causing a computer to execute a report generation method.

[0167] This application also provides a computer program product, which includes computer-executable instructions for causing a computer to execute a report generation method.

[0168] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0169] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0170] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0171] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0172] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A report generation method, characterized in that, include: Receive report generation description; wherein the report generation description is used to instruct the generation of a target report based on the target database; Obtain the target analysis approach that matches the report generation description from the analysis approach knowledge base; Based on the report generation description and the target analysis approach, the dependent data tables and dependent fields used to generate the target report are determined from the target database; the dependent fields are used to determine the analysis indicators and / or analysis dimensions of the target report. For any analysis step indicated by the target analysis approach, retrieve the field value of the dependency field corresponding to the analysis step from the dependency data table; The target report is formed by using the analysis steps indicated by the target analysis approach as the chapters of the target report and by using the dependent fields and their values ​​for each analysis step.

2. The method as described in claim 1, characterized in that, The step of obtaining the target analysis approach that matches the report generation description from the analysis approach knowledge base includes: The report generation description and the pre-set analysis approach knowledge base are input into the first large language model. The target report analysis mode is output through the first large language model via the first prompt word. The pre-set analysis approach knowledge base includes multiple report analysis modes. Each report analysis mode includes the name of the report analysis mode, a description example of the report analysis mode, and the analysis approach. The analytical approach in the target report analysis mode is used as the target analysis approach.

3. The method as described in claim 1, characterized in that, The step of determining the dependent data tables and dependent fields used to generate the target report from the target database based on the report generation description and the target analysis approach includes: The report generation description, the target analysis approach, and the target database are input into a second language model. The second language model then determines from the target database the dependent data tables, indicator fields, and the dependent data tables containing the indicator fields, as well as the dimension fields and the dependent data tables containing the dimension fields. The indicator fields are related to the analysis indicators indicated by the target analysis approach, and the dimension fields are related to the analysis dimensions indicated by the target analysis approach.

4. The method as described in claim 3, characterized in that, The step involves inputting the report generation description, the target analysis approach, and the target database into a second large language model. The second large language model then determines from the target database the dependent data tables, indicator fields, and their respective dependent data tables, as well as the dimension fields and their respective dependent data tables, used to generate the target report. The report generation description, the report analysis mode to which the target analysis approach belongs, and N data tables in the target database are input into the second large language model. Using the second prompt word, the second large language model determines multiple weakly dependent data tables related to the report generation description and related reasons from the target database. The data tables in the target database are processed in batches of N data tables. The report generation description, the report analysis mode to which the target analysis approach belongs, the target analysis approach, and the multiple weakly dependent data tables are input into the second large language model. The second large language model then uses a third prompt word to determine the dependent data table, indicator field, and the dependent data table where the indicator field is located, as well as the dimension field and the dependent table where the dimension field is located, from the multiple weakly dependent data tables.

5. The method as described in claim 1, characterized in that, For any analysis step indicated by the target analysis approach, retrieving the field value of the dependency field corresponding to the analysis step from the dependency data table includes: For any analysis step indicated by the target analysis approach, determine at least one analysis task that needs to be performed in the analysis step; For any one of the at least one analysis tasks, based on the task type to which the analysis task belongs, a task analysis tool matching the task type is invoked, and the field value of the dependency field corresponding to the analysis task is obtained from the dependency data table through the task analysis tool.

6. The method as described in claim 5, characterized in that, The task types include one or more of the following: trend analysis, dimensional comparison analysis, indicator fluctuation attribution analysis, and trend prediction. The task analysis tools include one or more of the following: chatbi tools, attribution analysis tools, and trend prediction tools.

7. The method as described in claim 5, characterized in that, For any analysis step indicated by the target analysis approach, determine at least one analysis task that needs to be performed in the analysis step, including: For any analysis step indicated by the target analysis approach, the report generation description, the target analysis approach, the dependency data table, the dependency fields, and the list of executed tasks are input into the fourth language model. The fourth language model outputs at least one analysis task to be executed in the analysis step and the dependent tasks of the at least one analysis task through the fifth prompt word. The list of executed tasks contains the analysis tasks corresponding to each analysis step executed before the analysis step.

8. A computing device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the method as described in any one of claims 1-7 according to the obtained program.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the method as described in any one of claims 1-7.

10. A computer program product, characterized in that, The computer program product includes computer-executable instructions for causing a computer to perform the method as described in any one of claims 1-7.