Service report generation method, device and system
By using a large language model to identify business report generation requirements, build a business indicator system, and query data from the business database, the problem of accuracy and low efficiency of generating business reports in the existing technology is solved, and efficient and accurate business report generation is achieved.
Patent Information
- Application Number
- CN202411883766.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, the accuracy and efficiency of generating business reports are low, relying on artificial or machine learning models, and artificial methods are affected by subjectivity. Machine learning models consume a large amount of computing resources and generate general reports.
A large language model is used to identify the intent of input problems, generate an indicator list, build a business indicator system based on indicator categories, query indicator data from the business database, and generate business reports.
It improves the accuracy and efficiency of business report generation, can quickly identify generation needs, automatically build an indicator system and query data, and generate targeted business reports.
Smart Images

Figure CN119807408A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device and system for generating a business report. Background Art
[0002] Generating business reports means collecting, organizing, processing, analyzing and generating reports on the data generated by the business of an enterprise to gain insights and opinions on business operations, market trends, customer behavior, etc. By generating business reports, enterprises can make more informed decisions, optimize business processes, and improve efficiency and profitability.
[0003] In the related technology, business reports can usually be generated manually or by machine learning models. However, the manual method of generating business reports relies on business experts and their rich business experience and knowledge. The generated business reports are highly affected by subjective factors, and the efficiency and accuracy of the method for generating business reports are low. The machine learning model method consumes a large amount of computing resources to collect and process enterprise data, and can only generate general business reports for different businesses. The efficiency and accuracy of the method for generating business reports are low.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a method, device and system for generating a business report, so as to at least solve the technical problems of low accuracy and low efficiency of the method for generating a business report in the related art.
[0006] According to one aspect of an embodiment of the present application, a business report generation method is provided, including: using a large language model to perform intent recognition on an input question to obtain an indicator list, wherein the input question is used to describe the generation requirements of a business report, and the indicator list is used to record multiple data analysis indicators associated with the generation requirements; constructing a business indicator system based on the indicator categories of the multiple data analysis indicators in the indicator list; using the large language model and the business indicator system to query and obtain indicator data from a business database; and generating a business report based on the indicator data.
[0007] Optionally, using a large language model to identify the intent of an input question to obtain an indicator list includes: using a large language model to semantically decompose the input question to obtain structured data, wherein the structured data includes business domain data and dimensional domain data; supplementing dimensions based on the structured data to obtain intermediate data; comparing and analyzing the intermediate data with an empirical knowledge vector library to determine multiple data analysis indicators, wherein the empirical knowledge vector library is constructed based on case generation based on multiple historical business reports; and generating an indicator list using multiple data analysis indicators.
[0008] Optionally, dimension supplementation is performed based on structured data to obtain intermediate data, including one of the following: using a preset reasoning model and knowledge graph search method to search for potential dimension information on structured data to generate intermediate data; using a large language model to perform implicit dimension domain reasoning on structured data to generate intermediate data.
[0009] Optionally, based on the indicator categories of multiple data analysis indicators in the indicator list, constructing a business indicator system includes: classifying multiple data analysis indicators into non-lineage indicators and lineage indicators, wherein lineage indicators are data analysis indicators that rely on upper-level data analysis indicators in the business logic to recursively query indicator values, and non-lineage indicators are data analysis indicators that do not rely on upper-level data analysis indicators to calculate indicator values; mounting the non-lineage indicators and lineage indicators respectively to a pre-built initial indicator system to obtain an intermediate indicator system; in response to an adjustment control operation on the intermediate indicator system, adjusting the intermediate indicator system to obtain a business indicator system, wherein the adjustment control operation includes at least one of the following: a trimming control operation and a dimension change control operation.
[0010] Optionally, mounting the non-bloodline indicators and the bloodline indicators respectively into a pre-built initial indicator system to obtain an intermediate indicator system includes: determining the target level corresponding to the bloodline indicators in the initial indicator system according to the hierarchical bloodline relationship of the bloodline indicators in the business logic; mounting the non-bloodline indicators to the basic level in the initial indicator system, and mounting the bloodline indicators to the target level of the initial indicator system to obtain the intermediate indicator system.
[0011] Optionally, using a large language model and a business indicator system to query indicator data from a business database includes: using the business indicator system, a first agent and a second agent corresponding to the large language model to construct a target query statement, wherein the first agent is a structured query language agent and the second agent is a structured query language correction agent; according to the target query statement, calling a query interface corresponding to the business database to perform data query to obtain indicator data.
[0012] Optionally, using the business indicator system, the first agent and the second agent corresponding to the large language model to construct a target query statement includes: using the first agent to analyze the indicator dimension information and the indicator description information corresponding to the business indicator system to construct an initial query statement; using the second agent to perform statement evaluation on the initial query statement to obtain an evaluation result, and modifying the initial query statement according to the evaluation result to obtain a target query statement.
[0013] Optionally, generating a business report based on the indicator data includes: classifying the indicator data into fields to obtain classification results; reasoning the classification results using a large language model and preset inference rules to determine a target chart type; generating report content corresponding to a visual chart based on the indicator data and the target chart type; and performing interactive layout based on the report content to obtain a business report.
[0014] According to another aspect of an embodiment of the present application, a business report generating device is also provided, including: an identification module, used to use a large language model to perform intent recognition on an input question to obtain an indicator list, wherein the input question is used to describe the generation requirements of a business report, and the indicator list is used to record multiple data analysis indicators associated with the generation requirements; a construction module, used to construct a business indicator system based on the indicator categories of multiple data analysis indicators in the indicator list; a query module, used to use the large language model and the business indicator system to query and obtain indicator data from a business database; and a generation module, used to generate a business report based on the indicator data.
[0015] According to another aspect of an embodiment of the present application, a business report generation system is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any one of the above-mentioned business report generation methods.
[0016] In an embodiment of the present application, a large language model is used to identify the intent of an input question to obtain an indicator list, wherein the input question is used to describe the generation requirements of a business report, and the indicator list is used to record multiple data analysis indicators associated with the generation requirements; a business indicator system is constructed based on the indicator categories of multiple data analysis indicators in the indicator list; indicator data is obtained by querying from a business database using a large language model and the business indicator system; and a business report is generated based on the indicator data. As a result, the present application achieves the purpose of accurately identifying the generation requirements of a business report using a large language model and quickly generating a business report according to the generation requirements, thereby achieving the technical effect of improving the accuracy and efficiency of the method for generating a business report, and further solving the technical problems of low accuracy and low efficiency of the method for generating a business report in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 It is a hardware structure block diagram of a terminal device for a business report generation method according to an optional embodiment of the present application;
[0019] Figure 2is a flow chart of a method for generating a business report according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of an optional business report generation process according to an embodiment of the present application;
[0021] Figure 4 It is a schematic diagram of a specific implementation process of generating an optional business report according to an embodiment of the present application;
[0022] Figure 5 is a schematic diagram of an optional knowledge graph search method according to an embodiment of the present application;
[0023] Figure 6 is a schematic diagram of an optional intermediate indicator system according to an embodiment of the present application;
[0024] Figure 7 is an optional flow chart of acquiring data according to an embodiment of the present application;
[0025] Figure 8 It is a structural block diagram of a business report generating device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] According to an embodiment of the present application, an embodiment of a business report generating method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] Figure 1 is a hardware structure block diagram of a terminal device for a business report generation method according to an optional embodiment of the present application, such as Figure 1 As shown, the terminal device may include one or more processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Microcontroller Unit, referred to as MCU) or a programmable logic device (Field Programmable Gate Array, referred to as FPGA)), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display device 110, an input / output device 108 (i.e., an I / O device), a Universal Serial Bus (USB) port (which may be included as one of the ports of a computer bus, not shown in the figure), a network interface (not shown in the figure), a power supply (not shown in the figure) and / or a camera (not shown in the figure). It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0030] It should be noted that the one or more processors 102 and / or other data processing circuits may be embodied in whole or in part as software, hardware, firmware or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be fully or partially integrated into any of the other components in the terminal device (or mobile device).
[0031] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the business report generation method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned business report generation method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0032] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the terminal device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0033] Under the above operating environment, the embodiment of the present application provides the following Figure 2 The business report generation method shown, Figure 2 is a flow chart of a method for generating a business report according to an embodiment of the present application. Figure 2 As shown, the method includes the following implementation steps S201 to S204.
[0034] Step S201, using a large language model to perform intent recognition on an input question to obtain an indicator list, wherein the input question is used to describe the generation requirements of a business report, and the indicator list is used to record multiple data analysis indicators associated with the generation requirements.
[0035] The above-mentioned large language model can be a natural language processing model with a large number of parameters (such as billions to trillions of parameters) and a complex neural network structure. The large language model can be obtained by training text data, and the large language model can be used to understand and generate natural language.
[0036] The input question may be a business analysis requirement or business analysis question in natural language. The generated requirement may be a requirement for the generated business report, such as data requirements (such as sales, customer satisfaction, inventory turnover, etc.), analysis dimension domain (such as time, geographic location, product category, customer type, etc.), report format (such as the number of pages, title, summary, directory, body and conclusion of the report, etc.), report cycle, etc.
[0037] The above data analysis indicators can be used to quantify the business status. The data analysis indicators may include but are not limited to: indicator name, indicator score ratio, and business indicator caliber. The above indicator name can be used to describe the meaning or measurement standard of the business represented by the indicator. The above indicator score ratio can be used to measure the relative importance of the data analysis indicator in the business. The above business indicator caliber can be used to determine the unified standard of business indicators, such as the calculation method of the indicator, data source, scope of use and statistical rules.
[0038] The above indicator list includes multiple data analysis indicators. Taking the attendance data indicator among the multiple data analysis indicators as an example, the indicator name of the attendance data indicator is the daily on-the-job hours of employees. The business indicator caliber of the attendance data indicator includes the calculation method of attendance and the scope of use of attendance. The calculation method of the attendance data indicator is the difference between the clock-in time and the clock-in time. The scope of use of the attendance data indicator is employee C in department B, and the indicator score of the attendance data indicator accounts for 10%.
[0039] The specific implementation method of using a large language model to identify the intent of input questions and obtain an indicator list can be: using a large language model to identify the intent of input questions in natural language form, identifying the generation requirements of business reports, determining multiple data analysis indicators associated with the generation requirements and recording them in an indicator list to obtain an indicator list.
[0040] It is easy to understand that in the embodiment of the present application, the above-mentioned large language model is used to identify the intent of the input questions corresponding to the generation requirements of the business report, and multiple data analysis indicators associated with the generation requirements can be determined in a targeted manner according to the generation requirements of different business reports. Compared with the business report generation method for generating general business reports, the business report generated by the embodiment of the present application is more targeted.
[0041] Step S202: constructing a business indicator system based on the indicator categories of the plurality of data analysis indicators in the indicator list.
[0042] The indicator category can be determined by judging whether the data analysis indicator has an upper-level dependent indicator. The upper-level indicator can be a parent node in the tree structure.
[0043] The above-mentioned business indicator system may be a structured indicator set. The business indicator system may be used to determine the hierarchy and association between data analysis indicators. The business indicator system may be constructed through a tree structure.
[0044] Based on the indicator categories of multiple data analysis indicators in the indicator list, the specific implementation method of constructing a business indicator system can be: judging whether there are upper-level dependent indicators for the multiple data analysis indicators in the indicator list, determining the indicator category of each data analysis indicator in the multiple data analysis indicators, and determining the level and position of each data analysis indicator in the business indicator system according to the indicator categories of the multiple data analysis indicators, and constructing a business indicator system.
[0045] It is easy to understand that in the embodiment of the present application, by judging whether the data analysis indicator has an upper-level dependent indicator, multiple data analysis indicators in the indicator list are divided into different indicator categories, and a business indicator system is constructed. This can not only accurately display the hierarchy and association between the data analysis indicators, but also more conveniently and flexibly manage multiple data analysis indicators in the business indicator system, thereby improving the accuracy of data analysis and thus improving the accuracy of the business report generation method.
[0046] Step S203, using the large language model and the business indicator system, query and obtain indicator data from the business database.
[0047] The business database mentioned above may be a database storing multiple business indicator data.
[0048] The above indicator data may be a numerical set result obtained by querying a business database.
[0049] The specific implementation method of querying and obtaining indicator data from a business database using a large language model and a business indicator system may be: using a large language model, generating a corresponding query statement for each data analysis indicator of multiple data analysis indicators in the business indicator system, and using the query statement, querying and obtaining a numerical set of each data analysis indicator in the business indicator system from the business database.
[0050] It is easy to understand that in the embodiment of the present application, a large language model is used to automatically generate corresponding query statements for each data analysis indicator, which not only reduces dependence on manual labor, reduces the time for manual writing and debugging of query code, and improves the efficiency of data query, but also can accurately query the indicator data corresponding to each data analysis indicator from the business database, ensuring that the business report contains the analysis results of each data analysis indicator, thereby improving the accuracy of the business report generation method.
[0051] Step S204: Generate a business report based on the indicator data, wherein the business report includes a visual chart.
[0052] The above visualization chart can be used to display the indicator data in the form of a chart in the graphical user interface of the terminal device.
[0053] It is easy to understand that in the embodiments of the present application, a business report containing a visual chart is generated based on the indicator data, which can not only automatically analyze the indicator data to generate a business report and improve the efficiency of the business report generation method, but also display complex indicator data more intuitively in the form of a chart, thereby facilitating users to quickly understand the business status.
[0054] Through the above steps S201 to S204, in the embodiment of the present application, the large language model is used to identify the intent of the input question, so that the generation requirements of the business report can be accurately understood, and the business indicator system can be automatically constructed, which effectively improves the efficiency and accuracy of report generation; further, the large language model and the business indicator system are used to query and obtain indicator data from the business database, which can reduce dependence on manual work and avoid missing the analysis of indicator data in the business report; further, a business report containing a visual chart is automatically generated, which improves the visibility of the business report and improves the efficiency of the method for generating a business report.
[0055] Optionally, in the above step S201, using a large language model to perform intent recognition on the input question to obtain an indicator list further includes the following method steps:
[0056] Step S211, using a large language model to semantically decompose the input question to obtain structured data, wherein the structured data includes business domain data and dimension domain data;
[0057] Step S212, supplementing the dimensions based on the structured data to obtain intermediate data;
[0058] Step S213, comparing and analyzing the intermediate data with the experience knowledge vector library to determine a plurality of data analysis indicators, wherein the experience knowledge vector library is constructed based on a plurality of historical business report generation cases;
[0059] Step S214, generating an indicator list using multiple data analysis indicators.
[0060] The semantic decomposition can be a process of extracting keywords related to the business from the input question. The structured data can be stored in a table format. The business domain data can be data directly related to the business field in the input question, such as sales records, production data, etc. The dimension domain data can be conditional data that limits data analysis indicators in the input question, such as time, location, product category, customer group, etc.
[0061] The dimension supplementation may be a process of acquiring dimension data related to the structured data.
[0062] The above-mentioned experience knowledge vector library can be used to store vectors corresponding to historical business report generation cases.
[0063] In an exemplary application scenario, Figure 3 is a schematic diagram of an optional business report generation process according to an embodiment of the present application, Figure 4 FIG. 1 is a schematic diagram of a specific implementation process of generating an optional business report according to an embodiment of the present application. Figure 3 As shown, the business report generation process includes user intention recognition (ie, E1), specifically, as Figure 4 As shown, the user inputs the analysis intention (i.e., input question) into the business report generation system, and the user intention is identified for the input question. The user intention identification (i.e., Figure 3 The E1) process in the example can include the following three parts: semantic decomposition; semantic expansion; building a knowledge vector library based on historical experience and determining data analysis indicators. The input question above is "I want to see the attendance data for the past three months."
[0064] The specific steps of the semantic decomposition part in the user intent recognition process can be: use the large language model to semantically decompose the input questions in natural language form, remove irrelevant information in the input questions (that is, I want to take a look), extract business-related keywords, and obtain business domain data (that is, attendance data) and dimension domain data (that is, the past three months), thereby converting the input questions into "attendance data for the past three months", and performing structural transformation to obtain structured data.
[0065] The specific steps of the semantic expansion part in the user intent recognition process can be: based on structured data, using reasoning models and knowledge graphs, the structured data is supplemented with dimensions, and the data corresponding to the supplemented dimensions is obtained and determined as intermediate data.
[0066] In the process of user intention recognition, a knowledge vector library is established based on historical experience, and the specific steps of determining the data analysis indicator part can be: obtaining multiple historical business report generation cases, vectorizing the multiple historical business report generation cases, and storing them in the experience knowledge vector library, constructing the experience knowledge vector library, vectorizing the intermediate data to obtain the intermediate data vector, performing similarity search on the intermediate data vector in the experience knowledge vector library, and obtaining multiple knowledge base vectors in the experience knowledge vector library, and the similarity score between the knowledge base vector and the intermediate data vector is greater than the similarity score threshold (such as 0.5); further, multiple historical business report generation cases corresponding to the multiple knowledge base vectors are obtained, based on the multiple historical business report generation cases, the case indicators in each historical business report generation case are determined, and multiple data analysis indicators are determined; further, an indicator list is generated using the multiple data analysis indicators.
[0067] The structure of the above-mentioned experience knowledge vector library can be: {vector:'business domain|dimensional domain', 'Indexs'[indicator list]}, {vector:'analysis intent', 'Indexs'[indicator list]}, where vector can represent a vector and Indexes can represent a list.
[0068] It should be noted that, in one embodiment, the above-mentioned determination of case indicators in each historical business report generation case based on multiple historical business report generation cases, and determination of multiple data analysis indicators may also include: comparing and analyzing the case indicators in each historical business report generation case in multiple historical business reports, deleting duplicate case indicators in multiple case indicators, obtaining multiple case sorting indicators, and determining multiple data analysis indicators from the multiple case sorting indicators.
[0069] It is easy to understand that through the above steps S211 to S214, in the embodiment of the present application, through the deep combination of the large language model and the empirical knowledge vector library, the effects of accurate understanding of the input questions, intelligent supplementation of dimensional information and precise determination of data analysis indicators are achieved, which not only improves the accuracy and pertinence of the business report generation method, but also enhances the intelligence level of the business report generation method.
[0070] Optionally, in the above step S212, dimension supplementation based on structured data to obtain intermediate data may also include one of the step methods in step S2121 to step S2122.
[0071] Step S2121, using the preset reasoning model and knowledge graph search method, search for potential dimension information of structured data to generate intermediate data.
[0072] The above inference model can be used to find indicator attribute nodes in the knowledge graph. The above indicator attribute nodes can be nodes containing clear indicator values, and the indicator attribute nodes can be used to evaluate and monitor business status.
[0073] The above-mentioned knowledge graph can be a database composed of graph nodes and graph edges. The above-mentioned graph nodes can be used to represent entities, and the above-mentioned graph edges can be used to represent the relationship between graph nodes.
[0074] The potential dimension information may be the dimension information in the node corresponding to the vector in the knowledge graph that is not mentioned in the input question and whose similarity value with the structured data is greater than the similarity threshold. The similarity value may be calculated by using the cosine similarity calculation method, and the similarity value may be used to represent the similarity between the dimension information and the business domain data. The higher the similarity value, the higher the similarity between the dimension information and the business domain data. The similarity threshold may be set to different values according to different businesses.
[0075] The potential dimension information may also be dimension information in the knowledge domain node connected to the node corresponding to the structured data in the knowledge graph. The knowledge domain node may be a node representing a specific field or subject.
[0076] A specific implementation method of using a preset reasoning model and knowledge graph search method to search for potential dimensional information of structured data and generate intermediate data may be: using a large language model to vectorize the graph nodes of the knowledge graph and store them in a knowledge graph vector database, using a preset reasoning model to retrieve vectors in the knowledge graph vector database that are not mentioned in the input question and whose similarity values with the structured data are greater than a similarity threshold, obtaining the node corresponding to the vector in the knowledge graph, determining the parent node of the node as the root node, searching for the indicator attribute node corresponding to the root node, obtaining the dimensional information in the indicator attribute node, and generating intermediate data.
[0077] The above-mentioned parent node can be a node to which one or more child nodes are connected by a specific relationship, and the specific relationship can be used to represent a hierarchical structure or classification structure, wherein the parent node represents a higher-level concept, category or entity, and the child node represents a more specific or detailed concept, category or entity subordinate to the parent node.
[0078] In an exemplary application scenario, Figure 5 is a schematic diagram of an optional knowledge graph search method according to an embodiment of the present application, such as Figure 5 As shown, the large language model can be a sentence bidirectional transformer encoder (e.g., Sentence-BERT) or a text embedding program programming interface (e.g., OpenAI's Embedding API). The similarity threshold can be 0.7.
[0079] Specifically, the graph nodes of the structured representation are vectorized using a large language model and stored in a knowledge graph vector database. Furthermore, a preset reasoning model is used to retrieve vectors with a similarity value greater than 0.7 with the structured data in the knowledge graph vector database, and the nodes corresponding to the vectors are found in the knowledge graph (denoted as approximate concept nodes). For example, Figure 5The attendance node shown belongs to the approximate concept node of the attendance node. Furthermore, the knowledge graph is used to determine the parent node corresponding to the attendance node. The parent node is taken as the root node (i.e., the starting point of traversing the knowledge graph). The breadth traversal algorithm is used to search for multiple indicator attribute nodes corresponding to the root node in the knowledge graph in the six layers upwards, and the dimension information in the multiple indicator attribute nodes is obtained to generate intermediate data.
[0080] Another specific implementation method of using a preset reasoning model and knowledge graph search method to search for potential dimensional information of structured data and generate intermediate data may be: based on the structured data, determine the node corresponding to the structured data in the knowledge graph, and then use the preset reasoning model to determine each knowledge domain node in multiple knowledge domain nodes as a root node, search for the indicator attribute node corresponding to each root node, obtain the dimensional information in the indicator attribute node, and generate intermediate data.
[0081] In an exemplary application scenario, Figure 5 As shown, the node corresponding to the above structured data in the knowledge graph is the attendance node, and the multiple knowledge domain nodes connected to the attendance node are: lateness rate node and personnel domain node.
[0082] Specifically, using the preset reasoning model, multiple knowledge domain nodes connected to the node are determined in the knowledge graph (such as the lateness rate node and the personnel domain node), and the lateness rate node and the personnel domain node are used as root nodes respectively. The breadth traversal algorithm is used to search for multiple indicator attribute nodes in the six layers upward corresponding to the root node in the knowledge graph (such as, using the lateness rate node as the root node, the lateness rate indicator node of the indicator attribute node can be searched), and the dimensional information in the multiple indicator attribute nodes is obtained to generate intermediate data.
[0083] Correspondingly, if the node corresponding to the structured data in the knowledge graph is a personnel domain node, the knowledge domain nodes connected to the personnel domain node are: authentication node and attendance node.
[0084] It is easy to understand that in the embodiments of the present application, the use of preset reasoning models and knowledge graph search methods to supplement potential dimensional information can not only meet the generation needs, but also generate additional dimensional information related to the generation needs in the business report, which can provide more comprehensive analysis results, enhance the integrity of the business report, and improve the accuracy of the business report generation method.
[0085] Step S2122, using a large language model to perform implicit dimension domain reasoning on the structured data to generate intermediate data.
[0086] The implicit dimension domain mentioned above may be a dimension domain associated with structured data.
[0087] The specific implementation method of using a large language model to infer the implicit dimensional domain of structured data and generate intermediate data can be: using a large language model to infer the structured data, generate multiple dimensional domains associated with the structured data, search for the indicator attribute nodes corresponding to each implicit dimensional domain in the knowledge graph, determine multiple implicit dimensional domain data, and generate intermediate data.
[0088] In an exemplary application scenario, the input question is "attendance data for the past three months". The large language model is used to perform implicit dimensional domain reasoning on the structured data corresponding to the input question to generate multiple dimensional domains associated with the structured data (such as attendance rate, lateness rate, and overtime hours). Furthermore, the indicator attribute nodes corresponding to each implicit dimensional domain are searched in the knowledge graph (such as attendance rate node, lateness rate node, and overtime hour node), and multiple implicit dimensional domain data are determined to generate intermediate data.
[0089] It is easy to understand that in the embodiment of the present application, the use of a large language model to generate implicit dimensional domains can automatically supplement structured data, provide more comprehensive dimensional information, and improve the accuracy of the business report generation method.
[0090] Through the above-mentioned steps S2121 to S2122, in the embodiment of the present application, it is possible to automatically supplement dimensional information based on the business report generation needs and obtain more comprehensive and detailed intermediate data, which not only improves the accuracy and depth of data analysis, but also enhances the intelligence level of the business report generation method, and provides a more efficient and professional business report generation method.
[0091] Optionally, in the above step S202, based on the indicator categories of the multiple data analysis indicators in the indicator list, constructing the business indicator system further includes the following method steps:
[0092] Step S221, classifying multiple data analysis indicators into non-lineage indicators and lineage indicators, wherein lineage indicators are data analysis indicators that rely on upper-layer data analysis indicators in business logic to recursively query indicator value calculations, and non-lineage indicators are data analysis indicators that do not rely on upper-layer data analysis indicators to calculate indicator values;
[0093] Step S222, mounting the non-bloodline indicators and the bloodline indicators to the pre-built initial indicator system respectively, to obtain an intermediate indicator system;
[0094] Step S223, in response to the adjustment control operation on the intermediate indicator system, the intermediate indicator system is adjusted to obtain the business indicator system, wherein the adjustment control operation includes at least one of the following: a trimming control operation and a dimension change control operation.
[0095] The above business logic can be used to define the dependency relationship between data analysis indicators. The above upper-level data analysis indicators can be indicators at a higher level in the indicator system. The above initial indicator system can be a pre-designed indicator framework containing indicator classification and hierarchical relationship. The above trimming control operation can be used to delete data analysis indicators. The above dimension change control operation can be used to add data analysis indicators and update the intermediate indicator system.
[0096] Specifically, based on the business logic, determine whether multiple data analysis indicators depend on the upper-level data analysis indicators. If the data analysis indicators do not depend on the upper-level data analysis indicators to calculate the indicator values, the data analysis indicators are determined as non-lineage indicators. If the data analysis indicators depend on the upper-level data analysis indicators in the business logic to perform recursive query indicator value calculation, the data analysis indicators are determined as lineage indicators. Further, according to the indicator mounting method, determine the corresponding levels of the non-lineage indicators and the lineage indicators in the initial indicator system, respectively, mount the non-lineage indicators and the lineage indicators in a hierarchical manner, and obtain the hierarchical expression formats corresponding to the non-lineage indicators and the lineage indicators. The hierarchical expression formats corresponding to the non-lineage indicators and the lineage indicators are respectively mounted on the pre-built initial indicator system to obtain an intermediate indicator system. Further, in response to the adjustment control operation on the intermediate indicator system, perform trimming control operations and / or dimension change operations on the intermediate indicator system to obtain a business indicator system.
[0097] In an exemplary application scenario, Figure 3 As shown in Figure 2, the business report generation process also includes indicator system construction (E2), specifically, Figure 4 As shown, the indicator list is used to construct an indicator system, and the indicator system is constructed (i.e., Figure 3 The E2) process in the above may include the following five parts: semantic hierarchical processing of data analysis indicators; tracing back the upper data analysis indicators of related indicators; building an indicator system tree, indicator cutting, and dimension table supplementation. The above hierarchical expression format may include a basic hierarchical expression format (as shown in the first expression format) and a dependent hierarchical expression format (as shown in the second expression format).
[0098] The first expression format: <indicator table>::business domain::indicator name.
[0099] In the first expression format, <indicator table> indicates the data table where the indicator is located, the business domain indicates the business field to which the indicator belongs, and the indicator name indicates the specific name of the indicator.
[0100] The second expression format: <indicator table>::upper-level indicator business domain::upper-level indicator name::business domain::indicator name.
[0101] In the first expression format, the upper-layer indicator business domain indicates the business field to which the upper-layer data analysis indicator corresponding to the indicator belongs, and the upper-layer indicator name indicates the specific name of the upper-layer data analysis indicator corresponding to the indicator.
[0102] The specific steps for the semantic hierarchical processing of data analysis indicators during the indicator system construction process can be: according to the business logic, multiple data analysis indicators are judged. If the data analysis indicator does not rely on the upper-level data analysis indicator to calculate the indicator value, the data analysis indicator is determined as a non-bloodline indicator; if the data analysis indicator depends on the upper-level data analysis indicator in the business logic, the data analysis indicator is determined as a bloodline indicator.
[0103] The specific steps for tracing the upper-level data analysis indicator part of the related indicator during the indicator system construction process can be: take the related indicator as the search starting point, and according to the business logic, use the depth-first search method to traverse the search upward layer by layer until the non-related indicator is found, and obtain multiple upper-level data analysis indicators corresponding to the related indicator, and according to the indicator mounting method, determine the corresponding levels of the non-related indicator and the related indicator in the initial indicator system respectively, mount the non-related indicator and the related indicator in a hierarchical expression format, and obtain the non-related indicator in a hierarchical expression format and the related indicator in a dependent hierarchical expression format, and add the indicator name and business domain corresponding to each upper-level data analysis indicator in the multiple upper-level data analysis indicators layer by layer in the dependent hierarchical expression format corresponding to the related indicator.
[0104] The specific steps for constructing the indicator system tree during the indicator system construction process can be: construct an intermediate indicator system based on the non-bloodline indicators in the hierarchical expression format and the bloodline indicators in the dependent hierarchical expression format. The intermediate indicator system can be a tree structure. In the intermediate indicator system in the tree structure, the root node can represent the non-bloodline indicator, the leaf node can represent the bloodline indicator, and the dependency relationship of each data analysis indicator can be represented in the form of parent-child nodes.
[0105] The specific steps of the indicator trimming part in the indicator system construction process can be: according to the actual needs of business report generation, perform trimming control operations on unnecessary data analysis indicators in the intermediate indicator system, respond to the trimming control operations on the intermediate indicator system, delete unnecessary data analysis indicators in the intermediate indicator system, and obtain the business indicator system.
[0106] The specific steps of the dimension table supplement part in the process of indicator system construction can be: according to the actual needs of business report generation, perform dimension change control operations on the intermediate indicator system, respond to the dimension change control operations on the intermediate indicator system, supplement new data analysis indicators in the intermediate indicator system, and update the intermediate indicator system to obtain the business indicator system.
[0107] Through the above-mentioned steps S221 to S223, in the embodiment of the present application, the classification of multiple data analysis indicators can enhance the logic of the intermediate indicator system, which is conducive to faster query of indicators in the indicator system; by adjusting the control operation, the intermediate indicator system can be tailored and dimensionally changed according to actual needs to meet personalized needs and improve the accuracy of the intermediate indicator system, thereby improving the accuracy of the business report generation method.
[0108] Optionally, in the above step S222, mounting the non-bloodline indicator and the bloodline indicator to the pre-built initial indicator system respectively, and obtaining the intermediate indicator system further comprises the following method steps:
[0109] Step S2221, determining the target level corresponding to the related indicator in the initial indicator system according to the hierarchical relationship of the related indicator in the business logic;
[0110] Step S2222, mount the non-bloodline indicators to the basic level in the initial indicator system, and mount the bloodline indicators to the target level of the initial indicator system, to obtain an intermediate indicator system.
[0111] The above steps S2221 to S2222 can be used to implement the indicator mounting method.
[0112] Specifically, based on the business logic, the dependency relationship between the related indicators and the upper-level data analysis indicators is analyzed, the hierarchical relationship of the related indicators in the business logic is determined, and the target level of the related indicators in the initial indicator system is determined; further, the non-bloodline indicators are mounted and the related indicators are hierarchically processed to obtain the hierarchical expression formats corresponding to the non-bloodline indicators and the related indicators, the non-bloodline indicators in the basic hierarchical expression format are directly mounted to the basic level in the initial indicator system, and the related indicators in the dependent hierarchical expression format are mounted to the target level of the initial indicator system to obtain the intermediate indicator system.
[0113] In an exemplary application scenario, Figure 6 It is a schematic diagram of an optional intermediate indicator system according to an embodiment of the present application. The above-mentioned non-bloodline indicator can be the first indicator (i.e., the data analysis indicator corresponding to the indicator name a), the second indicator (i.e., the data analysis indicator corresponding to the indicator name b1), and the third indicator (i.e., the data analysis indicator corresponding to the indicator name b2). The above-mentioned bloodline indicator can be the fourth indicator (i.e., the data analysis indicator corresponding to the indicator name e). The upper-level data analysis indicator corresponding to the fourth indicator is the fifth indicator (i.e., the data analysis indicator corresponding to the indicator name c) and the sixth indicator (i.e., the data analysis indicator corresponding to the indicator name d).
[0114] Specifically, according to the hierarchical relationship of the fourth indicator in the business logic, it can be determined that the target level corresponding to the fourth indicator in the initial indicator system is the second level, and the first indicator, the second indicator, the third indicator, and the fourth indicator are hierarchically processed respectively to obtain the first indicator, the second indicator, the third indicator in the basic hierarchical expression format, and the fourth indicator in the dependent hierarchical expression format. The first indicator, the second indicator, and the third indicator in the basic hierarchical expression format are directly mounted to the basic level of the indicator system, and the fourth indicator in the dependent hierarchical expression format is mounted to the target level of the initial indicator system according to the hierarchical blood relationship to obtain an intermediate indicator system. The intermediate indicator system is as follows: Figure 6 shown.
[0115] Through the above-mentioned steps S2221 to S2222, in the embodiment of the present application, by accurately classifying and mounting non-bloodline indicators and bloodline indicators to different levels of the initial indicator system, not only can the data analysis indicators be accurately managed, but also the logic and accuracy of business report generation can be improved.
[0116] Optionally, in the above step S203, using the large language model and the business indicator system to query and obtain indicator data from the business database also includes the following method steps S231 to S232.
[0117] Step S231, constructing a target query statement using the business indicator system, the first agent and the second agent corresponding to the large language model, wherein the first agent is a structured query language agent and the second agent is a structured query language correction agent.
[0118] The first agent may be used to generate a database query statement. The second agent may be used to modify a database query statement. The target query statement may be represented in a structured form.
[0119] In an exemplary application scenario, according to the business indicator system, the constraints of the business database and the function list of the business database are determined, and the business indicator system is analyzed by using the first agent corresponding to the large language model to determine the query scope of the query statement in the business database and the indicator data table structure, and according to the constraints of the business database, the function list of the business database, the query scope and the data table structure, the query target is constructed, and the query target is modified by using the second agent corresponding to the large language model to obtain the target query statement in a structured form. The above-mentioned data table structure may include the English name of the field, the Chinese name of the field, the field type, and the value range.
[0120] Step S232: According to the target query statement, the query interface corresponding to the business database is called to perform data query to obtain indicator data.
[0121] According to the target query statement, the query interface corresponding to the business database is called to perform data query, and the specific implementation steps for obtaining the indicator data may be: according to the target query statement, the query interface corresponding to the business database is called to perform data query to obtain a first query result data set, and further, it is determined whether the first query result data set belongs to an empty set, if the first query result data set does not belong to the empty set, the first query result data set is determined as the indicator data; if the first query result data set belongs to the empty set, the business indicator system, the first agent and the second agent corresponding to the large language model are used to update the target query statement, and according to the updated target query statement, the query interface corresponding to the business database is called to perform data query to obtain a second query result data set, and the second query result data set is determined as the indicator data.
[0122] Through the above steps S231 to S232, in the embodiment of the present application, by utilizing the first agent and the second agent of the large language model, it is possible to quickly and accurately generate a target query statement corresponding to the business indicator system, thereby quickly and accurately obtaining indicator data from the business database.
[0123] Optionally, in the above step S231, constructing the target query statement by using the business indicator system, the first agent and the second agent corresponding to the large language model further includes the following method steps:
[0124] Step S2311, using the first agent, analyzing the indicator dimension information and indicator description information corresponding to the business indicator system, and constructing an initial query statement;
[0125] Step S2312: Using the second agent, the initial query statement is evaluated to obtain an evaluation result, and the initial query statement is modified according to the evaluation result to obtain a target query statement.
[0126] The indicator dimension information may be information corresponding to the dimension domain, and the indicator dimension information may be used to determine the query scope of the query statement in the business database. The indicator description information may be used to describe the indicator data table structure.
[0127] The above evaluation results can be used to characterize the grammatical correctness and execution feasibility of the initial query statement. The evaluation results can also be used to determine whether the indicator data can be found from the business database according to the initial query statement.
[0128] Specifically, the first agent is used to analyze the indicator dimension information and indicator description information corresponding to the business indicator system, determine the constraints of the business database, the function list of the business database, the query scope of the query statement in the business database, and the indicator data table structure, thereby constructing an initial query statement according to the constraints of the business database, the function list of the business database, the query scope and the data table structure.
[0129] In an exemplary application scenario, Figure 3 As shown, the business report generation process also includes obtaining data (E3), specifically, Figure 4 As shown, obtain data (ie, Figure 3 The E3) process in the example may include the following four parts: calling sqlagent to construct a target query statement; calling the evaluation agent to evaluate the target query statement; using the data query interface and the target query statement to query the business database for initial indicator data; using the data verification interface to verify the initial indicator data and determine the target indicator data.
[0130] It should be noted that the above-mentioned SQL agent, evaluation agent, data query interface and data verification interface can be built-in or encapsulated in the data acquisition module of the business report generation system.
[0131] Still taking the above application scenario as an example, Figure 7 is an optional flow chart of obtaining data according to an embodiment of the present application, such as Figure 7 As shown, in the above application scenario, a query text (denoted as prompt) is constructed based on the indicator dimension information and indicator description information corresponding to the business indicator system, and the query text is analyzed by the first agent corresponding to the large language model to generate an initial query statement in a structured form (denoted as sql), and the initial query statement is evaluated (i.e., checked) by the second agent corresponding to the large language model to obtain an evaluation result.
[0132] Furthermore, if the evaluation result is that the syntax of the initial query statement is correct and executable, and the indicator data can be found from the business database according to the initial query statement, it is recorded as a successful verification; otherwise, it is recorded as an unsuccessful verification; the case where the verification is unsuccessful and the number of retries reaches the maximum number of retries is recorded as a retry failure, and the evaluation result is verified to obtain a verification result. If the verification result is a successful verification, the initial query statement is determined as a target query statement; if the verification result is a retry failure, the indicator in the business indicator system is corrected or discarded; if the verification result is an unsuccessful verification and the number of retries does not reach the maximum number of retries, the initial query statement is corrected (i.e., automatically corrected) to obtain the target query statement.
[0133] Furthermore, according to the target query statement, the query interface corresponding to the business database is called to perform data query (i.e., execute SQL to obtain data). According to the target query statement, the query interface corresponding to the business database is called to perform data query, and the data set corresponding to the query result is verified. If the query result does not belong to an empty set, the data set corresponding to the query result is output.
[0134] Through the above-mentioned steps S2311 to S2312, in the embodiment of the present application, the first agent corresponding to the large language model can be used to automatically generate an initial query statement, thereby improving the efficiency of the business report generation method. The second agent corresponding to the large language model can be used to correct the initial query statement, thereby improving the quality of the target query statement, avoiding erroneous indicator data due to errors in the target query statement, improving the quality of the indicator data, and thus improving the accuracy of the generated business report.
[0135] Optionally, in the above step S204, generating a business report based on the indicator data further includes the following method steps:
[0136] Step S241, classifying the indicator data by fields to obtain classification results;
[0137] Step S242, using the large language model and preset reasoning rules to reason about the classification results and determine the target chart type;
[0138] Step S243, generating report content corresponding to the visualization chart according to the indicator data and the target chart type;
[0139] Step S244, interactive layout is performed based on the report content to obtain a business report.
[0140] The above classification results may include dimension fields and metric fields. The above dimension field may be a character type field, and the dimension field may also be a time type field. The above metric field may be a numeric type field. The above preset inference rules may be used to assist in determining the target chart type. The above target chart types may include but are not limited to bar charts, line charts, radar charts, pie charts, area charts, scatter charts, card charts, etc. The above preset inference rules may be used to guide the large language model to determine the target chart type. The above report content may include but is not limited to the title, legend, data label, data structure and annotations to the chart data of the chart. The above data structure may be used to represent the structure of the content displayed in the chart.
[0141] Specifically, the indicator data is analyzed to determine the field type corresponding to the indicator data, and the field types corresponding to the indicator data are classified to obtain the classification results; further, the generation requirements are parsed using a large language model and preset inference rules to determine one or more target chart types; further, a visual chart is generated based on the indicator data and the target chart type, data is annotated in the visual chart, and report content is generated; further, an interactive layout is performed based on the report content, and the size, position, and order of the chart are adjusted to obtain a more targeted business report.
[0142] In an exemplary application scenario, Figure 3As shown, the business report generation process also includes generating a view construction report (E4), specifically, as Figure 4 As shown, generate a view build report (i.e., Figure 3 The E4) process can include the following four parts: classifying the indicator data into fields, determining the chart type, building report structured data, and generating reports.
[0143] The specific steps for generating the field classification part of the indicator data in the view construction report can be: analyzing the field types corresponding to the indicator data, classifying the indicator data corresponding to the character type fields and the indicator data corresponding to the time type fields as the indicator data corresponding to the dimension fields, and classifying the indicator data corresponding to the numerical type fields as the indicator data corresponding to the metric fields, to obtain the classification results.
[0144] The specific steps for generating the chart type determination part in the view construction report may be: defining a preset inference rule to determine whether there is a time type field in the classification result; if there is a time type field in the classification result, determining the target chart type to be a trend chart, which can be used to display data changes over time, such as a line chart, an area chart, a bar chart, a scatter chart, etc.; further, reasoning the classification results based on a large language model and preset inference rules to determine at least one target chart type.
[0145] The specific steps of generating the structured data part of the report in the view construction report may be: determining the data structure of the indicator data according to the indicator data and the target chart type, and generating report content corresponding to the visual chart.
[0146] The specific steps of generating the report part in the generated view construction report may be: generating a preliminary business report based on the report content, and using a drag function tool (such as DraggablePlus) to interactively layout the content of the preliminary business report to obtain a business report.
[0147] Through the above steps S241 to S244, in the embodiment of the present application, on the one hand, by using a large language model and preset reasoning rules to reason about the classification results, a targeted target chart type can be automatically determined according to the actual situation; on the other hand, by interactively laying out the report content, a targeted business report can be generated to meet personalized needs, thereby improving the targeted nature of the business report generation method.
[0148] In an embodiment of the present application, a large language model is used to identify the intent of an input question to obtain an indicator list, wherein the input question is used to describe the generation requirements of a business report, and the indicator list is used to record multiple data analysis indicators associated with the generation requirements; a business indicator system is constructed based on the indicator categories of multiple data analysis indicators in the indicator list; indicator data is obtained by querying from a business database using a large language model and the business indicator system; and a business report is generated based on the indicator data. As a result, the present application achieves the purpose of accurately identifying the generation requirements of a business report using a large language model and quickly generating a business report according to the generation requirements, thereby achieving the technical effect of improving the accuracy and efficiency of the method for generating a business report, and further solving the technical problems of low accuracy and low efficiency of the method for generating a business report in the related technology.
[0149] In this embodiment, a business report generating device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, a "module" is a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0150] Figure 8 is a structural block diagram of a business report generating device according to an embodiment of the present application, such as Figure 8 As shown, the device includes: an identification module 801, which is used to use a large language model to perform intent recognition on an input question to obtain an indicator list, wherein the input question is used to describe the generation requirements of a business report, and the indicator list is used to record multiple data analysis indicators associated with the generation requirements; a construction module 802, which is used to construct a business indicator system based on the indicator categories of multiple data analysis indicators in the indicator list; a query module 803, which is used to use a large language model and the business indicator system to query and obtain indicator data from a business database; a generation module 804, which is used to generate a business report based on the indicator data, wherein the business report includes a visual chart.
[0151] Optionally, the above-mentioned recognition module 801 can also be used to use a large language model to semantically decompose the input problem to obtain structured data, wherein the structured data includes business domain data and dimension domain data; supplement the dimensions based on the structured data to obtain intermediate data; compare and analyze the intermediate data with the experience knowledge vector library to determine multiple data analysis indicators, wherein the experience knowledge vector library is constructed based on case generation based on multiple historical business reports; and generate an indicator list using multiple data analysis indicators.
[0152] Optionally, the above-mentioned identification module 801 can also be used to use a preset reasoning model and knowledge graph search method to search for potential dimensional information of structured data and generate intermediate data; use a large language model to perform implicit dimensional domain reasoning on structured data and generate intermediate data.
[0153] Optionally, the above-mentioned construction module 802 can also be used to classify multiple data analysis indicators into non-lineage indicators and lineage indicators, wherein lineage indicators are data analysis indicators that rely on upper-level data analysis indicators in the business logic to perform recursive query indicator value calculations, and non-lineage indicators are data analysis indicators that do not rely on upper-level data analysis indicators to calculate indicator values; mount the non-lineage indicators and the lineage indicators respectively into a pre-built initial indicator system to obtain an intermediate indicator system; in response to an adjustment control operation on the intermediate indicator system, adjust the intermediate indicator system to obtain a business indicator system, wherein the adjustment control operation includes at least one of the following: a trimming control operation and a dimension change control operation.
[0154] Optionally, the above-mentioned construction module 802 can also be used to determine the target level corresponding to the lineage indicators in the initial indicator system according to the hierarchical lineage relationship of the lineage indicators in the business logic; mount the non-lineage indicators to the basic level in the initial indicator system, and mount the lineage indicators to the target level of the initial indicator system to obtain an intermediate indicator system.
[0155] Optionally, the query module 803 can also be used to construct a target query statement using the business indicator system, the first agent and the second agent corresponding to the large language model, wherein the first agent is a structured query language agent and the second agent is a structured query language correction agent; according to the target query statement, the query interface corresponding to the business database is called to perform data query to obtain indicator data.
[0156] Optionally, the query module 803 can also be used to use the first agent to analyze the indicator dimension information and indicator description information corresponding to the business indicator system to construct an initial query statement; use the second agent to perform statement evaluation on the initial query statement to obtain an evaluation result, and modify the initial query statement according to the evaluation result to obtain a target query statement.
[0157] Optionally, the above-mentioned generation module 804 can also be used to classify the fields of the indicator data to obtain the classification results; use the large language model and preset inference rules to infer the classification results to determine the target chart type; generate the report content corresponding to the visual chart according to the indicator data and the target chart type; perform interactive layout based on the report content to obtain a business report.
[0158] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0159] According to another aspect of an embodiment of the present application, a business report generation system is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any one of the aforementioned business report generation methods.
[0160] Optionally, in this embodiment, the above-mentioned processor can be configured to perform the following steps through a computer program: use a large language model to identify the intent of an input question to obtain an indicator list, wherein the input question is used to describe the generation requirements of a business report, and the indicator list is used to record multiple data analysis indicators associated with the generation requirements; based on the indicator categories of the multiple data analysis indicators in the indicator list, a business indicator system is constructed; using the large language model and the business indicator system, the indicator data is queried from the business database; and a business report is generated based on the indicator data, wherein the business report includes a visual chart.
[0161] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiment and its optional implementation manners, which will not be described in detail here.
[0162] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0163] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0164] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0165] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0166] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0167] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or in other words contribute to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), mobile hard disk, disk or optical disk and other media that can store program codes.
[0168] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for generating a business report, characterized in that: include: Using a large language model to perform intent recognition on an input question, and obtaining an indicator list, wherein the input question is used to describe a generation requirement of a business report, and the indicator list is used to record a plurality of data analysis indicators associated with the generation requirement; Building a business indicator system based on the indicator categories of the multiple data analysis indicators in the indicator list; Using the large language model and the business indicator system, querying and obtaining indicator data from a business database; A business report is generated based on the indicator data.
2. The method for generating a business report according to claim 1, characterized in that: The large language model is used to perform intent recognition on the input question, and the indicator list obtained includes: Using the large language model to semantically decompose the input question to obtain structured data, wherein the structured data includes business domain data and dimension domain data; Supplementing dimensions based on the structured data to obtain intermediate data; Comparing and analyzing the intermediate data with an experience knowledge vector library to determine the plurality of data analysis indicators, wherein the experience knowledge vector library is constructed based on a plurality of historical business report generation cases; The indicator list is generated using the multiple data analysis indicators.
3. The method for generating a business report according to claim 2, characterized in that: The intermediate data obtained by supplementing the dimensions based on the structured data includes one of the following: Using a preset reasoning model and knowledge graph search method, search for potential dimension information on the structured data to generate the intermediate data; The large language model is used to perform implicit dimension domain reasoning on the structured data to generate the intermediate data.
4. The method for generating a business report according to claim 1, characterized in that: Based on the indicator categories of the plurality of data analysis indicators in the indicator list, constructing the business indicator system includes: Classify the multiple data analysis indicators into non-lineage indicators and lineage indicators, wherein the lineage indicators are data analysis indicators that rely on upper-layer data analysis indicators in the business logic to recursively query indicator values, and the non-lineage indicators are data analysis indicators that do not rely on the upper-layer data analysis indicators to calculate indicator values; Mounting the non-bloodline indicator and the bloodline indicator to a pre-built initial indicator system respectively to obtain an intermediate indicator system; In response to an adjustment control operation on the intermediate indicator system, the intermediate indicator system is adjusted to obtain the business indicator system, wherein the adjustment control operation includes at least one of the following: a trimming control operation and a dimension change control operation.
5. The method for generating a business report according to claim 4, characterized in that: Mounting the non-bloodline indicator and the bloodline indicator to the pre-built initial indicator system respectively to obtain the intermediate indicator system includes: Determine the target level corresponding to the blood-related indicator in the initial indicator system according to the hierarchical blood-related relationship of the blood-related indicator in the business logic; The non-bloodline indicators are mounted to the basic level in the initial indicator system, and the bloodline indicators are mounted to the target level of the initial indicator system to obtain an intermediate indicator system.
6. The method for generating a business report according to claim 1, characterized in that: Utilizing the large language model and the business indicator system, querying the indicator data from the business database includes: Using the business indicator system, the first agent and the second agent corresponding to the large language model, a target query statement is constructed, wherein the first agent is a structured query language agent, and the second agent is a structured query language correction agent; According to the target query statement, the query interface corresponding to the business database is called to perform data query to obtain the indicator data.
7. The method for generating a business report according to claim 6, characterized in that: Using the business indicator system, the first agent and the second agent corresponding to the large language model to construct the target query statement includes: Using the first agent, analyzing the indicator dimension information and indicator description information corresponding to the business indicator system, and constructing an initial query statement; The second agent is used to perform statement evaluation on the initial query statement to obtain an evaluation result, and the initial query statement is modified according to the evaluation result to obtain the target query statement.
8. The method for generating a business report according to claim 1, characterized in that: Generating the business report based on the indicator data includes: Classifying the indicator data by fields to obtain classification results; Reasoning the classification result using the large language model and preset reasoning rules to determine the target chart type; Generate report content corresponding to the visualization chart according to the indicator data and the target chart type; Interactive layout is performed based on the report content to obtain the business report.
9. A business report generating device, characterized in that: include: an identification module, used to use a large language model to perform intent recognition on an input question to obtain an indicator list, wherein the input question is used to describe a generation requirement of a business report, and the indicator list is used to record a plurality of data analysis indicators associated with the generation requirement; A construction module, used to construct a business indicator system based on the indicator categories of the multiple data analysis indicators in the indicator list; A query module, used to query and obtain indicator data from a business database using the large language model and the business indicator system; A generating module is used to generate a business report based on the indicator data.
10. A business report generation system, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the business report generating method according to any one of claims 1 to 8.
Citation Information
Cited By
Method and device for constructing compliance index system based on large language model
CN119990923A
Construction method for chart linkage display
CN120104640A
Construction method of chart linkage display
CN120104640B
Index calculation method and system considering period offset and terminal equipment
CN120561160A
Method and device for acquiring risk control analysis report
CN121073639A