Data analysis method and device based on large language model and storage medium

Through the data analysis method based on the large language model, the accuracy problem when converting natural language into SQL query statements is solved, the inference ability of complex tasks is enhanced, and the interpretability of the system is improved, achieving more efficient data query and insight.

CN119621760APending Publication Date: 2025-03-14BEIJING SHUSHI YUNCHUANG TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411738784.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The prior art has low accuracy when converting natural language into SQL query statements, making it difficult to solve complex scenario problems, and AI models are regarded as ‘black boxes’, making it difficult for users to understand the decision-making process of the model.

Method used

Using a data analysis method based on a large language model, the task planning is carried out by receiving original requests, the input parameters required to execute the skill are parsed, and the expression function of the skill is run to obtain the output result. In addition, by assembling the output result and the original request of the prompt word propt module, the large language model is called to generate interpretable speech.

Benefits of technology

It improves the accuracy of the query, enhances the system's complex task inference ability, and improves the system's interpretability, allowing users to better understand the model's decision-making process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621760A_ABST
    Figure CN119621760A_ABST
Patent Text Reader

Abstract

The invention discloses a data analysis method and device based on a large language model and a storage medium, and the method comprises the steps: enabling the large language model to receive an original request Query, carrying out the task planning, and obtaining a skill name S to be executed in the next step; analyzing according to the skill name S to obtain an input parameter set arg required for executing the skill; and running an expression function of the skill name S according to the skill name S and the input parameter set arg to obtain a corresponding output result T. The data analysis method based on the large language model has the advantages of being high in query accuracy, high in complex task reasoning capacity and good in interpretability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence (AI) and business intelligence (BI), and in particular to a data analysis method, device and storage medium based on a large language model. Background Art

[0002] With the rapid development of information technology, data has become an important asset for enterprises. How to effectively manage and analyze this data and extract valuable information is crucial to the development of enterprises. Artificial intelligence (AI) technology and business intelligence (BI) technology have emerged to provide strong support for data processing and analysis. Business intelligence (BI, Business Intelligence): is a set of technologies and practices used to help decision makers make more informed decisions by analyzing data in the enterprise; BI systems usually include data warehouses, data mining, data analysis, data visualization, and dashboards. They can help enterprises extract valuable information from large amounts of data and transform it into actionable insights. As an important AI technology, large language models have achieved remarkable results in natural language processing, text generation and other fields; however, existing data query tools and BI tools still have certain limitations in processing natural language understanding, data insight depth and interpretability.

[0003] The existing application number is 202311392654.9, and the name is a Chinese invention patent for a financial data query method and system based on a general large language model. The invention relates to a financial data query method and system based on a general large language model. After converting the natural language query request into a corresponding digital vector, it uses a preset recognition model to convert it into a query script to execute the query request. Based on the general large language model, it realizes the automatic generation of SQL scripts that can understand Chinese requirements, automatically completes script security and data security verification, and finally executes and sends the results to the person who proposed the requirement. It can directly export the data requirement documents of the front-line business personnel of commercial banks to SQL scripts and execute the generated results, reducing the work of data analysts to analyze requirements and write SQL scripts. While greatly reducing the manual workload, it also improves the efficiency of business personnel in using data. However, the patent solution is to realize the "number query" process from natural language to SQL, and the problem solved is relatively simple, limited to the problem space that can be solved by the SQL language.

[0004] Therefore, the technical defects of the prior art are: Query accuracy: Traditional Text2Sql end-to-end technical solutions often have low accuracy when converting natural language into SQL query statements. This is because there are large semantic differences between natural language and SQL query statements, which makes it easy for errors to occur during the conversion process.

[0005] Complex task reasoning ability: Existing interactive question-answering systems are mainly limited to a single "number-checking" capability and are difficult to solve more complex scenario problems, such as attribution insights, trend prediction, etc. This limits the satisfaction of user needs in actual applications.

[0006] Explainability issues: AI models, especially large language models, are often viewed as “black boxes”, making it difficult for users to understand the model’s decision-making process and results. This can cause users to feel distrustful when using interactive question-answering systems, which can affect the actual application of the system.

[0007] In view of this, the present invention patent is proposed. Summary of the invention

[0008] In order to solve the above problems, the present invention proposes a data analysis method, device and storage medium based on a large language model. Specifically, the following technical solutions are adopted: A data analysis method based on a large language model, comprising: The large language model receives the original request Query, performs task planning, and obtains the skill name S to be executed next; Parse the skill name S to obtain the input parameter set arg required to execute the skill; Run the expression function function of the skill name S according to the skill name S and the input parameter set arg to obtain the corresponding output result T.

[0009] As an optional implementation of the present invention, in a data analysis method based on a large language model of the present invention, the large language model receives the original request Query, performs task planning, and obtains the skill name S to be executed in the next step, including: Receive the original request Query; Decompose the task according to the original request Query and obtain the corresponding skill candidate set J; Obtain the executed skills and their execution results H according to the original request Query, and also obtain the historical conversation information R before the original request Query; The original request Query, the execution result H of the executed skill, the skill candidate set J, and the historical dialogue information R are assembled into a complete sentence through the prompt word prompt module, input into the large language model, and obtain the skill name S to be executed next.

[0010] As an optional implementation of the present invention, in a data analysis method based on a large language model of the present invention, the original request Query, the execution result H of the executed skill, the skill candidate set J, and the historical dialogue information R are assembled into a complete sentence through a prompt word prompt module, and the sentence assembly template is: Prompt statement = In order to realize the original request Query, it is necessary to select the skill name S to be executed next from the skill candidate set J. It is known that: the execution result H of the currently executed skill and the historical dialogue information R; If any skill of the original request Query has not been executed currently, the execution result H of the currently executed skill is empty.

[0011] As an optional embodiment of the present invention, in a data analysis method based on a large language model of the present invention, obtaining the input parameter set arg required to execute the skill according to the skill name S includes: Pre-configure the input parameter descriptions of each skill and store them in the skill metadata; According to the skill name S, the input parameter meta-information required to execute the skill is parsed from the skill meta-information; The prompt word module is used to assemble the original request Query and input parameter meta-information into a complete sentence, which is then input into the large language model to obtain the various input parameters required to execute the skill name S and record them as the input parameter set arg[arg1, arg2...argn].

[0012] As an optional embodiment of the present invention, in a data analysis method based on a large language model of the present invention, the expression function function of the skill name S is run according to the skill name S and the input parameter set arg to obtain the corresponding output result T, including: Pre-configure the function expression corresponding to each skill name S, skill name S = function (arg1, arg2......argn); Once the skill name S and the input parameter set arg required to run the skill name S are determined, the function expression corresponding to the skill name S can be run to obtain the corresponding output result T.

[0013] As an optional embodiment of the present invention, a data analysis method based on a large language model of the present invention includes interpretable speech output: By assembling the output result T and the original request Query through the prompt module and calling the large language model, the interpretable speech output of the output result T is completed.

[0014] As an optional embodiment of the present invention, in a data analysis method based on a large language model of the present invention, the sentence assembly template obtained by assembling the output result T and the original request Query through a prompt word module is: prompt sentence = According to the original request Q, the output result T is obtained. Please generate an introduction or explanation for the output result T.

[0015] The present invention also provides a data analysis device based on a large language model, comprising: Task planning module: The large language model receives the original request Query, performs task planning, and obtains the skill name S to be executed next; The parameter parsing module parses the skill name S to obtain the input parameter set arg required to execute the skill; The skill execution module runs the expression function function of the skill name S according to the skill name S and the input parameter set arg to obtain the corresponding output result T.

[0016] As an optional embodiment of the present invention, a data analysis device based on a large language model of the present invention includes: The interpretable speech output module assembles the output result T and the original request Query through the prompt module, calls the large language model, and completes the interpretable speech output of the output result T.

[0017] The present invention also provides a computer-readable storage medium storing a computer-executable program, which, when executed, implements the data analysis method based on a large language model.

[0018] Compared with the prior art, the present invention has the following beneficial effects: The data analysis method based on a large language model of the present invention has the following technical effects: 1. Query accuracy: Traditional Text2Sql end-to-end technical solutions often have certain errors when converting natural language into SQL query statements, resulting in inaccurate query results. However, the data analysis method based on a large language model in this embodiment proposes a mechanism for converting natural language into "indicator language", which can more efficiently convert user needs into executable SQL query statements, thereby reducing the semantic difference between natural language and SQL query statements, thereby improving query accuracy.

[0019] 2. Complex task reasoning capability: Traditional interactive question-answering systems can often only solve a single "counting" problem. However, the data analysis method based on a large language model in this embodiment is not limited to a single "counting" capability, but proposes an agent mode, which enables the interactive question-answering system to have the ability to solve more complex scenario problems, such as attribution insights, trend prediction, etc., thereby improving the system's reasoning ability.

[0020] 3. Explainability issues: AI models, especially large language models, are usually regarded as "black boxes", and it is difficult for users to understand the decision-making process and results of the model. However, a data analysis method based on a large language model in this embodiment exposes the decision-making thinking process and explainable parameters in an interactive question-and-answer system, so that users can better understand the decision-making process of the model and improve the explainability of the system.

[0021] In summary, the data analysis method based on the large language model of the present invention has the advantages of accurate query It has the advantages of high accuracy, strong reasoning ability for complex tasks and good explainability. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flow chart of a data analysis method based on a large language model according to an embodiment of the present invention; Figure 2 Embodiments of the present invention Figure 1 Step 1: Flowchart of task planning; Figure 3 Embodiments of the present invention Figure 1 Step 2: Flowchart of parameter parsing; Figure 4 Examples of skill meta information in embodiments of the present invention; Figure 5 An example of the output result T of the "data query skill" in the embodiment of the present invention; Figure 6 Embodiments of the present invention Figure 1 Step 4: A flowchart that can explain the output of the speech. DETAILED DESCRIPTION

[0023] To make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be described clearly and completely in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them.

[0024] Therefore, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the invention claimed for protection, but merely represents some embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0025] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features and technical solutions in the embodiments may be combined with each other.

[0026] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0027] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the invention product is usually placed when in use, or the orientation or positional relationship commonly understood by those skilled in the art. Such terms are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

[0028] See also Figure 1 As shown, a data analysis method based on a large language model in this embodiment includes: The large language model receives the original request Query, performs task planning, and obtains the skill name S to be executed next; Parse the skill name S to obtain the input parameter set arg required to execute the skill; Run the expression function function of the skill name S according to the skill name S and the input parameter set arg to obtain the corresponding output result T.

[0029] The large language models (LLMs) involved in this embodiment are also called "large models", which refer to deep learning models that use large-scale training data and have billions or even hundreds of billions of parameters, such as GPT-3 and GPT-4. They can understand and generate natural language texts and are used for tasks such as automatic writing, machine translation, language understanding, and text generation. The emergence of large language models marks a major breakthrough in the field of natural language processing.

[0030] The data analysis method based on a large language model in this embodiment has the following technical effects: 1. Query accuracy: Traditional Text2Sql end-to-end technical solutions often have certain errors when converting natural language into SQL query statements, resulting in inaccurate query results. However, the data analysis method based on a large language model in this embodiment proposes a mechanism for converting natural language into "indicator language", which can more efficiently convert user needs into executable SQL query statements, thereby reducing the semantic difference between natural language and SQL query statements, thereby improving query accuracy.

[0031] 2. Complex task reasoning capability: Traditional interactive question-answering systems can often only solve a single "counting" problem. However, the data analysis method based on a large language model in this embodiment is not limited to a single "counting" capability, but proposes an agent mode, which enables the interactive question-answering system to have the ability to solve more complex scenario problems, such as attribution insights, trend prediction, etc., thereby improving the system's reasoning ability.

[0032] 3. Explainability issues: AI models, especially large language models, are usually regarded as "black boxes", and it is difficult for users to understand the decision-making process and results of the model. However, a data analysis method based on a large language model in this embodiment exposes the decision-making thinking process and explainable parameters in an interactive question-and-answer system, so that users can better understand the decision-making process of the model and improve the explainability of the system.

[0033] In summary, the data analysis method based on a large language model in this embodiment has the advantages of high query accuracy, strong reasoning ability for complex tasks and good interpretability.

[0034] As an optional implementation of this embodiment, see Figure 2 As shown, in a data analysis method based on a large language model in this embodiment, the large language model receives the original request Query, performs task planning, and obtains the skill name S to be executed next, including: Receive the original request Query; Decompose the task according to the original request Query and obtain the corresponding skill candidate set J; Obtain the executed skills and their execution results H according to the original request Query, and also obtain the historical conversation information R before the original request Query; The original request Query, the execution result H of the executed skill, the skill candidate set J, and the historical dialogue information R are assembled into a complete sentence through the prompt word prompt module, input into the large language model, and obtain the skill name S to be executed next.

[0035] The above process of this embodiment is to realize task planning for the original request Query. Task planning is to use the ability of the large language model to realize the decomposition of complex tasks. Four types of information are input to let the large language model know which skill to execute next. These four types of information are: 1) Original Query: The original Query is issued in natural language. For example, a line graph is drawn based on the sales data of the most recent week, which is recorded as Q.

[0036] 2) Skill candidate set J: the skill space for the large language model to select, denoted by J. For example, J = [data query skills, chart drawing skills, data interpretation skills, attribution skills...].

[0037] 3) Execution results H of executed skills: that is, which skills have been executed and their results, recorded as H. For example, H = [data query skills (the data queried for the most recent week is...)], if no skills have been executed, then H = empty.

[0038] Since the original request Query may obtain a series of subtasks after task decomposition, and each subtask needs to be executed in a certain sequence, the large language model needs to refer to the previous skill and execution results when obtaining which skill to execute next.

[0039] 4) Historical conversation information R: that is, historical conversation information before the original request Query, only the most recent n conversation records are obtained, recorded as R.

[0040] Furthermore, in a data analysis method based on a large language model in this embodiment, the original request Query, the execution result H of the executed skill, the skill candidate set J, and the historical dialogue information R are assembled into a complete sentence through a prompt word prompt module, and the sentence assembly template is: Prompt statement = In order to realize the original request Query, it is necessary to select the skill name S to be executed next from the skill candidate set J. It is known that: the execution result H of the currently executed skill and the historical dialogue information R; If any skill of the original request Query has not been executed currently, the execution result H of the currently executed skill is empty.

[0041] Referring to the above specific example, in this embodiment, the above four types of information are assembled into a complete sentence through the "prompt word prompt module". This process is implemented through a template. The assembled sentence is as follows: prompt statement = In order to implement the original request Query, you need to select the most suitable skill for the next step from the skill candidate set J. Given: the skills that have been executed so far and their execution results H, and the historical dialogue information R of the previous n rounds.

[0042] As an optional implementation of this embodiment, see Figure 3 As shown, in a data analysis method based on a large language model in this embodiment, the input parameter set arg required for executing the skill is obtained by parsing the skill name S, including: Pre-configure the input parameter descriptions of each skill and store them in the skill metadata; According to the skill name S, the input parameter meta-information required to execute the skill is parsed from the skill meta-information; The prompt word module is used to assemble the original request Query and input parameter meta-information into a complete sentence, which is then input into the large language model to obtain the various input parameters required to execute the skill name S and record them as the input parameter set arg[arg1, arg2...argn].

[0043] A data analysis method based on a large language model in this embodiment, Figure 2 The step has obtained the skill name S to be executed in the next step. This step will parse the input parameters required by the skill name S so as to smoothly execute the next step: "skill execution".

[0044] First of all, it should be noted that the input parameter descriptions of each skill have been pre-configured in this step. These contents are stored in the "skill meta information", which is expressed in languages ​​such as YAML. For example, Figure 4 shown.

[0045] The input parameter meta information is input into the "prompt word module" to assemble into a complete sentence. This process is implemented through templates. The assembled sentence is as follows: prompt statement = Please parse the following parameters from the original request Query: Parameter 1......Parameter 2...... After the prompt statement is input into the large language model, the various parameters required to execute the skill are recorded as the arg set, that is, [arg1, arg2...argn].

[0046] As an optional implementation of this embodiment, a data analysis method based on a large language model in this embodiment is characterized in that the expression function of the skill name S is run according to the skill name S and the input parameter set arg to obtain the corresponding output result T, including: Pre-configure the function expression corresponding to each skill name S, skill name S = function (arg1, arg2......argn); Once the skill name S and the input parameter set arg required to run the skill name S are determined, the function expression corresponding to the skill name S can be run to obtain the corresponding output result T.

[0047] For example, for "data query skills", the output result T is as follows Figure 5 shown.

[0048] See also Figure 1 and Figure 6 As shown, a data analysis method based on a large language model described in this embodiment includes an interpretable speech output: By assembling the output result T and the original request Query through the prompt module and calling the large language model, the interpretable speech output of the output result T is completed.

[0049] Usually, in addition to the skill output result T, an explainable statement is also required to make the result more complete. For example, for the above output result T, the explainable statement that can be attached is: Hello, the sales data for the most recent week (January 1, 2024 to January 7, 2024) are as follows.

[0050] See Figure 6 As shown, in a data analysis method based on a large language model in this embodiment, the sentence assembly template assembled by assembling the output result T and the original request Query with the prompt word prompt module is: prompt sentence = According to the original request Q, the output result T is obtained. Please generate an introduction or explanation for the output result T. After the prompt sentence is input into the large model, the final interpretable speech is obtained.

[0051] In summary, the key point and protection point of the present invention is a data analysis method that integrates natural language processing, data analysis and model interpretation capabilities. It uses a large language model to improve the intelligence level of data query and insight, while enhancing users' understanding and trust in query results.

[0052] This embodiment also provides a data analysis device based on a large language model, including: Task planning module: The large language model receives the original request Query, performs task planning, and obtains the skill name S to be executed next; The parameter parsing module parses the skill name S to obtain the input parameter set arg required to execute the skill; The skill execution module runs the expression function function of the skill name S according to the skill name S and the input parameter set arg to obtain the corresponding output result T.

[0053] The data analysis device based on a large language model of this embodiment has the following technical effects: 1. Query accuracy: Traditional Text2Sql end-to-end technical solutions often have certain errors when converting natural language into SQL query statements, resulting in inaccurate query results. However, the data analysis device based on a large language model in this embodiment proposes a mechanism for converting natural language into "indicator language", which can more efficiently convert user needs into executable SQL query statements, thereby reducing the semantic difference between natural language and SQL query statements, thereby improving query accuracy.

[0054] 2. Complex task reasoning capability: Traditional interactive question-answering systems can often only solve a single "counting" problem. However, the data analysis device based on a large language model in this embodiment is not limited to a single "counting" capability, but proposes an agent mode, which enables the interactive question-answering system to have the ability to solve more complex scenario problems, such as attribution insights, trend prediction, etc., thereby improving the system's reasoning ability.

[0055] 3. Explainability issues: AI models, especially large language models, are usually regarded as "black boxes", and it is difficult for users to understand the decision-making process and results of the model. However, a data analysis device based on a large language model in this embodiment exposes the decision-making thinking process and explainable parameters in an interactive question-and-answer system, so that users can better understand the decision-making process of the model, thereby improving the explainability of the system.

[0056] In summary, the data analysis device based on a large language model in this embodiment has the advantages of high query accuracy, strong reasoning ability for complex tasks and good interpretability.

[0057] Furthermore, a data analysis device based on a large language model in this embodiment includes: The interpretable speech output module assembles the output result T and the original request Query through the prompt module, calls the large language model, and completes the interpretable speech output of the output result T.

[0058] This embodiment also provides a computer-readable storage medium storing a computer-executable program. When the computer-executable program is executed, the data analysis method based on a large language model is implemented.

[0059] The computer-readable storage medium described in this embodiment may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer-readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus, or a device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0060] This embodiment also provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer executable program, and when the computer program is executed by the processor, the processor executes the data analysis method based on a large language model.

[0061] The electronic device is presented in the form of a general-purpose computing device. The processor may be one or more than one and work in coordination. The present invention does not exclude distributed processing, that is, the processor may be dispersed in different physical devices. The electronic device of the present invention is not limited to a single entity, but may also be the sum of multiple physical devices.

[0062] The memory stores a computer executable program, which is usually a machine-readable code. The computer-readable program can be executed by the processor to enable the electronic device to perform the method of the present invention, or at least part of the steps in the method.

[0063] The memory includes a volatile memory, such as a random access memory unit (RAM) and / or a cache memory unit, and may also be a non-volatile memory, such as a read-only memory unit (ROM).

[0064] It should be understood that the electronic device of the present invention may also include elements or components not shown in the above examples. For example, some electronic devices also include display units such as display screens, and some electronic devices also include human-computer interaction elements such as buttons and keyboards. As long as the electronic device can execute the computer-readable program in the memory to implement the method of the present invention or at least part of the steps of the method, it can be considered as an electronic device covered by the present invention.

[0065] Through the above description of the embodiments, it is easy for those skilled in the art to understand that the present invention can be implemented by hardware capable of executing a specific computer program, such as the system of the present invention, and the electronic processing unit, server, client, mobile phone, control unit, processor, etc. included in the system. The present invention can also be implemented by computer software that executes the method of the present invention, such as by The computer software for executing the method of the present invention is implemented by a control software executed by a microprocessor, an electronic control unit, a client, a server, etc. However, it should be noted that the computer software for executing the method of the present invention is not limited to being executed by one or a specific hardware entity, and it can also be implemented in a distributed manner by unspecified specific hardware. For computer software, the software product can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), or it can be distributed and stored on the network, as long as it can enable the electronic device to execute the method according to the present invention.

[0066] The above embodiments are only used to illustrate the present invention and are not intended to limit the technical solutions described in the present invention. Although the present invention has been described in detail with reference to the above embodiments, the present invention is not limited to the above specific implementation methods. Therefore, any modification or equivalent replacement of the present invention; and all technical solutions and improvements thereof that do not depart from the spirit and scope of the invention are included in the scope of the claims of the present invention.

Claims

1. A data analysis method based on a large language model, characterized in that: include: The large language model receives the original request Query, performs task planning, and obtains the skill name S to be executed next; Parse the skill name S to obtain the input parameter set arg required to execute the skill; Run the expression function function of the skill name S according to the skill name S and the input parameter set arg to obtain the corresponding output result T.

2. A data analysis method based on a large language model according to claim 1, characterized in that: The large language model receives the original request Query, performs task planning, and obtains the skill name S to be executed next, including: Receive the original request Query; Decompose the task according to the original request Query and obtain the corresponding skill candidate set J; Obtain the executed skills and their execution results H according to the original request Query, and also obtain the historical conversation information R before the original request Query; The original request Query, the execution result H of the executed skill, the skill candidate set J, and the historical dialogue information R are assembled into a complete sentence through the prompt word prompt module, input into the large language model, and obtain the skill name S to be executed next.

3. A data analysis method based on a large language model according to claim 2, characterized in that: The original request Query, the execution result H of the executed skill, the skill candidate set J, and the historical dialogue information R are assembled into a complete sentence through the prompt word prompt module. The sentence assembly template is: Prompt statement = In order to realize the original request Query, it is necessary to select the skill name S to be executed next from the skill candidate set J. It is known that: the execution result H of the currently executed skill and the historical dialogue information R; If any skill of the original request Query has not been executed currently, the execution result H of the currently executed skill is empty.

4. The data analysis method based on a large language model according to claim 2, characterized in that: According to the skill name S, the input parameter set arg required to execute the skill is obtained, including: Pre-configure the input parameter descriptions of each skill and store them in the skill metadata; According to the skill name S, the input parameter meta-information required to execute the skill is parsed from the skill meta-information; The prompt word module is used to assemble the original request Query and input parameter meta-information into a complete sentence, which is then input into the large language model to obtain the various input parameters required to execute the skill name S and record them as the input parameter set arg[arg1, arg2...argn].

5. The data analysis method based on a large language model according to claim 4, characterized in that: The step of running the expression function function of the skill name S according to the skill name S and the input parameter set arg to obtain the corresponding output result T includes: Pre-configure the function expression corresponding to each skill name S, skill name S = function (arg1, arg2......argn); Once the skill name S and the input parameter set arg required to run the skill name S are determined, the function expression corresponding to the skill name S can be run to obtain the corresponding output result T.

6. A data analysis method based on a large language model according to any one of claims 1 to 5, characterized in that: Including interpretable speech output: By assembling the output result T and the original request Query through the prompt module and calling the large language model, the interpretable speech output of the output result T is completed.

7. The data analysis method based on a large language model according to claim 6, characterized in that: The sentence assembly template obtained by assembling the output result T and the original request Query through the prompt word module is: prompt sentence = According to the original request Q, the output result T is obtained. Please generate an introduction or explanation for the output result T.

8. A data analysis device based on a large language model, characterized in that: include: Task planning module: The large language model receives the original request Query, performs task planning, and obtains the skill name S to be executed next; The parameter parsing module parses the skill name S to obtain the input parameter set arg required to execute the skill; The skill execution module runs the expression function function of the skill name S according to the skill name S and the input parameter set arg to obtain the corresponding output result T.

9. The data analysis device based on a large language model according to claim 8, characterized in that: include: The interpretable speech output module assembles the output result T and the original request Query through the prompt module, calls the large language model, and completes the interpretable speech output of the output result T.

10. A computer-readable storage medium storing a computer-executable program, characterized in that: When the computer executable program is executed, a data analysis method based on a large language model as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Financial data query method and system based on general big language model

    CN117349303A