Data analysis method and device, equipment and storage medium

By introducing data analysis methods in business intelligence systems, using technologies such as information extraction, association database and preset function call library, the hallucination problem in data analysis based on large language models is solved, and the accuracy and reliability of analysis results are improved.

CN119443289APending Publication Date: 2025-02-14CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411439496.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When existing business intelligence systems conduct data analysis based on large language models, there are hallucinations problems, which leads to doubts about the accuracy and reliability of data analysis results.

Method used

A data analysis method is proposed. When receiving the user's input problem information, it extracts information, obtains problem association indicators, determines the association database, extracts indicator data, and analyzes it through preset function call library and built-in analysis components. , the final integrated results output attribution analysis results.

Benefits of technology

By combining the functional calculation results of quantitative analysis and the analysis results of large language models, the excessive divergence of analysis results caused by the hallucination problem of large language models is alleviated, and the accuracy and reliability of data analysis results are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443289A_ABST
    Figure CN119443289A_ABST
Patent Text Reader

Abstract

The invention discloses a data analysis method and device, equipment and a storage medium, and relates to the technical field of data analysis, and the method comprises the steps: carrying out the information extraction of question information when the question information inputted by a user is received, and obtaining a plurality of question correlation indexes; determining an association database based on each question association index, and extracting index data from the association database; determining a target operator function in a preset function call library according to the problem information, and substituting the index data into the target operator function to obtain a function calculation result; analyzing the index data through a built-in analysis component to obtain a model analysis result; and integrating a function calculation result and a model analysis result, and obtaining and outputting an attribution analysis result. Compared with an existing mode in which output data is completely self-generated based on the large language model, the attribution analysis result is combined with a function calculation result of quantitative analysis, the illusion problem of the large language model can be relieved, and the accuracy and reliability of the analysis result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data analysis technology, and in particular to a data analysis method, device, equipment and storage medium. Background Art

[0002] In the financial market, Business Intelligence (BI) systems can assist enterprises in making business decisions and provide enterprise users with technologies and methods for rapid data analysis. Existing BI products can be integrated with Large Language Models (LLMs), with additional data connection or data visualization functions. LLMs generate codes to access data sources to query and return results. Users can input question and answer statements based on LLMs to obtain corresponding answers output by the model, thereby meeting different data analysis needs of users.

[0003] However, since BI is based on LLM, LLM has an illusion problem when generating data: the essence of LLM is a predictive model, and the correctness of the code it generates cannot be guaranteed, resulting in the inability to guarantee the availability and execution performance of the code. Therefore, the accuracy and reliability of the data analysis results obtained based on BI are questionable. Summary of the invention

[0004] The main purpose of this application is to provide a data analysis method, which aims to solve the technical problem that when users perform data analysis based on existing BI, the accuracy and reliability of the obtained data analysis results are questionable because the LLM on which the BI is based has an illusion problem when generating data.

[0005] To achieve the above purpose, the present application proposes a data analysis method, which is applied to a device equipped with a large language model, and the data analysis method includes:

[0006] When receiving the question information input by the user, extracting the question information to obtain several question-related indicators;

[0007] Determine a related database based on each of the problem related indicators, and extract indicator data from the related database;

[0008] Determine a target operator function in a preset function call library according to the problem information, and substitute the indicator data into the target operator function to obtain a function calculation result;

[0009] Analyze the indicator data through the built-in analysis component to obtain the model analysis result;

[0010] Integrate the function calculation result and the model analysis result to obtain and output the attribution analysis result.

[0011] In one embodiment, when receiving the question information input by the user, the step of extracting information from the question information to obtain several question-related indicators includes:

[0012] When receiving question information input by the user, extracting entities from the question information to obtain question entities;

[0013] According to the question entity, the intent of the current question is identified to determine the question category of the current question, where the question category includes: document question and answer, other question and answer, and data question and answer;

[0014] When the current question is a data question and answer, information extraction is performed on the question information to obtain several question-related indicators.

[0015] In one embodiment, when the current question is a data question answering, the step of extracting information from the question information to obtain several question-related indicators includes:

[0016] When the current question is a data question and answer, extracting information from the question information;

[0017] Determine whether the information of the problem is sufficient according to the extraction results;

[0018] If not, a guidance prompt is generated to guide the user to supplement the question information, and the process returns to the step of judging whether the question information is sufficient according to the extraction result;

[0019] If so, several problem-related indicators are determined based on the extraction results.

[0020] In one embodiment, the step of determining a related database based on each of the problem related indicators and extracting indicator data from the related database includes:

[0021] Determine a related database based on each of the problem related indicators, and generate a SQL query statement corresponding to the related database;

[0022] The SQL query statement is sent to the associated database, and the indicator data returned by the associated database based on the SQL query statement is received.

[0023] In one embodiment, the step of determining a target operator function in a preset function call library according to the problem information, and substituting the indicator data into the target operator function to obtain a function calculation result includes:

[0024] Input the problem information into a function call sub-model to obtain a target operator function, wherein the function call sub-model is trained based on each operator function in a preset function call library and corresponding call scenario examples;

[0025] The corresponding parameters of the target operator function are extracted from the indicator data, and the corresponding parameters are substituted into the target operator function to obtain a function calculation result.

[0026] In one embodiment, after the step of identifying the intent of the current question according to the question entity and determining the question category of the current question, the step further includes:

[0027] When the current question is a document question and answer, a preset resource pool is mixedly recalled according to the question information and each question entity to obtain a recalled associated text;

[0028] The recalled associated texts are reordered to obtain and output the document answer result of the current question.

[0029] In one embodiment, after the step of identifying the intent of the current question according to the question entity and determining the question category of the current question, the step further includes:

[0030] When the current question is other questions and answers, the current question is answered through the built-in analysis component of the large language model, and the corresponding answer to the current question is output.

[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a data analysis device, which includes:

[0032] A data extraction module is used to extract information from the problem information when receiving the problem information input by the user, and obtain a number of problem-related indicators; determine a related database based on each of the problem-related indicators, and extract indicator data from the related database;

[0033] A function calling module, used to determine a target operator function in a preset function calling library according to the problem information, and substitute the indicator data into the target operator function to obtain a function calculation result;

[0034] A model analysis module, used to analyze the indicator data through a built-in analysis component to obtain a model analysis result;

[0035] The integrated output module is used to integrate the function calculation results and the model analysis results to obtain and output the attribution analysis results.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a data analysis device, which includes: a memory, a processor, and a data analysis program stored in the memory and executable on the processor, and the data analysis program is configured to implement the steps of the data analysis method described above.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, on which a data analysis program is stored, and when the data analysis program is executed by a processor, the steps of the data analysis method described above are implemented.

[0038] The present application discloses a data analysis method, which is applied to a device equipped with a large language model. When receiving the problem information input by the user, the problem information is extracted to obtain several problem-related indicators; the related database is determined based on each of the problem-related indicators, and the indicator data is extracted from the related database; the target operator function is determined in the preset function call library according to the problem information, and the indicator data is substituted into the target operator function to obtain the function calculation result; the indicator data is analyzed by the built-in analysis component to obtain the model analysis result; the function calculation result and the model analysis result are integrated to obtain and output the attribution analysis result. The present application can extract the problem-related indicators according to the user input to obtain the indicator data, so as to substitute the indicator data into the predefined operator function for operation, obtain the function calculation result, and combine the function calculation result and the analysis result of the built-in component of the large language model as the final output. Compared with the existing method in which the output data is completely self-generated based on the large language model, the attribution analysis result in the present application combines the function calculation result of the quantitative analysis, which can alleviate the situation that the hallucination problem of the large language model leads to excessive divergence of the analysis result, and is conducive to improving the accuracy and reliability of the analysis result. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0041] Figure 1 This is a flow chart of the first embodiment of the data analysis method of the present application;

[0042] Figure 2 This is a flow chart of the second embodiment of the data analysis method of the present application;

[0043] Figure 3 This is a flow chart of the third embodiment of the data analysis method of the present application;

[0044] Figure 4 This is a schematic diagram of the entire process of the data analysis method of this application;

[0045] Figure 5 This is a schematic diagram of the module structure of the first embodiment of the data analysis device of the present application;

[0046] Figure 6 This is a schematic diagram of the structure of the data analysis equipment of this application.

[0047] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0050] Existing BI products based on LLM are based on the operation logic of BI and LLM: they use LLM to generate code to access data sources to query and return results. Affected by the illusion problem of LLM, the reliability of the output results is low. And they can only provide "one answer" based on "one question" instead of gaining insights into the data. Users need to master every step of data analysis to clearly instruct LLM to give answers that meet current analysis needs. When using BI products, users are required to have background knowledge of data analysis, which is not conducive to the use of general users.

[0051] Based on this, the present application embodiment provides a data analysis method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the data analysis method of the present application. In this embodiment, the method includes: Steps S10 to S50:

[0052] Step S10: when receiving the question information input by the user, extract the question information to obtain several question-related indicators.

[0053] It should be noted that the method of this embodiment can be applied to financial scenarios to meet the data analysis needs of diversified finance. The method of this embodiment can be applied to devices installed with LLM, such as mobile phones, tablets, data analysis servers, or to other electronic devices that can access BI built based on LLM through the network. The following uses the device connected to LLM (hereinafter referred to as "LLM device") as an example of the execution subject to explain the various embodiments of this application.

[0054] It should be understood that the LLM used in this embodiment can be obtained by pre-training a common large language model and fine-tuning the model according to different financial tasks. Specifically, LLM is first pre-trained on a large number of Internet text corpora, which can cover a wide range of subjects and languages. Through pre-training, LLM has a broad understanding of language; then it can be fine-tuned for specific financial tasks. Through the flexibility of transfer learning, it is possible to reduce dependence on large domain-specific data sets, so that less financial domain-specific training data can be used to achieve efficient adaptation to new tasks.

[0055] Understandably, considering the huge amount of documents in the financial field, summarizing and extracting key information from documents is crucial to quickly understand and analyze important data in lengthy and complex texts. Therefore, when training the model, the LLM can be trained to have the ability to summarize and extract key information from documents.

[0056] In addition, in financial documents, financial time series data (such as stock prices) have volatility, seasonality, and nonlinear relationships. Traditional data statistics methods often find it difficult to encompass the full range of these complexities. Therefore, during model training, LLM can be further trained to have the ability to detect anomalies in financial time series.

[0057] It should also be noted that after the pre-training of LLM is completed, common efficient fine-tuning techniques can be used to fine-tune LLM. Common efficient fine-tuning techniques can be divided into three categories: adding additional parameters (Addition-Based), selecting a part of the parameters to update (Selection-Based), and introducing reparametrization (Reparametrization-Based). Among them, the addition of additional parameters is further divided into two subcategories: adapter-like methods and soft prompts.

[0058] Exemplarily, the specific description of model fine-tuning is given by taking the addition of additional parameters (such as Prefix Tuning, Prompt Tuning, AdapterTuning and their variants) as an example: first, a part of the parameters are updated (Selection-Based), such as using the BitFit method; then reparameterization (Reparametrization-Based) is introduced, such as using LoRA, AdaLoRA, QLoRA and other methods; finally, hybrid and efficient fine-tuning is completed through methods such as MAM Adapter or UniPELT.

[0059] In the specific implementation, QLoRA technology can be used to fine-tune LLM. QLoRA is actually Quantize+LoRA technology, which can compress large models from 16 bits to 4 bits during training, thereby reducing the video memory required for training.

[0060] In order to illustrate how the LLM device indexes the received question information input by the user, step S10 specifically includes: steps S101 to S103:

[0061] Step 101: When question information input by a user is received, entity extraction is performed on the question information to obtain question entities.

[0062] It should be understood that when a user inputs a question described in natural language based on the interactive interface of the LLM device, the LLM will identify the problem entities in the question information, such as organization names, time nouns, and proper nouns, based on its own large language model entity extraction function and combined with the entity recognition functions of other small models used for entity recognition.

[0063] After entity recognition, the obtained question entities can also be identified for query enhancement, such as synonym expansion, hyponym expansion, etc., to enrich the phonetic information of the question information, thereby obtaining rich question entities.

[0064] Step S102: performing intent recognition on the current question according to the question entity, and determining the question category of the current question, wherein the question category includes: document question and answer, other question and answer, and data question and answer.

[0065] It can be understood that LLM can analyze the question entity to determine the question category of the current question, which can be divided into document question and answer, other question and answer, and data question and answer according to the intent recognition category.

[0066] For example, the question information of the current question in the document question and answer category can be expressed as: "Query branch A"; the question information of the current question in the other question and answer categories can be: "How is the weather today"; the question information of the current question in the data question and answer category can be: "Query the total amount of proprietary deposits of each subsidiary branch under the head office B".

[0067] Step S103: When the current question is a data question and answer, information is extracted from the question information to obtain several question-related indicators.

[0068] It should be understood that when the current question is a data question and answer, LLM can extract the problem information warning information to extract several problem-related indicators from the problem information. The problem-related indicators can be the business name and the corresponding business volume value.

[0069] It should also be noted that, considering that the question information initially input by the user may be unclear or incomplete, it is possible to determine whether the question information is sufficient when extracting information.

[0070] Specifically, when the current question is a data question, extract information from the question information; determine whether the question information is sufficient based on the extraction result; if not, generate a guide prompt to guide the user to supplement the question information, and return to the step of determining whether the question information is sufficient based on the extraction result; if yes, determine several question-related indicators based on the extraction result. In this way, complete question-related indicators are obtained so that data can be extracted based on each question-related indicator in the future.

[0071] Step S20: determining a related database based on each of the problem-related indicators, and extracting indicator data from the related database.

[0072] It should be understood that, according to each of the problem-related indicators, a database associated with the problem-related indicator can be determined, and the associated database stores indicator data corresponding to each of the problem-related indicators. After determining the associated database, LLM can generate a query statement for the associated database to obtain indicator data for subsequent problem analysis.

[0073] Step S30: determining a target operator function in a preset function call library according to the problem information, and substituting the indicator data into the target operator function to obtain a function calculation result.

[0074] It should be understood that the preset function library is used to provide function call (Function Call) service, which may include a number of preset metrology operators and corresponding call scenarios, and each operator function and the corresponding call scenario constitute the call rules of each operator function.

[0075] It should be noted that each metrology operator is an independent operator function, which may include the following functions:

[0076] (1) Extraction of data features (whether there are missing values, changes in trends over time, trends and periodicity, etc.);

[0077] (2) Data aggregation (whether it is aggregated in the time dimension, such as day to month, month to quarter, etc.);

[0078] (3) Missing value filling (whether there is missing data at a certain time point);

[0079] (4) Statistical analysis (statistical characteristics and distribution of data, etc.);

[0080] (5) Time series analysis (whether the sequence is stable, trendy, periodic, etc.);

[0081] (6) Financial business calculations (year-on-year and month-on-month calculations, etc.);

[0082] (7) Multi-node analysis (comparative analysis of multiple node sequence diagrams and correlation analysis, such as comparative analysis of branches A, B, C, D, and their mutual correlation).

[0083] In the specific implementation, firstly, it can be determined whether the problem information matches the calling rules of each operator function; then the operator function corresponding to the matching item is used as the target operator function; then the indicator data is substituted into the target operator function to call the function calculation; finally, the function calculation result of the target operator function is obtained. The function calculation result is the problem analysis result obtained by the preset fixed operator function.

[0084] Step S40: Analyze the indicator data through the built-in analysis component to obtain a model analysis result.

[0085] It should be noted that LLM has natural language understanding capabilities and can directly perform data analysis and answer questions input by users. The built-in analysis component can be an original component in LLM for performing the above data analysis.

[0086] In a specific implementation, the built-in analysis component in LLM can respond to the question information input by the user, and use the above indicator data as enhanced input to generate a model analysis result corresponding to the above question information based on the cases related to the question information in the historical case library. The model analysis result is the question analysis result generated based on the inherent natural language understanding ability of LLM.

[0087] Step S50: Integrate the function calculation result and the model analysis result to obtain and output the attribution analysis result.

[0088] It can be understood that after obtaining the function calculation results and the model analysis results, LLM can also integrate the above two types of results, so that the final output attribution results can combine quantitative analysis (through function calculation) and qualitative analysis (through LLM), thereby providing more comprehensive and accurate data insights. Users do not need to have a high level of data analysis background knowledge and can meet different data analysis needs based on this LLM device.

[0089] This embodiment can extract question-related indicators according to user input to obtain indicator data, and then substitute the indicator data into a predefined operator function for operation to obtain the function calculation result, and combine the function calculation result with the analysis result of the built-in component of the large language model as the final output, thereby realizing an indicator-centric attribution answer to any question indicator for the end user based on detailed data.

[0090] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , Figure 2 This is a flow chart of the second embodiment of the data analysis method of the present application.

[0091] In this embodiment, in order to specifically explain how to extract the indicator data corresponding to each problem-related indicator from the related database, step S20 specifically includes: steps S201 to S202:

[0092] Step S201: determining a related database based on each of the problem related indicators, and generating a SQL query statement corresponding to the related database.

[0093] It should be understood that in financial scenarios, operational data is mostly stored in a database, and SQL is the core language for database management. Therefore, SQL query statements can be generated to perform operations such as data retrieval, update, and deletion on the data in the management database.

[0094] It should be noted that the LLM device can encode each problem-related indicator into a comparable vector, namely the problem vector, and then match the vector information related to the problem vector in the vector library, which includes but is not limited to the database table structure, field annotations, namely DDL statements, and related SQL training examples. The above matched vector information is assembled into the prompt to form a structured query description, and then the prompt is passed to the LLM to generate an accurate SQL query statement.

[0095] Step S202: Send the SQL query statement to the associated database, and receive indicator data returned by the associated database based on the SQL query statement.

[0096] It should be understood that the LLM device sends the generated SQL query statement to the associated database for execution, thereby obtaining query data fed back by the associated database based on the SQL query statement, that is, indicator data corresponding to each problem-related indicator.

[0097] Further, after obtaining the indicator data, a predefined operator function may be called through the Function Call service to perform problem analysis based on the indicator data. Therefore, step S30 specifically includes steps S301 to S302:

[0098] Step S301: input the problem information into a function call sub-model to obtain a target operator function, wherein the function call sub-model is trained based on each operator function in a preset function call library and corresponding call scenario examples.

[0099] It should be noted that the function call submodel can be another built-in component in LLM, and the application of the function call submodel is similar to the aforementioned process of generating SQL query statements. The function call submodel needs to analyze the problem information input by the user to determine whether a specific operator function is needed to complete the task.

[0100] If so, the sub-model needs to determine: the function name (what is the operator function that needs to be called, that is, the target operator function), the function purpose (the purpose and function of the target operator function), and the parameter name and parameter description (the parameters required by the target operator function and the corresponding parameter meanings).

[0101] It should also be noted that the function call sub-model can be fine-tuned in advance so that it can understand and execute function calls. The training dataset can include open source datasets such as ToolBench and glaive-function-calling, which provide examples and scenarios of function calls.

[0102] In the specific implementation, the function call sub-model identifies whether a function call is required by analyzing the problem information; if a call is required, a JSON object containing the function name, parameter name and parameter value of the target operator function can be generated to facilitate the subsequent substitution of specific data for the target operator function for solving.

[0103] Step S302: extracting corresponding parameters of the target operator function from the indicator data, and substituting each corresponding parameter into the target operator function to obtain a function calculation result.

[0104] It should be understood that the parameter values ​​corresponding to the parameter names in the target operator function are assigned according to the indicator data, and then the function calculation is completed based on the target operator function, and the function calculation result is output, so that the attribution analysis result of the current problem can be finally output in combination with the model analysis result.

[0105] This embodiment can automatically generate SQL query statements based on LLM to obtain indicator data from the database, and determine the operator function that matches the current problem based on LLM, so that the indicator data can be substituted into the operator function to obtain the function calculation result. Compared with the existing method in which the output data is completely self-generated based on the large language model, the attribution analysis results in this embodiment are combined with the function calculation results of the quantitative analysis, which can alleviate the problem of hallucination of the large language model that causes the analysis results to diverge excessively, and is conducive to improving the accuracy and reliability of the analysis results.

[0106] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those of the first and second embodiments can be referred to the above description, and will not be described in detail later. Figure 3 , Figure 3 This is a flow chart of the third embodiment of the data analysis method of the present application.

[0107] In this embodiment, considering that the current question input by the user may also be a document question and answer category, after step S102, the following steps are further included: steps S20' to S30':

[0108] Step S20': when the current question is a document question and answer, a mixed recall is performed on a preset resource pool according to the question information and each question entity to obtain a recall-related text.

[0109] It should be noted that the preset resource pool may include pre-stored document files (PDF format, Word format or Excel format) of several financial scenarios. When the document files in the above different formats are collected, each document file may be pre-processed, such as performing OCR recognition or structure recognition, to extract the corresponding document information from each document file and store it in the preset resource pool.

[0110] It can be understood that hybrid recall is a strategy that uses multiple retrieval technologies in the text retrieval process. The LLM device can perform vector retrieval in a preset resource pool based on the semantic content of the current question, i.e., question information, to find the documents most relevant to the question semantics; at the same time, it also uses keyword retrieval technology to find relevant documents by using specific words that appear in the current question, i.e., question entities. By combining these two retrieval technologies, it is possible to more comprehensively recall the associated text information related to the current question.

[0111] Step S30': reorder the recalled related texts to obtain and output the document answer result of the current question.

[0112] It should be understood that the recall-related texts may be deduplicated and re-ranked (RE-Ranking) to ensure that the document answer results presented to the user are accurate and relevant. In the RE-Ranking process, the recall-related texts may be scored and ranked, using algorithms such as BM25 and TF-IDF to evaluate the relevance of each recall-related text to the current question, and rank them based on the relevance.

[0113] It should be noted that hybrid recall can improve the accuracy and coverage of retrieval and recall-related text, find the most relevant text from a large amount of data, and use RE-Ranking to process the recall-related text, further improving the quality and relevance of the retrieval results, making the document answer results generated by the built-in analysis component in LLM more accurate and reliable.

[0114] Furthermore, considering that the current question input by the user may also be other question categories, after step S102, the following steps are further included:

[0115] Step S20": when the current question is other questions and answers, the current question is answered through the built-in analysis component of the large language model, and the corresponding answer to the current question is output.

[0116] It should be understood that other questions and answers may be questions and answers that are not related to financial scenarios. Therefore, there is no need to perform indicator analysis on the question information and call function calculation. The built-in analysis component in LLM can directly respond to the current question and output the corresponding model answer result for the current question.

[0117] When the user inputs a document question and answer as the current question, the LLM device of this embodiment performs mixed recall of the preset resource pool according to the question information and each of the question entities, obtains the recall-related text, reorders the recall-related text, obtains and outputs the document answer result of the current question; when the current question is other questions and answers, the built-in analysis component of the large language model is used to answer the current question and output the corresponding answer to the current question. In this way, it is possible to respond to and answer the question information of different question categories input by the user in a targeted manner, accurately understand and respond to various questions of the user, and provide personalized answers that meet the user's needs.

[0118] Further, please refer to Figure 4 The process of applying the data analysis method of the present application to the LLM device to achieve targeted responses to different categories of user questions is specifically described. Figure 4 Schematic diagram of the entire process of the data analysis method of this application.

[0119] exist Figure 4 In the process, the user inputs the question information of the current question based on the interactive interface of the LLM device; the LLM receives the Question and extracts its entity to obtain the question entity; then the LLM recognizes the intent of the current question based on the question entity and determines the question category to which the current question belongs.

[0120] When the question category is document question answering, a hybrid recall strategy (vector retrieval + semantic retrieval) is adopted to obtain the recall-related text from the preset resource pool, and the recall-related text is RE-Ranked as enhanced input. Finally, the built-in analysis component in LLM generates and outputs the document answer result.

[0121] When the question category is other questions and answers, the built-in analysis component in LLM directly responds to the current question and outputs the model answer result corresponding to the current question.

[0122] When the question category is data question and answer, information extraction is performed, and whether the question information is sufficient is determined based on the extraction result; if not, a guidance prompt is generated to guide the user to supplement the question information, and return to the step of determining whether the question information is sufficient based on the extraction result; if so, a number of question-related indicators are determined based on the extraction result.

[0123] Then, the associated database is determined according to the problem-related indicators, and the indicator data is extracted from the associated database. Then, it is determined whether a function call is required based on the problem information, and then the target operator function is called, and the parameter values ​​corresponding to the parameter names in the target operator function are assigned according to the indicator data, so as to complete the function calculation based on the target operator function and output the function calculation result.

[0124] At the same time, the built-in analysis component in LLM can respond to the problem information input by the user, and use the above indicator data as enhanced input to generate model analysis results corresponding to the above problem information based on the cases related to the problem information in the historical case library.

[0125] Finally, LLM integrates the above function calculation results and model analysis results to obtain and output the attribution analysis results corresponding to the current problem.

[0126] The data analysis method implemented in this application based on LLM can decompose complex problems into multiple subtask nodes suitable for LLM processing during the analysis of user input problem information by LLM equipment, and design prompts and tools (including resource pools, function operators, databases, and historical case libraries) for different subtask nodes, thereby integrating the advantages of precise language models and large language models for data analysis, and providing in-depth analysis from the "what" to the "how" and "why" of the data. Compared with traditional BI products based on BI operation logic and LLM, the method of this application can meet the data attribution analysis needs of general users without data analysis background, and realize attribution questions and answers for any indicators for end users.

[0127] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the data analysis method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0128] In addition, the present application also provides a data analysis device, referring to Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the data analysis device of this application; Figure 5 As shown, the device comprises:

[0129] The data extraction module 501 is used to extract information from the question information when receiving the question information input by the user, and obtain a number of question-related indicators; determine a related database based on each of the question-related indicators, and extract indicator data from the related database;

[0130] A function calling module 502 is used to determine a target operator function in a preset function calling library according to the problem information, and substitute the indicator data into the target operator function to obtain a function calculation result;

[0131] The model analysis module 503 is used to analyze the indicator data through a built-in analysis component to obtain a model analysis result;

[0132] The integration output module 504 is used to integrate the function calculation result and the model analysis result to obtain and output the attribution analysis result.

[0133] Furthermore, the data extraction module 501 is also used to perform entity extraction on the question information to obtain question entities when receiving question information input by the user; perform intent recognition on the current question based on the question entity to determine the question category of the current question, and the question categories include: document question and answer, other question and answer, and data question and answer; when the current question is a data question and answer, perform information extraction on the question information to obtain a number of question-related indicators.

[0134] Furthermore, the data extraction module 501 is also used to extract information from the question information when the current question is a data question and answer; determine whether the question information is sufficient based on the extraction result; if not, generate a guidance prompt to guide the user to supplement the question information, and return to the step of determining whether the question information is sufficient based on the extraction result; if so, determine a number of question-related indicators based on the extraction result.

[0135] Furthermore, the data extraction module 501 is also used to determine the associated database based on each of the problem-related indicators, and generate an SQL query statement corresponding to the associated database; send the SQL query statement to the associated database, and receive the indicator data returned by the associated database based on the SQL query statement.

[0136] Furthermore, the function call module 502 is also used to input the problem information into a function call sub-model to obtain a target operator function, wherein the function call sub-model is trained based on each operator function in a preset function call library and corresponding call scenario examples; extract corresponding parameters of the target operator function from the indicator data, and substitute each corresponding parameter into the target operator function to obtain a function calculation result.

[0137] Furthermore, the data extraction module 501 is also used to, when the current question is a document question and answer, perform a mixed recall of a preset resource pool based on the question information and each question entity to obtain recall-related text; reorder the recall-related text to obtain and output the document answer result of the current question.

[0138] Furthermore, the data extraction module 501 is also used to answer the current question through the built-in analysis component of the large language model when the current question is other questions and answers, and output the corresponding answer to the current question.

[0139] This embodiment can extract problem-related indicators according to user input to obtain indicator data, and then substitute the indicator data into a predefined operator function for calculation to obtain a function calculation result, and combine the function calculation result with the analysis result of the built-in component of the large language model as the final output. Compared with the existing method in which the output data is completely self-generated based on the large language model, the attribution analysis result in this embodiment is combined with the function calculation result of the quantitative analysis, which can alleviate the situation in which the hallucination problem of the large language model causes the analysis result to diverge excessively, and is conducive to improving the accuracy and reliability of the analysis results.

[0140] Other embodiments or specific implementations of the data analysis device described in this application can refer to the above-mentioned method embodiments and will not be repeated here.

[0141] The present application also provides a data analysis device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data analysis method in the above-mentioned embodiment one.

[0142] Reference below Figure 6 , Figure 6The data analysis device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The data analysis device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0143] like Figure 6 As shown, the data analysis device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the data analysis device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the data analysis device to communicate with other devices wirelessly or by wire to exchange data. Although the data analysis device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0144] The present application also provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the data analysis method in the above-mentioned embodiment.

[0145] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0146] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A data analysis method, characterized in that: The method is applied to a device equipped with a large language model, and the method includes: When receiving the question information input by the user, extracting the question information to obtain several question-related indicators; Determine a related database based on each of the problem related indicators, and extract indicator data from the related database; Determine a target operator function in a preset function call library according to the problem information, and substitute the indicator data into the target operator function to obtain a function calculation result; Analyze the indicator data through the built-in analysis component to obtain the model analysis result; Integrate the function calculation result and the model analysis result to obtain and output the attribution analysis result.

2. The method according to claim 1, characterized in that The step of extracting information from the question information to obtain several question-related indicators upon receiving the question information input by the user includes: When receiving question information input by the user, extracting entities from the question information to obtain question entities; According to the question entity, the intent of the current question is identified to determine the question category of the current question, where the question category includes: document question and answer, other question and answer, and data question and answer; When the current question is a data question and answer, information extraction is performed on the question information to obtain several question-related indicators.

3. The method according to claim 2, characterized in that When the current question is a data question answering, the step of extracting information from the question information to obtain several question-related indicators includes: When the current question is a data question and answer, extracting information from the question information; Determine whether the information of the problem is sufficient according to the extraction results; If not, a guidance prompt is generated to guide the user to supplement the question information, and the process returns to the step of judging whether the question information is sufficient according to the extraction result; If so, several problem-related indicators are determined based on the extraction results.

4. The method according to claim 1, characterized in that The step of determining a related database based on each of the problem related indicators and extracting indicator data from the related database includes: Determine a related database based on each of the problem related indicators, and generate a SQL query statement corresponding to the related database; The SQL query statement is sent to the associated database, and the indicator data returned by the associated database based on the SQL query statement is received.

5. The method according to claim 1, characterized in that The step of determining a target operator function in a preset function call library according to the problem information, and substituting the indicator data into the target operator function to obtain a function calculation result comprises: Input the problem information into a function call sub-model to obtain a target operator function, wherein the function call sub-model is trained based on each operator function in a preset function call library and corresponding call scenario examples; The corresponding parameters of the target operator function are extracted from the indicator data, and the corresponding parameters are substituted into the target operator function to obtain a function calculation result.

6. The method according to claim 2, characterized in that After the step of identifying the intent of the current question according to the question entity and determining the question category of the current question, the method further includes: When the current question is a document question and answer, a preset resource pool is mixedly recalled according to the question information and each question entity to obtain a recalled associated text; The recalled associated texts are reordered to obtain and output the document answer result of the current question.

7. The method according to claim 2, characterized in that After the step of identifying the intent of the current question according to the question entity and determining the question category of the current question, the method further includes: When the current question is other questions and answers, the current question is answered through the built-in analysis component of the large language model, and the corresponding answer to the current question is output.

8. A data analysis device, characterized in that: The device comprises: A data extraction module is used to extract information from the problem information when receiving the problem information input by the user, and obtain a number of problem-related indicators; determine a related database based on each of the problem-related indicators, and extract indicator data from the related database; A function calling module, used to determine a target operator function in a preset function calling library according to the problem information, and substitute the indicator data into the target operator function to obtain a function calculation result; A model analysis module, used to analyze the indicator data through a built-in analysis component to obtain a model analysis result; The integrated output module is used to integrate the function calculation results and the model analysis results to obtain and output the attribution analysis results.

9. A data analysis device, characterized in that: The data analysis device comprises: a memory, a processor, and a data analysis program stored in the memory and executable on the processor, wherein the data analysis program implements the steps of the data analysis method according to any one of claims 1 to 7 when executed by the processor.

10. A storage medium, characterized in that: The storage medium stores a data analysis program, which, when executed by a processor, implements the steps of the data analysis method according to any one of claims 1 to 7.