Report generation method, electronic equipment and readable storage medium

Through voice interaction and language big models, SQL statements and chart configurations are dynamically generated, which solves the cumbersome operations and fixed configuration problems of existing report generation technology, and realizes flexible and fast report generation.

CN120493886APending Publication Date: 2025-08-15CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510547072.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing large-screen report generation technology relies on manual configuration, and the operation is cumbersome and time-consuming. The data source and display fields are fixed configurations lack dynamic adjustment capabilities. They cannot flexibly generate reports according to real-time needs, and cannot directly generate reports through voice.

Method used

By monitoring voice input, converting it into text and generating wake-up words, combining the language model and data source structure, SQL statements and chart configurations are dynamically generated to realize report generation for voice interaction.

Benefits of technology

It realizes automated and dynamic large-screen report generation based on voice commands, breaking through the traditional system's dependence on pre-configuration. Users can quickly drive data query and report generation through voice input, improving the efficiency and flexibility of report generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120493886A_ABST
    Figure CN120493886A_ABST
Patent Text Reader

Abstract

The invention provides a report generation method, electronic equipment and a readable storage medium. The method comprises the following steps: monitoring voice input; responding to a wake-up word contained in the voice input, continuously monitoring the voice input of the user and converting the voice input into characters to obtain question content of the user; sending the large screen identifier and the question content to a server; receiving report data, chart types, abscissa dimensions, chart titles and index unit arrays sent by the server after executing the SQL statements; and generating a corresponding report according to the report data, the chart type, the abscissa dimension, the chart title and the index unit array. According to the method, the electronic equipment and the readable storage medium, the problems that an existing large-screen report generation technology depends on manual configuration, operation is tedious and time-consuming, a data source and a display field are fixedly configured and lack dynamic adjustment ability, a report cannot be flexibly generated according to real-time requirements, and the report cannot be directly generated through voice can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a report generation method, electronic equipment, and a readable storage medium. Background Art

[0002] With the continuous acceleration of digital transformation and the widespread application of 5G technology, more and more factories and enterprises are transforming towards modernization. Large factories are often equipped with data warehouses and large-screen data display services to monitor production data in real time and display core corporate information. However, current large-screen report generation technology has significant limitations:

[0003] 1) Reliance on manual configuration: Existing large-screen reporting systems usually require manual configuration of data sets and chart presentation methods in the background, which is cumbersome and time-consuming.

[0004] 2) Fixed data source and field configuration: Mainstream large-screen reporting systems usually require pre-configured data sources and display fields, lack dynamic adjustment capabilities, and cannot flexibly generate reports based on real-time needs.

[0005] 3) Lack of voice interaction capabilities: Existing technologies cannot generate reports directly through voice. Summary of the Invention

[0006] The technical problem to be solved by the present invention is to address the above-mentioned shortcomings of the existing technology and provide a report generation method, electronic device and readable storage medium to solve the problems that the existing large-screen report generation technology relies on manual configuration, the operation is cumbersome and time-consuming, and the data source and display fields are fixed configurations and lack dynamic adjustment capabilities, making it impossible to flexibly generate reports according to real-time needs, and it is also impossible to generate reports directly through voice.

[0007] In a first aspect, the present invention provides a report generation method, applied to a web page, comprising:

[0008] Monitor voice input;

[0009] In response to the voice input containing the wake-up word, continuously monitoring the user's voice input and converting it into text to obtain the user's question content;

[0010] Sending the large screen identifier and the question content to the server, so that the server queries the configured data source structure according to the large screen identifier, assembles prompt words based on the configured data source structure and the question content, and uses the assembled prompt words to call the language large model to obtain returned data, wherein the returned data includes an executable structured query language SQL statement, a chart type, a horizontal axis dimension, a chart title, and an indicator unit array, the horizontal axis dimension is used to indicate the field to be displayed on the horizontal axis, and the indicator unit array is used to indicate the field and unit corresponding to each indicator;

[0011] Receive the report data, the chart type, the horizontal axis dimension, the chart title, and the indicator unit array sent by the server after executing the SQL statement;

[0012] Generate a corresponding report based on the report data, chart type, horizontal axis dimension, chart title and indicator unit array.

[0013] Furthermore, before monitoring the voice input, the method further includes:

[0014] Get the name of the business table selected by the user when configuring the data source structure;

[0015] Requesting the server to obtain the table structure information and field annotations of the business table according to the table name;

[0016] Receive and display the table structure information and field annotations of the business table returned by the server, wherein the table structure information includes all field names and field types of the business table;

[0017] Get the field name selected by the user and the modified field comment;

[0018] The field name selected by the user, the modified field comment, and the corresponding field type are sent to the server, so that the server saves the relationship between the data source and the table name, table comment, the field name selected by the user, the modified field comment, and the corresponding field type.

[0019] Furthermore, in response to the voice input containing a wake-up word, continuously monitoring the user's voice input and converting it into text to obtain the user's question content specifically includes:

[0020] When voice input is detected, the corresponding audio file is obtained;

[0021] Sending the audio file to the server, so that the server determines whether the audio file contains the wake-up word;

[0022] Receiving a wake-up success message sent by the server when it is determined that the audio file contains the wake-up word;

[0023] Continuously monitor the user's voice input according to the wake-up success message, establish a connection with the voice model, and request the voice model to obtain the text corresponding to the continuously monitored voice input;

[0024] Receive the text returned by the speech model and obtain the content of the user's question.

[0025] Furthermore, while sending the large screen logo and the question content to the server, the method also includes:

[0026] Sending a conversation identifier to the server;

[0027] Generating a corresponding report according to the report data, chart type, horizontal axis dimension, chart title and indicator unit array specifically includes:

[0028] Determining a data generating function corresponding to the chart type;

[0029] Using the report data, horizontal axis dimension, chart title and indicator unit array, call the data generation function to generate the data structure required for the chart;

[0030] Rendering and display are performed based on the data structure to complete the generation of the corresponding report.

[0031] In a second aspect, the present invention provides a report generation method, applied to a server, comprising:

[0032] Receiving a large screen logo and question content sent by a webpage, wherein the question content is obtained by the webpage monitoring voice input, and in response to the voice input containing a wake-up word, continuously monitoring the user's voice input and converting it into text;

[0033] Querying the configured data source structure according to the large screen logo, and assembling prompt words based on the configured data source structure and the question content;

[0034] The assembled prompt word is used to call the language model to obtain returned data, wherein the returned data includes an executable structured query language SQL statement, a chart type, a horizontal axis dimension, a chart title, and an indicator unit array, wherein the horizontal axis dimension is used to indicate the field to be displayed on the horizontal axis, and the indicator unit array is used to indicate the field and unit corresponding to each indicator;

[0035] Execute the SQL statement to obtain corresponding report data;

[0036] The report data, chart type, horizontal axis dimension, chart title and indicator unit array are sent to the web page end, so that the web page end generates a corresponding report according to the report data, chart type, horizontal axis dimension, chart title and indicator unit array.

[0037] Furthermore, before receiving the large-screen logo and question content sent by the webpage, the method further includes:

[0038] Receiving a request sent by the webpage for obtaining table structure information and field annotations of a business table, wherein the webpage obtains the table name of the business table selected by the user when configuring the data source structure, and sends the request to the server according to the table name;

[0039] Returning the table structure information and field annotations of the business table to the web page, so that the web page receives and displays them, and obtains the field name and modified field annotation selected by the user, wherein the table structure information includes all field names and field types of the business table;

[0040] Receive the user-selected field name and modified field comment, and corresponding field type sent by the web page, and save the relationship between the data source and the table name, table comment, user-selected field name and modified field comment, and corresponding field type.

[0041] Furthermore, before receiving the large-screen logo and question content sent by the webpage, the method further includes:

[0042] Receiving an audio file sent by the webpage, wherein the audio file is obtained when the webpage detects voice input;

[0043] Determining whether the audio file contains the wake-up word;

[0044] In response to the wake-up word being included in the audio file, a wake-up success message is sent to the web page, so that the web page continues to monitor the user's voice input according to the wake-up success message, establishes a connection with the voice model, requests the voice model to obtain the text corresponding to the continuously monitored voice input, and receives the text returned by the voice model to obtain the content of the user's question.

[0045] Furthermore, the assembling of prompt words based on the configured data source structure and the question content specifically includes:

[0046] Define a character string X for concatenating the business tables in the configured data source structure;

[0047] Define the task's return structure format description, SQL field rules, time dimension processing rules, and field validation rules, wherein the return structure format description is used to indicate that the task is returned in JavaScript Object Notation (JSON) format and includes the executable SQL statement, chart type, horizontal axis dimension, chart title, and indicator unit array;

[0048] Define business supplementary information for the business table;

[0049] The character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules and business supplementary information are assembled into the prompt word.

[0050] Furthermore, while receiving the large-screen logo and question content sent by the webpage, the method further includes:

[0051] Receiving a conversation identifier sent by the web page;

[0052] The step of assembling the character string X, the question content, the return structure format description, the SQL field rules, the time dimension processing rules, the field verification rules, and the business supplementary information into the prompt word specifically includes:

[0053] Determine whether there is a historical round of conversation in the current round of conversation according to the conversation identifier;

[0054] If there is a historical round conversation in the current round conversation, the character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules, business supplementary information, and the question content of the historical round conversation and the corresponding executable SQL statement are assembled into the prompt word; otherwise, the character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules, and business supplementary information are assembled into the prompt word.

[0055] Furthermore, executing the SQL statement to obtain corresponding report data specifically includes:

[0056] Querying the configuration information of the data source according to the large screen identifier;

[0057] A connection is established with the data source based on the configuration information, and after the connection is established, the SQL statement is executed to obtain corresponding report data.

[0058] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the report generation method described in the first aspect or the second aspect above.

[0059] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the report generation method described in the first or second aspect above is implemented.

[0060] The present invention provides a report generation method, electronic device and readable storage medium. The web page first monitors voice input, and in response to the voice input containing a wake-up word, continuously monitors the user's voice input and converts it into text to obtain the user's question content; then sends a large screen identifier and the question content to the server, so that the server queries the configured data source structure according to the large screen identifier, and assembles prompt words based on the configured data source structure and the question content, and uses the assembled prompt words to call the language model to obtain returned data, wherein the returned data includes an executable structured query language SQL statement, a chart type, a horizontal axis dimension, a chart title and an indicator unit array, the horizontal axis dimension is used to indicate the field to be displayed on the horizontal axis, and the indicator unit array is used to indicate the field and unit corresponding to each indicator; then receives the report data, the chart type, the horizontal axis dimension, the chart title and the indicator unit array sent by the server after executing the SQL statement; and then generates a corresponding report according to the report data, chart type, horizontal axis dimension, chart title and indicator unit array. The present invention realizes the automatic and dynamic large-screen report generation based on voice commands by introducing voice wake-up and natural language interaction technology, breaking through the traditional system's reliance on pre-configuration. Specifically, users only need to express their needs through voice input to quickly drive the server to query the data source structure, intelligently assemble prompt words and call the language model, accurately obtain the data required for the report, and realize flexible customization of report dimensions, chart types and display content, thereby greatly improving the efficiency and flexibility of report generation. It solves the problems of existing large-screen report generation technology relying on manual configuration, cumbersome and time-consuming operation, fixed configuration of data sources and display fields lacking dynamic adjustment capabilities, and unable to flexibly generate reports according to real-time needs, as well as unable to generate reports directly through voice. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 This is a flow chart of a report generation method according to Example 1 of the present invention;

[0062] Figure 2 This is an interactive diagram of a report generation method according to an embodiment of the present invention;

[0063] Figure 3 A schematic diagram of the process of entering data source information according to an embodiment of the present invention;

[0064] Figure 4This is a flowchart of voice wake-up according to an embodiment of the present invention;

[0065] Figure 5 A schematic diagram of the process of obtaining question text according to an embodiment of the present invention;

[0066] Figure 6 This is a flow chart of the interaction between the server and the language model in an embodiment of the present invention;

[0067] Figure 7 A schematic diagram of the process of assembling prompt words according to an embodiment of the present invention;

[0068] Figure 8 A schematic diagram of a task definition process according to an embodiment of the present invention;

[0069] Figure 9 A schematic diagram of a report according to an embodiment of the present invention;

[0070] Figure 10 This is a flow chart of a report generation method according to embodiment 2 of the present invention;

[0071] Figure 11 This is a schematic structural diagram of an electronic device according to embodiment 3 of the present invention. DETAILED DESCRIPTION

[0072] In order to enable those skilled in the art to better understand the technical solutions of the present invention, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0073] It should be understood that the specific embodiments and drawings described herein are only used to explain the present invention rather than to limit the present invention.

[0074] It is understood that, in the absence of conflict, the various embodiments of the present invention and the various features in the embodiments may be combined with each other.

[0075] It can be understood that, for the convenience of description, the drawings of the present invention only show parts related to the present invention, while parts unrelated to the present invention are not shown in the drawings.

[0076] It can be understood that each unit and module involved in the embodiments of the present invention may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.

[0077] It can be understood that the terms "first", "second", etc. in the embodiments of the present invention are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.

[0078] It will be understood that, without conflict, the functions and steps marked in the flowcharts and block diagrams of the present invention may occur in an order different from that marked in the drawings.

[0079] It is understood that the flowcharts and block diagrams of the present invention illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to various embodiments of the present invention. Each box in the flowchart or block diagram may represent a unit, module, program segment, or code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented using a hardware-based system that implements the specified functions, or may be implemented using a combination of hardware and computer instructions.

[0080] It can be understood that the units and modules involved in the embodiments of the present invention can be implemented by software or hardware. For example, the units and modules can be located in a processor.

[0081] Example 1:

[0082] This embodiment provides a report generation method, which is applied to a web page. Figure 1 As shown, the method includes:

[0083] Step S101: monitoring voice input.

[0084] In this embodiment, the web page end is the front end of the large screen, and the server end corresponds to the back end of the large screen. The web page end monitors voice input through a browser plug-in.

[0085] Optionally, before monitoring the voice input, the method further includes:

[0086] Get the name of the business table selected by the user when configuring the data source structure;

[0087] Requesting the server to obtain the table structure information and field annotations of the business table according to the table name;

[0088] Receive and display the table structure information and field annotations of the business table returned by the server, wherein the table structure information includes all field names and field types of the business table;

[0089] Get the field name selected by the user and the modified field comment;

[0090] The field name selected by the user, the modified field comment, and the corresponding field type are sent to the server, so that the server saves the relationship between the data source and the table name, table comment, the field name selected by the user, the modified field comment, and the corresponding field type.

[0091] In this embodiment, the configuration information of the data source is first entered into the server. The configuration information includes database address, user, password, database name, driver and other information. In addition to the configuration information of the data source, the structure of the data source that the report data may involve must also be configured, that is, all business tables corresponding to the data source, the field names involved in the table, field types and field comments, etc.

[0092] In this embodiment, when configuring the data source structure, the web page displays the table names of all business tables corresponding to the data source, and the user selects the table name of the business table that the report data may involve; the web page requests the server to obtain the table structure information and field annotations of the business table based on the table name; the server returns all the field names, field types and field annotations in the table; the user selects the required fields and modifies the field annotations; the web page transmits the user's modified field annotations and the required field names and field types to the server, and the server saves the relationship between the data source and the table name, table annotations, the field name selected by the user and the modified field annotations, as well as the corresponding field types. Among them, the field annotations are used to explain the fields in detail and carry units. For example, there is a field called totalAmount, and its annotation is the total amount (10,000 yuan). There is a field called UnitPrice, and its annotation is the unit price (yuan / kg), to facilitate the subsequent processing of business logic by the language model.

[0093] It should be noted that in actual applications, since reports usually do not involve all fields in the business table, the present invention does not use all fields in the business table when configuring the data source structure. This design has two advantages: on the one hand, it can reduce the complexity of understanding the subsequent large language model when processing prompt words; on the other hand, by reducing the length of text interacting with the large language model, it can significantly shorten the processing time of the large model and reduce network latency.

[0094] Step S102: In response to the voice input containing a wake-up word, the user's voice input is continuously monitored and converted into text to obtain the user's question content.

[0095] In this embodiment, the wake-up word is typically a few characters long. Once the wake-up word is included in the voice input, the user begins a Q&A session. The webpage continuously monitors the user's input and converts it into text to obtain the user's question. User questions can include business content, such as "this year's total production" or "today's sales," and chart types, such as line charts or bar charts.

[0096] Optionally, in response to the voice input containing a wake-up word, continuously monitoring the user's voice input and converting it into text to obtain the user's question content specifically includes:

[0097] When voice input is detected, the corresponding audio file is obtained;

[0098] Sending the audio file to the server, so that the server determines whether the audio file contains the wake-up word;

[0099] Receiving a wake-up success message sent by the server when it is determined that the audio file contains the wake-up word;

[0100] Continuously monitor the user's voice input according to the wake-up success message, establish a connection with the voice model, and request the voice model to obtain the text corresponding to the continuously monitored voice input;

[0101] Receive the text returned by the speech model and obtain the content of the user's question.

[0102] In this embodiment, the browser plug-in on the web page listens to the voice input of the browser, starts recording when there is voice input, and continues recording until there is no sound. After the recording is completed, the audio is transmitted to the server. The server determines whether the audio file contains the wake-up word based on the audio file. If the wake-up word is contained, the wake-up is successful, and a wake-up success message is sent to the web page. After the voice wake-up, the web page will continue to listen to the user's input and convert it into text. The specific steps include: the web page establishes a websocket connection with the voice model to conduct real-time request interaction; the web page listens to the user's voice input and requests the voice model to obtain text; if no text is returned from the voice model within a preset time (such as within 1 second), it is considered that the question has been asked and the user's question content is obtained.

[0103] Step S103: Send the large-screen identifier and the question content to the server, so that the server queries the configured data source structure according to the large-screen identifier, assembles prompt words based on the configured data source structure and the question content, and uses the assembled prompt words to call the language large model to obtain returned data, wherein the returned data includes an executable structured query language SQL statement, a chart type, a horizontal axis dimension, a chart title, and an indicator unit array, the horizontal axis dimension is used to indicate the field to be displayed on the horizontal axis, and the indicator unit array is used to indicate the field and unit corresponding to each indicator.

[0104] In this embodiment, the large screen identifier (such as a large screen code) is used to uniquely identify a large screen, and each large screen is pre-configured with a corresponding data source structure. For example, the production large screen is configured with a production information data source, and the corresponding data source structure includes a plurality of business tables related to production information; the employee large screen is configured with an employee information data source, and the corresponding data source structure includes a plurality of business tables related to employee information. After the server receives the large screen identifier and question content sent by the web page, it assembles prompt words based on the configured data source structure and question content, and uses the assembled prompt words to call the language model to obtain the returned data, wherein the returned data includes executable SQL (Structured Query Language) statements, chart types, horizontal axis dimensions, chart titles, and indicator unit arrays.

[0105] Optionally, the server assembles prompt words based on the configured data source structure and question content, specifically including:

[0106] Define a character string X for concatenating the business tables in the configured data source structure;

[0107] Define the task's return structure format description, SQL field rules, time dimension processing rules, and field validation rules. The return structure format description is used to indicate that the task is returned in JSON (JavaScript Object Notation) format and includes the executable SQL statement, chart type, horizontal axis dimension, chart title, and indicator unit array.

[0108] Define business supplementary information for the business table;

[0109] The character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules and business supplementary information are assembled into the prompt word.

[0110] In this embodiment, the configured data source structure includes the business table name, table fields, table Chinese name, business supplements for the table, etc. Each field also has a related comment and field type. For example, [{"tableName":"user","comment":"user table":"columns":[{"column":"id","type":"bigint(11)","remark":"user id, globally unique"},{"column":"name","type":"varchar(64)","remark":"user name"}],"remark":"user table and other tables are associated using id"}], which is an array structure.

[0111] In this embodiment, in order to simplify the content and thus reduce the character length of the prompt word, a string X is defined for concatenating the business tables in the configured data source structure, thereby ultimately converting the array structure into a DDL (Data Definition Language) statement.

[0112] In this embodiment, the return structure format description of the task is used to instruct the language large model to return in the return structure format, which can be the following JSON format return structure:

[0113]

[0114] Among them, executable SQL is used to return report data; the chart type type can be obtained from the question content. If the chart type is not specified in the question content, the default value (such as table) can be used; the horizontal axis dimension abscissa is displayed using Chinese fields, and multiple attributes are separated by | and there are no spaces. It is mainly used to determine the fields for classifying or grouping the X-axis data of the chart. When generating reports on the web page, these fields will be used as the display basis for the X-axis of the chart; units represents the indicator unit array. The indicator refers to the data items that need to be counted or displayed in the chart. The indicator unit array is used to indicate the fields and units corresponding to each indicator. During the chart rendering process, the correct unit label will be added to the corresponding indicator data based on the array information. Usually, the indicator can be other data fields in addition to the horizontal axis dimension. For example, in the example of querying the output of each team in January 2025 in the form of a bar chart, "team" is the horizontal axis dimension, and "output" is the indicator. The indicator corresponds to the vertical axis in the chart and other data information that may need to be displayed.

[0115] In this embodiment, the defined SQL field rules might include uniformly using English field names for query fields, but with Chinese aliases for front-end display. The defined time dimension processing rules might include using functions for all specific time-related aspects, as well as rules for whether to use time as a dimension and query field under different time descriptions. The defined field validation rules might also include ensuring that the fields found in the final select query are included in both the horizontal and vertical coordinates, and that SQL queries can only be performed using fields contained in the database table structure. Supplementary business information can be defined for each business table or only for certain tables. Examples of supplementary business information include business term mapping, explanations of specific terms, and special field calculation rules.

[0116] In this embodiment, the server assembles the string X, question content, return structure format description, SQL field rules, time dimension processing rules, field verification rules and business supplementary information into prompt words in a preset order, and then calls the language big model to obtain the returned data. The language big model returns the report data according to the return structure in JSON format.

[0117] Optionally, while sending the large screen logo and the question content to the server, the method further includes:

[0118] Sending a conversation identifier to the server;

[0119] In this embodiment, a conversation identifier (i.e., conversation ID) is used to identify a conversation, and a conversation can have multiple rounds of conversations. If there are multiple rounds of historical conversations for the current question, the previous question content and the corresponding executable SQL statements can be spliced together to form a complete context. Specifically, after the server receives the conversation identifier sent by the web page, it first determines whether there is a historical round conversation for the current round conversation based on the conversation identifier (i.e., whether the conversation identifier is the same). If there is a historical round conversation for the current round conversation, the character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules, business supplementary information, and the question content of the historical round conversation and the corresponding executable SQL statement are assembled into the prompt word. Otherwise, the character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules, and business supplementary information are directly assembled into the prompt word.

[0120] Step S104: receiving the report data, the chart type, the horizontal axis dimension, the chart title and the indicator unit array sent by the server after executing the SQL statement.

[0121] In this embodiment, the server queries the data source configuration information based on the large screen identifier; then, based on the configuration information, establishes a connection with the data source and, after the connection is established, executes the SQL statement to obtain the corresponding report data. The server then sends the report data, chart type, horizontal axis dimension, chart title, and indicator unit array to the web page.

[0122] Step S105: Generate a corresponding report according to the report data, chart type, horizontal axis dimension, chart title and indicator unit array.

[0123] Specifically, the web page first determines the data generation function corresponding to the chart type; then uses the report data, horizontal axis dimension, chart title and indicator unit array to call the data generation function to generate the data structure required for the chart; then renders and displays based on the data structure to complete the generation of the corresponding report.

[0124] It should be noted that the report generation method provided by the present invention realizes the real-time generation of large-screen reports through the voice wake-up function combined with natural language interaction, gets rid of the traditional system's reliance on pre-configuration, and improves the flexibility and convenience of data display. At the same time, the present invention can realize dynamic adjustment of generated reports and drill-down operations on deep data through multiple consecutive conversations, meeting the user's demand for in-depth data analysis. Combining semantic analysis and large model technology, from voice input to data query and chart generation, full-process intelligent operation is realized, greatly improving the usability and interactive experience of the reporting system.

[0125] In a specific embodiment, the report generation method involves users, web pages, servers, language models, and voice models. The web page (i.e., the front end of the large screen) will have a plug-in to continuously collect user voice input. The server will handle the wake-up logic and call the large model, and query data based on the results returned by the large model. The language model mainly generates corresponding SQL based on the conversation, and the voice model converts the input audio stream into text. Figure 2 , which shows an interactive diagram of a report generation method provided by an embodiment of the present invention. The main process includes the following steps:

[0126] 1. Enter data source information on the server;

[0127] 2. The web browser monitors voice input;

[0128] 3. The user says the wake-up word;

[0129] 4. Wake up voice interaction on the web page;

[0130] 5. The user states the query requirement;

[0131] 6. The large voice model converts speech into text in real time;

[0132] 7. The large voice model returns text;

[0133] 8. The web page switches chart types or enlarges charts based on keywords, and calls the interface to pass in questions and data sources;

[0134] 9. The server assembles data;

[0135] 10. The server calls the language model for processing;

[0136] 11. The language model returns SQL;

[0137] 12. The server queries data based on SQL;

[0138] 13. The server returns data;

[0139] 14. The web page renders the chart according to the parameters.

[0140] Based on the above main process, the detailed description is as follows:

[0141] First, you need to enter the data source configuration into the system, including database address, user, password, database name, driver and other information. When querying data later, you need to establish a database link based on this information. In addition to the basic information of the database, you also need to enter the table structure and comments of the report data involved in the database. The process is as follows: Figure 3 ,include:

[0142] (1) The user selects the name of the business table that the report data may involve;

[0143] (2) The web page requests the server to obtain all the fields in the table based on the table name;

[0144] (3) The server returns all the field names, field types, and comments in the table;

[0145] (4) The user selects the required fields and modifies the comments;

[0146] (5) The web page transmits the user's modified comments and the required field names and field types to the server, which saves them.

[0147] Annotations can provide detailed explanations of fields and include units. For example, a field called "totalAmount" is annotated with the total amount (10,000 yuan), and a field called "UnitPrice" is annotated with the unit price (yuan / kg). This facilitates the subsequent processing of business logic by the language model. Not all fields in the table are used here to reduce the complexity of the language model's understanding during subsequent processing and to shorten the text length when communicating with the language model, thereby reducing the model's processing time and network latency.

[0148] It's important to note that you can group common business tables into a single data source (e.g., user table, output table, production plan table). Subsequent reports can simply select the data source. By configuring the data source, the server saves the relationship between the data source and the table name, field name, field type, and comment. After entering the basic data source information, the web page will display all the tables in the database.

[0149] It should be noted that Figure 3It can be understood as combining several tables into a data source based on the business, that is, a data source configured according to the business. For example, if one data source is production information and one data source is employee information, then the production large screen uses the production information data source, and the employee large screen uses the employee information data source.

[0150] Next is the voice wake-up logic. The wake-up logic is the interaction between the web plug-in and the server. After recognizing the wake-up word, it starts to accept user dialogue questions and answers. The server-side is used to process the wake-up word based on low cost considerations. If all audio is processed by the large voice model, the cost of the large voice model will be very high. The large voice model is to make the voice-to-text conversion more suitable for the current scenario. The wake-up word is generally only a few words, which can be processed by the back-end server to save costs. The flowchart of voice wake-up is as follows Figure 4 As shown, including:

[0151] (1) The browser plug-in on the web page monitors the browser's voice input;

[0152] (2) Start recording when there is voice input and continue until there is no sound. Once the recording is complete, transmit the audio to the server.

[0153] (3) The server determines whether the audio file contains the wake-up word;

[0154] (4) The server returns the wake-up result. If the wake-up is successful, the browser plug-in notifies the front-end service.

[0155] After voice wake-up, the front-end (i.e. web page) will continue to monitor the user's input and convert it into text. The process is as follows: Figure 5 As shown, including:

[0156] (1) The front-end establishes a websocket connection with the large voice model to conduct real-time request interaction;

[0157] (2) The front end monitors the user's voice input and requests the voice model to obtain text

[0158] (3) If no text response is received from the voice model within 1 second, the question is considered to have been asked;

[0159] (4) Pass the question to the backend (i.e., the server) to obtain data for display in charts.

[0160] The questions asked by users include business content and chart types. Business content includes, for example, "I want to query the total output this year, or today's sales." Chart types include, for example, displaying using a line chart or a bar chart.

[0161] Next is the interaction process between the server and the language model, such as Figure 6 As shown, including:

[0162] (1) The front-end passes the large screen code reportId, question content content, and conversation ID messageId to call the server interface;

[0163] (2) The server queries the configured data source structure based on reportId. The data source configuration process is visible Figure 3 , the data source structure queried is as follows: [{"tableName":"user","comment":"user table":"columns":[{"column":"id","type":"bigint(11)","remark":"user id, globally unique"},{"column":"name","type":"varchar(64)","remark":"user name"}],"remark":"user table and other tables are associated using id"}], which is an array structure. Each piece of data includes the table name, table fields, table Chinese name, and business supplements for the table. Each field also has related comments and field types. It should be noted that the array here includes all table structures designed by the data source. For example, the ID of the production screen corresponds to the production information data source. Assuming that the production information data source involves 15 tables, the table names, table Chinese names, table fields, business supplements for the table, and other information of these 15 tables will be displayed.

[0164] (3) Assemble the data source information and questions into prompt words. The process is as follows Figure 7 As shown, including:

[0165] (3-1) First, define the string X. X is the prompt word for the subsequent call to the language model. The table structure has been obtained in the above process. The table structure is spliced in the following format: create table `user`(`id`bigint(11)COMMENT'user id, globally unique',`name`varchar(64)COMMENT'user name')COMMENT='user table; It should be noted that the purpose of splicing here is to convert the array structure into a DDL (Data Definition Language) statement to simplify the content and thus reduce the character length of the prompt word.

[0166] (3-2) After the table structure is completed, the problem is solved again. The user's content is the content passed in by the interface;

[0167] (3-3) Splicing tasks, the task definition process is as follows Figure 8 As shown, including:

[0168] ① Define the return structure of the task, as described below: Based on the provided database information, answer the above questions and return the chart type type in JSON format {"sql":"xxx","type":"","abscissa":"","title":"xxx","units":[{"column":"xx","unit":"xxx"}]} (if the chart type is not specified in the question, use type=table), the horizontal axis parameter abscissa (displayed using Chinese fields, multiple attributes are separated by | and there are no spaces. If it is a pie chart or table, provide the field representing the dimension, which will not be empty), and executable MYSQL SQL. If SQL cannot be generated based on the existing database fields, an empty JSON is returned. For example, if the data table is related to production data, then asking for salary information will not generate SQL.

[0169] ② Define database field rules (also known as SQL field rules) as follows: select fields cannot be in Chinese, and all returned fields must use Chinese aliases (that is, in the generated SQL, the fields after select can only be English fields in the data table, but they must be displayed with Chinese aliases, such as "SELECTid AS sales record identifier, product_name AS product name..."). Ignore chart types during SQL processing. The chart title is generated based on the question and chart type name and placed in the title field. Field units are units. Fields other than the horizontal axis require units (for example, if you need to query the production and sales for each month of this year, then the production and sales must be in units). Return in JSON Array format; fields in SQL do not require units.

[0170] ③ Define the time dimension processing rules, as described below: All those involving specific time are implemented using functions. Among them, those related to the week are implemented using Week(date,0), with Sunday as the first day. For the previous month and the previous year, the month or year should be equal to xxx, rather than within a range. If the question asks about this month, this year, last month, last year, etc. and does not specify every day of this month or every month of this year, then there is no need to use time as a dimension, and it does not need to be returned in the SQL query field. For example, if you need to query the total output this year, you only need to return the output value, without returning the year.

[0171] ④ Define field validation processing to ensure that the fields queried by the final select are included in both the horizontal and vertical coordinates, and only fields included in the database table structure can be used for SQL queries;

[0172] (3-4) Joining Supplementary Information. As can be seen from the above process, business supplementary information is configured for each table. Here, we join the information. For example, we define the storage rules for database fields: xx workshop is stored as xx in the database, and xx process is stored as xx process in the database. At the same time, we can configure the calculation rules for special terms or certain fields that appear in the system.

[0173] (3-5) Based on the messageId passed in by the interface, historical conversations can be queried. If there are multiple conversations, they need to be spliced together according to the large model call rules. For example, the questions and corresponding SQL statements from multiple rounds of conversations can be spliced together to finally obtain the complete prompt word X. It should be noted that one conversation is one messageId, and a conversation can have multiple rounds.

[0174] (4) Use the assembled prompt words to call the interface of the language model to obtain the results;

[0175] (5) Parse the JSON result returned by the large model and obtain sql, type, abscissa, and units, where sql is the executable SQL for obtaining data, type is the type of chart, including pie charts, bar charts, line charts, and tables, abscissa is the horizontal axis dimension, and units is the unit of each indicator. Unit is an array, and the result is [{"column":"xxx","unit":"xxx"}];

[0176] (6) Query the data source driver, database name, user name, and password based on reportId. After the server establishes a connection with the data source, it executes SQL queries to obtain relevant data.

[0177] (7) Return the data to the web page, including the chart name title, chart type type, horizontal axis dimension abscissa, indicator unit array units, report data / chart data data, where data data is the array obtained by querying in step (6) above;

[0178] (8) The web page uses different data generation functions based on the data and chart types returned by the server to generate the data structure required for the corresponding chart and render it. For example, if the question is: query the output of each team in January 2025 and display it in the form of a bar chart, the resulting report diagram can be as follows: Figure 9 As shown, the horizontal axis is the work group, the vertical axis is the output, and the unit corresponding to the output is kg.

[0179] It should be noted that the report generation method provided by the present invention passes the data structure, field business function, user query requirements and expected return data format to the big model by calling the language big model's deep understanding of semantics, and generates SQL query statements and horizontal and vertical coordinate dimensions of the chart that match the user's needs. After that, the server accurately extracts relevant data based on the query conditions generated by the language big model, and returns the results to the front end. The front end dynamically renders the corresponding chart form based on this, realizing full-link intelligent processing from semantic analysis to data display. In addition, the user's operation intention can be judged based on the recognition of keywords, such as switching chart types, enlarging charts, etc., instead of manual operations, to improve the convenience of interaction.

[0180] The report generation method provided by the embodiment of the present invention is as follows: the web page first monitors voice input, and in response to the voice input containing a wake-up word, continuously monitors the user's voice input and converts it into text to obtain the user's question content; then sends a large screen identifier and the question content to the server, so that the server queries the configured data source structure according to the large screen identifier, and assembles prompt words based on the configured data source structure and the question content, and uses the assembled prompt words to call the language large model to obtain returned data, wherein the returned data includes an executable structured query language SQL statement, a chart type, a horizontal axis dimension, a chart title, and an indicator unit array, the horizontal axis dimension is used to indicate the field to be displayed on the horizontal axis, and the indicator unit array is used to indicate the field and unit corresponding to each indicator; then receives the report data, the chart type, the horizontal axis dimension, the chart title, and the indicator unit array sent by the server after executing the SQL statement; and then generates a corresponding report based on the report data, chart type, horizontal axis dimension, chart title, and indicator unit array. The present invention realizes the automatic and dynamic large-screen report generation based on voice commands by introducing voice wake-up and natural language interaction technology, breaking through the traditional system's reliance on pre-configuration. Specifically, users only need to express their needs through voice input to quickly drive the server to query the data source structure, intelligently assemble prompt words and call the language model, accurately obtain the data required for the report, and realize flexible customization of report dimensions, chart types and display content, thereby greatly improving the efficiency and flexibility of report generation. It solves the problems of existing large-screen report generation technology relying on manual configuration, cumbersome and time-consuming operation, fixed configuration of data sources and display fields lacking dynamic adjustment capabilities, and unable to flexibly generate reports according to real-time needs, as well as unable to generate reports directly through voice.

[0181] Example 2:

[0182] like Figure 10 As shown, this embodiment provides a report generation method, which is applied to a server, and the method includes:

[0183] Step S201: Receive the large-screen logo and question content sent by the web page, wherein the question content is obtained by the web page monitoring voice input, and in response to the voice input containing a wake-up word, continuously monitoring the user's voice input and converting it into text.

[0184] In this embodiment, the large screen identifier (such as the large screen code) is used to uniquely identify a large screen, and each large screen is pre-configured with a corresponding data source structure. For example, I want to query the total output this year and display it in a bar chart.

[0185] Optionally, before receiving the large-screen logo and question content sent by the webpage, the method further includes:

[0186] Receiving a request sent by the webpage for obtaining table structure information and field annotations of a business table, wherein the webpage obtains the table name of the business table selected by the user when configuring the data source structure, and sends the request to the server according to the table name;

[0187] Returning the table structure information and field annotations of the business table to the web page, so that the web page receives and displays them, and obtains the field name and modified field annotation selected by the user, wherein the table structure information includes all field names and field types of the business table;

[0188] Receive the user-selected field name and modified field comment, and corresponding field type sent by the web page, and save the relationship between the data source and the table name, table comment, user-selected field name and modified field comment, and corresponding field type.

[0189] It should be noted that in actual applications, since reports usually do not involve all fields in the business table, the present invention does not use all fields in the business table when configuring the data source structure. This design has two advantages: on the one hand, it can reduce the complexity of understanding the subsequent large language model when processing prompt words; on the other hand, by reducing the length of text interacting with the large language model, it can significantly shorten the processing time of the large model and reduce network latency.

[0190] Optionally, before receiving the large-screen logo and question content sent by the webpage, the method further includes:

[0191] Receiving an audio file sent by the webpage, wherein the audio file is obtained when the webpage detects voice input;

[0192] Determining whether the audio file contains the wake-up word;

[0193] In response to the wake-up word being included in the audio file, a wake-up success message is sent to the web page, so that the web page continues to monitor the user's voice input according to the wake-up success message, establishes a connection with the voice model, requests the voice model to obtain the text corresponding to the continuously monitored voice input, and receives the text returned by the voice model to obtain the content of the user's question.

[0194] In this embodiment, the browser plug-in on the web page listens to the voice input of the browser, starts recording when there is voice input, and continues recording until there is no sound. After the recording is completed, the audio is transmitted to the server. The server determines whether the audio file contains the wake-up word based on the audio file. If the wake-up word is contained, the wake-up is successful, and a wake-up success message is sent to the web page. After the voice wake-up, the web page will continue to listen to the user's input and convert it into text. The specific steps include: the web page establishes a websocket connection with the voice model to conduct real-time request interaction; the web page listens to the user's voice input and requests the voice model to obtain text; if no text is returned from the voice model within a preset time (such as within 1 second), it is considered that the question has been asked and the user's question content is obtained.

[0195] Step S202: querying the configured data source structure according to the large screen logo, and assembling prompt words based on the configured data source structure and the question content;

[0196] Optionally, assembling prompt words based on the configured data source structure and the question content specifically includes:

[0197] Define a character string X for concatenating the business tables in the configured data source structure;

[0198] Define the task's return structure format description, SQL field rules, time dimension processing rules, and field validation rules, wherein the return structure format description is used to indicate that the task is returned in JavaScript Object Notation (JSON) format and includes the executable SQL statement, chart type, horizontal axis dimension, chart title, and indicator unit array;

[0199] Define business supplementary information for the business table;

[0200] The character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules and business supplementary information are assembled into the prompt word.

[0201] In this embodiment, the return structure format description of the task is used to instruct the language large model to return in the return structure format; specifically, the return structure can be in the following JSON format:

[0202]

[0203]

[0204] Among them, executable SQL is used to return report data; the chart type type can be obtained from the question content. If the chart type is not specified in the question content, the default value (such as table) can be used; the horizontal axis dimension abscissa is displayed using Chinese fields, and multiple attributes are separated by | without spaces. It is mainly used to determine the fields for classifying or grouping the chart's X-axis data. When generating reports on the web page, these fields will be used as the display basis for the chart's X-axis; units represents the indicator unit array. Indicators refer to the data items that need to be counted or displayed in the chart. The indicator unit array is used to indicate the fields and units corresponding to each indicator. During the chart rendering process, the correct unit labels will be added to the corresponding indicator data based on the array information.

[0205] Optionally, while receiving the large-screen logo and question content sent by the webpage, the method further includes:

[0206] Receiving a conversation identifier sent by the web page;

[0207] The step of assembling the character string X, the question content, the return structure format description, the SQL field rules, the time dimension processing rules, the field verification rules, and the business supplementary information into the prompt word specifically includes:

[0208] Determine whether there is a historical round of conversation in the current round of conversation according to the conversation identifier;

[0209] If there is a historical round conversation in the current round conversation, the character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules, business supplementary information, and the question content of the historical round conversation and the corresponding executable SQL statement are assembled into the prompt word; otherwise, the character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules, and business supplementary information are assembled into the prompt word.

[0210] In this embodiment, if there are multiple rounds of historical conversations, the previous question content and the corresponding executable SQL statements can be spliced together to form a complete context.

[0211] Step S203: Use the assembled prompt word to call the language model to obtain returned data, wherein the returned data includes an executable structured query language SQL statement, a chart type, a horizontal axis dimension, a chart title, and an indicator unit array. The horizontal axis dimension is used to indicate the field to be displayed on the horizontal axis, and the indicator unit array is used to indicate the field and unit corresponding to each indicator.

[0212] In this embodiment, the language large model returns the report data according to the return structure in JSON format.

[0213] Step S204: Execute the SQL statement to obtain corresponding report data;

[0214] Specifically, the server queries the configuration information of the data source according to the large screen identifier; then establishes a connection with the data source based on the configuration information, and executes the SQL statement after the connection is established to obtain corresponding report data.

[0215] Step S205: Send the report data, chart type, horizontal axis dimension, chart title and indicator unit array to the web page end, so that the web page end generates a corresponding report according to the report data, chart type, horizontal axis dimension, chart title and indicator unit array.

[0216] In this embodiment, the web page first determines the data generation function corresponding to the chart type; then uses the report data, horizontal axis dimension, chart title and indicator unit array to call the data generation function to generate the data structure required for the chart; and then renders and displays based on the data structure to complete the generation of the corresponding report.

[0217] It should be noted that the report generation method provided by the present invention realizes the automatic generation of data charts through the voice wake-up function combined with natural language interaction, effectively reduces the complexity of data display, while improving the flexibility of querying various data reports, and supports display in a variety of chart forms.

[0218] Example 5:

[0219] refer to Figure 11 This embodiment provides an electronic device, including a memory 21 and a processor 22. The memory 21 stores a computer program, and the processor 22 is configured to run the computer program to execute the report generation method in Example 1 or Example 2.

[0220] The memory 21 is connected to the processor 22 . The memory 21 may be a flash memory, a read-only memory, or other memory. The processor 22 may be a central processing unit or a single-chip microcomputer.

[0221] Example 4:

[0222] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the report generation method in the above-mentioned embodiment 1 or embodiment 2 is implemented.

[0223] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.

[0224] In summary, the report generation method, electronic device and readable storage medium provided by the embodiments of the present invention are as follows: the web page first monitors the voice input, and in response to the voice input containing a wake-up word, continuously monitors the user's voice input and converts it into text to obtain the user's question content; then sends the large screen identifier and the question content to the server, so that the server queries the configured data source structure according to the large screen identifier, and assembles prompt words based on the configured data source structure and the question content, and uses the assembled prompt words to call the language large model to obtain the returned data, wherein the returned data includes an executable structured query language SQL statement, a chart type, a horizontal axis dimension, a chart title and an indicator unit array, the horizontal axis dimension is used to indicate the field to be displayed on the horizontal axis, and the indicator unit array is used to indicate the field and unit corresponding to each indicator; then receives the report data, the chart type, the horizontal axis dimension, the chart title and the indicator unit array sent by the server after executing the SQL statement; and then generates a corresponding report according to the report data, chart type, horizontal axis dimension, chart title and indicator unit array. The present invention realizes the automatic and dynamic large-screen report generation based on voice commands by introducing voice wake-up and natural language interaction technology, breaking through the traditional system's reliance on pre-configuration. Specifically, users only need to express their needs through voice input to quickly drive the server to query the data source structure, intelligently assemble prompt words and call the language model, accurately obtain the data required for the report, and realize flexible customization of report dimensions, chart types and display content, thereby greatly improving the efficiency and flexibility of report generation. It solves the problems of existing large-screen report generation technology relying on manual configuration, cumbersome and time-consuming operation, fixed configuration of data sources and display fields lacking dynamic adjustment capabilities, and unable to flexibly generate reports according to real-time needs, as well as unable to generate reports directly through voice.

[0225] It will be understood that the above embodiments are merely exemplary embodiments for illustrating the principles of the present invention, and the present invention is not limited thereto. Those skilled in the art will appreciate that various modifications and improvements can be made without departing from the spirit and substance of the present invention, and such modifications and improvements are also considered to be within the scope of protection of the present invention.

Claims

1. A method for generating a report, characterized in that: Applied to a web page, the method includes: Monitor voice input; In response to the voice input containing the wake-up word, continuously monitoring the user's voice input and converting it into text to obtain the user's question content; Sending the large screen identifier and the question content to the server, so that the server queries the configured data source structure according to the large screen identifier, assembles prompt words based on the configured data source structure and the question content, and uses the assembled prompt words to call the language large model to obtain returned data, wherein the returned data includes an executable structured query language SQL statement, a chart type, a horizontal axis dimension, a chart title, and an indicator unit array, the horizontal axis dimension is used to indicate the field to be displayed on the horizontal axis, and the indicator unit array is used to indicate the field and unit corresponding to each indicator; Receive the report data, the chart type, the horizontal axis dimension, the chart title, and the indicator unit array sent by the server after executing the SQL statement; Generate a corresponding report based on the report data, chart type, horizontal axis dimension, chart title and indicator unit array.

2. The method according to claim 1, characterized in that Before monitoring the voice input, the method further includes: Get the name of the business table selected by the user when configuring the data source structure; Requesting the server to obtain the table structure information and field annotations of the business table according to the table name; Receive and display the table structure information and field annotations of the business table returned by the server, wherein the table structure information includes all field names and field types of the business table; Get the field name selected by the user and the modified field comment; The field name selected by the user, the modified field comment, and the corresponding field type are sent to the server, so that the server saves the relationship between the data source and the table name, table comment, the field name selected by the user, the modified field comment, and the corresponding field type.

3. The method according to claim 1, characterized in that In response to the voice input containing the wake-up word, continuously monitoring the user's voice input and converting it into text to obtain the user's question content specifically includes: When voice input is detected, the corresponding audio file is obtained; Sending the audio file to the server, so that the server determines whether the audio file contains the wake-up word; Receiving a wake-up success message sent by the server when it is determined that the audio file contains the wake-up word; Continuously monitor the user's voice input according to the wake-up success message, establish a connection with the voice model, and request the voice model to obtain the text corresponding to the continuously monitored voice input; Receive the text returned by the speech model and obtain the content of the user's question.

4. The method according to claim 1, wherein While sending the large screen logo and the question content to the server, the method further includes: Sending a conversation identifier to the server; Generating a corresponding report according to the report data, chart type, horizontal axis dimension, chart title and indicator unit array specifically includes: Determining a data generating function corresponding to the chart type; Using the report data, horizontal axis dimension, chart title and indicator unit array, call the data generation function to generate the data structure required for the chart; Rendering and display are performed based on the data structure to complete the generation of the corresponding report.

5. A report generation method, characterized in that: Applied to the server, the method includes: Receiving a large screen logo and question content sent by a webpage, wherein the question content is obtained by the webpage monitoring voice input, and in response to the voice input containing a wake-up word, continuously monitoring the user's voice input and converting it into text; Querying the configured data source structure according to the large screen logo, and assembling prompt words based on the configured data source structure and the question content; The assembled prompt word is used to call the language model to obtain returned data, wherein the returned data includes an executable structured query language SQL statement, a chart type, a horizontal axis dimension, a chart title, and an indicator unit array, wherein the horizontal axis dimension is used to indicate the field to be displayed on the horizontal axis, and the indicator unit array is used to indicate the field and unit corresponding to each indicator; Execute the SQL statement to obtain corresponding report data; The report data, chart type, horizontal axis dimension, chart title and indicator unit array are sent to the web page end, so that the web page end generates a corresponding report according to the report data, chart type, horizontal axis dimension, chart title and indicator unit array.

6. The method according to claim 5, characterized in that Before receiving the large-screen logo and question content sent by the webpage, the method further includes: Receiving a request sent by the webpage for obtaining table structure information and field annotations of a business table, wherein the webpage obtains the table name of the business table selected by the user when configuring the data source structure, and sends the request to the server according to the table name; Returning the table structure information and field annotations of the business table to the web page, so that the web page receives and displays them, and obtains the field name and modified field annotation selected by the user, wherein the table structure information includes all field names and field types of the business table; Receive the user-selected field name and modified field comment, and corresponding field type sent by the web page, and save the relationship between the data source and the table name, table comment, user-selected field name and modified field comment, and corresponding field type.

7. The method according to claim 5, characterized in that Before receiving the large-screen logo and question content sent by the webpage, the method further includes: Receiving an audio file sent by the webpage, wherein the audio file is obtained when the webpage detects voice input; Determining whether the audio file contains the wake-up word; In response to the wake-up word being included in the audio file, a wake-up success message is sent to the web page, so that the web page continues to monitor the user's voice input according to the wake-up success message, establishes a connection with the voice model, requests the voice model to obtain the text corresponding to the continuously monitored voice input, and receives the text returned by the voice model to obtain the content of the user's question.

8. The method according to claim 5, characterized in that The configuration-based data source structure and the question content-based prompt word assembly specifically include: Define a character string X for concatenating the business tables in the configured data source structure; Define the task's return structure format description, SQL field rules, time dimension processing rules, and field validation rules, wherein the return structure format description is used to indicate that the task is returned in JavaScript Object Notation (JSON) format and includes the executable SQL statement, chart type, horizontal axis dimension, chart title, and indicator unit array; Define business supplementary information for the business table; The character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules and business supplementary information are assembled into the prompt word.

9. The method according to claim 8, characterized in that While receiving the large-screen logo and question content sent by the webpage, the method further includes: Receiving a conversation identifier sent by the web page; The step of assembling the character string X, the question content, the return structure format description, the SQL field rules, the time dimension processing rules, the field verification rules, and the business supplementary information into the prompt word specifically includes: Determine whether there is a historical round of conversation in the current round of conversation according to the conversation identifier; If there is a historical round conversation in the current round conversation, the character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules, business supplementary information, and the question content of the historical round conversation and the corresponding executable SQL statement are assembled into the prompt word; otherwise, the character string X, the question content, the return structure format description, SQL field rules, time dimension processing rules, field verification rules, and business supplementary information are assembled into the prompt word.

10. The method according to claim 5, characterized in that Executing the SQL statement to obtain corresponding report data specifically includes: Querying the configuration information of the data source according to the large screen identifier; A connection is established with the data source based on the configuration information, and after the connection is established, the SQL statement is executed to obtain corresponding report data.

11. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the report generation method according to any one of claims 1 to 4, or to implement the report generation method according to any one of claims 5 to 10.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the report generation method according to any one of claims 1 to 4, or the report generation method according to any one of claims 5 to 10.

Citation Information

Cited By

  • Automatic page generation method of software construction platform based on large language model

    CN120973364A