Analysis report generation method and device based on large language model
By using a large language model-based analytical report generation method, the shortcomings of manual time consumption and template-based generation in report generation are solved, realizing the automation, flexibility and data consistency of reports, and generating high-quality analytical reports.
Patent Information
- Application Number
- CN202511556737.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-02-17
AI Technical Summary
Existing technologies for generating analysis reports suffer from drawbacks such as time-consuming and labor-intensive manual writing, inconsistent quality, lack of flexibility in template-based generation methods, and separation of charts and text. Business intelligence systems struggle to guarantee narrative integrity and data consistency.
The analysis report generation method based on a large language model is adopted, which includes basic data storage, structure generation model, indicator design model, content generator and chart plotter. By linking and generating report outlines, indicators and charts, it realizes the synchronous generation and automatic layout of text and charts.
It enables real-time adaptation and dynamic adjustment of reports, ensuring data consistency and narrative integrity, meeting compliance requirements in enterprise scenarios, and reducing manual intervention.
Smart Images

Figure CN121543547A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automatic generation of analysis reports, and specifically provides a method and apparatus for generating analysis reports based on a large language model. Background Technology
[0002] Currently, various industries have a large demand for writing analytical reports in their daily work, such as business briefings, project progress summaries, financial statistics, and government bulletins. The traditional method mainly relies on manual writing, which requires manual data collection, chart creation, and text organization. The process is time-consuming and labor-intensive, and the quality is easily inconsistent due to differences in the skill level of the personnel.
[0003] To reduce human intervention, template-based or rule-driven automatic generation methods have emerged in the industry. These methods rely on preset document templates to fill data into fixed positions. While simple to implement, they lack flexibility when faced with temporary adjustments to the report's focus, scope, or application scenario. The generated content structure and language are often rigid, and the format and layout are difficult to meet diverse needs.
[0004] In recent years, some business intelligence systems and large language models have been used for report generation. Business intelligence systems can automatically generate charts and output simple interpretations, but they lack linkage with the overall report outline and indicator system, making it difficult to ensure the integrity of the narrative.
[0005] Large language models have strong language generation capabilities and can directly output natural language text. However, in practical applications, they are often disconnected from enterprise data, lack consistency constraints on the data collection and definition of indicators, separate charts and text content, have insufficient dynamic adaptability, and still require a lot of manual intervention to meet business needs. Summary of the Invention
[0006] This invention addresses the shortcomings of the prior art by providing a highly practical method for generating analysis reports based on a large language model.
[0007] A further technical objective of this invention is to provide a reasonably designed, safe, and applicable analysis report generation device based on a large language model.
[0008] The technical solution adopted by this invention to solve its technical problem is:
[0009] Analysis report generation methods based on large language models include:
[0010] The basic data storage device stores historical data of basic business operations to support data analysis in reports, including business fields and business data.
[0011] The content designer includes a structure generation model unit and an indicator design model unit;
[0012] The indicator calculator includes an indicator query unit and an indicator calculation unit;
[0013] The content generator is used to generate the specific content of the analysis report;
[0014] The chart plotter is used to generate statistical analysis images. The input is the analysis chart information output by the content generator, and the output is the analysis image file drawn based on the analysis chart information.
[0015] The report generator is used to generate the final statistical analysis report.
[0016] Furthermore, the structure generation model unit is used to generate the outline and chapter structure of the report, which is obtained by fine-tuning the large language model. The fine-tuning training data consists of historical report titles and historical report chapter outlines. At the same time, the fine-tuning data includes historical reports from different industries. The model is fine-tuned using LoRa with a learning rate of 1e-5 and trained for 5 epochs.
[0017] The specific implementation process is as follows:
[0018] The user-defined title is converted into a text vector representation by an encoder, which is then used to generate the input structure model. The text vector representation is then processed by the feature layer and output layer of the pre-trained model to finally output the report outline and the titles of each chapter.
[0019] Furthermore, the indicator design model designs and selects analytical indicators for the report based on the report title. The indicator design model is obtained through pre-training on a large language model, using historical analytical reports as training data, a learning rate of 1e-5, and 3 epochs of training. The information input to the indicator design model is as follows:
[0020] (1) The report title entered by the user;
[0021] (2) Output of the structure generation model;
[0022] (3) Metadata information in the basic data storage;
[0023] The above information passes through the feature layer and output layer of the indicator design model, and finally outputs the indicator design result, namely the historical basic data that the report needs to use and the calculation methods that need to be performed on the basic data;
[0024] The specific calculation method involves data containing the following information:
[0025] (1)B d The basic data required for the indicator;
[0026] (2)B c The calculation method of the indicator;
[0027] (3)B tThe meaning of the indicator.
[0028] Furthermore, the indicator calculator uses the output of the indicator design model as input, and the indicator query unit uses B... d The built-in program retrieves the necessary historical data for calculation from the basic data storage. The indicator calculation unit then calculates the data based on the design result B. c Perform calculations on the basic historical data and output the indicator calculation result R. 指标计算 .
[0029] Furthermore, the content generator has a built-in content generation model that can automatically organize language according to the input and output analytical text and basic information for visual display images that meet expectations. The content generation model is obtained by fine-tuning historical report data, using the LoRa method, a learning rate of 1e-5, and 10 epochs of training.
[0030] Furthermore, the input to the content generation model includes:
[0031] (1) Report title;
[0032] (2) Output of the content designer;
[0033] The input is processed by the content generation model, and the output consists of two types of results.
[0034] (1) The specific textual content of the analysis report;
[0035] (2) Visualize the basic information of the analysis content;
[0036] The basic information for visualization of analytical content is used to define the visualization format of analytical data in the report, and includes the following information:
[0037] a. The insertion position of the visual image in the report, specifically represented by the word count index value;
[0038] b. Data visualization methods;
[0039] c. The data information required for the visualization section, i.e., the specific values of the content displayed in the visualization images.
[0040] Furthermore, the report generator is used to generate the final statistical analysis report, including placing the visualizations generated by the chart generator into the appropriate positions in the report content, writing the report content into the report file, adjusting the paragraph format, font size, and font type of the report text according to the configuration, and finally generating the report file.
[0041] An analysis report generation device based on a large language model includes: at least one memory and at least one processor;
[0042] The at least one memory is used to store a machine-readable program;
[0043] The at least one processor is used to call the machine-readable program to execute the analysis report generation method based on a large language model.
[0044] Compared with existing technologies, the analysis report generation method and apparatus based on a large language model of the present invention have the following outstanding advantages:
[0045] This invention, through the linkage of a structure generation model and an indicator design model, automatically determines the analysis indicators and their calculation methods while generating the report outline, ensuring the consistency between the framework and the indicators, which is different from traditional templates and single generation methods.
[0046] The content generator generates chart metadata (type, value, insertion position) while outputting the report text, realizing the synchronous generation and automatic layout of text and charts, avoiding the problem of text and chart separation in existing technologies.
[0047] When users adjust the reporting target, analysis scope, or application scenario, the system can trigger a linked update of the outline, indicators, and main text, achieving real-time report adaptation and overcoming the limitations of traditional static templates that are difficult to modify.
[0048] Metadata information is incorporated into the design and calculation of indicators to ensure consistent data definitions and reproducible results, meeting the stringent compliance and auditing requirements of enterprise scenarios. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is a flowchart illustrating a method for generating analysis reports based on a large language model. Detailed Implementation
[0051] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] The following is a preferred embodiment:
[0053] Example 1:
[0054] like Figure 1 As shown in this embodiment, a method for generating analysis reports based on a large language model includes:
[0055] The basic data storage is used to store historical basic business data to support data analysis in reports. It includes business fields and business data.
[0056] The content designer includes a structure generation model unit and an indicator design model unit:
[0057] The structure generation model is used to generate the outline and chapter structure of the report. It is obtained by fine-tuning a large language model. The fine-tuning training data consists of historical report titles and chapter outlines. At the same time, the fine-tuning data should include historical reports from different industries as much as possible. The model is fine-tuned using LoRa with a learning rate of 1e-5 and trained for 5 epochs.
[0058] The specific implementation process is as follows:
[0059] The user-defined title is converted into a text vector representation by an encoder, which is then used to generate the input structure model. The text vector representation is then processed by the feature layer and output layer of the pre-trained model to finally output the report outline and the titles of each chapter.
[0060] In the indicator design model, since the supporting data for the data analysis in the report sometimes needs to be obtained by further calculation of the basic historical data, the indicator design model needs to design and screen the analytical indicators of the report based on the report title.
[0061] The indicator design model is based on the pre-training of a large language model. The training data is historical analysis reports, with a learning rate of 1e-5 and training for 3 epochs.
[0062] The information input into the indicator design model is as follows:
[0063] (1) The report title entered by the user.
[0064] (2) Output of the structure generation model.
[0065] (3) Metadata information in the basic data storage.
[0066] The above information passes through the feature layer and output layer of the indicator design model, and finally outputs the indicator design result, which is the historical basic data that the report needs to use and the calculation method that needs to be performed on the basic data.
[0067] The calculation methods include, but are not limited to, finding the average, maximum, minimum, and summation, specifically for data containing the following information:
[0068] (1)B d The basic data required for the indicator.
[0069] (2)B c The calculation method of the indicator, such as averaging or summing.
[0070] (3)B t The meaning of an indicator, such as the total number of items in a year.
[0071] The indicator calculator includes an indicator query unit and an indicator calculation unit. The indicator calculation uses the output of the indicator design model as input, and the indicator query unit calculates based on B. d The built-in program retrieves the necessary historical data for calculation from the basic data storage. The indicator calculation unit then calculates the data based on the design result B. c Perform calculations on the basic historical data and output the indicator calculation result R. 指标计算 .
[0072] The content generator is used to generate specific content for analysis reports. It has a built-in content generation model that automatically organizes language based on input, outputting expected analytical text and basic information for visualization. The content generation model is fine-tuned from historical report data using the LoRa method, a learning rate of 1e-5, and 10 epochs of training. The input to the content generation model includes:
[0073] (1) Report title;
[0074] (2) Output of the content designer (outline and indicator design);
[0075] The input is processed by the content generation model, and the output consists of two types of results.
[0076] (1) The specific text content of the analysis report.
[0077] (2) Visualize the basic information of the analysis content.
[0078] The basic information for visualizing the analysis content defines the visualization format of the analysis data in the report, and includes the following information:
[0079] a. The insertion position of the visualization image in the report is represented by the word index value. For example, if the insertion position is 11, the image will be inserted at the 11th character in the report.
[0080] b. Data visualization methods, including but not limited to pie charts, bar charts, and line charts.
[0081] c. The data information required for the visualization section, i.e., the specific values of the content displayed in the visualization images.
[0082] Through the above design, the content generator can not only generate natural language text, but also simultaneously output chart metadata, achieving close collaboration between text and graphics content. This mechanism avoids the problem of "separation of text and charts" in existing technologies.
[0083] The chart plotter is used to generate statistical analysis images. The input is the analysis chart information output by the content generator, and the output is an analysis image file drawn based on the analysis chart information.
[0084] The report generator is used to generate the final statistical analysis report. It mainly includes placing the visualization images generated by the chart generator into the appropriate positions in the report content, writing the report content into the report file, adjusting the paragraph format, font size, and font type of the report text according to the configuration, and finally generating the report file.
[0085] Example 2:
[0086] Suppose a user wants to write an analysis report with the following existing information: basic historical data d h User-defined report title t. Where d h Stored in the underlying data storage device.
[0087] Input t into the structure generation model M in the content designer. 结构设计 The output design results of the R structure design include a textual description of the report outline and the title text of each chapter.
[0088] R 结构设计 , t, d h Indicator Design Model M in Input Content Designer 指标设计 Output design results R 指标设计 =[r 指标设计1 ,r 指标设计2 ,r 指标设计3 ....],r 指标设计 Includes the basic data B required for indicator calculation. d Method B for calculating indicators c The meaning of the indicators B t For example: B d —Number of college graduates in 2025, number of college graduates in 2024, number of college graduates in 2023; B c —avg (average); B t Average number of college graduates in the past three years.
[0089] R 指标设计 Input the indicator into the indicator calculator to get the specific calculated numerical result R of the indicator. 指标 = [r index 1, r index 2, r index 3....].
[0090] t, R 结构设计and R 指标 The input is fed into the content generation model in the content generator. After transformation through the model's feature layer and output layer, the text content T of the analysis report is output. 报告内容 and visualization of basic information T 可视化 =[t 可视化1 , t 可视化2 ,....],t 可视化 Visualization type V type Visualized basic data V data Visualize the text location of the image (V) index It consists of three parts. V type Specific values include, but are not limited to: pie (pie chart), bar (bar chart), line (line chart), etc. index Specifically, it is an integer value representing the index position of this visualization in the report, such as V. index =26 means that in T 报告内容 Insert the image at the 26th character position.
[0091] T 可视化 Input a chart plotter, output a batch of plotted visualization image files F image =[f image1 ,f image1 ,...];
[0092] F image T 可视化 T 报告内容 Input the report generator to obtain the final report file.
[0093] Example 3:
[0094] An analysis report generation device based on a large language model includes: at least one memory and at least one processor;
[0095] The at least one memory is used to store a machine-readable program;
[0096] The at least one processor is used to call the machine-readable program to execute the analysis report generation method based on a large language model.
[0097] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can be a microprocessor or any conventional processor.
[0098] Memory is used to store computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function, etc.; the data storage area can store data created based on the use of the terminal, etc. In addition, memory can also include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart memory cards (SMC), secure digital cards (SD cards), flash memory cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating analysis reports based on a large language model, characterized in that, include: The basic data storage device stores historical data of basic business operations to support data analysis in reports, including business fields and business data. The content designer includes a structure generation model unit and an indicator design model unit; The indicator calculator includes an indicator query unit and an indicator calculation unit; The content generator is used to generate the specific content of the analysis report; The chart plotter is used to generate statistical analysis images. The input is the analysis chart information output by the content generator, and the output is the analysis image file drawn based on the analysis chart information. The report generator is used to generate the final statistical analysis report.
2. The method for generating analysis reports based on a large language model according to claim 1, characterized in that, The structure generation model unit is used to generate the outline and chapter structure of the report. It is obtained by fine-tuning a large language model. The fine-tuning training data consists of historical report titles and chapter outlines. The fine-tuning data also includes historical reports from different industries. The model is fine-tuned using LoRa with a learning rate of 1e-5 and trained for 5 epochs. The specific implementation process is as follows: The user-defined title is converted into a text vector representation by an encoder, which is then used to generate the input structure model. The text vector representation is then processed by the feature layer and output layer of the pre-trained model to finally output the report outline and the titles of each chapter.
3. The method for generating analysis reports based on a large language model according to claim 2, characterized in that, The indicator design model designs and selects analytical indicators for the report based on the report title. The indicator design model is obtained by pre-training a large language model using historical analysis reports as training data, a learning rate of 1e-5, and 3 epochs of training. The information input to the indicator design model is as follows: (1) The report title entered by the user; (2) Output of the structure generation model; (3) Metadata information in the basic data storage; The above information passes through the feature layer and output layer of the indicator design model, and finally outputs the indicator design result, namely the historical basic data that the report needs to use and the calculation methods that need to be performed on the basic data; The specific calculation method involves data containing the following information: (1)B d The basic data required for the indicator; (2)B c The calculation method of the indicator; (3)B t The meaning of the indicator.
4. The method for generating analysis reports based on a large language model according to claim 3, characterized in that, The indicator calculator uses the output of the indicator design model as input, and the indicator query unit queries based on B. d The built-in program retrieves the necessary historical data for calculation from the basic data storage. The indicator calculation unit then calculates the data based on the design result B. c Perform calculations on the basic historical data and output the indicator calculation result R. 指标计算 .
5. The method for generating analysis reports based on a large language model according to claim 4, characterized in that, The content generator has a built-in content generation model that can automatically organize language based on the input to output analytical text and basic information for visual display images that meet expectations. The content generation model is obtained by fine-tuning historical report data, using the LoRa method, a learning rate of 1e-5, and 10 epochs of training.
6. The method for generating analysis reports based on a large language model according to claim 5, characterized in that, The inputs to the content generation model include: (1) Report title; (2) Output of the content designer; The input is processed by the content generation model, and the output consists of two types of results. (1) The specific textual content of the analysis report; (2) Visualize the basic information of the analysis content; The basic information for visualization of analytical content is used to define the visualization format of analytical data in the report, and includes the following information: a. The insertion position of the visual image in the report, specifically represented by the word count index value; b. Data visualization methods; c. The data information required for the visualization section, i.e., the specific values of the content displayed in the visualization images.
7. The method for generating analysis reports based on a large language model according to claim 6, characterized in that, The report generator is used to generate the final statistical analysis report, including placing the visualizations generated by the chart generator into the appropriate positions in the report content, writing the report content into the report file, adjusting the paragraph format, font size, and font type of the report text according to the configuration, and finally generating the report file.
8. An analysis report generation device based on a large language model, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to perform the method according to any one of claims 1 to 7.