An AI-based automated report generation method, system, device, and medium
By using an AI-based automated report generation method, natural language query requests are automatically parsed and visual analysis reports are generated, solving the problem of low efficiency in traditional manual report generation and achieving highly efficient automated report generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SI-TECH INFORMATION TECH CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-26
AI Technical Summary
Traditional data analysis reports rely on manual compilation, which consumes a lot of time and manpower and is inefficient.
An AI-based automated report generation method is adopted, which generates SQL query statements by parsing natural language query requests, performs multi-dimensional analysis, and generates visual analysis reports.
It achieves fully automated report generation, reducing human input, lowering labor and time costs, and improving efficiency.
Smart Images

Figure CN122086986A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to an AI-based automated report generation method, system, device, and medium. Background Technology
[0002] Data analysis primarily involves organizing and merging data for analysis. Through data analysis, collected data can be rationally planned, facilitating subsequent overview and achieving a clear and concise understanding. Traditional data analysis reports mainly rely on manual compilation by staff. Since these reports typically contain large amounts of data and charts, staff must spend a significant amount of time on data querying, statistical analysis, chart creation, and arrangement, resulting in substantial resource consumption and extremely low efficiency. Summary of the Invention
[0003] This invention provides an AI-based automated report generation method, system, device, and medium to overcome at least one of the aforementioned technical problems in the prior art.
[0004] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions: In a first aspect, the present invention provides an AI-based automated report generation method, comprising: Obtain the user's natural language query request; Parse the natural language query request, generate the first SQL query statement and execute it to obtain an initial result set; Perform multi-dimensional analysis on the initial result set to generate at least one analysis dimension array, wherein the analysis dimension array includes at least an analysis value description, a recommended chart type, an analysis SQL query statement, and an analysis title; For each of the analysis dimension arrays, execute the corresponding analysis SQL query statement to obtain the dimension dataset, and generate the corresponding result array according to the recommended chart type; The resulting array is formatted to generate a visual analysis report.
[0005] In one possible implementation of the first aspect, parsing the natural language query request, generating a first SQL query statement and executing it to obtain an initial result set includes: The natural language query request is input into a pre-trained NLP model for parsing, generating the first SQL query statement; Execute the first SQL query statement to search for the target data in the preset database and obtain the initial result set.
[0006] In one possible implementation of the first aspect, the step of performing multi-dimensional analysis on the initial result set to generate at least one array of analysis dimensions includes: The initial result set is input into a pre-trained data analysis model, which identifies and plans multiple analytical dimensions for interpreting the initial result set. For each identified analysis dimension, an array of analysis dimensions is automatically generated, which includes the analysis value description, the recommended chart type, the analysis SQL query statement, and the analysis title.
[0007] In one possible implementation of the first aspect, the step of executing the corresponding analytical SQL query statement for each of the analytical dimension arrays to obtain the dimension dataset includes: The analytical SQL query statement is logically compared with the first SQL query statement to determine whether the data required by the analytical SQL query statement can be completely derived from the initial result set. If so, the initial result set is used as the data source, and the analysis SQL query statement is executed to generate the dimension dataset; If not, the preset database is used as the data source, and the analysis SQL query statement is executed to generate the dimension dataset.
[0008] In one possible implementation of the first aspect, generating a corresponding result array based on the recommended chart type includes: Determine whether the recommended chart type is a preset indicator type; If so, convert the dimensional dataset into indicator text to generate the result array; If not, based on the recommended chart type, the dimensional dataset is converted into the corresponding visualization chart code to generate the result array.
[0009] In one possible implementation of the first aspect, converting the dimensional dataset into corresponding visualization chart code includes: Input the dimensional dataset and the recommended chart type into the ECharts conversion model; generate ECharts configuration code that can be directly rendered through the ECharts conversion model.
[0010] In one possible implementation of the first aspect, the step of formatting the result array to generate a visual analysis report includes: Extract the chart type and analysis title for each of the resulting arrays; Based on the chart type and the analysis title, determine the display priority of each result array and the semantic relationships between the result arrays; Based on the display priority, the semantic relationship, and the preset page space constraints, the position and size of each result array in the report page are dynamically calculated to generate a layout scheme; The visualization analysis report is generated based on the layout scheme.
[0011] Compared with the prior art, the present invention has at least the following beneficial effects: The present invention provides an AI-based automated report generation method that automates the entire report generation process, reduces the human resource input of developers and data analysts, frees up resources for high-value tasks, and significantly reduces labor costs.
[0012] Furthermore, the AI-based automated report generation method provided by this invention can complete the process from input requirements to report output in seconds, which is much faster than traditional manual methods and significantly reduces time costs.
[0013] Secondly, the present invention provides an AI-based automated report generation system, comprising: The receiving module is used to acquire users' natural language query requests; The data query module is used to parse the natural language query request, generate the first SQL query statement and execute it to obtain an initial result set; The data analysis module is used to perform multi-dimensional analysis on the initial result set and generate at least one analysis dimension array, wherein the analysis dimension array includes at least an analysis value description, a recommended chart type, an analysis SQL query statement, and an analysis title; The data transformation module is used to execute the corresponding analysis SQL query statement for each of the analysis dimension arrays to obtain the dimension dataset, and generate the corresponding result array according to the recommended chart type; The data layout module is used to layout the result array and generate a visual analysis report.
[0014] Thirdly, the present invention provides an electronic device comprising: at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors to cause the electronic device to implement an AI-based automated report generation method as described in any implementation of the first aspect.
[0015] Fourthly, the present invention provides a storage medium having a computer-executable program stored thereon, the computer-executable program being used to cause a computer to execute an AI-based automated report generation method as described in any implementation of the first aspect.
[0016] Understandably, the beneficial effects achieved by the system of the second aspect, the electronic device of the third aspect, and the storage medium of the fourth aspect provided above can be referred to in light of the beneficial effects of the first aspect and any of its possible design embodiments, which will not be repeated here. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention; Figure 2 A flowchart illustrating an AI-based automated report generation method provided in this embodiment of the invention; Figure 3 This is a structural block diagram of an AI-based automated report generation system provided in an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be described below with reference to the accompanying drawings. In the description of the present invention, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. The "or" in the present invention is merely a description of the relationship between the related objects, indicating that three relationships can exist. For example, A or B can represent: A alone, A and B simultaneously, and B alone. A and B can be singular or plural. Furthermore, in the description of the present invention, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items.
[0020] Furthermore, in the embodiments of the present invention, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of the present invention should not be construed as superior or more advantageous than other embodiments or designs. Rather, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.
[0021] Data analysis primarily involves organizing and merging data for analysis. Through data analysis, collected data can be rationally planned, facilitating subsequent overview and achieving a clear and concise understanding. Traditional data analysis reports mainly rely on manual compilation by staff. Since these reports typically contain large amounts of data and charts, staff must spend a significant amount of time on data querying, statistical analysis, chart creation, and arrangement, resulting in substantial resource consumption and extremely low efficiency.
[0022] In view of this, on the one hand, embodiments of the present invention provide an AI-based automated report generation method, comprising: acquiring a user's natural language query request; parsing the natural language query request, generating a first SQL query statement and executing it to obtain an initial result set; performing multi-dimensional analysis on the initial result set to generate at least one analysis dimension array, wherein the analysis dimension array includes at least an analysis value description, a recommended chart type, an analysis SQL query statement, and an analysis title; for each analysis dimension array, executing its corresponding analysis SQL query statement to obtain a dimension dataset, and generating a corresponding result array according to the recommended chart type; and formatting the result array to generate a visual analysis report.
[0023] The present invention provides an AI-based automated report generation method that automates the entire report generation process, reducing the manpower required by developers and data analysts, freeing up resources for high-value tasks, and significantly reducing labor costs. Moreover, from inputting requirements to report output, the process can be completed in seconds, which is much faster than traditional manual methods and significantly reduces time costs.
[0024] In some embodiments, the AI-based automated report generation method provided by the present invention can be executed by any electronic device 20 with data processing capabilities, such as a general-purpose computer, personal computer, laptop computer, switch, or tablet computer, etc. The specific implementation of the electronic device 20 is not limited here.
[0025] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention is shown. The electronic device 20 includes a processor 210, a memory 220, and a communication interface 230.
[0026] Processor 210 may include one or more processing cores. Processor 210 connects to various parts within electronic device 20 using various interfaces and lines, and performs various functions and processes data of electronic device 20 by running or executing instructions, programs, code sets, or instruction sets stored in memory 220, and by calling data stored in memory 220. Optionally, processor 210 may be implemented using at least one of the following hardware forms: Central Processing Unit (CPU), Graphics Processing Unit (GPU), Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA).
[0027] The memory 220 may include random access memory (RAI) or read-only memory (ROI). Optionally, the memory 220 may include non-transitory computer-readable storage ledger. The memory 220 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 220 may include a stored program area. The stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as data processing functions, data storage functions, and display push functions), and instructions for implementing the various method embodiments described above.
[0028] Communication interface 230 is used to communicate with other devices, equipment or communication networks, such as data storage devices, image processing devices or Ethernet, wireless access network (RAN), wireless local area network (WLAN), etc.
[0029] In terms of physical implementation, the aforementioned devices (such as processor 210, memory 220, and communication interface 230) can each be devices within the same device (such as a laptop computer). Alternatively, at least two of these devices can be located within the same device, i.e., as different devices within a single device, similar to the deployment of devices or components in a distributed system.
[0030] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 20. In other embodiments of the present invention, the electronic device 20 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0031] The following description, in conjunction with the accompanying drawings, illustrates an AI-based automated report generation method provided by an embodiment of the present invention.
[0032] like Figure 2 As shown, this embodiment of the invention provides an AI-based automated report generation method, which may include, but is not limited to: S1: Obtain the user's natural language query request.
[0033] In specific implementation, the natural language query request of the user can be obtained by responding to the user's input instructions in the input box, but is not limited to obtaining the natural language query request. That is, the user can input the relevant statement instructions in the preset input box to realize the input of the natural language query request.
[0034] S2: Parse the natural language query request, generate the first SQL query statement and execute it to obtain the initial result set.
[0035] In one feasible implementation, the process of parsing the natural language query request, generating a first SQL query statement, executing it, and obtaining an initial result set in this embodiment of the invention may include, but is not limited to: The natural language query request is input into a pre-trained NLP model for parsing, generating the first SQL query statement; Execute the first SQL query statement to search for the target data in the preset database and obtain the initial result set.
[0036] In specific implementation, this embodiment of the invention can obtain a database connection to the target data analysis database from a pre-configured database connection pool. When executing the first SQL query statement, the first SQL query statement is submitted to the database server for execution through the database connection. The first SQL query statement can be constructed as a read-only SELECT query statement, whose selected fields cover the explicit intent of the user's natural language query and potential relevant analytical dimensions. After retrieving the target data, it is encapsulated into a standard data structure within the program (such as ResultSet or DataFrame) as the initial result set.
[0037] S3: Perform multi-dimensional analysis on the initial result set to generate at least one analysis dimension array, wherein the analysis dimension array includes at least an analysis value description, a recommended chart type, an analysis SQL query statement, and an analysis title.
[0038] In one feasible implementation, the multi-dimensional analysis of the initial result set to generate at least one analysis dimension array in this embodiment of the invention includes: The initial result set is input into a pre-trained data analysis model, which identifies and plans multiple analytical dimensions for interpreting the initial result set. For each identified analysis dimension, an array of analysis dimensions is automatically generated, which includes the analysis value description, the recommended chart type, the analysis SQL query statement, and the analysis title.
[0039] In specific implementation, the analysis dimensions in the embodiments of the present invention may include, but are not limited to, time, location, category, etc., and are not limited here.
[0040] In specific implementation, the analytical value description in this embodiment of the invention represents the analytical significance of the analytical dimension, such as sales trend analysis helping to predict future demand; the recommended chart type represents the recommended chart format for the analytical dimension, such as bar chart, pie chart, line chart, etc.; the analytical SQL query statement represents the SQL query statement that the analytical dimension needs to be analyzed specifically; and the analytical title represents the main idea of the analytical dimension, such as monthly sales trend, etc.
[0041] S4: For each of the analysis dimension arrays, execute the corresponding analysis SQL query statement to obtain the dimension dataset, and generate the corresponding result array according to the recommended chart type.
[0042] In one feasible implementation, the step of executing the corresponding analytical SQL query statement for each of the analytical dimension arrays to obtain the dimension dataset in this embodiment of the invention may include, but is not limited to: The analytical SQL query statement is logically compared with the first SQL query statement to determine whether the data required by the analytical SQL query statement can be completely derived from the initial result set. If so, the initial result set is used as the data source, and the analysis SQL query statement is executed to generate the dimension dataset; If not, the preset database is used as the data source, and the analysis SQL query statement is executed to generate the dimension dataset.
[0043] In the specific implementation process, after obtaining all the analysis dimension arrays, the embodiments of the present invention will traverse each element in the analysis dimension arrays, extract the analysis SQL query statement, and then compare the analysis SQL query statement with the first SQL query statement to determine whether the analysis SQL query statement can be regarded as a subset, aggregation, or simple transformation of the first SQL query statement. For example, if the first SQL query statement queries [SELECT date, product, region, sales FROM orders WHERE year=2024], and the analysis SQL query statement is [SELECT region, SUM(sales) FROM orders WHERE year=2024 GROUP BYregion], then it can be determined that the original data to be queried by the analysis SQL query statement already exists in the initial result set.
[0044] If the data required by the analytical SQL query can be completely derived from the initial result set, then the initial result set is used as the data source to execute the analytical SQL query operation. If the data required by the analytical SQL query cannot be completely derived from the initial result set, then a preset database is used as the data source to execute the analytical SQL query operation.
[0045] This invention, through a logical comparison between the analytical SQL query and the first SQL query, selects different data sources, thereby effectively improving response efficiency and reducing database pressure while ensuring data accuracy.
[0046] In one feasible implementation, the step of generating a corresponding result array based on the recommended chart type in this embodiment of the invention may include, but is not limited to: Determine whether the recommended chart type is a preset indicator type; If so, convert the dimensional dataset into indicator text to generate the result array; If not, based on the recommended chart type, the dimensional dataset is converted into the corresponding visualization chart code to generate the result array.
[0047] In one feasible implementation, the conversion of the dimensional dataset into corresponding visualization chart code in this embodiment of the invention may include, but is not limited to: Input the dimensional dataset and the recommended chart type into the ECharts conversion model; generate ECharts configuration code that can be directly rendered through the ECharts conversion model.
[0048] S5: Arrange the result array to generate a visual analysis report.
[0049] In one feasible implementation, the method of formatting the result array and generating a visual analysis report in this embodiment of the invention may include, but is not limited to: Extract the chart type and analysis title for each of the resulting arrays; Based on the chart type and the analysis title, determine the display priority of each result array and the semantic relationships between the result arrays; Based on the display priority, the semantic relationship, and the preset page space constraints, the position and size of each result array in the report page are dynamically calculated to generate a layout scheme; The visualization analysis report is generated based on the layout scheme.
[0050] In specific implementation, embodiments of the present invention may, but are not limited to, assign basic weights to the result array according to the chart type, wherein the basic weight of the result array of the chart type is greater than that of the result array of the plain text indicator type; perform keyword extraction and intent analysis on the analysis title, calculate the content importance weight according to the importance of the analysis conclusion; and then, based on the basic weight and the content importance weight, and combined with the user's historical interaction preference data, obtain the display priority through weighted calculation.
[0051] In specific implementation, embodiments of the present invention can calculate the semantic similarity between any two result arrays based on the analysis titles of each result array, or based on the data dimensions, time range, and geographical range analyzed by the result arrays; construct a result array association graph based on the semantic similarity, and use a community detection algorithm to perform cluster analysis on the result array association graph, and classify the result arrays with semantic similarity higher than a preset threshold into the same semantic association group.
[0052] In specific implementation, embodiments of the present invention may, but are not limited to, employ a hierarchical waterfall layout algorithm, placing the result arrays sequentially in descending order of display priority, wherein the result arrays with higher priority are allocated to more prominent positions on the page and / or larger initial display areas; during placement, the result arrays belonging to the same semantic association group are arranged spatially adjacent, and a unified visual container or association identifier is generated for the semantic association group.
[0053] In specific implementation, embodiments of the present invention can also dynamically determine the number of columns of the page grid based on the total number of elements, the distribution of their types, and the distribution of their display priorities; based on the semantic association, elements belonging to the same group are preferentially assigned to the same or adjacent grid cells; based on the type of the element and the display priority, the number of grid cells occupied by each element is determined, wherein elements with higher priority can span more grid cells.
[0054] In the specific implementation process, after generating the layout scheme, the embodiments of the present invention can also perform layout conflict detection to determine whether there is overlapping of element areas or visual balance below the preset standard; if a conflict is detected, the optimization and rearrangement process is started to resolve the conflict by locally adjusting the position and size of elements or globally recalculating the layout scheme.
[0055] The embodiments of the present invention achieve automated layout based on semantic understanding of content and priority judgment rules, which can avoid the problems of rigid layout and inability to adapt to content changes in traditional template-based report generation, and enhance the flexibility of layout.
[0056] The AI-based automated report generation method provided in this embodiment of the invention automates the entire report generation process, reduces the manpower input of developers and data analysts, frees up resources for high-value tasks, and significantly reduces labor costs.
[0057] Furthermore, the AI-based automated report generation method provided in this embodiment of the invention can complete the process from input requirements to report output in seconds, which is much faster than traditional manual methods and significantly reduces time costs.
[0058] Furthermore, the AI-based automated report generation method provided in this embodiment of the invention only requires user input of requirements to automatically generate reports without human intervention in the intermediate process, which can effectively reduce human errors (such as SQL syntax errors) and improve the reliability of report content.
[0059] Based on the AI-based automated report generation method provided in the first aspect, this embodiment of the invention provides an AI-based automated report generation system, such as... Figure 3 As shown, the AI-based automated report generation system includes: The receiving module 110 is used to obtain the user's natural language query request; The data query module 120 is used to parse the natural language query request, generate a first SQL query statement and execute it to obtain an initial result set; The data analysis module 130 is used to perform multi-dimensional analysis on the initial result set and generate at least one analysis dimension array, wherein the analysis dimension array includes at least an analysis value description, a recommended chart type, an analysis SQL query statement, and an analysis title; The data conversion module 140 is used to execute the corresponding analysis SQL query statement for each of the analysis dimension arrays to obtain the dimension dataset, and generate the corresponding result array according to the recommended chart type; The data layout module 150 is used to layout the result array and generate a visual analysis report.
[0060] Based on the AI-based automated report generation method provided in the first aspect, this embodiment of the invention also provides a storage medium storing a computer-executable program. The computer-executable program is used to cause a computer to execute the AI-based automated report generation method as described in any implementation of the first aspect. Explanations of the relevant content and descriptions of the beneficial effects of any of the computer-readable storage media provided above can be found in the corresponding embodiments described above, and will not be repeated here.
[0061] Those skilled in the art will understand that the program for implementing all or part of the steps of the above embodiments, which can be executed by a program instructing related hardware, can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The processing unit or processor mentioned above can be a central processing unit, a general-purpose processor, an application-specific integrated circuit (ASIC), a microprocessor (DSP), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
[0062] This invention also provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform any of the methods described in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this invention is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD), etc.
[0063] It should be noted that the devices for storing computer instructions or computer programs provided in the embodiments of the present invention, such as, but not limited to, the aforementioned memory, computer-readable storage medium, and communication chip, are all non-transitory. Those skilled in the art should recognize that the functions described in the embodiments of the present invention in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one place to another. Storage media can be any available medium accessible to general-purpose or special-purpose computers.
[0064] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. An AI-based automated report generation method, characterized in that, include: Obtain the user's natural language query request; Parse the natural language query request, generate the first SQL query statement and execute it to obtain an initial result set; Perform multi-dimensional analysis on the initial result set to generate at least one analysis dimension array, wherein the analysis dimension array includes at least an analysis value description, a recommended chart type, an analysis SQL query statement, and an analysis title; For each of the analysis dimension arrays, execute the corresponding analysis SQL query statement to obtain the dimension dataset, and generate the corresponding result array according to the recommended chart type; The resulting array is formatted to generate a visual analysis report.
2. The AI-based automated report generation method according to claim 1, characterized in that, The process of parsing the natural language query request, generating a first SQL query statement, executing it, and obtaining an initial result set includes: The natural language query request is input into a pre-trained NLP model for parsing, generating the first SQL query statement; Execute the first SQL query statement to search for the target data in the preset database and obtain the initial result set.
3. The AI-based automated report generation method according to claim 1, characterized in that, The step of performing multi-dimensional analysis on the initial result set to generate at least one array of analysis dimensions includes: The initial result set is input into a pre-trained data analysis model, which identifies and plans multiple analytical dimensions for interpreting the initial result set. For each identified analysis dimension, an array of analysis dimensions is automatically generated, which includes the analysis value description, the recommended chart type, the analysis SQL query statement, and the analysis title.
4. The AI-based automated report generation method according to claim 1, characterized in that, The step of executing the corresponding analysis SQL query statement for each of the analysis dimension arrays to obtain the dimension dataset includes: The analytical SQL query statement is logically compared with the first SQL query statement to determine whether the data required by the analytical SQL query statement can be completely derived from the initial result set. If so, the initial result set is used as the data source, and the analysis SQL query statement is executed to generate the dimension dataset; If not, the preset database is used as the data source, and the analysis SQL query statement is executed to generate the dimension dataset.
5. The AI-based automated report generation method according to claim 1, characterized in that, The step of generating a corresponding result array based on the recommended chart type includes: Determine whether the recommended chart type is a preset indicator type; If so, convert the dimensional dataset into indicator text to generate the result array; If not, based on the recommended chart type, the dimensional dataset is converted into the corresponding visualization chart code to generate the result array.
6. The AI-based automated report generation method according to claim 5, characterized in that, The step of converting the dimensional dataset into corresponding visualization chart code includes: Input the dimensional dataset and the recommended chart type into the ECharts conversion model; generate ECharts configuration code that can be directly rendered through the ECharts conversion model.
7. The AI-based automated report generation method according to claim 1, characterized in that, The step of formatting the result array and generating a visual analysis report includes: Extract the chart type and analysis title for each of the resulting arrays; Based on the chart type and the analysis title, determine the display priority of each result array and the semantic relationships between the result arrays; Based on the display priority, the semantic relationship, and the preset page space constraints, the position and size of each result array in the report page are dynamically calculated to generate a layout scheme; The visualization analysis report is generated based on the layout scheme.
8. An AI-based automated report generation system, characterized in that, include: The receiving module is used to acquire users' natural language query requests; The data query module is used to parse the natural language query request, generate the first SQL query statement and execute it to obtain an initial result set; The data analysis module is used to perform multi-dimensional analysis on the initial result set and generate at least one analysis dimension array, wherein the analysis dimension array includes at least an analysis value description, a recommended chart type, an analysis SQL query statement, and an analysis title; The data transformation module is used to execute the corresponding analysis SQL query statement for each of the analysis dimension arrays to obtain the dimension dataset, and generate the corresponding result array according to the recommended chart type; The data layout module is used to layout the result array and generate a visual analysis report.
9. An electronic device, characterized in that, include: A memory, one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the AI-based automated report generation method as described in any one of claims 1 to 7.
10. A storage medium storing a computer-executable program, characterized in that, The computer-executable program is used to cause the computer to perform the AI-based automated report generation method as described in any one of claims 1 to 7.