A task processing method and device
By splitting tasks into subtasks and obtaining input data based on context templates, the problem of inaccurate information transmission in multi-agent orchestration is solved, achieving successful and accurate task execution and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LENOVO (BEIJING) LTD
- Filing Date
- 2026-03-16
- Publication Date
- 2026-06-19
Smart Images

Figure CN122242627A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a task processing method and apparatus. Background Technology
[0002] Multi-agent orchestration refers to the orchestration of multiple agents to collaborate and complete a task. Recently, supervisor-based orchestration, primarily centralized, has seen widespread adoption in industry. This approach designates a single supervisor agent as the central controller of the entire process, managing task flow and information transmission.
[0003] During agent orchestration, the accuracy, non-redundancy, and completeness of context passing largely determine the success rate and efficiency of each agent's execution. In tasks with long steps (requiring ten or more single agent calls) and high dependencies (requiring multiple agents with sequential or even nested dependencies), context passing often suffers from the following problems: 1. Loss of valid information: Information needed by the agent in the current step is not accurately passed to the current agent. For example, if a previous task has already obtained information that the user is about to travel to Shanghai for business, the current agent may also need the "location" information, but the valid information "Shanghai" may not be provided to the current agent. 2. Redundant information passing: Information unrelated to the current agent's needs (such as information needed by agents in other steps) is passed to the current agent. These problems can lead to task execution failure. Summary of the Invention
[0004] The purpose of this application is to provide a task processing method and apparatus.
[0005] In a first aspect, embodiments of this application provide a task processing method, including: Based on user demand data, determine the target tasks; The target task is broken down into multiple subtasks, and the corresponding intelligent agent for each subtask is determined. For a target agent among the agents, input data corresponding to the target agent is obtained from the task data based on the context template of the target agent; wherein, the context template represents the input content required by the target agent, and the task data includes at least one of the following: the user requirement data or context data generated by other agents besides the target agent performing sub-tasks; The input data and instruction information are input to the target intelligent agent to obtain the execution result of the target intelligent agent. The instruction information is used to instruct the target intelligent agent to execute the corresponding sub-task.
[0006] In one possible implementation, the method further includes: Determine the declaration information of the target intelligent agent; wherein the declaration information is used to declare at least one of the following to the object that invokes the target intelligent agent: capability description, skill description, and example description; Based on the declaration information, a context template corresponding to the target intelligent agent is generated.
[0007] In one possible implementation, generating the context template corresponding to the target agent based on the declaration information includes: Obtain the historical input data and historical output data corresponding to the target intelligent agent; wherein, the historical input data and the historical output data are generated when the target intelligent agent performs historical tasks; Based on the declaration information, the historical input data, and the historical output data, a context template corresponding to the target intelligent agent is generated.
[0008] In one possible implementation, based on the context template of the target agent, the input data corresponding to the target agent is obtained from the task data, including: The input data corresponding to the target agent is obtained from the task data based on the slot information in the context template.
[0009] In one possible implementation, obtaining the input data corresponding to the target agent from the task data based on the slot information in the context template includes: From the task data, obtain multiple candidate slot filling information corresponding to the target slot in the context template; The candidate slot filling information is filtered based on the semantic information of the context template, and the input data is obtained based on the filtering results.
[0010] In one possible implementation, obtaining the input data corresponding to the target agent from the task data based on the context template of the target agent includes: Based on the context template of the target agent, candidate data is obtained from the context data; The candidate data is filtered based on the dependency information to obtain the input data, wherein the dependency information is determined based on the task dependency relationship between the subtasks.
[0011] In one possible implementation, filtering the candidate data based on dependency information includes: The candidate data is filtered based on the dependency information and the timeliness information of each candidate data.
[0012] In one possible implementation, filtering the candidate data based on dependency information includes at least one of the following: Remove data from the candidate data that has no dependency on the target agent; The candidate data is filtered based on the length of the dependency path between the candidate data and the target agent.
[0013] In one possible implementation, determining the agent corresponding to each subtask includes: By using any of the aforementioned intelligent agents, the context template corresponding to each intelligent agent is matched with the subtask to obtain the intelligent agent corresponding to each subtask.
[0014] Secondly, embodiments of this application also provide a task processing apparatus, including: The first determination module is configured to determine the target task based on user requirement data; The second determining module is configured to split the target task into multiple sub-tasks and determine the intelligent agent corresponding to each sub-task. The first acquisition module is configured to, for a target intelligent agent among the intelligent agents, obtain input data corresponding to the target intelligent agent from the task data based on the context template of the target intelligent agent; wherein, the context template represents the input content required by the target intelligent agent, and the task data includes at least one of the following: the user demand data or the context data generated by other intelligent agents besides the target intelligent agent performing sub-tasks; The second obtaining module is configured to input the input data and instruction information into the target intelligent agent to obtain the execution result of the target intelligent agent, wherein the instruction information is used to instruct the target intelligent agent to execute the corresponding sub-task. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 A flowchart of a task processing method provided in this application is shown; Figure 2 This paper presents a flowchart illustrating a method for generating a context template corresponding to a target intelligent agent in a task processing method provided in this application. Figure 3 This paper presents a flowchart illustrating a task processing method provided in this application for obtaining input data corresponding to a target agent from task data based on slot information in a context template. Figure 4 A schematic diagram of the structure of a task processing device provided in this application is shown; Figure 5 A schematic diagram of the structure of an electronic device provided in this application is shown. Detailed Implementation
[0017] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0018] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.
[0019] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0020] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0021] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application, which have the features described in the claims and are therefore all within the scope of protection defined herein.
[0022] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0023] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.
[0024] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0025] The task processing framework of this application can include multiple agents, each of which can be a program or component with specific functions, capable of making decisions and taking actions based on input. Furthermore, each agent is customizable, for example, specifying the task it performs and the desired result. Agents can also communicate with each other. For instance, agent 1 determines query logic based on a graph model or determines prompts based on a vector library; agent 2 determines the SQL statement based on the query logic or prompts, executes the SQL statement to generate query results; and agent 3 determines whether there is an analytical intent based on the input data, and if so, uses an analytical model to obtain analytical results from the query results. In practical applications, the execution logic of each agent and the dialogue logic between multiple agents can be flexibly allocated according to task requirements and scenario requirements.
[0026] To facilitate understanding of this application, a task processing method provided in this application will be described in detail below. The executor of this task processing method can be a specific intelligent agent used to control other intelligent agents to collaborate in completing a task, or it can be any intelligent agent among those performing the task; this application does not limit this.
[0027] As an example, Figure 1 A flowchart of a task processing method provided in an embodiment of this application is shown, wherein the steps specifically include S101-S104.
[0028] S101, determine the target task based on user demand data.
[0029] For example, user requirement data refers to input data defined by the user, which can be input data from one round or multiple rounds. Based on the user requirement data, the target task is determined.
[0030] For example, user request data could be "Help me create a travel plan, starting from Beijing, with a destination in Xinjiang, and a duration of 15 days." Users can further supplement their request data with details such as "departure date: June 1, 2026." Based on this, user request data can be analyzed and reconstructed to determine the target task.
[0031] S102, the target task is broken down into multiple subtasks, and the corresponding agent for each subtask is determined.
[0032] After defining the target task, it is broken down into multiple sub-tasks. For example, if the target task is "to plan a 15-day trip from Beijing to Xinjiang starting June 1, 2026", the sub-tasks could include: "finding the transportation options from Beijing to Xinjiang on June 1, 2026, as well as the travel time and cost for each option", "finding attractions, food, and accommodation in Xinjiang", "planning the itinerary for each transportation option", and "planning the return trip to Beijing for each itinerary", etc.
[0033] Of course, the above is just one example. In practice, to better meet user needs, the target task can be broken down into a large number of sub-tasks, so that the final execution result meets user requirements. For example, the final output travel plan may better match the user's travel needs.
[0034] Furthermore, after breaking down the task into multiple subtasks, the agent corresponding to each subtask is determined. One agent can correspond to multiple subtasks, meaning the same agent can execute multiple subtasks. Ideally, a one-to-one correspondence is established between subtasks and agents.
[0035] For example, when determining the agent corresponding to each subtask, the context template corresponding to each agent is matched with the subtask for each subtask to obtain the agent corresponding to each subtask. Here, the context template represents the input content required by the target agent, and the agent corresponding to the input content of the subtask is taken as the agent corresponding to that subtask.
[0036] S103, for the target intelligent agent in the intelligent agents, based on the context template of the target intelligent agent, the input data corresponding to the target intelligent agent is obtained from the task data; wherein, the context template represents the input content required by the target intelligent agent, and the task data includes at least one of the following: user requirement data or context data generated by other intelligent agents other than the target intelligent agent performing sub-tasks.
[0037] After determining the agent corresponding to each subtask, for the target agent within the agent group, based on the target agent's context template, the input data corresponding to the target agent is obtained from the task data; that is, the input data required by the target agent to execute the corresponding subtask is obtained. Here, any agent used to execute the task can be the target agent.
[0038] Optionally, the task data includes at least one of the following: user requirement data or context data generated by other intelligent agents (excluding the target intelligent agent) performing sub-tasks. That is, the input data corresponding to the target intelligent agent can be obtained solely from the user requirement data, or solely from the context data generated by other intelligent agents (excluding the target intelligent agent) performing sub-tasks, or from both the user requirement data and the context data generated by other intelligent agents (excluding the target intelligent agent) performing sub-tasks.
[0039] S104, input the input data and instruction information to the target intelligent agent, obtain the execution result of the target intelligent agent, and use the instruction information to instruct the target intelligent agent to execute the corresponding sub-task.
[0040] After obtaining the input data corresponding to the target intelligent agent, the input data and instruction information are input to the target intelligent agent so that the target intelligent agent processes the input data based on the instruction information and obtains the execution result.
[0041] The instruction information is used to instruct the target agent to execute the corresponding sub-task. That is, the target agent can process the input data according to the sub-task to be executed, and the corresponding execution result can include the context data generated by the target agent in executing the sub-task, whether the sub-task was executed successfully, and the reliability of the sub-task execution.
[0042] Optionally, the instruction information may include authentication information, which the target intelligent agent can authenticate to determine whether to process the input data or execute the subtask indicated by the instruction information. This prevents the transmission of subtasks corresponding to other intelligent agents to the target intelligent agent, which could lead to the target intelligent agent executing incorrect subtasks, resulting in wasted processing resources and task failure. The authentication information can be the target intelligent agent's identity information or pre-defined unique identifier information, etc.
[0043] This application's embodiments determine the corresponding target agent for each subtask, and for each target agent, obtain corresponding input data based on its context module. This targeted input data acquisition avoids situations where the required input content for the target agent is not provided, leading to subtask execution failure or low accuracy. It also avoids wasting processing resources and causing low accuracy due to inputting data unrelated to the target agent's subtask. The task processing method of this application's embodiments can accurately obtain the input data corresponding to each target agent, thereby ensuring that the target agent can successfully execute its corresponding subtask and guaranteeing high accuracy of the execution results, effectively improving the user experience.
[0044] For example, before obtaining the input data corresponding to the target agent from the task data based on the context template of the target agent, the context template corresponding to the target agent is generated in advance. Figure 2 A flowchart illustrating the generation of a context template corresponding to a target intelligent agent provided in an embodiment of this application is shown, wherein the steps specifically include S201 and S202.
[0045] S201, Determine the declaration information of the target intelligent agent; wherein the declaration information is used to declare at least one of the following to the object that calls the target intelligent agent: capability description, skill description, and example description.
[0046] S202, Based on the declared information, generate the context template corresponding to the target agent.
[0047] Optionally, for each target agent corresponding to a subtask, the declaration information of the target agent is determined, so as to generate a context template corresponding to the target agent based on the declaration information.
[0048] The declaration information in this application embodiment is used to declare at least one of the following to the object that calls the target intelligent agent: capability description, skill description, and example description. The capability description represents the type of task that the target intelligent agent can perform, the attributes of the execution result, and the effect produced by the execution of the task. The skill description represents the technical means and advantages that the target intelligent agent uses when performing the task. The example description represents the input content and characteristics and the execution result and characteristics of the target intelligent agent.
[0049] For example, when generating the context template corresponding to the target agent based on the declaration information, the historical input data and historical output data corresponding to the target agent are obtained, so as to generate the context template corresponding to the target agent based on the declaration information, historical input data and historical output data.
[0050] Historical input and output data are generated when the target agent performs historical tasks. Based on these historical input and output data, the context template corresponding to the target agent can be better optimized, making the required input content clearer. Therefore, when actually using the target agent to perform tasks, more accurate input data (more consistent with the target agent's required input content) can be obtained based on its context template, thereby improving the accuracy of the target agent's execution results.
[0051] As an example, the context template can have multiple slots, and the slot information for each slot can represent the input content required by the target agent. Based on this, when obtaining the input data corresponding to the target agent from the task data based on the target agent's context template, the input data corresponding to the target agent can be obtained from the task data according to the slot information in the context template.
[0052] Optionally, the slot information may include the length, type, and required / optional identifiers of the input data corresponding to the slot. If the slot information includes a required identifier, it indicates that the input content required for that slot is essential for the target agent to perform its sub-task, and the required input content directly affects the success or failure of the target agent's sub-task execution. If the slot information includes an optional identifier, it indicates that the input content required for that slot is not essential for the target agent to perform its sub-task; that is, the required input content does not affect the success or failure of the target agent's sub-task execution, but it can affect the execution result of the target agent's sub-task. Obtaining the required input content for the slot corresponding to the optional identifier will make the execution result of the target agent's sub-task more in line with user expectations, improving user satisfaction.
[0053] Taking the example of making a travel plan as described above, the input content required for the slots corresponding to the required fields can include departure date, destination city, budget, etc., while the input content required for the slots corresponding to the optional fields can include user preferences, additional restrictions, etc.
[0054] Considering that there may be multiple corresponding input data for each slot information, in this case, you can refer to... Figure 3 The flowchart shown illustrates how to obtain the input data corresponding to the target agent from the task data based on the slot information in the context template. Specifically, the steps include S301 and S302.
[0055] S301, obtain multiple candidate slot filling information corresponding to the target slot in the context template from the task data.
[0056] S302, filter candidate slot filling information based on the semantic information of the context template, and obtain input data based on the filtering results.
[0057] Each slot in the context template can serve as a target slot. For each target slot, multiple candidate slot filling information corresponding to the target slot are obtained from the task data, and each candidate slot filling information meets the input requirements of the target slot.
[0058] Furthermore, the semantic information of the context template is identified, and the candidate slot information that best matches the semantic information is selected from multiple candidate slot information, and this candidate slot information is determined as the input data corresponding to the target slot. As another example, the semantic information of preset characters before and after the target slot can also be identified, so as to select the candidate slot information corresponding to the target slot based on the semantic information of the context template and the semantic information of the preset characters before and after the target slot.
[0059] After obtaining the candidate filling information for each target slot, the input data corresponding to the target agent is obtained.
[0060] As another example, considering that multiple subtasks are obtained by splitting the target task, when multiple candidate data are obtained from the context data based on the context template of the target agent, the candidate data can be further filtered according to the dependency information to obtain the input data corresponding to the target agent.
[0061] Here, dependency information is determined based on the task dependencies between subtasks. These dependencies include pre- and post-task dependencies (e.g., subtask 1 is destination identification, subtask 2 is hotel booking, and hotel booking depends on destination identification; therefore, the task dependency between subtask 1 and subtask 2 is pre- and post-task dependencies), cross-step dependencies (e.g., subtask 3 is itinerary planning, subtask 4 is hotel booking, and subtask 5 is visa processing; in practice, visa preparation depends on hotel and itinerary information; therefore, the task dependency between subtask 5 and subtasks 3 and 4 is cross-step dependencies), and nested dependencies (e.g., the target task is split into subtasks 6, 7, and 8, and subtask 7 is further split into subtasks 71 and 72; in this case, the task dependency between subtask 7 and subtasks 71 and 72 is nested dependencies).
[0062] Optionally, when filtering candidate data based on dependency information, at least one of the following methods can be used: First, considering that some candidate data does not depend on the target agent, that is, there is data that the target agent does not need to execute its corresponding subtask, when filtering candidate data based on dependency information, data that does not depend on the target agent is removed. This avoids problems such as wasted processing resources, low task execution efficiency, and inaccurate execution results caused by inputting data that does not depend on the target agent into the target agent.
[0063] Second: Considering that the subtask corresponding to the target agent may have dependencies on multiple other subtasks, when filtering candidate data based on dependency information, the candidate data is filtered according to the length of the dependency path between the candidate data and the target agent to ensure that the input data of the determined target agent is relatively accurate.
[0064] For example, if the task dependency between subtask A and subtask B corresponding to the target agent is a cross-step dependency, and the task dependency between subtask A and subtask C is a sequential dependency, when both the context data generated by the agent corresponding to subtask B executing subtask B and the context data generated by the agent corresponding to subtask C executing subtask C contain candidate data corresponding to the target agent, the candidate data in the context data generated by the agent corresponding to subtask C executing subtask C will be selected first as the input data.
[0065] In another example, when an agent performs a subtask, it needs to connect to a network to query data from the network to complete the subtask. However, considering the time-sensitivity of network data, even if updated data is available, historical data will not be erased. Therefore, when filtering candidate data based on dependency information, the filtering is based on both the dependency information and the time-sensitivity information of each candidate data. This ensures that the input data to the target agent is highly timely, thereby guaranteeing that the target agent's execution result of the subtask is relatively accurate.
[0066] This application also provides a task processing device. Since the principle of the task processing device in this application is similar to the task processing method described above, the implementation of the task processing device can refer to the implementation of the task processing method described above, and the repeated parts will not be described again.
[0067] For example, Figure 4 A schematic diagram of the task processing device is shown, with reference to... Figure 4 The task processing device includes: The first determining module 401 is configured to determine the target task based on user requirement data; The second determining module 402 is configured to split the target task into multiple sub-tasks and determine the intelligent agent corresponding to each sub-task. The first obtaining module 403 is configured to obtain input data corresponding to the target intelligent agent from the task data based on the context template of the target intelligent agent for the target intelligent agent; wherein, the context template represents the input content required by the target intelligent agent, and the task data includes at least one of the following: the user demand data or the context data generated by other intelligent agents other than the target intelligent agent performing sub-tasks; The second obtaining module 404 is configured to input the input data and instruction information into the target intelligent agent to obtain the execution result of the target intelligent agent, wherein the instruction information is used to instruct the target intelligent agent to execute the corresponding sub-task.
[0068] As another example, the task processing apparatus also includes a generation module 405, which is configured as follows: Determine the declaration information of the target intelligent agent; wherein the declaration information is used to declare at least one of the following to the object that invokes the target intelligent agent: capability description, skill description, and example description; Based on the declaration information, a context template corresponding to the target intelligent agent is generated.
[0069] As another example, the specific configuration of generation module 405 is as follows: Obtain the historical input data and historical output data corresponding to the target intelligent agent; wherein, the historical input data and the historical output data are generated when the target intelligent agent performs historical tasks; Based on the declaration information, the historical input data, and the historical output data, a context template corresponding to the target intelligent agent is generated.
[0070] As another example, the first acquisition module 403 is specifically configured as follows: The input data corresponding to the target agent is obtained from the task data based on the slot information in the context template.
[0071] As another example, the first acquisition module 403 is also configured as follows: From the task data, obtain multiple candidate slot filling information corresponding to the target slot in the context template; The candidate slot filling information is filtered based on the semantic information of the context template, and the input data is obtained based on the filtering results.
[0072] As another example, the first acquisition module 403 is also configured as follows: Based on the context template of the target agent, candidate data is obtained from the context data; The candidate data is filtered based on the dependency information to obtain the input data, wherein the dependency information is determined based on the task dependency relationship between the subtasks.
[0073] As another example, the first acquisition module 403 is also configured as follows: The candidate data is filtered based on the dependency information and the timeliness information of each candidate data.
[0074] As another example, the first acquisition module 403 is also configured to perform at least one of the following: Remove data from the candidate data that has no dependency on the target agent; The candidate data is filtered based on the length of the dependency path between the candidate data and the target agent.
[0075] As another example, the second determining module 402 is specifically configured as follows: By using any of the aforementioned intelligent agents, the context template corresponding to each intelligent agent is matched with the subtask to obtain the intelligent agent corresponding to each subtask.
[0076] This application's embodiments determine the corresponding target agent for each subtask, and for each target agent, obtain corresponding input data based on its context module. This targeted input data acquisition avoids situations where the required input content for the target agent is not provided, leading to subtask execution failure or low accuracy. It also avoids wasting processing resources and causing low accuracy due to inputting data unrelated to the target agent's subtask. The task processing method of this application's embodiments can accurately obtain the input data corresponding to each target agent, thereby ensuring that the target agent can successfully execute its corresponding subtask and guaranteeing high accuracy of the execution results, effectively improving the user experience.
[0077] Another aspect of this application provides an electronic device, the structural schematic of which can be shown as follows: Figure 5 As shown, it includes at least a memory 501 and a processor 502. The memory 501 stores a computer program, and the processor 502 implements the method provided in any embodiment of this application when executing the computer program in the memory 501. Exemplarily, the steps of the electronic device computer program are as follows: S11-S13: S11, Determine the target task based on user demand data; S12, the target task is broken down into multiple sub-tasks, and the agent corresponding to each sub-task is determined; S13, for the target intelligent agent in the intelligent agents, based on the context template of the target intelligent agent, obtain the input data corresponding to the target intelligent agent from the task data; wherein, the context template represents the input content required by the target intelligent agent, and the task data includes at least one of the following: the user demand data or the context data generated by other intelligent agents other than the target intelligent agent performing sub-tasks; S14, input the input data and instruction information to the target intelligent agent to obtain the execution result of the target intelligent agent, wherein the instruction information is used to instruct the target intelligent agent to execute the corresponding sub-task.
[0078] Another aspect of this application provides a storage medium that is a computer-readable medium, the storage medium carrying one or more computer programs, which, when executed by a processor, implement the method provided in any embodiment of this application, including the following steps S21-S23: S21, Determine the target task based on user demand data; S22, the target task is broken down into multiple sub-tasks, and the intelligent agent corresponding to each sub-task is determined; S23, for the target intelligent agent in the intelligent agents, based on the context template of the target intelligent agent, obtain the input data corresponding to the target intelligent agent from the task data; wherein, the context template represents the input content required by the target intelligent agent, and the task data includes at least one of the following: the user demand data or the context data generated by other intelligent agents other than the target intelligent agent performing sub-tasks; S24, input the input data and instruction information to the target intelligent agent to obtain the execution result of the target intelligent agent, wherein the instruction information is used to instruct the target intelligent agent to execute the corresponding sub-task.
[0079] This application's embodiments determine the corresponding target agent for each subtask, and for each target agent, obtain corresponding input data based on its context module. This targeted input data acquisition avoids situations where the required input content for the target agent is not provided, leading to subtask execution failure or low accuracy. It also avoids wasting processing resources and causing low accuracy due to inputting data unrelated to the target agent's subtask. The task processing method of this application's embodiments can accurately obtain the input data corresponding to each target agent, thereby ensuring that the target agent can successfully execute its corresponding subtask and guaranteeing high accuracy of the execution results, effectively improving the user experience.
[0080] Furthermore, although exemplary embodiments have been described herein, their scope includes any and all embodiments based on this application that have equivalent elements, modifications, omissions, combinations (e.g., schemes involving intersections of various embodiments), adaptations, or alterations. Elements in the claims will be interpreted broadly based on the language used in the claims and are not limited to the examples described in this specification or during the implementation of this application, which will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered illustrative only, and the true scope and spirit are indicated by the following claims and the full scope of their equivalents.
[0081] The above description is intended to be illustrative and not restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. Other embodiments may be used by those skilled in the art upon reading the above description. Furthermore, in the above detailed description, various features may be grouped together to simplify the application. This should not be construed as an intention that a disclosed feature not claimed is necessary for any claim. Rather, the subject matter of this application may be less than all the features of a particular disclosed embodiment. Thus, the following claims are incorporated herein by reference as examples or embodiments, wherein each claim is an independent, separate embodiment, and these embodiments are contemplated as being possible in various combinations or arrangements. The scope of this application should be determined by reference to the appended claims and the full scope of their equivalents.
[0082] The foregoing has described in detail several embodiments of this application, but this application is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications based on the concept of this application, and all such variations and modifications should fall within the scope of protection claimed in this application.
Claims
1. A task processing method, comprising: Based on user demand data, determine the target tasks; The target task is broken down into multiple subtasks, and the corresponding intelligent agent for each subtask is determined. For a target agent among the agents, input data corresponding to the target agent is obtained from the task data based on the context template of the target agent; wherein, the context template represents the input content required by the target agent, and the task data includes at least one of the following: the user requirement data or context data generated by other agents besides the target agent performing sub-tasks; The input data and instruction information are input to the target intelligent agent to obtain the execution result of the target intelligent agent. The instruction information is used to instruct the target intelligent agent to execute the corresponding sub-task.
2. The processing method according to claim 1, further comprising: Determine the declaration information of the target intelligent agent; wherein the declaration information is used to declare at least one of the following to the object that invokes the target intelligent agent: capability description, skill description, and example description; Based on the declaration information, a context template corresponding to the target intelligent agent is generated.
3. The processing method according to claim 2, wherein generating the context template corresponding to the target agent based on the declaration information includes: Obtain the historical input data and historical output data corresponding to the target intelligent agent; wherein, the historical input data and the historical output data are generated when the target intelligent agent performs historical tasks; Based on the declaration information, the historical input data, and the historical output data, a context template corresponding to the target intelligent agent is generated.
4. The processing method according to claim 1, wherein the input data corresponding to the target agent is obtained from the task data based on the context template of the target agent, includes: The input data corresponding to the target agent is obtained from the task data based on the slot information in the context template.
5. The processing method according to claim 4, wherein obtaining the input data corresponding to the target agent from the task data based on the slot information in the context template includes: From the task data, obtain multiple candidate slot filling information corresponding to the target slot in the context template; The candidate slot filling information is filtered based on the semantic information of the context template, and the input data is obtained based on the filtering results.
6. The processing method according to claim 1, wherein obtaining the input data corresponding to the target agent from the task data based on the context template of the target agent includes: Based on the context template of the target agent, candidate data is obtained from the context data; The candidate data is filtered based on the dependency information to obtain the input data, wherein the dependency information is determined based on the task dependency relationship between the subtasks.
7. The processing method according to claim 6, wherein filtering the candidate data based on dependency information includes: The candidate data is filtered based on the dependency information and the timeliness information of each candidate data.
8. The processing method according to claim 6, wherein filtering the candidate data based on dependency information includes at least one of the following: Remove data from the candidate data that has no dependency on the target agent; The candidate data is filtered based on the length of the dependency path between the candidate data and the target agent.
9. The processing method according to claim 1, wherein determining the agent corresponding to each subtask includes: By using any of the aforementioned intelligent agents, the context template corresponding to each intelligent agent is matched with the subtask to obtain the intelligent agent corresponding to each subtask.
10. A task processing apparatus, comprising: The first determination module is configured to determine the target task based on user requirement data; The second determining module is configured to split the target task into multiple sub-tasks and determine the intelligent agent corresponding to each sub-task. The first acquisition module is configured to, for a target intelligent agent among the intelligent agents, obtain input data corresponding to the target intelligent agent from the task data based on the context template of the target intelligent agent; wherein, the context template represents the input content required by the target intelligent agent, and the task data includes at least one of the following: the user demand data or the context data generated by other intelligent agents besides the target intelligent agent performing sub-tasks; The second obtaining module is configured to input the input data and instruction information into the target intelligent agent to obtain the execution result of the target intelligent agent, wherein the instruction information is used to instruct the target intelligent agent to execute the corresponding sub-task.