Intelligent agent-based data processing method and device, electronic equipment and storage medium
Through the first agent, the intent identification of the target problem and the determination of the target tool sequence is solved, and the problem of single model functions and insufficient flexibility in the prior art is solved, and efficient and automated data processing is achieved.
Patent Information
- Application Number
- CN202510082923.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art uses a single model to complete the functions of the entire intelligent agent, resulting in insufficient functions and lack of flexibility, making it difficult to effectively handle complex data analysis tasks.
The first agent performs intention identification of the target problem, determines the target intention of the target problem, and determines the target tool sequence from the preset tool set based on the target intention, and uses the target tool sequence to deal with the target problem.
It significantly improves the degree of automation of data processing, reduces manual intervention, improves the efficiency and flexibility of data processing, and can adapt to diverse data processing needs.
Smart Images

Figure CN119940552A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of data processing technology and artificial intelligence technology. Specifically, the present application relates to an agent-based data processing method, device, electronic device, computer-readable storage medium and product. Background Art
[0002] In the real world, the amount and scale of data are increasing day by day, and many companies generate massive amounts of information every day. Almost all companies are equipped with data analysts to conduct in-depth analysis of this data on a regular basis. There is a lot of valuable information hidden in the company's data, and mining the insights can provide an important impetus for the development of related products. However, data analysis tasks usually require a solid professional background and involve cumbersome manual processing processes, which are inefficient.
[0003] With the rapid development of large language models and agent technology, many intelligent applications have emerged. In the field of text-to-SQL conversion and table understanding, relevant research has made significant progress, making intelligent data analysis gradually possible. In the field of data analysis, applications based on intelligent agents have become the mainstream. However, existing research mainly focuses on using a single model to complete the functions of the entire intelligent agent, which has the problems of single function and insufficient flexibility. Summary of the invention
[0004] The embodiments of the present application provide a data processing method, device, electronic device, computer-readable storage medium and computer program product based on an intelligent agent, which can solve the problem that the existing technology uses a single model to complete the functions of the entire intelligent agent, has a single function and insufficient flexibility. The technical solution is as follows: According to a first aspect of an embodiment of the present application, there is provided an agent-based data processing method, the method comprising: Get the target questions of the target object; The first agent performs a problem processing operation, and provides a target answer obtained by the problem processing operation to the target object; The problem handling operation includes the following steps: Performing intent recognition on the target problem to determine the target intent of the target problem; According to the target intention, a target tool sequence corresponding to the target problem is determined from a preset tool set, wherein the tool set includes a plurality of tools, and the target tool sequence includes at least one target tool determined from the plurality of tools, and a calling order of each target tool in the at least one target tool; wherein each tool in the tool set is a second intelligent agent for executing a corresponding data processing task; Based on the execution order, each target tool in the target tool sequence is called to process the target problem to obtain a target answer to the target problem.
[0005] As an optional embodiment of the present application, the step of identifying the intent of the target question and determining the target intent of the target question includes: Performing semantic analysis on the target question to obtain a semantic analysis result; If it is determined that the target question is complete according to the semantic analysis result, the target question is input into the intent recognition model to obtain the target intent of the target question; If it is determined according to the semantic analysis result that the target question is incomplete, and indeed the target question is missing content items, content completion prompt information is displayed to the target object based on the missing content items to obtain the missing content items from the target object, and the target question is supplemented. The supplemented target question is input into the intent recognition model to obtain the target intent of the target question.
[0006] As an optional embodiment of the present application, the step of identifying the intent of the target question and determining the target intent of the target question includes: Performing intent recognition on the target question using multiple intent recognition models respectively, and obtaining candidate intents output by each of the multiple intent recognition models; The target intent is determined from the candidate intents output by each of the multiple intent recognition models based on the voting principle.
[0007] As an optional embodiment of the present application, determining, according to the target intent, a target tool sequence corresponding to the target problem from a preset tool set includes: Acquire an intention task table, wherein the intention task table stores a correspondence between each of a plurality of intentions and a subtask sequence corresponding to the intention, each subtask sequence includes at least one subtask, and a task execution order between the at least one subtask; According to the intention task table, determining the target subtask sequence corresponding to the target intention; Acquire a task tool table, wherein the task tool table records the correspondence between each subtask in the subtask set and the tool corresponding to the subtask; According to the task tool table, the target tool corresponding to each target subtask in the target subtask sequence is determined to obtain a target tool sequence corresponding to the target subtask sequence, wherein the calling order between the target tools in the target tool sequence corresponds to the task execution order between the target subtasks.
[0008] As an optional embodiment of the present application, if the target intent is not included in the intent task table, the target subtask sequence corresponding to the target intent is obtained in the following manner: Obtain a first instruction, where the first instruction is used to instruct the large language model to generate a subtask sequence corresponding to the intent; Based on the target intent and the first instruction, a target subtask sequence corresponding to the target intent is generated through the large language model.
[0009] As an optional embodiment of the present application, based on the calling order, calling each target tool in the target tool sequence to process the target problem to obtain a target answer to the target problem includes: Based on the calling sequence, calling each target tool to process the to-be-processed data of the corresponding target subtask, and obtaining the data processing results corresponding to each target subtask; wherein the to-be-processed data of each target subtask is determined based on the target problem; Based on the data processing results of each of the target subtasks, a target answer to the target question is obtained.
[0010] As an optional embodiment of the present application, the method further includes: According to the target problem, determining a first parameter corresponding to each target subtask in the target subtask sequence, wherein for each target subtask, the first parameter is used to indicate a method for obtaining to-be-processed data of a target tool corresponding to the target subtask; Wherein, for each of the target subtasks, the method for obtaining the to-be-processed data corresponding to the target subtask includes at least one of the following: Acquired according to the target problem; acquired from the data processing result of the predecessor tool, the predecessor tool including the target tool corresponding to at least one predecessor subtask of the target subtask in the target subtask sequence; The calling of each target tool in the target tool sequence to process the target problem based on the calling order includes: Based on the calling sequence and the first parameter corresponding to each of the target subtasks, each target tool is called to obtain the corresponding data to be processed based on the first parameter corresponding to each target tool, and the corresponding data to be processed is processed.
[0011] As an optional embodiment of the present application, for each of the target subtasks, before calling the corresponding target tool to process the respective input data, the method further includes: Obtaining a task result table, wherein the task result table stores a correspondence between a type of to-be-processed data and a corresponding data processing result of at least one subtask in the subtask set, wherein the data processing result of a type of to-be-processed data of a subtask is a data processing result obtained by processing the to-be-processed data through a tool of the subtask; If the task result table records the data processing result corresponding to the to-be-processed data of the target subtask, the data processing result recorded in the task result table is used as the data processing result corresponding to the target tool of the target subtask; If the task result table does not record the data processing result corresponding to the to-be-processed data of the target subtask, the target tool corresponding to the target subtask is called to process the to-be-processed data of the target subtask to obtain the corresponding data processing result.
[0012] As an optional embodiment of the present application, obtaining a target answer to a target question further includes: Obtaining an evaluation result of the target answer, wherein the evaluation result is used to indicate whether the target answer is correct; In the case that the target answer is incorrect, the target question and the target answer are taken as a group of error samples to optimize the first agent and each of the second agents according to the error samples.
[0013] As an optional embodiment of the present application, when the target subtask sequence includes a table finding task, the target tool corresponding to the table finding task is a table finding tool, and the data processing result corresponding to the table finding task is obtained by performing the following operations by the table finding tool: Extracting at least one entity element from the data to be processed of the table search task, and searching for a first candidate data table including at least one entity element from a plurality of data tables in a database; The correlation between the to-be-processed data corresponding to the table search task and each first candidate data table is judged by using a judgment model; Based on the judgment results corresponding to the first candidate data tables, each first candidate data table is screened to obtain a screened second candidate data table; Based on the association between the second candidate data table and the at least one entity element, a target data table is determined from the second candidate data table, and the target data table is used as a data processing result corresponding to the table search task.
[0014] As an optional embodiment of the present application, when the target subtask sequence includes a structured query language SQL error correction task, the target tool corresponding to the SQL error correction task is an SQL error correction tool, and the data processing result corresponding to the SQL error correction task is obtained by performing the following operations by the SQL error correction tool: Checking the grammatical structure of the data to be processed in the SQL error correction task to obtain a check result; Correct the to-be-processed data of the SQL error correction task according to the inspection result to obtain a first SQL statement after error correction; Execute the first SQL statement, and if error information is obtained during the execution process, determine the error in the first SQL statement according to the error information, and correct the error of the first SQL statement to obtain a target SQL statement; If no error message is obtained during the execution process, the first SQL statement is used as the target SQL statement; The target SQL statement is used as the data processing result corresponding to the SQL error correction task.
[0015] According to a second aspect of an embodiment of the present application, there is provided an agent-based data processing device, which is applied to a server and includes: An acquisition module is used to obtain the target problem of the target object; A question processing operation module, configured to perform a question processing operation through the first agent, and provide a target answer obtained by the question processing operation to the target object; The problem handling operation module includes: A target intention determination module is used to identify the intention of the target question and determine the target intention of the target question; A tool determination module, used to determine a target tool sequence corresponding to the target problem from a preset tool set according to the target intention, wherein the tool set includes a plurality of tools, and the target tool sequence includes at least one target tool determined from the plurality of tools and a calling order of each target tool in the at least one target tool; wherein each tool in the tool set is a second intelligent agent for executing a corresponding data processing task; The calling tool module is used to call each target tool in the target tool sequence based on the execution order to process the target problem and obtain the target answer to the target problem.
[0016] According to a third aspect of an embodiment of the present application, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory, and when the processor executes the program, the steps of the method provided in the first aspect are implemented.
[0017] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method provided in the first aspect are implemented.
[0018] According to the fifth aspect of the embodiment of the present application, a computer program product is provided, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. When a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the computer device executes the steps of implementing the method provided in the first aspect.
[0019] The beneficial effects of the technical solution provided by the embodiment of the present application are: By obtaining the target problem of the target object, and using the first agent to identify the intent of the target problem, clarifying the target intention of the target problem, the core needs of the target object can be accurately grasped; by presetting a plurality of second agents for performing data processing tasks, and using the second agent as a tool that the first agent can call, the most matching target tool sequence can be determined based on the target intention, and the target problem can be processed using the target tool sequence, which can significantly improve the automation of data processing, reduce manual intervention, and effectively improve the overall processing efficiency of the target problem; by using the agent as the execution tool of the data processing task, and calling one by one according to the calling order of the target tool, multiple target tools can be divided into work and cooperate, giving full play to their respective advantages to solve the target problem; each tool is a second agent specifically used to process a specific data task, so that the present application has a high degree of flexibility and scalability when dealing with different target problems, and can adapt to diverse data processing needs. The embodiment of the present application uses the collaborative work of multiple tools, and each tool is optimized for a specific task, avoiding the performance bottleneck of a single model, improving the overall performance and stability of the data processing process, and improving the efficiency when dealing with complex data processing problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0021] Figure 1 A schematic diagram of the architecture of an agent-based data processing system provided in an embodiment of the present application; Figure 2 An architecture diagram of a first intelligent agent provided in an embodiment of the present application; Figure 3 A flow chart of an agent-based data processing method provided in an embodiment of the present application; Figure 4A flowchart of a problem handling operation provided in an embodiment of the present application; Figure 5 A corresponding relationship diagram between capabilities and tools provided by an atomic function module provided in an embodiment of the present application; Figure 6 A schematic diagram of a module of a first intelligent agent provided in an embodiment of the present application; Figure 7 A schematic diagram of a visualization interface for intent recognition provided in an embodiment of the present application; Figure 8 A schematic diagram of determining target intent based on majority voting provided in an embodiment of the present application; Fig. 9 A schematic diagram of an intention task table is provided for an embodiment of the present application; Fig.10 A functional schematic diagram of a memory module provided in an embodiment of the present application; Fig.11 A schematic diagram of another agent-based data processing flow provided in an embodiment of the present application; Fig.12 A flowchart of an execution problem operation provided in an embodiment of the present application; Fig.13 An architectural diagram of another first intelligent agent provided in an embodiment of the present application; Fig.14 A schematic diagram of a module of a first intelligent agent provided in an embodiment of the present application; Fig.15 A schematic diagram of the structure of an agent-based data processing device provided in an embodiment of the present application; Fig.16 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0023] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B".
[0024] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0025] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0026] First, several terms involved in this application are introduced and explained: Artificial Intelligence (AI) is an important driving force for a new round of scientific and technological revolution and industrial transformation. It is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. Artificial Intelligence is an important part of the intelligent discipline. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial Intelligence is a very broad science, including robots, speech recognition, image recognition, natural language processing, expert systems, machine learning, computer vision, etc.
[0027] Large Language Model (LLM), also known as large language model or large model, is an artificial intelligence model designed to understand and generate human language. They are trained on large amounts of text data and can perform a wide range of tasks, including text summarization, translation, sentiment analysis, and more. Large language models are characterized by their large size and contain billions of parameters, which help them learn complex patterns in language data.
[0028] An agent is an agent that can perceive the environment and take actions to achieve specific goals. It can be software, hardware or a system with autonomy, adaptability and interaction. The agent perceives changes in the environment, makes judgments and decisions based on the knowledge and algorithms it has learned, and then performs actions to affect the environment or achieve predetermined goals. Agents are widely used in the field of artificial intelligence and are commonly seen in automated systems, robots, virtual assistants and game characters. The core of agents is the ability to learn autonomously and continuously evolve to better complete tasks and adapt to complex environments.
[0029] Structured Query Language (SQL) is a database language with multiple functions such as data manipulation and data definition. This language is interactive and can provide great convenience for users. Database management systems should make full use of SQL to improve the work quality and efficiency of computer application systems. SQL can not only be used independently in terminals, but also as a sub-language to provide effective assistance for other program designs. In this program application, SQL can optimize program functions together with other program languages, thereby providing users with more comprehensive information.
[0030] Bidirectional Encoder Representations from Transformers (BERT) is a pre-trained language representation model based on the Transformer architecture, which aims to improve the performance of natural language processing (NLP) tasks through deep learning technology. The main feature of BERT is its bidirectional encoding capability, that is, when processing text, the model considers not only the contextual information of the previous text, but also the contextual information of the following text, so as to understand the sentence more comprehensively.
[0031] In the field of data analysis, the application of intelligent agents has become a mainstream approach. However, most current research focuses on using a single model to support the implementation of the entire agent (such as data agent data-copilot). This code-centric data analysis product that relies entirely on a single model has many problems: low accuracy, difficulty in implementation, and the generated SQL code often has many problems, such as hallucinations and inability to run, etc., and it is difficult to intervene manually, resulting in a high probability of error, making it difficult to effectively apply in actual scenarios.
[0032] In order to overcome these challenges, the agent-based data processing method, device, electronic device, computer-readable storage medium and computer program product provided in this application are intended to solve the above technical problems of the prior art.
[0033] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0034] Figure 1 The following is a schematic diagram of the architecture of an agent-based data processing system provided in an embodiment of the present application. The agent-based data processing system includes a terminal device 10 and a server 20. The terminal device can be any device that runs a question-and-answer application or question-and-answer software. The terminal device can be a user's mobile phone or a computer. The terminal device 10 can establish a communication connection with the server 20 of the question-and-answer application or question-and-answer software in a wired or wireless manner, and the user can use various services provided by the question-and-answer application based on the user interface of the question-and-answer application displayed on the user terminal 10.
[0035] The user can input the target question through the user interface of the application on the terminal 10, and the terminal 10 sends the target question to the server 20. The server 20 is deployed with a first agent and multiple tools. The first agent can call the multiple tools, and each tool is a second agent for data processing tasks. The first agent can perform intent recognition on the target question, determine the target intent of the target question, and can determine the target tool sequence for processing the target question according to the target intent, and call each target tool to process the target question according to the target tool sequence, obtain the target answer of the target question, and send the target answer to the terminal device 10, and the terminal device 10 displays the target answer to the user.
[0036] like Figure 2 As shown, Figure 2An architecture diagram of a first intelligent agent provided for an embodiment of the present application. It can be seen from the figure that the first intelligent agent may include a three-layer architecture, namely, an atomic function layer, an application layer, and a public service layer. Each layer contains different functional modules, which work together to realize the complete functions of the intelligent agent. Among them, the atomic function layer contains the basic operating functions of the intelligent agent, which can be regarded as the basis for building more complex functions. Specific functions include the business table search function, which is used to find a specific business data table in the database; the SQL generation function, which automatically generates SQL query statements to retrieve data from the database; the SQL execution function, which executes the generated SQL statements to obtain data from the database; the data visualization function, which displays the data in charts or other visual forms for easy understanding and analysis; the data interpretation function, which analyzes and interprets the data to provide insights and conclusions.
[0037] The application layer is based on the atomic function layer and is the user-oriented application side. Each application can correspond to at least one intelligent agent in the atomic function layer. Figure 2 In the figure, an example of one application corresponding to one agent is used for explanation. When each application processes the target problem based on the corresponding agent, it can obtain the capability or service of the first agent from the functional service layer. For example, the table lookup business table application can apply for large model services, NLG capabilities and recall capabilities from the functional service layer to improve the efficiency of the table lookup business table application in processing the target problem based on the table lookup business table agent. Different applications can obtain different services from the functional service layer according to actual needs.
[0038] The public service layer provides public services for intelligent entities, which can be selected by applications in the application layer. The functions of the public service layer include: RAG capability; large model service; NLG capability; recall capability: the ability to quickly retrieve relevant information from a large amount of data; SQL parsing capability: parsing SQL statements to ensure their correctness and optimized execution; SQL formatting capability: formatting SQL statements to improve readability and maintainability.
[0039] Through the collaborative work of these levels and functional modules, the entire architecture achieves comprehensive coverage from basic data processing to advanced application functions and then to public services, providing intelligent entities with powerful data processing and application capabilities.
[0040] Among them, the server 20 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal 20 (also referred to as a user terminal or user device) can be a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent voice interaction device (such as a smart speaker), a wearable electronic device (such as a smart watch), a car terminal, a smart home appliance (such as a smart TV), an AR / VR device, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this disclosure.
[0041] The agent-based data processing method provided in the embodiment of the present application can be implemented as an independent application or a functional module / plug-in of an application. For example, the application can be an application with data processing functions, and the application can provide data processing results for users or other programs. That is, the target object in the embodiment of the present application can be a user or some applications that need to do data processing, and the data processing requirements of the application can be used as the target problem.
[0042] For example, the method provided in the embodiment of the present application can be developed as an independent intelligent data processing application. The user can use the application directly, by inputting the target question (such as "what is the sales trend of a certain product in the past year"), the application will work together through the intelligent body to process the relevant data and return a clear sales trend report. The method provided in the embodiment of the present application can also be used as a functional module or plug-in of an existing application, for example, embedded in an enterprise management system. When the business personnel of the enterprise ask questions in the system (such as "what are the goods that are out of stock"), the plug-in will return a list of goods that are out of stock by analyzing the relevant data tables and calling specific tools. The method provided in the embodiment of the present application can also be used as a data processing intelligent body to provide support for other applications. A chart generation tool needs to generate dynamic charts based on specific data. The tool can call the data processing intelligent body, input the target question (such as "generate a user activity change chart for the past week"), and the data processing intelligent body processes the relevant data according to the target question and provides the processing results to the chart generation tool, and the tool generates the final chart.
[0043] It should be noted that in the optional embodiments of the present application, the data related to the object (such as the user) involved, when the embodiments of the present application are applied to specific products or technologies, need to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present application involve data related to the object, these data need to be obtained with the authorization and consent of the object and in compliance with the relevant laws, regulations and standards of the country and region.
[0044] The present application provides an agent-based data processing method, such as Figure 3 As shown, the method includes S201-S202.
[0045] S201, obtaining the target problem of the target object.
[0046] In an embodiment of the present application, the target problem of the target object can be obtained through a server deployed with a first intelligent agent. The target object can be a user or other application that requires data processing results. The target problem is a specific requirement or task description raised by the target object, such as querying a certain data indicator, performing a specific data analysis operation, etc. In the case where the target object is a user, the server can extract the target problem from the user's input. For example, the user inputs "What is the total sales volume last quarter", and the server uses this question as the target problem and performs subsequent processing. Among them, the server can obtain the target problem input by the user through a terminal device that interacts with the user.
[0047] When the target object is other applications, the server can receive API requests or task instructions (such as "analyze user access trends") initiated by other programs and parse this demand into a target problem.
[0048] Therefore, no matter the target question is a natural language question from the user or a task request from other programs, the server can obtain it flexibly, laying the foundation for the subsequent intention recognition and tool calling of the target question. S202: The first agent performs a question processing operation, and provides the target answer obtained by the question processing operation to the target object.
[0049] In the embodiment of the present application, the first agent can be a generative model for the data processing field, and the first agent can integrate multiple machine learning technologies to perform problem processing operations on the target problem. The first agent is a multifunctional data multi-agent, which is used to search data tables, explore data, analyze data, and support a series of SQL-related tasks, such as text to SQL, SQL insight, SQL error correction and optimization, etc.
[0050] Among them, the first intelligent agent may include a control module, which serves as the command center of the first intelligent agent and is responsible for coordinating, assembling and choreographing other modules in the first intelligent agent. Other modules may be an intention recognition module and a planning module. In the problem handling operation, the intention recognition module is used to identify the intention of the target problem, and the planning module is used to formulate a series of execution plans for the target problem based on the intention recognition results. The control module can call a variety of tools according to the execution plan to obtain the target answer to the target problem and provide the target answer to the target object. Among them, the target answer can be a direct value, a combined data set or a structured result, or a visual data analysis chart.
[0051] As an optional embodiment, the first agent can be implemented as a device with data processing capabilities, and the target object can directly interact with the first agent, input target questions to the first agent through the input interface of the first agent, and obtain the target answer output by the first agent.
[0052] Specifically, Figure 4 As shown, Figure 4 A flowchart of a problem handling operation provided in an embodiment of the present application is provided, wherein the first agent performs the problem handling operation including steps S301-S303.
[0053] S301, identify the intention of the target question and determine the target intention of the target question.
[0054] In the embodiment of the present application, the target question may be a task-based query or a task-based request, and the intent of the target question is identified to determine the task type corresponding to the target question. The task type may include but is not limited to business indicator analysis tasks, data screening tasks, predictive analysis tasks, data insight tasks, and SQL generation tasks.
[0055] Among them, the business indicator analysis task is used to extract and analyze key indicators from business data; the data screening task is to filter out some data that meets the requirements by setting specific conditions, thereby narrowing the scope of analysis; the predictive analysis task is based on historical data and statistical models to predict future trends, behaviors or results, helping users make forward-looking decisions; the data insight task aims to discover potential patterns, trends, correlations or anomalies through in-depth analysis of data to obtain valuable business insights; the SQL generation task is a task that automatically or semi-automatically generates structured query language (SQL) statements, which are usually used to obtain, modify or analyze data from a database.
[0056] In an embodiment of the present application, the first intelligent agent can analyze and classify the target problem through natural language processing (NLP) to identify the task type of the target problem. The first intelligent agent can parse the semantics and structure of the target problem through NLP to obtain the target intent of the target problem.
[0057] As an optional embodiment, the first agent may also include a memory module, which can be used to store and manage the information obtained by the first agent during the interaction process, supporting long-term knowledge accumulation and multiple rounds of interaction. In the memory module, the mapping relationship between different entities can be recorded through the knowledge graph. The first agent can parse the target problem through NLP to obtain the entities in the target problem, determine the mapping relationship between the entities in the target problem in the knowledge graph, and thus determine the target intent of the target problem. Through the automated intent recognition process, human intervention and misjudgment can be reduced, and a more accurate target intent can be obtained.
[0058] In the embodiment of the present application, the first agent identifies the intention of the target problem and determines the target intention of the target problem, which can clearly identify the core needs of the target object to raise the problem and accurately determine the type of task. Through clear intention identification, appropriate tools and methods are selected to handle the target problem according to the specific task type, thereby improving the accuracy and efficiency of handling the target problem.
[0059] S302: Determine a target tool sequence corresponding to the target problem from a preset tool set according to the target intent.
[0060] Among them, the tool set includes multiple tools, the target tool sequence includes at least one target tool determined from the multiple tools, and the calling order of each target tool in the at least one target tool; wherein each tool in the tool set is a second intelligent entity for executing its corresponding data processing task, and each tool is designed for a specific type of task.
[0061] In the embodiment of the present application, each tool in the tool set is a second agent with at least one atomic capability. Atomic capability can be understood as a basic, minimum-granularity functional unit. Atomic capability is the basic tool for agents to complete tasks. Agents use these capabilities to solve more complex tasks through scheduling and combination. Each second agent in the tool set can be used alone, or can be combined or arranged to complete more complex tasks.
[0062] In the embodiment of the present application, the first agent may further include an atomic function module, which is used to provide multiple atomic capabilities. The module may provide atomic capabilities by deploying a tool set, or the module may call each tool in the tool set through an API interface to provide atomic capabilities. Therefore, in the embodiment of the present application, the tool set may be deployed as an atomic function module on the first agent, or the tool set may be called by the atomic function module, in which case the tool set is independent of the first agent. Figure 5 As shown, Figure 5 A corresponding relationship diagram between capabilities and tools provided by an atomic function module provided in an embodiment of the present application. As can be seen from the figure, each tool has its corresponding capability, which can be composed of the capabilities of each sub-tool of the tool, and each tool is an intelligent entity. The capabilities in the atomic function module can be formulated according to actual business needs, and new capabilities can be flexibly expanded. After the capabilities are determined, corresponding tools can be formulated according to the capabilities, and each tool is an intelligent entity. For each tool, the tool can include multiple sub-tools or call multiple sub-tools. The sub-tools can be machine learning modules, large language modules, and some written code scripts, etc.
[0063] In the embodiment of the present application, the first agent can select a tool suitable for executing the target intent from the tool set according to the target intent, and determine the execution order for it. For example, when the target intent is a data screening task, the "data screening tool" may be used to filter the data first, and then the "data analysis tool" may be used to further process the filtered data.
[0064] Specifically, the planning module in the first intelligent agent can have language understanding capabilities. For example, the planning module can be implemented based on a large language model. Instructions can be preset in the large language model to instruct the large language model to output an execution plan for any input data and to determine a target tool sequence based on the execution plan. Through the preset instructions, the large language model is used to determine the execution plan field, thereby determining the target tool sequence corresponding to the target problem from a preset tool set.
[0065] The embodiment of the present application can effectively reduce the reliance on manual intervention by determining the target tool sequence corresponding to the target problem from a preset tool set according to the target intent, realize a high degree of automation of task planning and execution, and improve the overall data processing efficiency. When facing complex, multi-stage problems, by calling each tool in the target tool sequence in stages, the capabilities provided by each tool can be fully utilized, and the ability to handle complex data processing tasks can be improved.
[0066] S303: Based on the calling order of each target tool, call each target tool in the target tool sequence to process the target problem and obtain a target answer to the target problem.
[0067] In the embodiment of the present application, the first agent sequentially calls each target tool to process the target problem according to the obtained target tool sequence. For each target tool, when processing, the target tool can semantically understand the target problem according to its own capabilities, and can also semantically understand the output data of the predecessor tool of the target tool to obtain the input data required by the tool, and process the input data based on the atomic capabilities corresponding to the tool.
[0068] In an embodiment of the present application, the target answer may be the output data of the last target tool called, or it may be obtained by combining the output data of multiple target tools. It is understandable that in some cases, the processing flow of the target problem may only require the last tool called to get the answer, and the "target answer" is the output data of the last tool. For example, assuming that the target problem is "to calculate the annual total sales of employees of a certain company", the target tool sequence can be a data cleaning tool, a data conversion tool, and a statistical analysis tool, wherein the data cleaning tool is used to clean invalid values in the data, the data conversion tool is used to convert the sales field into a standard format, and the statistical analysis tool is used to sum the sales to obtain the total. In this case, the sum data output by the last tool, i.e., the statistical analysis tool, is the target answer. At this time, the target answer is directly given only by the processing result of the last target tool.
[0069] In other cases, the answer to the target problem requires the output data of multiple target tools to be merged or processed. Each target tool completes a part of the problem processing, and the final target answer is the combination of these output data or the result of further processing. For example, assuming that the target problem is "generate personalized recommendations based on user behavior data", the tool sequence can be: data preprocessing tool, user preference analysis tool and recommendation generation tool. The data preprocessing tool is used to clean and organize data, the user preference analysis tool is used to analyze the user's historical behavior and generate preference data, and the recommendation generation tool is used to generate a recommendation list based on the user's preference data and the product database. In this case, each tool outputs a part of information: the data preprocessing tool outputs the organized data; the user preference analysis tool outputs the user preference information; the recommendation generation tool outputs a personalized recommendation list. The target answer may be to combine the output data of all tools (such as user preference information and recommendation list) to form the final personalized recommendation result.
[0070] like Figure 6 As shown, Figure 6A module schematic diagram of a first intelligent agent provided for an embodiment of the present application. As can be seen from the figure, the first intelligent agent may include a control module, an intention recognition module, a planning module, a memory module and an atomic function module, wherein the control module is used to command other modules, the intention recognition module is used to perform intention recognition on the target problem of the target object, the planning module is used to determine the target tool sequence according to the target intention, the control module can call each target tool in the atomic function module according to the target tool sequence, and the memory module can be based on the retrieval augmented generation (RAG) technology and data storage technology, and is used to store and retrieve data for other modules. Among them, the control module, the intention recognition module, the planning module, and the memory module can be used as the outer module of the first intelligent agent, and the atomic function module can be used as the inner module of the first intelligent agent. Each intelligent agent in the inner module can be customized according to actual needs, and can flexibly expand the intelligent agent that provides atomic capabilities, and the intelligent agent architecture can achieve rapid cross-domain reuse.
[0071] The embodiment of the present application, by obtaining the target problem of the target object, and using the first agent to identify the intention of the target problem, clarifying the target intention of the target problem, can accurately grasp the core needs of the target object; by presetting a plurality of second agents for performing data processing tasks, and using the second agent as a tool that the first agent can call, it is possible to determine the most matching target tool sequence based on the target intention, and use the target tool sequence to process the target problem, which can significantly improve the automation of data processing, reduce manual intervention, and effectively improve the overall processing efficiency of the target problem; by using the agent as the execution tool of the data processing task, and calling it one by one according to the calling sequence of the target tool, multiple target tools can be divided into work and cooperate, give full play to their respective advantages to solve the target problem; each tool is a second agent specifically used to process a specific data task, so that the present application has a high degree of flexibility and scalability when dealing with different target problems, and can adapt to diversified data processing needs. The embodiment of the present application works through the collaborative work of multiple tools, and each tool is optimized for a specific task, avoiding the performance bottleneck of a single model, and improving the overall performance and stability of the data processing process through a multi-stage and clear division of labor processing method, and also showing higher efficiency and reliability when dealing with complex data processing problems.
[0072] As an optional embodiment of the present application, performing intent recognition on the target question to determine the target intent of the target question includes: Perform semantic analysis on the target question to obtain semantic analysis results; If the target question is determined to be complete according to the semantic analysis result, the target question is input into the intent recognition model to obtain the target intent of the target question; If it is determined based on the semantic analysis result that the target question is incomplete, and indeed the target question is missing content items, content completion prompt information is displayed to the target object based on the missing content items to obtain the missing content items from the target object, supplement the target question, and input the supplemented target question into the intent recognition model to obtain the target intent of the target question.
[0073] In an embodiment of the present application, in some scenarios, the semantics of the target question provided by the target object may not be clear. The target question provided by the target object is "How many daily active users are there in the past 7 days?". Although it can be seen that the intention of the target question is business data analysis, subsequent processing cannot be performed due to the lack of an analysis object for business data analysis.
[0074] In order to solve the problem of unclear semantics of the target question provided by the target user, in an embodiment of the present application, the first intelligent agent performs semantic analysis on the target question when performing intent recognition to obtain a semantic analysis result, and determines whether it is necessary to display incomplete content prompt information to the target object based on whether the semantic analysis result is complete.
[0075] Among them, the semantic analysis result of a complete target problem is to enable the first intelligent agent to clearly understand the actual needs of the user. Generally, in the field of data processing, the semantic analysis result of a complete target problem includes at least a processing object and a task type.
[0076] In an embodiment of the present application, the first agent performs semantic analysis on the target question, and after obtaining the semantic analysis result, if the semantic analysis result indicates that the semantics of the target question are complete, the target question is input into the intent recognition model to obtain the target intent of the target question; if the semantic information analysis result indicates that the semantics of the target question are incomplete, the first agent determines the missing content items of the target question from the semantic analysis result, for example, it is determined that the processing object or task type is missing in the target question, and after determining the missing content items, the content completion prompt information is displayed to the target object. The content completion prompt information can be sent to the target object via a server, or the server can display it to the target object via a terminal.
[0077] The target object receives the content completion prompt information, and can clarify that the semantics of the target question it has raised is unclear, and supplement the missing content. After the first intelligent agent obtains the target question supplemented by the target object, it can perform semantic analysis on the supplemented target question. If the semantic analysis result of the supplemented target question determines that the target question is semantically complete, the supplemented target question is input into the intent recognition model to obtain the target intent of the target question. Among them, when the target object is completing, it can only provide the missing content items, and obtain the supplemented target question based on the context understanding ability of the first intelligent agent.
[0078] As an optional embodiment, when the first agent performs semantic analysis on the target question, it can combine the context information input by the target object to perform semantic analysis on the target question to determine whether the semantic information of the target question is accurate. The first agent can perform intent recognition on the target question through an intent recognition module, and the intent recognition module can include a multi-round dialogue module for understanding the dialogue history, summarizing the needs of the target object, and expressing the multi-round dialogue as a comprehensive question. When the semantics of the target question is incomplete, the semantics of the comprehensive question can be combined to try to obtain the complete semantics of the target question.
[0079] In the embodiment of the present application, the intention recognition module in the first agent also includes an intention recognition model, which can be a trained classification model. Various problems related to data processing can be used as training samples, and the intentions corresponding to the various problems can be used as labels to train the classification model to obtain the intention recognition model.
[0080] like Figure 7 As shown, Figure 7 A schematic diagram of a visualization interface for intent recognition provided in an embodiment of the present application. The dashed box shows the thinking process of the first agent. When the target question sent by the target object is "What is the number of daily active users in the past 7 days?", the first agent can send the target question to the intent recognition model and the semantic analysis model respectively, and obtain the intent recognition result (i.e., the task type identification in the figure) according to the intent recognition model, and obtain the intent of the target question as business data analysis. According to the semantic analysis model, the semantics of the target question is incomplete, and user intent clarification (object intent clarification) needs to be performed: determine that the missing content item is a missing business, which needs to be returned to the user for supplementation.
[0081] The first intelligent agent can send an incomplete prompt message to the user through a visual interface, "Please clarify which platform or application's daily active user (DAU) number you need to obtain", and the user returns the missing item "A video application". The first intelligent agent can combine the context information to determine that the target question to be completed is "What is the number of daily active users of A video application in the past 7 days?", and then send the completed target question to the intent recognition model and the semantic analysis model, and obtain the intent of the target question as business data analysis, and the semantics are complete, without the need for clarification.
[0082] The first intelligent agent can also provide a task correction function. By combining the semantic analysis results of the target problem with the task type identification, it can perform a step-by-step analysis of the intent of the target problem as a business indicator, thereby obtaining a more accurate target intent for the target problem. This is beneficial for the subsequent determination of the target tool. If there are multiple tools with similar functions, a tool that is more suitable for handling the target problem can be selected from the multiple tools with similar functions.
[0083] In the embodiment of the present application, the completeness of the target question is determined through semantic analysis, and when the question is complete, it is directly input into the intent recognition model for processing, which helps to reduce redundant operations and improve the accuracy and efficiency of target intent recognition. For incomplete target questions, the system can automatically identify missing content and prompt the user to complete it. Through the content completion prompt information, the user can clearly understand the missing items and efficiently supplement the required information, reduce the possibility of repeated attempts or incorrect input, and improve the user experience. And in the case of incomplete questions, direct processing may lead to incorrect intent recognition or invalid results. By supplementing the missing content and then processing it, the ineffective use of resources can be avoided, while ensuring the accuracy of subsequent processing. The content completion prompt information allows the user to dynamically adjust the input content based on feedback, supports multiple rounds of interaction, enhances the interactivity with the user, and makes the target intent recognition in complex scenarios more accurate.
[0084] As an optional embodiment of the present application, performing intent recognition on the target question to determine the target intent of the target question includes: Performing intent recognition on the target question through multiple intent recognition models respectively, and obtaining candidate intents output by each of the multiple intent recognition models; The target intent is determined from the candidate intents output by each of the multiple intent recognition models based on the voting principle.
[0085] In an embodiment of the present application, the intent recognition module may further include an intent classification module, the core task of which is to accurately determine the target intent. The intent classification module is designed through an integrated strategy based on voting. Among them, the intent recognition model can be a classification model such as a decision tree, a support vector machine, or a deep neural network.
[0086] Among them, the voting-based integration strategy determines the candidate intents of the target question based on multiple intent recognition models. The integration strategy weights or counts the candidate intents output by each intent recognition model through a voting mechanism. The target intent can be determined by a simple majority voting method (i.e., selecting the intent with the most votes) or a weighted voting method (assigning different weights according to the accuracy or confidence of the model).
[0087] like Figure 8 As shown, Figure 8 A schematic diagram of determining the target intent based on majority voting provided in an embodiment of the present application. The target question is identified by multiple intent recognition models to obtain the recognition result of each intent recognition model. The intent corresponding to each intent recognition model is marked in the intent set, and the intent with the most marking times is used as the target intent of the target question. If a tie occurs, the results are sorted according to the confidence of the intent recognition model.
[0088] The voting mechanism can effectively reduce the errors that may be caused by a single model and improve the accuracy of intent recognition.
[0089] As an optional embodiment, each intention recognition model can be based on the ranking results of each intention as the target intention, or the ranking results of a preset number of intentions with the greatest probability of being the target intention, and the target intent can be determined from the various intentions based on the ranking results output by each intention recognition model.
[0090] As an optional embodiment, the intent recognition model in this application may include a retrieval-based classification model, a BERT-based classification model, and a large language model-based classification model. These three models can be fine-tuned and optimized through the following steps so that they can output more accurate intent recognition results: First, preset multiple intent labels, create core samples for each label, and expand these core samples through the large language model. The core samples can be artificially generated cold start samples, or cold start samples generated by some existing large language models. Through the expanded samples and the intent labels corresponding to each sample, build the corresponding retrieval library to implement the retrieval-based classification model; train the BERT-based classification model through the expanded samples and the intent labels corresponding to each sample to achieve fine-tuning training of the BERT-based classification model; guide the optimization of the classification model based on the large language model through the expanded samples and the intent labels corresponding to each sample, or optimize the large language model only through the core samples and the intent labels of the core samples.
[0091] Furthermore, in the actual application of the agent-based data processing system provided in the embodiment of the present application, query data of each object (such as a user) can be continuously acquired, a retrieval library can be constructed based on these data, and a BERT-based classification model and a large language model-based model can be optimized.
[0092] Among them, the retrieval-based classification model can enhance the controllability of intent recognition and ensure the consistency of the intent generated when dealing with similar problems. The BERT-based classification model performs well on data sets in specific fields, but its generalization ability is relatively limited. The large language model has strong generalization ability, but may have some shortcomings when dealing with queries involving professional knowledge. The embodiment of the present application introduces a voting mechanism to enable multiple intent recognition models to complement each other and improve the accuracy and adaptability of intent recognition.
[0093] As an optional embodiment of the present application, according to the target intent, determining a target tool sequence corresponding to the target problem from a preset tool set includes: Acquire an intention task table, in which the intention task table stores a correspondence between each of a plurality of intentions and a subtask sequence corresponding to the intention, each subtask sequence includes at least one subtask, and a task execution order between the at least one subtask; According to the intention task table, determine the target subtask sequence corresponding to the target intention; Obtaining a task tool table, wherein the task tool table records the correspondence between each subtask in the subtask set and the tool corresponding to the subtask; According to the task tool table, the target tool corresponding to each target subtask in the target subtask sequence is determined to obtain a target tool sequence corresponding to the target subtask sequence, wherein the calling order between the target tools in the target tool sequence corresponds to the task execution order between the target subtasks.
[0094] In an embodiment of the present application, after the first intelligent agent determines the target intent of the target problem, it can analyze the capabilities required to achieve the target intent, and determine the target tool sequence corresponding to the target intent based on the capabilities required for the target intent. The target tool sequence includes tool representations of each target tool for processing the target problem, as well as the calling order of each target tool.
[0095] In an embodiment of the present application, when analyzing the capabilities required to achieve the target intent, the target intent can be disassembled to determine the target subtask sequence corresponding to the target intent. By analyzing the capabilities required for each target subtask in the target subtask sequence, the target tool corresponding to each target subtask is determined, thereby determining the target tool sequence based on the target subtask sequence.
[0096] When the first agent decomposes the target intention and determines the target subtask sequence corresponding to the target intention, it can obtain the intention task table, which stores the mapping relationship between multiple intentions and corresponding subtask sequences. Fig. 9 As shown, Fig. 9 A schematic diagram of an intention task table is provided for an embodiment of the present application. It can be seen from the figure that different intentions correspond to different subtasks, and the execution order between the subtasks is also different, that is, the intention task table records the correspondence between different intentions and the corresponding subtask sequences. Figure 1 , each subtask may be executed in sequence, Figure 2 , subtask a and subtask d can be executed in parallel. Corresponding to subtask c, the subsequent tasks of this subtask can include subtask d and subtask c.
[0097] Among them, the intention task table can be pre-set, and the intention task table can include subtask sequences corresponding to all intentions, and can also obtain intentions whose frequency of occurrence exceeds a preset threshold in actual application. Such intentions have a high frequency of occurrence, so subtask sequences can be set as templates for intentions with a high frequency of occurrence. When the target intention is an intention with a high frequency of occurrence, the first agent can directly obtain the template corresponding to the target intention, thereby determining the target subtask sequence.
[0098] The first agent in the embodiment of the present application integrates the task planning model of global and local planning. There are challenges in using LLM to implement global planning, such as unclear capability boundaries of the tool and challenges in understanding limitations. In order to improve the accuracy, stability and usability of global planning, task experts in specific fields can manually predefine task groups, i.e., sub-task sequence templates, to achieve global planning; then these tasks are assigned based on the LLM in the planning module, and each task group is linked to a specific intent to achieve local planning for a specific intent. This method enables the first agent to effectively utilize the functions of LLM in a more controllable environment.
[0099] In an embodiment of the present application, the planning module in the first intelligent agent can be used to obtain the target subtask sequence. The planning module can be implemented based on a large language model. The mapping relationship between multiple intentions and the subtask sequences of each intention in the multiple intentions can be used as an intention task table. The intention task table can be embedded in the large language model in the form of instructions, or the intention task table can be stored in the memory module of the large language model. The planning module can obtain the intention task table by interacting with the memory module.
[0100] In an embodiment of the present application, for the target intent, after the target intent is disassembled, the target subtask sequence corresponding to the target intent is determined, and the atomic capabilities required for each target subtask can be analyzed separately to determine the target tool corresponding to each target subtask. The task execution order of the target subtask can be used as the calling order of the corresponding multiple target tools to obtain the target tool sequence.
[0101] In the embodiment of the present application, when the first agent determines the target tool according to the capability required by the target subtask, it can obtain a task tool table, which is a correspondence between pre-set subtasks and target tools. Similar to the intention task table, the task tool table can be embedded in the large language model in the form of instructions, or stored in the memory module of the large language model, and the planning module can obtain the task tool table by interacting with the memory module.
[0102] The embodiments of the present application, by presetting the intention task table and the task tool table, enable the first intelligent agent to quickly match the target subtask sequence and the target tool sequence corresponding to the target intent after determining the target intent, which can effectively reduce the manual intervention in the processing of complex tasks, and can also dynamically select the most suitable tools and execution order according to the task requirements, thereby improving the efficiency of obtaining the target answer and helping to enhance the user experience.
[0103] As an optional embodiment of the present application, if the target intent is not included in the intent task table, the target subtask sequence corresponding to the target intent is obtained in the following manner: Obtain a first instruction, where the first instruction is used to instruct the large language model to generate a subtask sequence corresponding to the intent; Based on the target intent and the first instruction, a target subtask sequence corresponding to the target intent is generated through a large language model.
[0104] In an embodiment of the present application, if the target intention is not included in the intention task table, the first agent can obtain a preset first instruction and instruct the large language model in the planning module to generate a sub-task sequence corresponding to the intention through the first instruction.
[0105] Among them, for some target intentions with lower frequency of occurrence, the target intention may not be included in the intention task table, then the first agent can generate a subtask sequence corresponding to the intention through the large language model in the planning module. Among them, the first instruction can be stored in the memory module, and the control module of the first agent can obtain the first instruction, input the first instruction and the target intention into the large language model, so that the large language model outputs the target subtask sequence corresponding to the target intention. As an optional embodiment, the first instruction can be pre-embedded into the large language model of the planning module. At this time, the large language model is a large language model for a specific field, and the target value subtask sequence can be directly determined according to the input target intention, thereby improving the efficiency of determining the target subtask sequence.
[0106] It should be noted that the subtasks in the subtask sequence generated according to the intent correspond to the capabilities of the tools in the tool set. When generating the subtask sequence corresponding to the intent based on the large language model, a plurality of preset subtasks can be provided for the large language model as a subtask set, so that the large language model selects the target subtask and the task execution order of the target subtask from the multiple subtasks according to the target intent.
[0107] As an optional embodiment of the present application, based on the calling order, calling each target tool in the target tool sequence to process the target problem to obtain a target answer to the target problem includes: Based on the calling sequence, each target tool is called to process the to-be-processed data of the corresponding target subtask to obtain the data processing results corresponding to each target subtask; wherein the to-be-processed data of each target subtask is determined based on the target problem; Based on the data processing results of each target subtask, the target answer to the target problem is obtained.
[0108] In an embodiment of the present application, the first agent may call the target tools one by one in the calling order of the target tools in the target tool sequence, and each target tool is focused on processing its corresponding target subtask.
[0109] In an embodiment of the present application, for each target subtask, the data to be processed of the target subtask is the input data of the target tool corresponding to the target subtask, and the data processing result of the target subtask is the output data of the target tool corresponding to the target subtask.
[0110] The data to be processed of the target subtask can be a specific part of the data extracted or decomposed from the target problem. Each tool is a second intelligent agent, which can determine the data to be processed of the corresponding target subtask based on the target problem according to the corresponding target subtask. Each target tool will generate a data processing result after completing the subtask. The data processing result may be part of the target answer or may be intermediate data used by subsequent target tools.
[0111] It should be understood that the agent, as an intelligent system, can analyze the target problem and then identify the required data resources, and obtain relevant data through its own defined atomic capabilities, thereby clarifying the specific tasks that need to be performed when solving the target problem.
[0112] In the embodiment of the present application, the data processing results of each target subtask can be integrated and analyzed according to the target question to determine the target answer.
[0113] The embodiment of the present application solves the target problem in a step-by-step manner by calling the target tool. Each tool handles a specific data processing task, and the results of all tasks can be integrated in an orderly manner to generate a target answer that meets user needs. This can improve the accuracy and efficiency of data processing and is suitable for complex, multi-step problem-solving scenarios.
[0114] As an optional embodiment of the present application, the agent-based data processing method further includes: According to the target problem, determine the first parameter corresponding to each target subtask in the target subtask sequence, and for each target subtask, the first parameter is used to indicate a method for obtaining the to-be-processed data of the target tool corresponding to the target subtask; For each target subtask, the method for obtaining the to-be-processed data corresponding to the target subtask includes at least one of the following: Acquired according to the target problem; acquired from the data processing results of the predecessor tool, the predecessor tool including the target tool corresponding to at least one predecessor subtask of the target subtask in the target subtask sequence; Among them, based on the calling order, each target tool in the target tool sequence is called to process the target problem, including: Based on the calling sequence and the first parameter corresponding to each target subtask, each target tool is called to obtain the corresponding data to be processed based on the first parameter corresponding to each target tool, and the corresponding data to be processed is processed.
[0115] In the embodiment of the present application, the first parameter is used to indicate how the target tool of the target subtask acquires the corresponding data to be processed, wherein the acquisition method may be to directly acquire the data from the target problem or to acquire the data from the output result of the preceding tool.
[0116] If the first parameter of the target subtask indicates that the required data can be directly extracted from the target problem, the target tool corresponding to the target subtask will obtain the required data from the target problem according to its own capabilities. For example: in a text classification task, the classification model can directly use the text entered by the user as input data.
[0117] If the first parameter of the target subtask indicates that the required data is the result generated by other subtasks, the target tool corresponding to the target subtask will extract the relevant data from the output of the specified predecessor tool. For example, the output of tool A is used as the input data of tool B.
[0118] The first parameter corresponding to each target subtask can be determined according to the intention task table, which includes the template of the intention and subtask sequence, and the template of the subtask sequence includes the subtask sequence and the first parameter of each subtask in the subtask sequence. Therefore, if the intention task table includes the target intention, the first parameter of each target subtask can be determined through the intention task table.
[0119] As an optional embodiment, if the target intent is not included in the intent task table, the target subtask sequence can be determined based on the large language model, as well as the first parameter of each target subtask in the target subtask sequence. In order to enable the large language model to determine a target subtask sequence corresponding to an intent, as well as the first parameter of each target subtask in the target subtask sequence, a certain number of training samples can be preset to fine-tune the large language model. The training samples may include a question, the intent of the question, a subtask sequence corresponding to the intent, and the first parameter of each subtask in the subtask sequence, so that the large language model has the intent for the input, determines the subtask sequence, and determines the first parameter of each subtask according to the target question.
[0120] In an embodiment of the present application, when the first intelligent agent calls each target tool based on the calling order of each target tool, each target tool obtains its own corresponding data to be processed based on the corresponding first parameter determined by the first intelligent agent, and processes its own data to be processed.
[0121] For example, the target problem is to perform statistical analysis on the sales data in a file, and the target problem includes the file and generates a forecast report. The target intent can be business indicator analysis, and the target subtasks in the target subtask sequence can be parsing data files, statistical analysis, and forecast analysis. The execution order can be sequential execution. For the parsing data file subtask, the first parameter is to determine the data to be processed from the target problem. The corresponding target tool determines that the data to be processed is the data file and the sales data according to the first parameter, and parses the relevant information of the sales data in the data file based on its own parsed data file. For the statistical analysis subtask, the first parameter is the data from the parsing data file subtask. The data to be processed is obtained from the processing result, and the corresponding target tool obtains the data to be processed from the data processing result of the subtask of parsing the data file, that is, the relevant information of the sales data in the data file, and performs statistical analysis on the relevant information of the sales data based on its own statistical analysis ability to obtain the statistical analysis result; for the prediction and analysis subtask, the first parameter of the subtask is to obtain the data to be processed from the result of the data statistics subtask, and the corresponding target tool obtains the data to be processed according to the first parameter, that is, the statistical analysis result, and predicts the statistical analysis result based on its own prediction and analysis ability to obtain a prediction report, and finally the statistical analysis result and the prediction report can be returned to the user as the target answer.
[0122] In the embodiment of the present application, by determining the first parameter of each target subtask, the method for obtaining the data to be processed of each target subtask can be clarified, so that each target tool can accurately locate its input data, thereby ensuring the smooth execution of the entire task processing.
[0123] As an optional embodiment of the present application, for each target subtask, before calling the corresponding target tool to process the respective input data, the method further includes: Obtaining a task result table, wherein the task result table stores a correspondence between a type of to-be-processed data and a corresponding data processing result of at least one subtask in the subtask set, wherein the data processing result of a type of to-be-processed data of a subtask is a data processing result obtained by processing the to-be-processed data through a tool of the subtask; If the task result table records the data processing result corresponding to the to-be-processed data of the target subtask, the data processing result recorded in the task result table is used as the data processing result corresponding to the target tool of the target subtask; If the task result table does not record the data processing result corresponding to the to-be-processed data of the target subtask, the target tool corresponding to the target subtask is called to process the to-be-processed data of the target subtask to obtain the corresponding data processing result.
[0124] In an embodiment of the present application, in order to improve the efficiency of processing the target problem, the correspondence between a type of to-be-processed data and the corresponding data processing result of at least one subtask in the subtask set can be stored in the task result table, and when the same to-be-processed data of the subtask needs to be executed, the data processing result can be directly obtained from the task result table. For example, if a subtask is to perform data analysis on the financial data of a company and generate financial analysis results, then in subsequent tasks, when the same financial data is encountered again, the previous results can be used directly without having to re-analyze the data.
[0125] Specifically, during the application of the first intelligent agent, data processing results after different tools process different data to be processed can be recorded to form a task result table, that is, the content of the task result table is constantly increasing.
[0126] In the embodiment of the present application, since the task result table may include a large amount of data, the task result table can be retrieved based on the memory module. The memory module is used to store various data, receive requests from other modules, and retrieve various data in the module. The retrieval capability of the memory module can be implemented based on RAG technology to achieve rapid retrieval of various information, such as historical conversations, related documents, and even some structured storage information that is not easy to understand in natural language (such as table mode, SQL language).
[0127] In an embodiment of the present application, the memory module is intended to retrieve various information, such as historical conversations, related documents, and structured storage information (such as table patterns) in non-natural languages required by different tools. The above information can be roughly divided into two categories: unstructured information and structured information. For unstructured information, the content of the unstructured information can be determined through semantic understanding, so the information can be retrieved from the unstructured information using the traditional method of embedding large models and the method based on RAG retrieval. For structured information, information can be retrieved from structured information by converting it into unstructured information or by a hierarchical retrieval method. Determining different retrieval methods for different types of information effectively solves common problems and long-tail problems.
[0128] like Fig.10 As shown, Fig.10 A functional schematic diagram of a memory module provided for an embodiment of the present application. The memory module includes long-term memory data, short-term memory data and transient memory data, as well as databases such as a note library, a knowledge base and a process result library. Among them, long-term memory data is used to store long-term knowledge and experience in the application process of the first agent, which has high stability and importance, including historical data, long-term accumulated rules, common sense, model parameters, long-term user behavior data, etc. The first agent can extract knowledge from these data and perform reasoning.
[0129] Short-term memory data refers to data that the first agent temporarily needs and will use in the short term. This data has a short life cycle and may be discarded or updated after the task is completed. Short-term memory includes temporary data of the current task, instant information input by the user, intermediate results being processed, current needs of the user, etc. Short-term memory can provide support for the first agent when processing the current task, helping the first agent maintain its contextual understanding of the task and the temporary data status to ensure smooth execution of the task.
[0130] Instantaneous Memory Data refers to data that is used in a very short time and is consumed almost immediately during the task processing. The life cycle of this type of data is usually very short, and it can even be discarded immediately after the task is completed. Instantaneous memory may include cached data, temporary calculation results, real-time sensor data, or instant feedback from the system. Instantaneous memory helps the first agent quickly respond to current input or state changes and perform temporary calculations. Due to its rapid consumption, the agent does not need to save this data after the task, which optimizes memory usage.
[0131] The Notes Library is a database used to store temporary notes, marks, and auxiliary information generated by the agent when interacting with the user or performing tasks. It is used to store user feedback, warnings during task execution, notes, and historical records of user interactions. This information is usually used to assist in decision-making for the current task or provide transparency in the task process. It helps the agent to backtrack tasks, troubleshoot errors, and optimize the task execution process. It can also be used to record user preferences, unfinished tasks, or temporary decisions.
[0132] The knowledge library is where the first agent stores known facts, rules, models, and domain knowledge. It contains structured and semi-structured knowledge, including various industry knowledge, domain expertise, empirical rules, theoretical models, etc. These data are the basis for the agent's reasoning, learning, and decision-making, and can help the first agent make high-quality decisions, perform complex reasoning, or solve problems in specific fields. The knowledge library is the core part of the agent's long-term memory and supports deep learning, reasoning, and knowledge transfer.
[0133] The Process Result Library is used to store the intermediate results, processing steps, and process information of the task execution generated by the agent during the task execution. It stores the intermediate steps of data processing, calculation results, error information, task logs, etc. It records each stage of task execution, which is helpful for subsequent task optimization and error analysis, and supports the first agent to backtrack and correct when processing tasks, ensuring that the execution of the task can be traced back to each key step. This is very important for debugging, optimizing, and improving the efficiency of task execution.
[0134] Among them, the intention task table, task tool table, and task result table in the embodiment of the present application can all be stored in the memory module. When the planning module determines the target tool sequence, it can also configure the services provided by other modules for the target tool, such as the RAG service of the memory module, so that the target tool can obtain corresponding data based on the RAG service of the memory module.
[0135] In an embodiment of the present application, if the task result table does not include the data processing results corresponding to the data to be processed of the target subtask, the target tool processes the data to be processed according to its own capabilities to obtain the corresponding data processing results, and stores the correspondence between the target subtask, the data to be processed and the data processing results in the task result table.
[0136] In the embodiment of the present application, by pre-recording the data to be processed of the subtask and its corresponding processing results in the task result table, the existing processing results can be quickly found and reused. When the target subtask needs to process the same or similar data, the processing results can be directly obtained from the table without recalculation, thus reducing the time and resource consumption of repeated calculations.
[0137] As an optional embodiment of the present application, obtaining a target answer to a target question further includes: Obtaining an evaluation result of the target answer, wherein the evaluation result is used to indicate whether the target answer is correct; In the case that the target answer is incorrect, the target question and the target answer are taken as a group of error samples to optimize the first agent and each of the second agents according to the error samples.
[0138] In the embodiment of the present application, the first agent may also include an evaluation module and a learning module. The evaluation module may be implemented based on a large language model. At present, large language models may have erroneous outputs or "hallucination" phenomena when processing tasks. Therefore, evaluating the target answer output by the first agent is crucial for the safe deployment of the first agent.
[0139] Considering that the large language model can be used not only as a task solver but also as an efficient evaluator, an evaluation module is set in the first agent to evaluate the processing results of the target problem through the large language model. After the first agent obtains the target answer, the large language model in the evaluation module can conduct an in-depth evaluation of the target answer corresponding to the target question, check whether it meets the specific needs of the target object, and obtain the corresponding evaluation result.
[0140] In addition, the evaluation module can also provide a feedback mechanism, allowing the target user to give feedback on the target answer in the form of approval or disapproval. This feedback can enable the first agent to clearly identify the problems in handling the target problem, provide evaluation data for the first agent, and help the first agent gain experience, thereby continuously optimizing the service quality and the system performance of the first agent.
[0141] The embodiment of the present application, by combining the large language model evaluation in the evaluation module and the feedback from the target object, can achieve continuous learning and improvement of the first intelligent agent, ensuring that the services provided by the first intelligent agent are continuously optimized to adapt to the changing needs of the target object.
[0142] This evaluation result may come from a variety of methods, such as manual review, automated verification, or comparison with actual data. Its function is to determine whether the agent has given a correct or satisfactory answer when dealing with the target problem.
[0143] In the embodiment of the present application, when the evaluation module finds that the target answer is incorrect through the evaluation mechanism of the large language model or the feedback mechanism of the target object, the current target question and the target answer can be regarded as a pair of error samples to guide the subsequent optimization of the first agent through the error samples. It should be understood that when the second agent can be deployed in the first agent, optimizing the first agent includes optimizing the second agent, and when the second agent is independent of the first agent, the first agent and the second agent can be optimized through the error samples.
[0144] In an embodiment of the present application, the first agent and the second agent represent corresponding different modules respectively. The first agent is responsible for higher-level task decisions, while the second agent performs specific subtask processing. Using error samples, the two agents can be optimized. Specifically, the intent recognition, task planning and other modules of the first agent can be adjusted to better understand and handle similar problems; the specific data processing, decision generation and other modules of the second agent can be adjusted to improve the accuracy of the processing process. The specific optimization method may be parameter adjustment, model training or correction through reinforcement learning.
[0145] In the embodiment of the present application, the error sample is an important resource for the first agent or the second agent to learn and improve. The error sample can be recorded in the form of an error book, so that the first agent or the second agent can analyze the cause of the error and avoid making the same mistake when dealing with similar problems in the future.
[0146] In the embodiment of the present application, the second agent, as the atomic function layer of the first agent, can provide specific capabilities for the first agent. The technician can add a new second agent to the atomic function layer of the first agent according to the changes in user needs, which has strong scalability. Among them, the second agent can be an existing agent or a self-made agent, wherein the self-made agent is realized by making some self-made models for realizing corresponding functions. When using the self-made model, the input data and output data can be encrypted and decrypted when the model is generated, solving the data privacy security problems that may exist in the existing model.
[0147] Specifically, a variety of self-made intelligent agents are provided in the embodiments of the present application, and these various intelligent agents are first introduced.
[0148] As an optional embodiment of the present application, when the target subtask sequence includes a table finding task, the target tool corresponding to the table finding task is a table finding tool, and the data processing result corresponding to the table finding task is obtained by performing the following operations by the table finding tool: Extracting at least one entity element from the data to be processed of the table search task, and searching for a first candidate data table including at least one entity element from a plurality of data tables in the database; The correlation between the to-be-processed data corresponding to the table search task and each first candidate data table is judged by the judgment model; Based on the judgment results corresponding to the first candidate data tables, each first candidate data table is screened to obtain a screened second candidate data table; Based on the association between the second candidate data table and at least one entity element, a target data table is determined from the second candidate data table, and the target data table is used as a data processing result corresponding to the table search task.
[0149] In the embodiment of the present application, the table search task is used to quickly and accurately locate and query related tables or data tables in a database or data system in order to solve specific problems or needs raised by users. When the target subtask sequence corresponding to the target intent includes the table search task, it means that the target problem requires table search capability, and the corresponding target tool sequence includes the table search tool.
[0150] The table finding tool processes the data to be processed of the table finding task to obtain the corresponding data processing result. In the data processing task, the table finding task is generally the first subtask in the subtask sequence, so the data to be processed of the table finding task can be obtained from the question text.
[0151] In the embodiment of the present application, the table search tool is an intelligent entity, which is composed of a query understanding layer, a multi-directional recall layer, a fusion sorting layer and a selection layer. The query understanding layer is used to extract entity elements from the data to be processed, and the entity elements include table names, field names, and entity names. For example, the data to be processed is the target question "What is the news DAU?", and the entity elements extracted by the query understanding layer can be news and DAU. The query understanding layer can also deeply understand the target problem, and by understanding the target problem and combining the obtained entity elements, further clarify its own tasks.
[0152] The multi-directional recall layer is used to perform table-level recall based on multiple dimensions such as table name, field name, entity name, etc., that is, to obtain a first candidate data table including at least one entity element from the database. The first agent is associated with a preset database and is used to process data tables in the database. The multi-directional recall layer can be understood as a fine-grained network that covers as many tables as possible that may be related to the user's question, and the table obtained by the multi-directional recall layer based on the entity element is used as the first candidate data table.
[0153] The fusion sorting layer performs preliminary screening of the first candidate table based on the judgment model. The judgment module can be implemented based on a lightweight model, such as a small model such as BERT. For each first candidate data table, the data to be processed and the first candidate data table are input into the judgment model, and the correlation between the data to be processed and the first candidate data table is judged based on the judgment model, and the first candidate data table with a correlation greater than a preset threshold is used as the second candidate data table. For example, the BERT model can be used to perform binary classification on multiple first candidate data tables to screen out the first candidate data table whose correlation with the data to be processed is greater than the preset threshold. The BERT model can also be used to perform multi-classification on multiple first candidate data tables, and each category represents the size of the correlation with the data to be processed. Through the classification results, the multiple first candidate data tables are sorted according to the correlation with the data to be processed, and the second candidate data table is obtained according to the sorting results.
[0154] The selection layer is used to further screen each second candidate data table. The selection layer can be implemented based on a large language model. The target question, entity elements and all second candidate data tables can be input into the large language model, and the target data table can be screened out from the second candidate data tables based on the understanding ability of the large language model.
[0155] In the embodiment of the present application, the search tool generates a highly detailed table result through the synergy of multiple internal models, thereby providing the most accurate and valuable information to the target object, facilitating the smooth execution of subsequent tasks, and improving the accuracy of obtaining the target answer.
[0156] As an optional embodiment of the present application, when a structured query language SQL error correction task is included in the target subtask sequence, the target tool corresponding to the SQL error correction task is an SQL error correction tool, and the data processing result corresponding to the SQL error correction task is obtained by performing the following operations by the SQL error correction tool: Check the grammatical structure of the data to be processed in the SQL error correction task and obtain the check result; Correct the to-be-processed data of the SQL error correction task according to the check result, and obtain the first SQL statement after error correction; Execute the first SQL statement, and if error information is obtained during the execution process, determine the error in the first SQL statement according to the error information, and correct the error of the first SQL statement to obtain the target SQL statement; If no error message is obtained during the execution process, the first SQL statement is used as the target SQL statement; The target SQL statement is used as the data processing result corresponding to the SQL error correction task.
[0157] In an embodiment of the present application, the SQL error correction task is to find and correct errors or problems when executing SQL queries or scripts to ensure that the SQL statements can be executed correctly and return expected results. SQL statement errors may occur in many aspects, such as syntax errors, logical errors, runtime errors, etc. The SQL error correction tool is used to quickly locate errors, understand the causes of errors, and provide solutions or automatic repairs. The data to be processed by the SQL error correction tool can be the SQL statement in the target problem, or it can be the SQL statement in the data processing results of the previous tool.
[0158] The embodiment of the present application presets a three-stage error correction process for the SQL error correction tool, including a self-correction stage, an execution process correction stage, and an error summary stage.
[0159] For the self-correction stage, the SQL error correction tool can be implemented based on a large language model. The large language model is used to check the grammatical structure in the data to be processed and obtain the inspection result of the data to be processed. If the inspection result is that the grammatical structure of the data to be processed is correct, the data to be processed is used as the first SQL statement and the execution process enters the error correction stage. If the inspection result is that the grammatical result of the data to be processed is wrong, the data to be processed can be modified to obtain the modified first SQL statement, and then the execution process enters the error correction stage.
[0160] For the execution process stage, it can be achieved by calling a third-party tool, which is used to execute SQL statements. For example, the MySQL Explain tool can be used to analyze the execution plan of SQL statements, which can provide detailed information about the execution process of SQL statements. The SQL error correction tool identifies potential problems, optimizes query performance, and indirectly discovers some possible problems. When an error message appears after executing the first SQL statement, the error in the first SQL statement is determined according to the error message, the first SQL statement is corrected, and then executed again. The first SQL statement that no longer has an error message after execution is used as the target SQL statement; if no error message is obtained when executing the first SQL statement, the first SQL statement can be used as the target SQL statement.
[0161] It should be understood that, when facing target problems, the data processing result of the SQL error correction tool is the target SQL statement. After the SQL error correction tool obtains the target SQL statement, the SQL error correction task is completed. In order to further realize the self-learning function of the SQL error correction tool, the embodiment of the present application sets an error summary stage for the SQL error correction tool.
[0162] For the error summary stage, the SQL error correction tool can record the errors in the self-correction stage and the execution process stage to avoid making the same mistakes again next time. Specifically, when the tool corrects SQL by itself, it may encounter some common errors. By recording these errors, it can be used to optimize the error correction process in the future. Some execution errors may also be found when executing SQL statements (such as database connection errors, runtime errors, etc.).
[0163] By summarizing and recording these errors, SQL debugging tools can learn and remember past errors, so that they can respond more quickly and accurately the next time they encounter similar problems, reducing the occurrence of repeated errors.
[0164] In the embodiment of the present application, the SQL error correction tool can efficiently correct various errors in SQL statements through self-correction and SQL error correction execution, ensuring that the output SQL statements are not only syntactically correct, but also can avoid potential logical errors or execution problems during execution, thereby improving development efficiency and reducing the cost of manual debugging.
[0165] As an optional embodiment of the present application, when the target subtask sequence includes a text-to-structured query language Text-to-SQL task, the target tool corresponding to the Text-to-SQL task is a Text-to-SQL tool, and the data processing result corresponding to the Text-to-SQL task is obtained by performing the following operations by Text-to-SQL: Perform semantic analysis on the data to be processed to obtain semantic analysis results; Extracting key information from the semantic analysis result, wherein the key information includes at least one of an entity element and an operation type; Build the corresponding SQL structure according to the operation type in the key information; Generate an SQL statement according to the operation type in the key information and the corresponding SQL structure.
[0166] In the embodiment of the present application, the Text-to-SQL task is used to convert natural language text into SQL statements, and the Text-to-SQL tool corresponds to a tool for converting natural language text into SQL statements. The data to be processed of the Text-to-SQL task can be obtained from the target problem or the data processing results of the previous task. The Text-to-SQL tool can understand the target problem and the output results of multiple previous tasks semantically, determine the natural language text that needs to be converted into SQL, and use the natural language text as the data to be processed.
[0167] The Text-to-SQL tool can achieve the same function based on the SQL generation model. The text is input into the SQL generation model and preprocessed through the SQL generation model, including cleaning the text and removing unnecessary symbols or noise; then the key information in the text is extracted, including identifying table names and fields: finding out the tables and fields involved, and extracting the operation types in the text, including determining whether the target object's requirements are to query, insert, update or delete data.
[0168] When generating SQL statements, the SQL generation model builds an SQL structure according to the operation type corresponding to the text as an SQL template, including selecting an appropriate SQL statement structure (such as SELECT, INSERT), and putting the extracted table and field information as insert information into the SQL structure: inserting the table name, field, condition, etc. into the SQL template to generate the final SQL statement.
[0169] In an embodiment of the present application, the Text-to-SQL tool may also include a series of pre-processing steps, such as table lookup and information accuracy; and post-processing steps, such as SQL error classification and SQL correction, to ensure the accuracy of the generated SQL.
[0170] Among them, a large amount of business-related data is pre-constructed as a data set to train the large language model, and an initial SQL generation model is obtained. Then, the initial SQL generation model is fine-tuned through the Lora technology to obtain the final SQL generation model. Considering that there are two problems with the existing open source data: first, most of them are for English scenarios, and a small number of Chinese open source data are far from the actual business data. Second, there is a lack of coverage of high-difficulty calculation logic, and it is easy to make mistakes when encountering real problems. In response to these two problems, when constructing a data set, the embodiment of the present application constructs a rich and diverse query SQL data from different angles, such as condition operation SQL statements, filter operation SQL statements, sorting order operation SQL statements, limit limit operation SQL statements, aggregation operation SQL statements, and grouping group by operation SQL statements, sum operation, table connection join operation SQL statements, and subqueries in SQL statements, etc., multi-dimensional construction data sets, and data enhancement technology can be further used to further enhance the richness of the data set.
[0171] As an optional embodiment of the present application, when a data insight task is included in the target subtask sequence, the target tool corresponding to the data insight task is a data insight tool, and the data processing result corresponding to the data insight task is obtained by the data insight tool performing the following operations: obtaining the data to be interpreted in the data interpretation subtask, and determining a plurality of indicators in the data to be interpreted; By analyzing the multiple indicators, determining the contribution weight of each indicator in the multiple indicators; According to the contribution weight of each indicator in the multiple indicators, a data interpretation result is obtained based on the large language model.
[0172] In an embodiment of the present application, the data insight tool can use a large language model to implement basic data description, trend prediction, anomaly detection and attribution analysis, and can also perform in-depth mining and interpretation of data more efficiently.
[0173] After obtaining the data to be processed, the data insight tool first compares the differences and deeply understands the data to identify possible anomalies and factors that need to be attributed in the data, ensuring that key details are not missed, such as the differences in Chinese and English translations through the interpretation of application data; Analyze business indicators, dig out key information worth paying attention to in the data, and use the big language model to sort and evaluate the contribution of different indicators to determine which factors are most important to business performance. This process is not limited to simple numerical calculations, but also involves intelligent evaluation of the importance of multiple dimensions. Finally, use the big language model to summarize the analysis results and present them through intelligent visualization to intuitively understand the business meaning behind the data.
[0174] In the data insight tool, a general business analysis template framework has been accumulated, which has achieved a smooth transition from basic data interpretation to higher-level analysis. In addition to rule-based automated interpretation, a multi-round dialogue function can be designed in the data insight tool, allowing users to gradually guide and adjust the direction of data analysis during the interaction with the system, so as to interpret data more flexibly and in-depth.
[0175] This innovative method, which combines intelligent interpretation, automated data exploration, and multi-round dialogue guidance, not only improves the depth and accuracy of data interpretation, but also greatly improves the efficiency of data analysis in high-frequency business scenarios, enabling the automated data exploration system to play a greater role in complex actual business.
[0176] As an optional embodiment of the present application, when the target subtask sequence includes an SQL optimization task, the target tool corresponding to the SQL optimization task is an SQL optimization tool, and the data processing result corresponding to the SQL optimization task is obtained by performing the following operations by the SQL optimization tool: Check the grammatical structure of the data to be processed in the SQL optimization task and obtain the check result; According to the inspection result, the expression and structure of the SQL statement to be optimized are adjusted to obtain a preliminarily optimized SQL statement; Based on the preset SQL optimization rules, the initially optimized SQL statement is optimized again through the large language model to obtain the target optimized SQL statement.
[0177] SQL optimization covers three aspects: SQL rewriting, optimizer optimization, and slow SQL optimization. Each step plays a key role in improving database execution efficiency.
[0178] SQL rewriting mainly adjusts the structure and expression of query statements to optimize the expression of SQL text. This process improves query efficiency by structurally optimizing SQL statements, such as adjusting the position of the WHERE clause, deleting redundant columns or conditions, etc. It should be pointed out that SQL rewriting does not rely on the underlying data distribution, but focuses on improving query performance and readability from the text level. The optimization at this stage can lay an efficient foundation for subsequent query execution.
[0179] Optimizer optimization is an important process in the database system kernel, and its core is to generate and adjust query execution plans. The database optimizer parses and analyzes SQL statements, selects the optimal execution path while maintaining the equivalent query logic, and thus significantly improves query performance. For example, by adjusting the table scan order, selecting appropriate indexes, or performing connection optimization, the optimizer can dynamically adapt to data distribution and operating environment, and provide efficient execution support for SQL queries.
[0180] Slow SQL optimization relies more on manual intervention, and manual adjustments are made to SQL statements with low execution performance. This process usually includes taking targeted optimization measures based on SQL logic and table structure, such as removing unnecessary ORDER BY clauses, adding indexes, and using LIMIT to limit the query range. Although this method may not completely maintain the equivalence of SQL logic, it can effectively reduce execution time and bring significant performance improvements in actual business scenarios.
[0181] In order to further enhance the intelligence and automation capabilities of SQL optimization, different types of SQL optimization samples can be collected and accumulated. These samples provide rich references for the optimization process of SQL optimization tools, help the model learn diverse optimization strategies, and promote the application of large language models (LLMs) in SQL optimization tasks. By combining the rule-based optimization library with the generation and reasoning capabilities of large language models, online performance optimization and readability optimization of SQL queries can be achieved.
[0182] The combination of the above optimization methods can not only significantly improve the efficiency of database queries, but also ensure the clarity and maintainability of SQL statements after optimization. The embodiment of the present application effectively promotes the intelligent and automated process of database performance optimization by combining traditional SQL optimization technology with advanced artificial intelligence technology, and provides a more efficient and reliable solution for complex query scenarios.
[0183] In order to more clearly illustrate the technical solution provided by the embodiment of the present application, a specific implementation is now given, such as Fig.11 As shown, Fig.11 Another agent-based data processing flow diagram provided for an embodiment of the present application includes S401-S402.
[0184] S401, obtaining a target problem of a target object; S402, performing a problem processing operation by the first agent, and providing a target answer obtained by the problem processing operation to a target object; The problem handling operations are as follows Fig.12 As shown, Fig.12 A flowchart of an execution question operation provided in an embodiment of the present application includes S501-S509.
[0185] S501, performing semantic analysis on the target question to obtain a semantic analysis result; S502: If it is determined according to the semantic analysis result that the target question is incomplete, a complete target question is obtained and the complete target question is used as the target question; S503, performing intent recognition on the target question through multiple intent recognition models respectively, and obtaining candidate intents output by each of the multiple intent recognition models; S504, determining a target intent from candidate intents outputted by each of the multiple intent recognition models based on a voting principle; S505, determining a target subtask sequence corresponding to the target intent according to the intent task table; S506, determining the target tool corresponding to each target subtask in the target subtask sequence according to the task tool table; S507, determining the first parameter corresponding to each target subtask in the target subtask sequence according to the target problem; S508, based on the calling sequence and the first parameter corresponding to each target subtask, calling each target tool to obtain the corresponding data to be processed based on the first parameter corresponding to each target tool, and processing the corresponding data to be processed to obtain the data processing result corresponding to each target subtask; S509, obtaining a target answer based on the data processing results of each target subtask; S510, obtaining an evaluation result of the target answer, where the evaluation result is used to indicate whether the target answer is correct; S511. When the target answer is incorrect, the target question and the target answer are taken as a group of error samples to optimize the first agent and each second agent according to the error samples.
[0186] In order to evaluate the method provided in the embodiment of the present application, online data collection was conducted for more than one month, and several selected modules and tools of the first agent were evaluated. Some modules or tools that are difficult to evaluate, such as data insight and SQL optimization, were not evaluated. The results are shown in Table 1 below:
[0187] Among them, the accuracy rate is the proportion of correctly executed output results in the output results of each module or tool, and the availability rate is the proportion of available output results in the output results of each module or tool. For the Text-to-SQL tool, the experimental design considered two different scenarios. In one scenario, the user only gave a query request without providing table information; in the other scenario, the user asked questions related to a specific table after selecting the table in advance. For these two scenarios, the experimental results were evaluated separately, and the "multiple tables" and "single table" situations were highlighted in the table. The evaluation results show that the performance of the selected modules has significant potential for improvement, especially in the intent recognition and SQL error correction modules, which have reached a relatively ideal level.
[0188] like Fig.13 As shown, Fig.13 An overall design diagram of an intelligent data processing and analysis platform provided for an embodiment of the present application includes an application layer, a unified front-end component, a unified back-end, an Agent intelligent body, a public service layer, and a data storage layer. Among them, the application layer is a plurality of intelligent data analysis-related applications that can be applied by the platform, and each application can obtain corresponding services from the Agent intelligent body and the public service layer according to actual needs. The unified front-end component is the front-end component of the platform in multiple applications in the application layer, and the unified back-end is the capability service provided by the platform for multiple applications in the application layer. A unified front-end component and back-end service are provided for each application. When the platform needs to serve other applications, the front-end component and back-end service can be directly extended to the application. For example, applications such as application A in the figure can have unified front-end components such as a universal UI, universal components, and universal interactions, and can have a unified back-end, such as data analysis insight functions, natural language table search functions, etc.
[0189] The Agent in the platform corresponds to the atomic functional layer in the system and is composed of agents that provide various capabilities. For example, agents with data search capabilities can include table lookup agents, metadata question-and-answer agents, and intelligent table lookup agents. Agents with different capabilities can serve different applications. In addition, the platform also provides some agents that provide adaptation to various applications, such as the agents used to assist analysis in the figure, as well as agents with public capabilities.
[0190] The public service layer is the service provided by the platform to each intelligent agent. For example, the intelligent agent may need the RAG recall service to retrieve relevant data, and the high-frequency problem service can quickly solve the high-frequency problems raised by users. Different applications in the application layer can choose the corresponding service from the public service layer according to their own needs. Different intelligent agents and different public services corresponding to different applications reflect the personalization of the application.
[0191] The data storage layer is used to store various data, including some library table information, indicator information, high-frequency problems, historical dialogues with target objects, and document knowledge bases for data processing. The platform also provides some other capabilities, as shown on the far right of the figure, including the unified configuration capability of the front-end and back-end, the ability to diagnose problems and restore scenarios for applications, and the problem annotation capability to annotate different problems and answers to problems handled by each application, the metadata access and enhancement capabilities required in data processing, and the process orchestration, execution, test release, and tool association capabilities of breaking problems into subtasks provided by the orchestration engine.
[0192] The general basic services designed in the intelligent data processing and analysis platform provide optional services, making the platform easy to expand to different applications and flexible to meet the diverse needs of different applications. The embodiment of the present application creates an intelligent analysis platform based on a large language model and rich data, and based on the interactive form of natural language, effectively lowers the threshold for users to check, retrieve and use data.
[0193] like Fig.14 As shown, Fig.14 A schematic diagram of a module of a first intelligent agent provided in an embodiment of the present application. The first intelligent agent includes an intention recognition module, a planning module, a control module (controller in the figure), a tool module, a memory module, an evaluation module and a learning module.
[0194] The first agent can be deployed in a server or server cluster, and interact with the user through the server. When the user sends the target question, the intention recognition module first recognizes the target question, including task type recognition, user intention clarification and task correction; the planning module is used to decompose the target question into multiple subtasks in the subtask set according to the target intention, and obtain a target subtask sequence for processing the target intention, where the subtask set can be tasks such as finding indicators, finding business tables, indicator attribution, SQL generation and execution, data visualization, and data interpretation in the planning module. After determining the target subtask sequence from the subtask set, the target tool sequence is obtained according to the tools corresponding to the target subtasks, and the capabilities of each tool in the target tool are connected in series. The control module calls each tool from the tool module according to the target tool sequence to execute the corresponding subtask, and each tool in the tool module is an agent. In addition, the memory module in the system is used to store data for other modules. The memory module includes a note library, a knowledge base and a process result library, which are used to store corresponding data respectively. The memory module can also store the data for a long time, a short time and an instantaneous storage according to the importance of the data, forming the long-term memory, short-term memory and instantaneous memory in the figure. The memory module has retrieval capability and can retrieve the corresponding data according to the needs of other modules.
[0195] The evaluation module can evaluate the target answer obtained by the tool module through the large language model, and the evaluation results are provided to manual feedback. The data of each step of the first agent in processing the target problem can be stored in the memory module. The learning module can manually correct and organize the answers evaluated as wrong from the memory module, and provide the questions and answers as an error sample to each model in the system for learning, so that the learning module can optimize each module in the first agent. The learning module can optimize all modules in the first agent as a whole, such as the intention recognition module, planning module, function module (tool module), evaluation module and memory module in the figure, and can also optimize each module separately, such as optimizing a tool in the tool module.
[0196] Among them, the relationship between the overall design of the intelligent data processing and analysis platform and the modular functions of the intelligent body can be that the public service layer is responsible for building the memory, learning and evaluation modules, while the application layer is responsible for the specific implementation of the control module, intention recognition module and planning module, and the atomic function layer provides various scalable intelligent capabilities.
[0197] The present application embodiment provides a data processing device based on an intelligent agent, such as Fig.15As shown, the data processing device may include: an acquisition module 1501 and a problem processing operation module 1502, wherein the problem processing operation module includes a target intention determination module 1601, a tool determination module 1602 and a tool calling module 1603, wherein: An acquisition module is used to obtain the target problem of the target object; A question processing operation module, configured to execute a question processing operation through the first agent, and provide a target answer obtained by the question processing operation to a target object; The problem handling operation module includes: A target intention determination module is used to identify the intention of the target question and determine the target intention of the target question; A tool determination module is used to determine a target tool sequence corresponding to the target problem from a preset tool set according to the target intent, wherein the tool set includes a plurality of tools, and the target tool sequence includes at least one target tool determined from the plurality of tools and a calling order of each target tool in the at least one target tool; wherein each tool in the tool set is a second intelligent agent for executing a corresponding data processing task; The calling tool module is used to call each target tool in the target tool sequence to process the target problem based on the execution order, so as to obtain the target answer to the target problem.
[0198] As an optional embodiment of the present application, when the target intent determination module is used to identify the intent of the target question and determine the target intent of the target question, it is specifically used to: Perform semantic analysis on the target problem to obtain a semantic analysis result; If the target question is determined to be complete according to the semantic analysis result, the target question is input into the intent recognition model to obtain the target intent of the target question; If it is determined according to the semantic analysis result that the target question is incomplete, and indeed the target question is missing content items, content completion prompt information is displayed to the target object based on the missing content items to obtain the missing content items from the target object, supplement the target question, and input the supplemented target question into the intent recognition model to obtain the target intent of the target question.
[0199] As an optional embodiment of the present application, when the target intent determination module is used to identify the intent of the target question and determine the target intent of the target question, it is specifically used to: Performing intent recognition on the target question through multiple intent recognition models respectively, and obtaining candidate intents output by each of the multiple intent recognition models; The target intent is determined from the candidate intents output by each of the multiple intent recognition models based on the voting principle.
[0200] As an optional embodiment of the present application, when the tool determination module is used to determine the target tool sequence corresponding to the target problem from a preset tool set according to the target intent, it is specifically used to: Acquire an intention task table, in which the intention task table stores a correspondence between each of a plurality of intentions and a subtask sequence corresponding to the intention, each subtask sequence includes at least one subtask, and a task execution order between the at least one subtask; According to the intention task table, determine the target subtask sequence corresponding to the target intention; Obtaining a task tool table, wherein the task tool table records the correspondence between each subtask in the subtask set and the tool corresponding to the subtask; According to the task tool table, the target tool corresponding to each target subtask in the target subtask sequence is determined to obtain a target tool sequence corresponding to the target subtask sequence, wherein the calling order between the target tools in the target tool sequence corresponds to the task execution order between the target subtasks.
[0201] As an optional embodiment of the present application, if the target intent is not included in the intent task table, the determination tool module obtains the target subtask sequence corresponding to the target intent in the following manner: Obtain a first instruction, where the first instruction is used to instruct the large language model to generate a subtask sequence corresponding to the intent; Based on the target intent and the first instruction, a target subtask sequence corresponding to the target intent is generated through the large language model.
[0202] As an optional embodiment of the present application, when the calling tool module is used to call each target tool in the target tool sequence based on the calling order to process the target problem and obtain the target answer to the target problem, it is specifically used to: Based on the calling sequence, each target tool is called to process the to-be-processed data of the corresponding target subtask to obtain the data processing results corresponding to each target subtask; wherein the to-be-processed data of each target subtask is determined based on the target problem; Based on the data processing results of each target subtask, the target answer to the target problem is obtained.
[0203] As an optional embodiment of the present application, the calling tool module is also used for: According to the target problem, determine the first parameter corresponding to each target subtask in the target subtask sequence, and for each target subtask, the first parameter is used to indicate a method for obtaining the to-be-processed data of the target tool corresponding to the target subtask; For each target subtask, the method for obtaining the to-be-processed data corresponding to the target subtask includes at least one of the following: Acquired according to the target problem; acquired from the data processing result of the predecessor tool, the predecessor tool including the target tool corresponding to at least one predecessor subtask of the target subtask in the target subtask sequence; Wherein, based on the calling sequence, calling each target tool in the target tool sequence to process the target problem includes: Based on the calling sequence and the first parameter corresponding to each target subtask, each target tool is called to obtain the corresponding data to be processed based on the first parameter corresponding to each target tool, and the corresponding data to be processed is processed.
[0204] As an optional embodiment of the present application, for each target subtask, before calling the corresponding target tool to process the respective input data, the calling tool module is further used to: Obtaining a task result table, wherein the task result table stores a correspondence between a type of to-be-processed data and a corresponding data processing result of at least one subtask in the subtask set, wherein the data processing result of a type of to-be-processed data of a subtask is a data processing result obtained by processing the to-be-processed data through a tool of the subtask; If the task result table records the data processing result corresponding to the to-be-processed data of the target subtask, the data processing result recorded in the task result table is used as the data processing result corresponding to the target tool of the target subtask; If the task result table does not record the data processing result corresponding to the to-be-processed data of the target subtask, the target tool corresponding to the target subtask is called to process the to-be-processed data of the target subtask to obtain the corresponding data processing result.
[0205] As an optional embodiment of the present application, the device further includes an evaluation learning module, which is used to obtain an evaluation result of the target answer after obtaining the target answer, and the evaluation result is used to indicate whether the target answer is correct; In the case that the target answer is incorrect, the target question and the target answer are taken as a group of error samples to optimize the first agent and each of the second agents based on the error samples.
[0206] As an optional embodiment of the present application, when the target subtask sequence includes a table finding task, the target tool corresponding to the table finding task is a table finding tool, and the data processing result corresponding to the table finding task is obtained by calling the tool module to perform the following operations through the table finding tool: Extracting at least one entity element from the data to be processed of the query task, and searching for a first candidate data table including at least one entity element from a plurality of data tables in the database; The correlation between the to-be-processed data corresponding to the table search task and each first candidate data table is judged by the judgment model; Based on the judgment results corresponding to the first candidate data tables, each first candidate data table is screened to obtain a screened second candidate data table; Based on the association between the second candidate data table and the at least one entity element, a target data table is determined from the second candidate data table, and the target data table is used as a data processing result corresponding to the table search task.
[0207] As an optional embodiment of the present application, when the target subtask sequence includes a structured query language SQL error correction task, the target tool corresponding to the SQL error correction task is an SQL error correction tool, and the data processing result corresponding to the SQL error correction task is obtained by calling the tool module to perform the following operations through the SQL error correction tool: Check the grammatical structure of the data to be processed in the SQL error correction task and obtain the check result; Correct the to-be-processed data of the SQL error correction task according to the check result, and obtain the first SQL statement after error correction; Execute the first SQL statement, and if error information is obtained during the execution process, determine the error in the first SQL statement according to the error information, and correct the error of the first SQL statement to obtain the target SQL statement; If no error message is obtained during the execution process, the first SQL statement is used as the target SQL statement; The target SQL statement is used as the data processing result corresponding to the SQL error correction task.
[0208] The device of the embodiment of the present application can execute the method provided by the embodiment of the present application, and the implementation principle is similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description of the corresponding method shown in the previous text, which will not be repeated here. The device can be applied to a server or to a device based on an agent.
[0209] In an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the above-mentioned computer program to implement the steps of the agent-based data processing method. Compared with the related art, the following can be achieved: by obtaining the target problem of the target object, and using the first agent to identify the intent of the target problem, the target intent of the target problem is clarified, and the core needs of the target object can be accurately grasped; by presetting a plurality of second agents for performing data processing tasks, and using the second agents as tools that can be called by the first agent, the most matching target tool sequence can be determined based on the target intent, and the target problem can be processed using the target tool sequence, which can significantly improve the automation of data processing, reduce manual intervention, and effectively improve the overall processing efficiency of the target problem; by using the agent as an execution tool for data processing tasks, and calling them one by one in the calling order of the target tools, multiple target tools can be divided into work and cooperate, and give full play to their respective advantages to solve the target problem; each tool is a second agent specifically used to process a specific data task, so that the present application has a high degree of flexibility and scalability when dealing with different target problems, and can adapt to diverse data processing needs. The embodiment of the present application utilizes multiple tools to work together, with each tool optimizing processing for a specific task, thereby avoiding the performance bottleneck of a single model, improving the overall performance and stability of the data processing process, and improving the efficiency in dealing with complex data processing problems.
[0210] In an alternative embodiment, an electronic device is provided, such as Fig.16 As shown, Fig.16 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0211] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0212] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.16 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0213] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0214] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.
[0215] Among them, electronic devices may include but are not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.16 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0216] The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented. Compared with the prior art, it can be achieved that: by obtaining the target problem of the target object, and using the first agent to identify the intent of the target problem, the target intention of the target problem is clarified, and the core needs of the target object can be accurately grasped; by presetting a plurality of second agents for performing data processing tasks, and using the second agent as a tool that can be called by the first agent, the most matching target tool sequence can be determined based on the target intention, and the target problem is processed using the target tool sequence, which can significantly improve the automation of data processing, reduce manual intervention, and effectively improve the overall processing efficiency of the target problem; by using the agent as the execution tool of the data processing task, and calling one by one according to the calling order of the target tool, multiple target tools can be divided into work and cooperate, and give full play to their respective advantages to solve the target problem; each tool is a second agent specifically used to process a specific data task, so that the present application has a high degree of flexibility and scalability when dealing with different target problems, and can adapt to diverse data processing needs. The embodiment of the present application utilizes multiple tools to work together, with each tool optimizing processing for a specific task, thereby avoiding the performance bottleneck of a single model, improving the overall performance and stability of the data processing process, and improving the efficiency in dealing with complex data processing problems.
[0217] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0218] The present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the above method embodiments when executed by a processor. Compared with the prior art, it can achieve: By obtaining the target problem of the target object, and using the first agent to identify the intent of the target problem, clarifying the target intention of the target problem, the core needs of the target object can be accurately grasped; by presetting a plurality of second agents for performing data processing tasks, and using the second agent as a tool that the first agent can call, the most matching target tool sequence can be determined based on the target intention, and the target problem can be processed using the target tool sequence, which can significantly improve the automation of data processing, reduce manual intervention, and effectively improve the overall processing efficiency of the target problem; by using the agent as the execution tool of the data processing task, and calling one by one according to the calling order of the target tool, multiple target tools can be divided into work and cooperate, giving full play to their respective advantages to solve the target problem; each tool is a second agent specifically used to process a specific data task, so that the present application has a high degree of flexibility and scalability when dealing with different target problems, and can adapt to diverse data processing needs. The embodiment of the present application uses the collaborative work of multiple tools, and each tool is optimized for a specific task, avoiding the performance bottleneck of a single model, improving the overall performance and stability of the data processing process, and improving the efficiency when dealing with complex data processing problems.
[0219] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.
[0220] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0221] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.
Claims
1. A data processing method based on an agent, characterized in that: The method comprises: Get the target questions of the target object; The first agent performs a problem processing operation, and provides a target answer obtained by the problem processing operation to the target object; The problem handling operation includes the following steps: Performing intent recognition on the target problem to determine the target intent of the target problem; According to the target intention, a target tool sequence corresponding to the target problem is determined from a preset tool set, wherein the tool set includes a plurality of tools, and the target tool sequence includes at least one target tool determined from the plurality of tools, and a calling order of each target tool in the at least one target tool; wherein each tool in the tool set is a second intelligent agent for executing a corresponding data processing task; Based on the calling order, each target tool in the target tool sequence is called to process the target problem to obtain a target answer to the target problem.
2. The method according to claim 1, characterized in that The step of identifying the intent of the target question and determining the target intent of the target question includes: Performing semantic analysis on the target question to obtain a semantic analysis result; If it is determined that the target question is complete according to the semantic analysis result, the target question is input into the intent recognition model to obtain the target intent of the target question; If it is determined according to the semantic analysis result that the target question is incomplete, and indeed the target question is missing content items, content completion prompt information is displayed to the target object based on the missing content items to obtain the missing content items from the target object, and the target question is supplemented. The supplemented target question is input into the intent recognition model to obtain the target intent of the target question.
3. The method according to claim 1 or 2, characterized in that: The step of identifying the intent of the target question and determining the target intent of the target question includes: Performing intent recognition on the target question using multiple intent recognition models respectively, and obtaining candidate intents output by each of the multiple intent recognition models; The target intent is determined from the candidate intents output by each of the multiple intent recognition models based on the voting principle.
4. The method according to claim 1, characterized in that: The step of determining a target tool sequence corresponding to the target problem from a preset tool set according to the target intention includes: Acquire an intention task table, wherein the intention task table stores a correspondence between each of a plurality of intentions and a subtask sequence corresponding to the intention, each subtask sequence includes at least one subtask, and a task execution order between the at least one subtask; According to the intention task table, determining the target subtask sequence corresponding to the target intention; Acquire a task tool table, wherein the task tool table records the correspondence between each subtask in the subtask set and the tool corresponding to the subtask; According to the task tool table, the target tool corresponding to each target subtask in the target subtask sequence is determined to obtain a target tool sequence corresponding to the target subtask sequence, wherein the calling order between the target tools in the target tool sequence corresponds to the task execution order between the target subtasks.
5. The method according to claim 4, characterized in that If the target intent is not included in the intent task table, the target subtask sequence corresponding to the target intent is obtained in the following manner: Obtain a first instruction, where the first instruction is used to instruct the large language model to generate a subtask sequence corresponding to the intent; Based on the target intent and the first instruction, a target subtask sequence corresponding to the target intent is generated through the large language model.
6. The method according to claim 4 or 5, characterized in that: The calling sequence is based on which each target tool in the target tool sequence is called to process the target problem to obtain a target answer to the target problem, including: Based on the calling sequence, calling each target tool to process the to-be-processed data of the corresponding target subtask, and obtaining the data processing results corresponding to each target subtask; wherein the to-be-processed data of each target subtask is determined based on the target problem; Based on the data processing results of each of the target subtasks, a target answer to the target question is obtained.
7. The method according to claim 6, characterized in that The method further comprises: According to the target problem, determining a first parameter corresponding to each target subtask in the target subtask sequence, wherein for each target subtask, the first parameter is used to indicate a method for obtaining to-be-processed data of a target tool corresponding to the target subtask; Wherein, for each of the target subtasks, the method for obtaining the to-be-processed data corresponding to the target subtask includes at least one of the following: Acquired according to the target problem; acquired from the data processing result of the predecessor tool, the predecessor tool including the target tool corresponding to at least one predecessor subtask of the target subtask in the target subtask sequence; The calling of each target tool in the target tool sequence to process the target problem based on the calling order includes: Based on the calling sequence and the first parameter corresponding to each of the target subtasks, each target tool is called to obtain the corresponding data to be processed based on the first parameter corresponding to each target tool, and the corresponding data to be processed is processed.
8. The method according to claim 7, characterized in that For each of the target subtasks, before calling the corresponding target tool to process the respective input data, the method further includes: Obtaining a task result table, wherein the task result table stores a correspondence between a type of to-be-processed data and a corresponding data processing result of at least one subtask in the subtask set, wherein the data processing result of a type of to-be-processed data of a subtask is a data processing result obtained by processing the to-be-processed data through a tool of the subtask; If the task result table records the data processing result corresponding to the to-be-processed data of the target subtask, the data processing result recorded in the task result table is used as the data processing result corresponding to the target tool of the target subtask; If the task result table does not record the data processing result corresponding to the to-be-processed data of the target subtask, the target tool corresponding to the target subtask is called to process the to-be-processed data of the target subtask to obtain the corresponding data processing result.
9. The method according to claim 1, characterized in that: The step of obtaining the target answer to the target question further includes: Obtaining an evaluation result of the target answer, wherein the evaluation result is used to indicate whether the target answer is correct; In the case that the target answer is incorrect, the target question and the target answer are taken as a group of error samples to optimize the first agent and each of the second agents according to the error samples.
10. The method according to claim 6, characterized in that When the target subtask sequence includes a table-finding task, the target tool corresponding to the table-finding task is a table-finding tool, and the data processing result corresponding to the table-finding task is obtained by performing the following operations by the table-finding tool: Extracting at least one entity element from the data to be processed of the table search task, and searching for a first candidate data table including at least one entity element from a plurality of data tables in a database; The correlation between the to-be-processed data corresponding to the table search task and each first candidate data table is judged by using a judgment model; Based on the judgment results corresponding to the first candidate data tables, each first candidate data table is screened to obtain a screened second candidate data table; Based on the association between the second candidate data table and the at least one entity element, a target data table is determined from the second candidate data table, and the target data table is used as a data processing result corresponding to the table search task.
11. The method according to claim 6, characterized in that When the target subtask sequence includes a structured query language SQL error correction task, the target tool corresponding to the SQL error correction task is an SQL error correction tool, and the data processing result corresponding to the SQL error correction task is obtained by performing the following operations by the SQL error correction tool: Checking the grammatical structure of the data to be processed in the SQL error correction task to obtain a check result; Correct the to-be-processed data of the SQL error correction task according to the inspection result to obtain a first SQL statement after error correction; Execute the first SQL statement, and if error information is obtained during the execution process, determine the error in the first SQL statement according to the error information, and correct the error of the first SQL statement to obtain a target SQL statement; If no error message is obtained during the execution process, the first SQL statement is used as the target SQL statement; The target SQL statement is used as the data processing result corresponding to the SQL error correction task.
12. An agent-based data processing device, characterized in that: The device comprises: An acquisition module is used to obtain the target problem of the target object; A question processing operation module, configured to perform a question processing operation through the first agent, and provide a target answer obtained by the question processing operation to the target object; The problem handling operation module includes: A target intention determination module is used to identify the intention of the target question and determine the target intention of the target question; A tool determination module, used to determine a target tool sequence corresponding to the target problem from a preset tool set according to the target intention, wherein the tool set includes a plurality of tools, and the target tool sequence includes at least one target tool determined from the plurality of tools and a calling order of each target tool in the at least one target tool; wherein each tool in the tool set is a second intelligent agent for executing a corresponding data processing task; The calling tool module is used to call each target tool in the target tool sequence based on the execution order to process the target problem and obtain the target answer to the target problem.
13. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
Citation Information
Cited By
Intelligent NL2SQL generation and optimization system, application method and storage medium
CN120371858A
Model prompt content generation method and device
CN120611029A
A model prompt content generation method and device
CN120611029B
Decision-making auxiliary method and device based on large model
CN120654795A
Power marketing knowledge question-answering system and method based on multi-modal retrieval enhancement generation
CN121301511A