Data analysis method and device, electronic equipment and computer readable storage medium

By using the ReAct pattern to perform intent analysis and result evaluation in data analysis, the ambiguity problem of natural language processing technology in data analysis is solved, and the accuracy and efficiency of database query tasks are improved.

CN120994716APending Publication Date: 2025-11-21GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511005739.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Natural language processing technology can lead to ambiguity in data analysis tasks, causing database query tasks to fail to meet accuracy requirements and affecting the accuracy and efficiency of data analysis.

Method used

The ReAct model is used for information extraction and result evaluation. The first ReAct model is used for intent analysis and key information extraction, and the second ReAct model is used for accuracy analysis of task execution results to eliminate ambiguity and ensure accuracy.

Benefits of technology

The dual processing of the ReAct mode improves the accuracy and efficiency of data analysis, ensures that the target answer matches the user's needs, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994716A_ABST
    Figure CN120994716A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data analysis method and device, electronic equipment and a computer readable storage medium. The method comprises the following steps: acquiring user demand data; performing intention analysis on the user demand data based on a first ReAct mode, and determining target key information, the first ReAct mode being a ReAct mode for performing key information extraction in an information extraction link; performing task planning based on the target key information, and determining a database query task; executing the database query task, and determining a task execution result; and performing accuracy analysis on the task execution result based on a second ReAct mode, and determining a target answer corresponding to the user demand data, the second ReAct mode being a ReAct mode for performing result evaluation in a result evaluation link. Processing is carried out in an information extraction link and a result evaluation link through the two ReAct modes, the accuracy of the two processing links is guaranteed, and then the availability, the analysis efficiency and the user experience of big data analysis are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of data analysis, and particularly relate to a data analysis method and device, electronic equipment and computer readable storage medium. BACKGROUND

[0002] In the background of rapid development of large models (such as large language models, such as GPT-3, GPT-4, etc.), using natural language processing (NLP) technology to implement data analysis tasks has become a popular research field. In general, data analysis tasks need to generate database query tasks, and the data structure and analysis logic of the database are complex, and the accuracy of the database query task is high; when using natural language processing (NLP) technology to implement data analysis tasks, natural language expression itself has ambiguity, and in actual application, it may not be understood or misinterpreted, so that the database query task formed based on natural language processing technology cannot meet the accuracy requirement, thereby affecting the application of natural language processing technology in data analysis tasks. SUMMARY

[0003] Embodiments of the present application provide a data analysis method, device, electronic equipment and computer readable storage medium, aiming to improve the accuracy of natural language processing technology in data analysis tasks.

[0004] A data analysis method comprises: obtaining user demand data; performing intent analysis on the user demand data based on a first ReAct mode to determine target key information, the first ReAct mode being a ReAct mode for key information extraction in an information extraction link; performing task planning based on the target key information to determine a database query task; executing the database query task to determine a task execution result; performing accuracy analysis on the task execution result based on a second ReAct mode to determine a target answer corresponding to the user demand data, the second ReAct mode being a ReAct mode for result evaluation in a result evaluation link.

[0005] In this embodiment, the user demand data is analyzed based on the first ReAct mode, feedback is given to the ambiguous content in the user demand data to eliminate ambiguity in the key information extraction process, ensure the accuracy of the intent understanding, and further ensure the accuracy of the target key information; task planning is performed based on the target key information, a database query task is generated and executed to realize the automatic switching of natural language data to a database query task, which helps to ensure the processing efficiency of task planning and execution; the accuracy of the task execution result is analyzed based on the second ReAct mode to avoid the mismatch between the final output target answer and the user demand data, thereby ensuring the accuracy of the target answer. Understandably, the two ReAct modes are processed in the information extraction link and the result evaluation link to ensure the accuracy of the two processing links, thereby improving the usability, analysis efficiency and user experience of big data analysis.

[0006] In an embodiment, the intent analysis of the user demand data based on the first ReAct mode includes: rewriting the user demand data into a question to determine the rewritten target demand data; classifying the target demand data into a target intent to determine the target intent corresponding to the target demand data; analyzing the key information corresponding to the target intent of the target demand data based on the first ReAct mode to determine the target key information.

[0007] In this embodiment, the user demand data is first rewritten into a question to effectively eliminate the uncertainty of the user's expression; then the target demand data is classified into a target intent to determine the target intent of the data analysis required by the user demand data; based on the first ReAct mode, the target intent corresponding key information of the target demand data is analyzed, and through effective intent understanding, the accuracy of the extracted target key information can be ensured.

[0008] In an embodiment, the analysis of the key information corresponding to the target intent of the target demand data based on the first ReAct mode includes: determining a plurality of necessary slots corresponding to the target intent based on the target intent; extracting slot information corresponding to the necessary slots from the target demand data; when all the necessary slots have extracted corresponding slot information, determining the target key information corresponding to the target demand data based on the slot information corresponding to all the necessary slots; When at least one of the necessary slots fails to extract corresponding slot information, an inquiry question is formed based on the at least one necessary slot failing to extract the corresponding slot information, and the obtaining of the user demand data is repeatedly performed based on the inquiry question.

[0009] In this embodiment, information is extracted from the target demand data for the multiple necessary slots corresponding to the target intent. When all the necessary slots can extract corresponding slot information, the corresponding target key information can be determined based on the slot information corresponding to all the necessary slots, so as to guarantee the accuracy of intent understanding. When at least one necessary slot fails to extract corresponding slot information, an inquiry question is formed based on these necessary slots to guide the user to supplement the uncertain slot information, so as to guarantee the accuracy of intent understanding.

[0010] In an embodiment, the task planning based on the target key information includes: Database retrieval recall based on the target key information to determine target field information and a target data table; Structural processing of the target field information and the target data table to determine a database query task.

[0011] In this embodiment, database retrieval recall is performed based on the target key information to guarantee the accuracy and efficiency of the extracted target field information and target data table. Structural processing is further performed based on the extracted target field information and target data table to quickly generate a corresponding database query task and guarantee the accuracy of the database query task.

[0012] In an embodiment, the accuracy analysis of the task execution result based on the second ReAct mode to determine the target answer corresponding to the user demand data includes: Result evaluation of the task execution result to obtain a target evaluation result; When the target evaluation result is evaluation failure, prompt information is output, and the task planning based on the target key information to determine a database query task is repeatedly performed; When the target evaluation result is evaluation success, the target answer corresponding to the user demand data is determined based on the task execution result.

[0013] In this embodiment, result evaluation is performed based on the user demand data and the task execution result. When the result evaluation result is evaluation failure, prompt information is output, and the task planning based on the target key information to determine a database query task and subsequent steps is iteratively performed. When the target evaluation result is evaluation success, the target answer corresponding to the task execution result is determined, so as to guarantee the accuracy of the target answer.

[0014] In an embodiment, the result evaluation on the task execution result is performed to obtain a target evaluation result, including: When the task execution result is unable to output an initial answer, the target evaluation result is determined to be evaluation failure; When the task execution result is able to output an initial answer, the result evaluation is performed based on the initial answer and the user demand data to determine the target evaluation result.

[0015] In the embodiment, whether the initial answer matches the user demand data is analyzed according to whether the task execution result is able to output an initial answer, so that the determined target evaluation result can effectively reflect whether the task execution result meets the accuracy requirement, which is helpful to guarantee the accuracy of the subsequently determined target answer.

[0016] In an embodiment, the result evaluation based on the initial answer and the user demand data to determine the target evaluation result includes: index evaluation based on the initial answer and the user demand data is performed to determine an index evaluation result; relevance evaluation based on the initial answer and the user demand data is performed to determine a relevance evaluation result; When the index evaluation result and the relevance evaluation result are both evaluation pass, the target evaluation result is determined to be evaluation pass; When at least one of the index evaluation result and the relevance evaluation result is evaluation failure, the target evaluation result is determined to be evaluation failure.

[0017] In the embodiment, the index evaluation and the relevance evaluation are performed based on the initial answer and the user demand data analysis, and the target evaluation result is determined according to the combination relationship of the index evaluation result and the relevance evaluation result, which is helpful to guarantee the accuracy of the target evaluation result.

[0018] A data analysis apparatus, including: a user demand data obtaining module configured to obtain user demand data; a target key information determining module configured to perform intention analysis on the user demand data based on a first ReAct mode to determine target key information, the first ReAct mode being a ReAct mode for key information extraction in an information extraction link; a query task determining module configured to perform task planning based on the target key information to determine a database query task; a task execution result determining module configured to execute the database query task to determine a task execution result; A target answer determination module is configured to determine a target answer corresponding to the user demand data based on an accuracy analysis of the task execution result by using a second ReAct mode, wherein the second ReAct mode is a ReAct mode for result evaluation in a result evaluation link.

[0019] An electronic device comprises a processor and a memory, wherein, The memory is configured to store a computer program. The processor is configured to execute the program stored in the memory to implement the data analysis method.

[0020] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the data analysis method. BRIEF DESCRIPTION OF DRAWINGS

[0021] Figure 1 is a flowchart of the data analysis method provided by an embodiment of the present application; Figure 2 is a flowchart of step S102 in the method; Figure 1 Figure 3 is a flowchart of step S203 in the method; Figure 2 Figure 4 is a flowchart of step S103 in the method; Figure 1 Figure 5 is a flowchart of step S105 in the method; Figure 1 Figure 6 is a flowchart of step S501 in the method; Figure 5 Figure 7 is a flowchart of step S602 in the method; Figure 6 Figure 8 is a structural diagram of the data analysis device provided by an embodiment of the present application; Figure 9 is a structural diagram of the electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the technical problems, technical solutions and beneficial effects of the present application clearer, the present application will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not used to limit the present application.

[0023] ​​​​​​Embodiments of the present application provide a data analysis method. The data analysis method is applicable to an electronic device (hereinafter referred to as "device") as an example. The data analysis method can be applied to data analysis in the field of Internet of Vehicles, and can also be applied to data analysis in other fields. As shown in Figure 1 The data analysis method includes the following steps. S101: obtaining user demand data; S102: performing intent analysis on the user demand data based on a first ReAct mode to determine target key information, the first ReAct mode being a ReAct mode for key information extraction in an information extraction link; S103: performing task planning based on the target key information to determine a database query task; S104: executing the database query task to determine a task execution result; S105: performing accuracy analysis on the task execution result based on a second ReAct mode to determine a target answer corresponding to the user demand data, the second ReAct mode being a ReAct mode for result evaluation in a result evaluation link.

[0024] The ReAct (Reasoning + Action) mode is an artificial intelligence interaction framework combining reasoning and action, aiming to enable the model to determine the next action through a dynamic reasoning process, and to achieve more flexible and controllable task execution. The core idea is that the model needs to think "what to do" (reasoning) and actually "perform operations" (action) at each step, and iteratively optimize subsequent decisions by observing the action results. The first ReAct mode is a ReAct mode for key information extraction in an information extraction link, specifically a pre-trained ReAct mode capable of key information extraction on demand data. The second ReAct mode is a ReAct mode for result evaluation in a result evaluation link, specifically a pre-trained ReAct mode capable of accuracy evaluation on task execution results.

[0025] The user demand data is data reflecting user demand. The target key information is the finally determined key information, specifically the key information processed by the first ReAct mode.

[0026] As an example, in step S101, the device can receive user input user demand data. The user demand data can be user input demand data or demand data in response to feedback of inquiry questions. In the field of Internet of Vehicles, the user demand data can reflect which Internet of Vehicles data the user wants to know, for example, the user demand data can be "the number of active users of XXX vehicle model in January 2025" and the like.

[0027] As an example, in step S102, after receiving the user demand data, the device can perform intent analysis on the user demand data based on the pre-trained first ReAct model, extract the key information corresponding to the analyzed intent, and determine the initial key information. It is determined whether the initial key information meets the pre-set first accuracy requirement. If the first accuracy requirement is not met, an inquiry question needs to be input, which is used to represent a question that needs to be supplemented by the user to improve the corresponding user demand data, i.e., step S101 is repeated. If the first accuracy requirement is met, it is determined that the user demand data can accurately determine the corresponding target key information. The first accuracy requirement here is the accuracy requirement set in the information extraction link. In this example, the first ReAct model is used to extract the key information from the user demand data, and feedback is given to the ambiguous content in the user demand data to eliminate the ambiguity in the key information extraction process, so as to obtain target key information with high accuracy.

[0028] As an example, in step S103, after the target key information is extracted, the device can perform task planning based on the target key information. Specifically, the pre-set task planning rule can be called to process the target key information as an input parameter to generate a database query task. This process does not require human intervention and is automatically generated, which helps to ensure the generation efficiency of the database query task. The database query task here is a task for querying a database, which is specifically represented as a database query statement, which can be but is not limited to an SQL statement.

[0029] As an example, in step S104, the device executes the database query task, queries the database based on the database query task, and determines the task execution result according to the database query result. In this example, the database query task is generated and executed based on the target key information to convert the user demand data in natural language form into a database query task. Since the target key information has high accuracy, the accuracy of the task execution result output by it can be ensured to a certain extent.

[0030] As an example, in step S105, after determining the task execution result, the device can perform accuracy analysis on the task execution result based on the pre-trained second ReAct mode to evaluate whether it matches the user demand data, determine an initial analysis result; if the initial analysis result meets the pre-set second accuracy requirement; if the second accuracy requirement is not met, prompt information needs to be output to prompt which content does not meet the second accuracy requirement, so as to subsequently repeat the task planning based on the target key information, determine the database query task, execute the database query task, and determine the task execution result; if the second accuracy requirement is met, the target answer corresponding to the user demand data is determined based on the task execution result. The second accuracy requirement here is the accuracy requirement in the result evaluation link. In this example, the task execution result is analyzed based on the second ReAct mode to evaluate whether it matches the user demand data; if the task execution result does not match the user demand data, it means that the target answer output based on the task execution result is not accurate, and prompt information needs to be output; if the task execution result matches the user demand data, the target answer is output based on the task execution result to ensure the accuracy of the target answer.

[0031] In this embodiment, the user demand data is analyzed based on the first ReAct mode, feedback is given to the ambiguous content in the user demand data to eliminate the ambiguity in the key information extraction process, ensure the accuracy of the intent understanding, and further ensure the accuracy of the target key information; the task planning is performed based on the target key information, the database query task is generated and executed to realize the automatic switching of natural language data to database query task, which helps to ensure the processing efficiency of the task planning and execution; the accuracy analysis is performed on the task execution result based on the second ReAct mode to avoid the mismatch between the finally output target answer and the user demand data, thereby ensuring the accuracy of the target answer. Understandably, through the processing of the two ReAct modes in the information extraction link and the result evaluation link, the accuracy of the two processing links is ensured, and the usability, analysis efficiency and user experience of big data analysis are improved.

[0032] In an embodiment, as shown in Figure 2 Step S102, i.e., the intent analysis of the user demand data based on the first ReAct mode to determine the target key information, includes: S201: rewriting the user demand data into a question to determine the rewritten target demand data; S202: classifying the target demand data to determine the target intent corresponding to the target demand data; S203: performing key information analysis on the target demand data based on the first ReAct mode corresponding to the target intent to determine the target key information.

[0033] The target demand data refers to the demand data obtained by rewriting the user demand data.

[0034] As an example, in step S201, after obtaining the user demand data, the device rewrites the user demand data to eliminate the uncertainty expressed by the user in the user demand data, so as to avoid the ambiguity caused by the uncertainty and obtain target demand data with higher accuracy.

[0035] In this example, the process of rewriting the user demand data includes but is not limited to reference elimination and multi-round understanding rewriting. Reference elimination refers to the process of rewriting the reference words in the user demand data into complete and clear sentences to facilitate subsequent intent analysis and key information extraction. Multi-round understanding rewriting refers to the process of rewriting the omitted content in the user demand data to obtain complete and clear sentences in combination with multi-round interactive communication. For example, the original sentence corresponding to the user demand data may be a question continuing the previous sentence, such as, the first sentence asks, "XXX model active user number in January 2025", the second sentence may directly ask, "What about February", if the intent classification is directly based on the second sentence, it will be more difficult to determine the user's intent, but through multi-round understanding rewriting, the previous rounds of questions and answers are taken as background information, and the question of the second sentence is rewritten, and the rewritten target demand data is "XXX model active user number in February 2025", so as to reduce the influence of the incompleteness of the user's expression on the accuracy of subsequent analysis.

[0036] As an example, in step S202, after determining the target demand data, the device needs to use a pre-set intent classification model to analyze the intent of the target demand data to determine the target intent corresponding to the target demand data. The intent classification model is a model used to realize intent classification, which can be but is not limited to a model trained by Qwen or other large language models that can realize intent classification.

[0037] In the field of Internet of Vehicles, training samples carrying two intent labels of vehicle state and user behavior can be used for model training, so that the intent classification model obtained by training can effectively identify the two intents, that is, when the intent classification model is used to classify the intent of the target demand data, the target intent can be determined as vehicle state or user behavior. Understandably, according to actual needs, training samples carrying more intent labels can be used for model training, so that the intent classification model obtained by training can identify more intents.

[0038] As an example, in step S203, after determining the target intent corresponding to the target demand data, the device can extract the key information according to different target intents to ensure the accuracy of the determined target key information. For example, in the field of Internet of Vehicles, if the target intent is identified as user behavior, the key information that needs to be extracted includes but is not limited to vehicle type, date, application name, and index information. At this time, the first ReAct mode is used to extract the key information from the user demand data to determine the initial key information. It is evaluated whether the initial key information contains all the key information required by the target intent. If the target demand data does not contain all the key information required by the target intent, an inquiry question is needed to be output. The inquiry question is used to represent a question that needs to be supplemented by the user to improve the user demand data corresponding to the user, that is, to repeat step S101. If the target demand data contains all the key information required by the target intent, it is determined that the user demand data can accurately determine the target key information corresponding thereto. In this example, the first ReAct mode is used to extract the key information corresponding to the target intent from the user demand data to eliminate the ambiguity in the key information extraction process and to obtain target key information with high accuracy.

[0039] In this embodiment, the user demand data is first rewritten to effectively eliminate the uncertainty expressed by the user in the rewritten target demand data. Then, the target intent of the target demand data is classified to determine the target intent required for data analysis of the user demand data. The first ReAct mode is used to analyze the key information corresponding to the target intent of the target demand data, and effective intent understanding can ensure the accuracy of the extracted target key information.

[0040] In an embodiment, as shown in Figure 3 Step S203, i.e., analyzing the key information corresponding to the target intent of the target demand data based on the first ReAct mode to determine the target key information, includes: S301: determining a plurality of necessary slots corresponding to the target intent based on the target intent; S302: extracting slot information corresponding to the necessary slots from the target demand data; S303: when all necessary slots have extracted corresponding slot information, determining the target key information corresponding to the target demand data based on the slot information corresponding to all necessary slots; S304: when there is at least one necessary slot that has not extracted corresponding slot information, forming an inquiry question based on the at least one necessary slot that has not extracted slot information, and repeating the acquisition of user demand data based on the inquiry question.

[0041] Slot is a key concept in dialogue systems and information extraction tasks, used to structure the extraction and representation of specific information pieces in text, often combined with Intent to complete semantic understanding and task execution. That is, slot is a structured information field used to identify specific types of information that need to be extracted from user input.

[0042] Among them, the inquiry question is formed based on at least one necessary slot for which the slot information is not extracted, and the inquiry question is used to guide the user to supplement the slot information corresponding to the necessary slot.

[0043] As an example, in step S301, the device can determine a plurality of necessary slots corresponding to the target intent based on the target intent, where the necessary slots are slots that must be extracted for the data corresponding to the target intent. For example, when the target intent is user behavior, the necessary slots corresponding to the target intent include but are not limited to vehicle type, date, application name, and index, etc.

[0044] As an example, in step S302, the device extracts slot information corresponding to the necessary slots from the target demand data, for example, when the target intent is user behavior, the slot information corresponding to the necessary slots of vehicle type, date, application name, and index, etc. needs to be extracted from the target demand data in turn, and according to the slot information extraction result, step S303 or S304 is executed.

[0045] As an example, in step S303, the device extracts slot information corresponding to the necessary slots from the target demand data, for example, when the target intent is user behavior, the slot information corresponding to the necessary slots of vehicle type, date, application name, and index, etc. needs to be extracted from the target demand data in turn, and according to the slot information extraction result, step S303 or S304 is executed.

[0046] As an example, in step S304, when there is at least one necessary slot for which the slot information is not extracted, the device forms an inquiry question based on the at least one necessary slot for which the slot information is not extracted, for example, when the slot information corresponding to the necessary slot of "date" cannot be extracted from the target demand data, an inquiry question needs to be formed based on "date". The device outputs the inquiry question, that is, controls the display screen to display the inquiry question, so that the user re-enters the user demand data based on the inquiry question, that is, steps S101-S102 are repeatedly executed until the target key information corresponding to the user demand data is determined.

[0047] In an example, the first ReAct mode is an information extraction module, which can extract necessary information from user uncertain target demand data (i.e. user question) through the first ReAct mode, improve the effectiveness and accuracy of the information extraction link, which specifically includes the following steps: (1) **extract slot information [Query, Slot]**, according to the target demand data (i.e. user question) and the corresponding target intent, fill the necessary slot, and return the filling slot result; (2) **information inquiry [MissingSlot]**, if the necessary slot is not filled, request secondary interaction with the user to inquire the necessary information, that is, form and output the inquiry question; (3) **complete [Result]**, when all necessary slots are filled, return the target key information and complete the information extraction link.

[0048] For example, the target demand data is "Please tell me the setting times of each setting item of voice", which is a user question. For this target demand data, the target intent corresponding to the user question is determined as user behavior, which specifically includes the following processing process: Thinking 1: The key information of the user question needs to be extracted, and the target intent corresponding to the user question is user behavior, so the necessary slots are date, vehicle type, application name, and index; Action 1: **Extract slot information ['Please tell me the setting times of each setting item of voice', 'date, vehicle type, application name, index']** Observation 1: Date: null; Vehicle type: null; Application name: voice; Index: setting times of each setting item; Thinking 2: The slots "date" and "vehicle type" lack the corresponding slot information of the necessary slots, and secondary interaction with the user is needed, that is, output the inquiry question; Action 2: **Information inquiry ['date, vehicle type']** Observation 2: The vehicle type is Haopu GT, and the date is from January 1, 2024 to January 31, 2024.

[0049] Thinking 3: Fill in the slots according to the supplementary information; Action 3: Extract slot information ['vehicle type is Haopu GT, date is from January 1, 2024 to January 31, 2024','vehicle type', 'date'] Observation 3: Date: 20240101-20240131; Vehicle type: Haopu GT; Application name: voice; Index: setting times of each setting item; Thinking 4: Complete the extraction of target key information; Action 4: **Complete ['date: 20240101-20240131; vehicle type: Haopu GT; application name: voice; index: setting times of each setting item']** In this embodiment, the target intent corresponding to the multiple necessary slots is extracted from the target demand data. When the corresponding slot information of all necessary slots can be extracted, the corresponding target key information can be determined based on the slot information of all necessary slots, so as to ensure the accuracy of intent understanding. When the corresponding slot information of at least one necessary slot cannot be extracted, the necessary slots are used to form an inquiry question to guide the user to supplement the uncertain slot information, so as to ensure the accuracy of intent understanding.

[0050] In an embodiment, as shown in FIG. 10, step S103, i.e., task planning based on target key information, includes: Figure 4 S401: Database retrieval recall based on target key information to determine target field information and target data table; S402: Structured processing of target field information and target data table to determine database query task.

[0051] The retrieval recall refers to a process of preliminarily screening a candidate set that may be related to a query from a large amount of data in an information retrieval or search system, and the core goal is to reduce the missing rate and ensure that the content with high relevance is returned first. Generally, the table information, field information, and calculation range are maintained in the database in advance, and the database retrieval recall is an effective database retrieval method. The mixed retrieval method of vector retrieval and full-text retrieval can be used, and the retrieval method is reordered to find the most suitable content. The traditional retrieval method mainly performs full matching and fuzzy matching, and the target key information extracted from the user demand data needs to be almost consistent with the definition of the table information and the field information to accurately retrieve.

[0052] The target field information refers to the field information related to the database query determined from the target key information. The target data table refers to the data table that needs to be queried from the target key information.

[0053] As an example, in step S401, the device can perform database retrieval recall based on the target key information to quickly and accurately determine the corresponding target field information and target data table. Since the user demand data (i.e., user question) input by the user has uncertainty, it is difficult to require the data table and field given by the user to be completely consistent with the data table and field in the database, which makes the traditional retrieval method have a large defect. In this example, the database retrieval recall can effectively extract the target field information in the target key information and find the matching target data table.

[0054] ​As an example, in step S402, after determining the target field information and the target data table, the device can perform structural processing on the target field information and the target data table to convert into a database query task. For example, when the database is an SQL database, the target field information and the target data table can be structurally processed based on the corresponding query statement generation rule of the SQL database to generate an SQL statement.

[0055] In this embodiment, the database is retrieved based on the target key information to ensure the accuracy and efficiency of the extracted target field information and target data table. Then, the extracted target field information and target data table are structurally processed to quickly generate the corresponding database query task and ensure the accuracy of the database query task.

[0056] In an embodiment, as shown in FIG. 1 1, Figure 5 As shown in FIG. 1 1, step S105, i.e., performing accuracy analysis on the task execution result based on the second ReAct mode to determine the target answer corresponding to the user demand data, includes: S501: performing result evaluation on the task execution result to obtain a target evaluation result; S502: when the target evaluation result is evaluation failure, outputting a prompt information and repeatedly performing task planning based on the target key information to determine the database query task; S502: when the target evaluation result is evaluation success, determining the target answer corresponding to the user demand data based on the task execution result.

[0057] As an example, in step S501, the device can perform result evaluation based on the user demand data and the task execution result to determine whether the task execution result can accurately reply to the user question reflecting the user demand data feedback, so as to determine the target evaluation result. In this example, the user demand data specifically represents a user question reflecting the user demand, and the task execution result determined by executing the database query task specifically represents an initial answer to the user question. The result evaluation process here is specifically used to analyze whether the initial answer corresponding to the user question is accurate, and the target evaluation result can be any one of evaluation success and evaluation failure.

[0058] As an example, in step S502, when the target evaluation result is evaluation failure, the device can output a prompt information, which can be used to reflect which content in the initial answer cannot reply to the user question, so as to repeatedly perform task planning based on the target key information to determine the database query task and subsequent steps, i.e., repeatedly perform steps S103-S105.

[0059] As an example, in step S503, when the target evaluation result is evaluation pass, it can be determined that the initial answer can accurately reply to the user question, and at this time, the initial answer determined by executing the database query task can be determined as the target answer corresponding to the user demand data.

[0060] In this embodiment, the result is evaluated based on the user demand data and the task execution result, and when the result evaluation result is evaluation fail, prompt information needs to be output, and task planning based on target key information is iteratively executed to determine the database query task and subsequent steps, until the target evaluation result is evaluation pass, and then the target answer corresponding to the task execution result is determined, which can guarantee the accuracy of the target answer.

[0061] In an embodiment, as shown in Figure 6 S501, i.e., the result of the task execution result is evaluated to obtain the target evaluation result, including: S601: When the task execution result is unable to output the initial answer, the target evaluation result is determined as evaluation fail; S602: When the task execution result is able to output the initial answer, the result is evaluated based on the initial answer and the user demand data to determine the target evaluation result.

[0062] As an example, in step S601, when the task execution result is unable to output the initial answer, the target evaluation result can be directly determined as evaluation fail, and prompt information needs to be output to prompt why the initial answer cannot be output, so as to repeat the task planning based on the target key information to determine the database query task and subsequent steps, i.e., to repeat S103-S105 based on the prompt information.

[0063] As an example, in step S602, when the task execution result is able to output the initial answer, the result needs to be evaluated based on the initial answer and the user demand data to evaluate whether the initial answer can accurately reply to the user question corresponding to the user demand, so as to obtain the target evaluation result. In this example, when the initial answer matches the user demand data, the target evaluation result thereof can be determined as evaluation pass, so as to determine the initial answer as the target answer; when the initial answer does not match the user demand data, the target evaluation result thereof can be determined as evaluation fail, and prompt information needs to be output to prompt why the initial answer does not match the user demand data, and repeat the task planning based on the target key information to determine the database query task and subsequent steps, i.e., repeat S103-S105.

[0064] In this embodiment, whether the initial answer matches the user demand data is analyzed according to whether the task execution result can be the initial answer, so that the determined target evaluation result can effectively reflect whether the task execution result meets the accuracy requirement, and helps to ensure the accuracy of the subsequently determined target answer.

[0065] In an embodiment, as shown in Figure 7 Step S602, i.e., performing result evaluation based on the initial answer and the user demand data to determine the target evaluation result, includes: S701: performing index evaluation based on the initial answer and the user demand data to determine an index evaluation result; S702: performing relevance evaluation based on the initial answer and the user demand data to determine a relevance evaluation result; S703: when the index evaluation result and the relevance evaluation result are both evaluation passed, determining that the target evaluation result is evaluation passed; S704: when at least one of the index evaluation result and the relevance evaluation result is evaluation failed, determining that the target evaluation result is evaluation failed.

[0066] As an example, in step S701, the device can perform index evaluation based on the initial answer and the user demand data to evaluate whether the number of indexes replied in the initial answer matches the number of indexes in the user demand data, and if the two numbers of indexes match, it is determined that the index evaluation result is evaluation passed; if the two numbers of indexes do not match, it is determined that the index evaluation result is evaluation failed. For example, the number of indexes can be the number of “indexes” corresponding to “date, vehicle model, application name, index” in the user demand data, and the indexes can be, but are not limited to, price, active user number and other indexes.

[0067] As an example, in step S702, the device can use a pre-trained relevance analysis model to perform relevance analysis on the initial answer and the user demand data to determine the relevance of the two; when the relevance of the two is greater than a preset threshold, it is determined that the relevance evaluation result is evaluation passed; when the relevance of the two is not greater than the preset threshold, it is determined that the relevance evaluation result is evaluation failed. For example, when the user demand data needs to understand the active user number of the XX vehicle model, and the initial answer is the usage time of the XX vehicle model navigation application, it can be determined that the relevance of the two is not greater than the preset threshold, and the relevance evaluation result of the two is evaluation failed.

[0068] As an example, in step S703, when the index evaluation result and the relevance evaluation result are both evaluation passed, the device can determine that the initial answer matches the user demand data from both the number of indexes and the content relevance, and therefore, it can be determined that the target evaluation result is evaluation passed. ​As an example, in step S704, if the device fails the evaluation in at least one of the indicator evaluation results and the relevance evaluation results, it can be determined that there is at least one mismatch in the two dimensions of indicator quantity and content relevance, and the target evaluation result can be determined as failing the evaluation.

[0069] In this embodiment, indicator evaluation and relevance evaluation are performed based on the analysis of initial answers and user demand data. The target evaluation result is determined according to the combination of indicator evaluation results and relevance evaluation results, which helps to ensure the accuracy of the target evaluation result.

[0070] In one example, the device plans tasks based on key target information, determines a database query task, executes the database query task, determines the task execution result, and analyzes the task execution result based on the second ReAct mode to determine the target answer corresponding to the user's requirement data. The specific processing steps include the following: Consideration 1: It is necessary to evaluate whether the requirements are met based on the user's questions and the task execution results; Action 1: **Evaluate task execution results ['December 2024 Haobo GT users' favorite applications and usage frequency', 'Error:XXX']** Observation 1: The task execution result error message Error:XXX does not meet the user's question, that is, the target evaluation result is that the evaluation is not passed, and a prompt message needs to be output; Reflection 2: If the task execution result does not meet the user's question, a second planning and execution is required. That is, the task planning based on the key information of the target is repeated, the database query task is determined, the database query task is executed, and the task execution result is determined. Action 2: **Re-plan and execute ['Task execution result error message: Error: XXX, cannot meet user's question']** Observation 2: QQ Music 17123455; Reflection 3: Conduct a secondary evaluation based on user questions and task execution results to assess whether the requirements are met; Action 3: **Evaluate Task Execution Results ['December 2024 Haobo GT Users' Favorite Apps and Usage Times', 'QQ Music 17123455']** Observation 3: In December 2024, the most popular application among Haobo GT users was QQ Music, with a total of 17,123,455 uses.

[0071] Thinking point 4: Generate the target answer; Action 4: **Completed ['In December 2024, the most popular app among Haobo GT users was QQ Music, with a total of 17,123,455 uses']** In this example, the task execution result and the user demand data are analyzed based on the second ReAct mode to effectively guarantee the accuracy of the target answer output from the result evaluation link, and further guarantee the accuracy of the subsequent data analysis task.

[0072] The embodiment of the present application further provides an A device 800, as shown in the figure, comprising: Figure 8 The user demand data acquisition module 801 is used for acquiring user demand data. The target key information determination module 802 is used for performing intention analysis on the user demand data based on a first ReAct mode, and determining target key information, wherein the first ReAct mode is a ReAct mode for key information extraction in an information extraction link. The query task determination module 803 is used for performing task planning based on the target key information, and determining a database query task. The task execution result determination module 804 is used for executing the database query task, and determining a task execution result. The target answer determination module 805 is used for performing accuracy analysis on the task execution result based on a second ReAct mode, and determining a target answer corresponding to the user demand data, wherein the second ReAct mode is a ReAct mode for result evaluation in a result evaluation link.

[0073] The embodiment of the present application further provides an electronic device 900, as shown in the figure, comprising a memory 901 and a processor 902, wherein the memory 901 is used for storing a computer program; and the processor 902 is used for executing the program stored in the memory 901, and realizing the data analysis method introduced in any embodiment of the present application. Figure 9

[0074] The embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the data analysis method introduced in any embodiment of the present application.

[0075] In the present application, multiple refers to two or more than two.

[0076] In the present application, unless otherwise explicitly limited, the terms "mounting", "connection" and "connection" should be understood in a broad sense, for example, it can be fixed connection, or detachable connection, or integrally connected; it can be mechanical connection, or electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or the communication between two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0077] ​​The terms "first", "second", "third", "fourth" and the like in the present application, if any, are used to distinguish similar objects, and do not necessarily indicate a particular order or sequence.

[0078] The term "and / or" in the present application is only used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in the present application generally represents an "or" relationship between the front and rear associated objects.

[0079] Unless otherwise specified, all steps in the present application can be performed in sequence or randomly. For example, the method comprises steps A and B, which means that the method can comprise steps A and B performed in sequence, or steps B and A performed in sequence. For example, the method can further comprise step C, which means that step C can be added to the method in any order, for example, the method can comprise steps A, B and C, or steps A, C and B, or steps C, A and B, etc.

[0080] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modifications, equivalent replacements and improvements made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A data analysis method, characterized by, The method comprises: obtaining user demand data; performing intent analysis on the user demand data based on a first ReAct mode to determine target key information, the first ReAct mode being a ReAct mode for key information extraction in an information extraction link; performing task planning based on the target key information to determine a database query task; executing the database query task to determine a task execution result; performing accuracy analysis on the task execution result based on a second ReAct mode to determine a target answer corresponding to the user demand data, the second ReAct mode being a ReAct mode for result evaluation in a result evaluation link.

2. The data analysis method of claim 1, wherein, The method comprises: rewriting the user demand data to determine rewritten target demand data; performing intent classification on the target demand data to determine a target intent corresponding to the target demand data; performing key information analysis on the target demand data corresponding to the target intent based on the first ReAct mode to determine target key information.

3. The data analysis method of claim 2, wherein, The method comprises: determining a plurality of necessary slots corresponding to the target intent based on the target intent; extracting slot information corresponding to the necessary slots from the target demand data; when all the necessary slots have extracted corresponding slot information, determining target key information corresponding to the target demand data based on the slot information corresponding to all the necessary slots; when there is at least one necessary slot that has not extracted corresponding slot information, forming an inquiry question based on the at least one necessary slot that has not extracted the slot information, and repeatedly performing the obtaining of the user demand data based on the inquiry question.

4. The data analysis method of claim 1, wherein, The method comprises: performing database retrieval recall based on the target key information to determine target field information and a target data table; performing structural processing on the target field information and the target data table to determine a database query task.

5. The data analysis method of claim 1, wherein, The method comprises: performing result evaluation on the task execution result to obtain a target evaluation result; when the target evaluation result is evaluation failure, outputting a prompt information and repeatedly performing the task planning based on the target key information to determine a database query task; when the target evaluation result is evaluation success, determining a target answer corresponding to the user demand data based on the task execution result.

6. The data analysis method of claim 5, wherein, The method comprises: when the task execution result is unable to output an initial answer, determining that the target evaluation result is evaluation failure. When the task execution result is capable of outputting the initial answer, result evaluation is performed based on the initial answer and the user demand data to determine a target evaluation result.

7. The data analysis method of claim 6, wherein, The result evaluation based on the initial answer and the user demand data to determine the target evaluation result comprises: index evaluation based on the initial answer and the user demand data to determine an index evaluation result; correlation evaluation based on the initial answer and the user demand data to determine a correlation evaluation result; When the index evaluation result and the correlation evaluation result are both evaluation passed, the target evaluation result is determined as evaluation passed; When at least one of the index evaluation result and the correlation evaluation result is evaluation not passed, the target evaluation result is determined as evaluation not passed.

8. A data analysis device, characterized by comprise: a user demand data acquisition module configured to acquire user demand data; a target key information determination module configured to perform intent analysis on the user demand data based on a first ReAct mode to determine target key information, the first ReAct mode being a ReAct mode for key information extraction in an information extraction link; a query task determination module configured to perform task planning based on the target key information to determine a database query task; a task execution result determination module configured to execute the database query task to determine a task execution result; a target answer determination module configured to perform accuracy analysis on the task execution result based on a second ReAct mode to determine a target answer corresponding to the user demand data, the second ReAct mode being a ReAct mode for result evaluation in a result evaluation link.

9. An electronic device, comprising: comprise a processor and a memory, wherein the memory is configured to store a computer program; the processor is configured to execute the program stored in the memory to implement the data analysis method of any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer program stored in the computer readable storage medium is executed by the processor to implement the data analysis method of any one of claims 1-7.

Citation Information

Patent Citations

  • Intelligent SQL query generation method and system based on large language model

    CN118861081A

  • Task execution method based on large language model and API gateway system

    CN119597504A

  • Intelligent question and answer processing method and device, electronic equipment, computer readable storage medium and computer program product

    CN119692449A