Task processing method and device, computer equipment, storage medium and product

By determining the task type in the large language model and generating task plans by querying process prompt word templates, the problem of low efficiency in LLM autonomous planning is solved, and high efficiency and flexibility in task processing are achieved.

CN122019624APending Publication Date: 2026-05-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2026-01-26
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Large Language Models (LLMs) are inefficient at autonomously planning tasks during task processing, resulting in low task processing efficiency.

Method used

After determining the task type, the corresponding process prompt template is retrieved from the template library to generate a task plan. The task is then processed based on this plan, avoiding random errors in self-planning and improving the success rate and efficiency of task processing.

Benefits of technology

It improves the efficiency and flexibility of task processing, ensures the accuracy and reliability of task processing, and is suitable for task planning and processing of different task types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122019624A_ABST
    Figure CN122019624A_ABST
Patent Text Reader

Abstract

The invention relates to a task processing method and device, computer equipment, a storage medium and a product. The method comprises the steps of determining a task type of a target task in response to a processing request for the target task; based on the task type, querying a first process cue word template corresponding to the task type from a template library; generating a first task plan based on the target task and the first process cue word template; and performing task processing on the target task based on the first task plan to obtain a first processing result of the target task. By adopting the method, the task processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a task processing method, apparatus, computer equipment, storage medium, and product. Background Technology

[0002] With the continuous development of computer and internet technologies, the application of Large Language Models (LLMs) is becoming increasingly widespread. Reason Act (ReAct) is a structured prompting method that guides LLMs to handle tasks in a manner similar to human problem-solving. However, ReAct autonomously plans and processes tasks during the task processing process, resulting in relatively low task processing efficiency. Summary of the Invention

[0003] Therefore, it is necessary to provide a task processing method, apparatus, computer equipment, storage medium, and product that can improve task processing efficiency in response to the above-mentioned technical problems.

[0004] Firstly, this application provides a task processing method. The method includes: in response to a processing request for a target task, determining the task type of the target task; based on the task type, querying a template library for a first process prompt word corresponding to the task type; generating a first task plan based on the target task and the first process prompt word template; and processing the target task based on the first task plan to obtain a first processing result for the target task.

[0005] Secondly, this application also provides a task processing apparatus. The apparatus includes: a determining module, configured to determine the task type of the target task in response to a processing request for the target task; a querying module, configured to query a first process prompt word template corresponding to the task type from a template library based on the task type; a generating module, configured to generate a first task plan based on the target task and the first process prompt word template; and a processing module, configured to perform task processing on the target task based on the first task plan to obtain a first processing result for the target task.

[0006] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program, performs the following steps: in response to a processing request for a target task, determining the task type of the target task; based on the task type, querying a template library for a first process prompt word template corresponding to the task type; generating a first task plan based on the target task and the first process prompt word template; and processing the target task based on the first task plan to obtain a first processing result for the target task.

[0007] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps: in response to a processing request for a target task, determining the task type of the target task; based on the task type, querying a template library for a first process prompt word template corresponding to the task type; generating a first task plan based on the target task and the first process prompt word template; and processing the target task based on the first task plan to obtain a first processing result for the target task.

[0008] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps: in response to a processing request for a target task, determining the task type of the target task; based on the task type, querying a template library for a first process prompt word template corresponding to the task type; generating a first task plan based on the target task and the first process prompt word template; and processing the target task based on the first task plan to obtain a first processing result for the target task.

[0009] The aforementioned task processing method, apparatus, computer equipment, storage medium, and product first respond to a processing request for a target task by determining the task type of the target task. Then, based on the task type, a first process prompt word template corresponding to that task type is retrieved from a template library. A first task plan is generated based on the target task and the first process prompt word template. Finally, the target task is processed based on the first task plan to obtain a first processing result. It is evident that first determining the task type, then retrieving the corresponding process prompt word template, and finally generating a task plan based on the task and the process prompt word template avoids random errors inherent in autonomous planning, thus ensuring a higher success rate for task processing and improving task processing efficiency. Furthermore, since the task plan is generated based on the process prompt word template, task planning from scratch is avoided, thereby improving task planning efficiency and further enhancing task processing efficiency. Furthermore, since the process prompt templates are obtained based on the task type, different process prompt templates can be used for different task types to plan and process tasks, thereby improving the flexibility and applicability of task planning and processing. Attached Figure Description

[0010] Figure 1 This is an application environment diagram of a task processing method in one embodiment;

[0011] Figure 2 This is a flowchart illustrating a task processing method in one embodiment;

[0012] Figure 3 This is a structural block diagram of a large language model in one embodiment;

[0013] Figure 4 This is a schematic diagram of parallel processing of a subtask processing chain in one embodiment;

[0014] Figure 5 This is a schematic diagram of a subtask processing chain and parallel processing of dependent subtasks in one embodiment;

[0015] Figure 6 This is a schematic diagram of the architecture of a task processing method in one embodiment;

[0016] Figure 7 This is a flowchart illustrating the task processing method in another embodiment;

[0017] Figure 8 This is an interactive diagram of a task processing method in one embodiment;

[0018] Figure 9This is a structural block diagram of a task processing device in one embodiment;

[0019] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0021] It should be noted that in the following description, the terms "first, second, and third" are used only to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, and third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0022] The task processing method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located on the cloud or other network servers. Terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart TVs, smart in-vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be a standalone physical server, a service node in a blockchain system, or a server cluster consisting of multiple physical servers. The server cluster can be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms.

[0023] Both the terminal and the server can be used independently to execute the methods provided in the embodiments of this application. For example, the server first responds to a processing request for a target task, determines the task type of the target task, then queries a template library for a first process prompt word template corresponding to that task type based on the task type, generates a first task plan based on the target task and the first process prompt word template, and then processes the target task based on the first task plan to obtain a first processing result for the target task. It is understood that in some application scenarios, the terminal and the server can also be used collaboratively to execute the methods provided in the embodiments of this application.

[0024] In one embodiment, such as Figure 2 As shown, a task processing method is provided. This method can be executed by the server or terminal alone, or by both the server and terminal, to be applied to... Figure 1 Taking a terminal as an example, this task processing method may include the following steps:

[0025] S202, in response to a request to process a target task, determine the task type of the target task.

[0026] The target task is any task input by the user. The processing request for the target task is the request used to process the target task. The task type of the target task is the type or category of the target task. Task types can be general or vertical. General types are those with broad applicability, not dependent on specific domain knowledge, and transferable to various different scenarios and problems. General types can include information retrieval, multi-hop information filtering, document retrieval, and deep search. Information retrieval is a technique for finding relevant documents or information fragments from large-scale, unstructured datasets based on user queries. Document retrieval is a proactive, targeted information search process conducted by users to obtain specific facts or data. Deep search is a systematic, multi-dimensional, and critical information mining and exploration process conducted for complex analysis, strategic decision-making, or deep understanding. Vertical types focus on a specific industry, professional field, or specific business scenario. Vertical types can include shopping, stocks, coding, etc. Multi-hop information filtering is a technique for accurately filtering information relevant to complex queries from large-scale, interconnected data through multi-step reasoning.

[0027] Upon receiving a processing request for a target task, the task type can be determined in response to the request. This can be achieved by performing semantic parsing or semantic analysis on the target task.

[0028] In this embodiment, when the terminal performs the operation, it can receive user input requesting the processing of a target task, and then determine the task type of the target task in response to the processing request.

[0029] In this embodiment, where the server performs the operation, it can receive a processing request for a target task from a client. Then, in response to the processing request, it can parse the request to obtain the target task and determine its task type. The processing request may include the target task. The client can be any client corresponding to the server.

[0030] S204, Based on the task type of the target task, query the template library for the first process prompt word template corresponding to the task type of the target task.

[0031] The template library is a database used to store and manage process prompt templates for different task types. A process prompt template is a predefined, structured framework for specific task types, used to guide LLM in generating task planning or task processing steps. The first process prompt template is any process prompt template stored in the template library. A process prompt template may include at least one of the following: task decomposition logic, core task constraints, task processing specifications, and agent recommendations. Task decomposition logic is the logic used to break down or decompose a task into a series of smaller, more specific, more manageable, and sequentially or concurrently executable subtasks. Core task constraints are the non-negotiable limitations or boundaries that must be followed during task processing. Task processing specifications are a set of standardized operating guidelines, processes, rules, and quality standards developed to ensure high-quality, efficient, predictable, and collaborative task completion. Agent recommendations are recommended agents. An agent is an intelligent system capable of perceiving the environment, autonomously making decisions, and taking actions to achieve specific goals. The following provides illustrative examples of process prompt templates for different task types.

[0032] For example, a shopping process prompt template could be as follows:

[0033] Shopping-related issues require in-depth analysis of user needs. This involves product filtering, comparison, price checks, cost-effectiveness analysis, and purchasing recommendations based on user preferences. Prioritize using product-related or shopping-related agents or Model Context Protocols (MCPs) to solve these problems.

[0034] Here are some common approaches to breaking down shopping problems:

[0035] 1. When a user asks for information about a product, simply try searching for the corresponding information.

[0036] 2. When users ask about prices or whether they got a good deal, you can use product price search tools to prioritize obtaining relevant data and analyze the user's questions accordingly.

[0037] 3. When users need product recommendations, they can first filter product models that meet the requirements, then conduct parameter comparison and analysis, and finally generate the final recommendation by combining the purchase price and the optimal route.

[0038] 4. When users ask about the best time to buy, the analysis should be combined with the historical price reduction trend of the corresponding product type and the timing of shopping festivals such as Shopping Festival 1 and Shopping Festival 2.

[0039] 5. When a user asks whether xx is worth buying, in addition to analyzing the product, you can also recommend more cost-effective alternatives of the same type.

[0040] The task decomposition logic in the above shopping process prompt template can be approach 1 to approach 5, the core task constraint in the above shopping process prompt template can be approach 3, and the task processing specifications in the above shopping process prompt template can be approach 2 and approach 4.

[0041] For example, a flowchart prompt template for information retrieval can be as follows:

[0042] Information retrieval questions can usually be answered with a simple search, without the need for complex multi-step planning.

[0043] Core processing strategy:

[0044] 1. Question type identification: Distinguish between factual queries (e.g., "Today's weather is XX"), concept explanations (e.g., "What is noun 1?"), and operation guides (e.g., "How to operate XXX").

[0045] 2. Search strategy selection:

[0046] a. Fact Lookup: Directly search and extract key factual information;

[0047] b. Concept Explanation: Prioritize authoritative sources such as Platform 1 and Platform 2;

[0048] c. Operation Guidelines: For professional issues, prioritize using technical documents and other professional communities.

[0049] 3. Result verification: For information with high time sensitivity (such as weather and stock prices), verify the update time of the data.

[0050] 4. Precautions: Avoid over-planning; simple problems do not need to be broken down into multiple steps; prioritize authoritative information sources; pay attention to the timeliness of information.

[0051] The task decomposition logic in the above information retrieval process prompt template can be strategy 1 to strategy 4, the core task constraints in the above information retrieval process prompt template can be strategy 1 and strategy 2, and the task processing specifications in the above information retrieval process prompt template can be strategy 3 and strategy 4.

[0052] For example, a flowchart prompt template for multi-hop information filtering can be as follows:

[0053] Multi-hop information filtering: The questions raised by users are quite complex, involving the analysis and progressive filtering of multiple questions.

[0054] Core processing strategy:

[0055] 1. Identify the multi-level information dependencies in the problem.

[0056] 2. Break down complex problems into multiple simple retrieval steps.

[0057] 3. Each search step generates clear and concise search keywords or key phrases.

[0058] 4. Establish an information transfer mechanism between retrieval steps.

[0059] 5. Use multiple search engines (engine 1, engine 2, engine 3, engine 4) to increase coverage.

[0060] 6. Validate the intermediate search results.

[0061] 7. Note: Never use complete and complex questions directly as search keywords.

[0062] The task decomposition logic in the above multi-hop information filtering process prompt template can be strategy 1 to strategy 7, the core task constraints in the above multi-hop information filtering process prompt template can be strategy 1 and strategy 6, and the task processing specifications in the above multi-hop information filtering process prompt template can be strategy 5 and strategy 7.

[0063] For example, a stock transaction prompt template could be as follows:

[0064] 1. Identify the stock code or company name queried by the user.

[0065] 2. Determine the time range for the query (real-time / historical / trend).

[0066] 3. Identify the types of indicators needed (stock price / price change / market capitalization / trading volume / financial indicators, etc.).

[0067] 4. If comparing multiple stocks, data must be obtained separately for each stock before comparative analysis.

[0068] 5. Notes: Stock data must include the data source and time; avoid using expired data.

[0069] The task decomposition logic in the above-mentioned stock's process prompt template can be 1 to 5, the core task constraints in the above-mentioned stock's process prompt template can be 1 to 3, and the task processing specifications in the above-mentioned stock's process prompt template can be 4 and 5.

[0070] The template library can also store version numbers of the process prompt templates. The version number of a process prompt template can include a major version number and a minor version number. For example, the version number of a process prompt template can be XY, where X is the major version number and Y is the minor version number. For instance, the version number of a process prompt template is 1.0, where "1" is the major version number and "0" is the minor version number.

[0071] Based on the task type of the target task, the system can query the template library for the corresponding first process prompt template. It can also query the template library for the corresponding first process prompt template based on the task type of the target task.

[0072] The template library stores the mapping between task types and workflow prompt templates. Based on this mapping, you can query the first workflow prompt template corresponding to a target task's task type. One task type can correspond to one workflow prompt template, or at least two. If a task type corresponds to at least two workflow prompt templates, the version numbers of these templates must be different. When the target task's task type corresponds to at least two workflow prompt templates, the first workflow prompt template is the one with the most recent release among the at least two templates corresponding to the target task's task type.

[0073] S206, Generate the first task plan based on the target task and the first process prompt word template.

[0074] Task planning is the process of breaking down a task into a sequence of specific, executable, or processable subtasks. A sequence of subtasks may include agent assignment, dependencies between subtasks, and parameter configuration. Agent assignment involves assigning agents to subtasks. Dependencies between subtasks are logical relationships where the start or completion of one subtask depends on the output, state, or resources of one or more other subtasks. Parameter configuration is the process of defining the behavior, performance, or connectivity of a subtask by setting adjustable parameters. The first task planning is task planning specifically for the target task.

[0075] After retrieving the first-step prompt word template, a first-step task plan can be generated based on the target task and the first-step prompt word template. In other words, task planning can be performed based on the target task and the first-step prompt word template to obtain the first-step task plan. Therefore, task planning for the target task can be performed based on the prompt words (Prompt) in the first-step prompt word template to obtain the first-step task plan. Prompt words are information used to guide the large language model in understanding and completing the task.

[0076] S208, Based on the first task planning, perform task processing on the target task to obtain the first processing result of the target task.

[0077] The first processing result of the target task is the result after processing the target task based on the first task plan. The first processing result of the target task may include the processing results of all or some of the subtasks of the target task, or it may be determined based on the processing results of all or some of the subtasks of the target task.

[0078] The target task can be processed based on the first task plan, that is, the target task can be processed according to the processing steps or processing logic in the first task plan to obtain the first processing result of the target task.

[0079] In the above embodiments, in response to a processing request for a target task, the task type of the target task is first determined. Then, based on the task type, a first process prompt word template corresponding to that task type is queried from a template library. A first task plan is generated based on the target task and the first process prompt word template. Finally, the target task is processed based on the first task plan to obtain a first processing result. It is evident that by first determining the task type, then querying the corresponding process prompt word template, and then generating a task plan based on the task and the process prompt word template, the randomness errors of autonomous planning can be avoided, thus ensuring a higher success rate for task processing and improving task processing efficiency. Furthermore, since the task plan is generated based on the process prompt word template, task planning from scratch is avoided, thereby improving task planning efficiency and further enhancing task processing efficiency. Moreover, since the process prompt word template is obtained based on the task type, different task types can be addressed with different process prompt word templates, allowing for task planning and processing based on different process prompt word templates, thus improving the flexibility and applicability of task planning and processing.

[0080] In one embodiment, in response to a processing request for a target task, determining the task type of the target task includes: in response to a processing request for the target task, obtaining classification prompt information; and based on the classification prompt information, performing semantic analysis on the target task using a first language model to obtain the task type of the target task.

[0081] The classification prompts are used to categorize tasks. The first large language model is a large language model used to determine task types, i.e., a large language model with task classification capabilities. The large language model is a large-scale artificial intelligence (AI) model with natural language understanding and generation capabilities.

[0082] Upon receiving a processing request for a target task, the system can respond by performing semantic analysis on the target task using the first major language model to determine its task type. Alternatively, it can first respond to the processing request by obtaining classification hints, and then perform semantic analysis on the target task using the first major language model based on these hints to determine its task type. Another approach is to input the classification hints and the target task into the first major language model, which will then output the task type.

[0083] For example, category suggestion information can be as follows:

[0084] You are a fully-featured intelligent assistant that can understand users' questions and identify the domain of the questions; then analyze the user's questions to determine whether the questions should be answered directly or whether a processing plan needs to be developed and handed over to other intelligent agents.

[0085] The list and detailed descriptions of the domains for handling requests are as follows:

[0086] - Shopping: All needs related to shopping, product comparison, product information inquiry, product purchase advice, product selection tips, product recommendations, and other product analysis can be categorized under shopping.

[0087] - Stocks: Check the stock price information of listed companies.

[0088] - Multi-hop information filtering: The questions raised by users are quite complex, involving the analysis and progressive filtering of multiple questions.

[0089] - Information retrieval: Information retrieval can answer users' questions.

[0090] - Write code: The user explicitly wants to accomplish their needs by writing a piece of code.

[0091] - Preference Settings: Users can set personal information or preferences. Supported settings include: enabling / disabling image generation, enabling / disabling follow-up questions, enabling / disabling deep thinking, and specifying the name of the large language model used by the system (Model 1, Model 2, Model 3, Model 4, ...). In addition to fixed settings, the system also supports recording users' personal preferences, such as when a user says, "I like digital products."

[0092] - Preference query: This refers only to users actively querying their current personal information or preferences, such as asking "What are my preferences?", "What are my settings?", "What are the current model settings?", etc. Other types of questions do not fall into this category.

[0093] -Others: Those that do not belong to the previous categories are classified as "Others".

[0094] 1. If a user asks you a simple common-sense question that you can answer accurately and directly without involving complex tasks such as creating charts or web pages, directly generate a title of no more than 20 characters and return {"domain":"Question Domain","intent":"Answer","title":"Title Content"}.

[0095] 2. If, after analysis, using the latest network data, further breaking down the problem, and utilizing other tools can yield a more accurate answer to the user's question, please generate a title of no more than 20 characters and return {"domain":"Problem Domain","intent":"plan","title":"Title Content"}.

[0096] The user's question is: {.rewrite_query}.

[0097] limit:

[0098] The current time is {.time}. Ignore any content that contradicts it.

[0099] - Returns the required JSON structure; be sure to return a JSON object that meets the requirements.

[0100] - The returned format is: {"domain":"domain type of query", "intent":"answer or plan", "title":"title of up to 20 characters"}.

[0101] - The domain field can only be selected from the list of domains above.

[0102] - The intent field can only be either answer or plan.

[0103] For example, assuming the target task is "recommendation of mobile phones under XXXX yuan, focusing on gaming and photography", the first language model can be guided based on the above classification prompts to identify the task type of "recommendation of mobile phones under XXXX yuan, focusing on gaming and photography", and a JavaScript Object Notation (JSON) format result can be generated. The JSON format result can be as follows:

[0104] {

[0105] "domain": "shopping",

[0106] "intent": "plan",

[0107] Title: Recommended Gaming and Camera Phones (Price: XXXX Yuan)

[0108] }

[0109] In the above embodiments, classification prompt information is first obtained, and then semantic analysis of the target task is performed using a large language model based on the classification prompt information to obtain the task type of the target task. Since the task type of the target task is obtained based on the semantic analysis of the classification prompt information, the randomness errors of autonomous semantic analysis can be avoided. Therefore, the accuracy and reliability of task type determination can be guaranteed, thereby improving task processing efficiency. Furthermore, since the task type of the target task is obtained based on the semantic analysis of the classification prompt information, semantic analysis from scratch can be avoided, thus improving the efficiency of task type determination and further improving task processing efficiency.

[0110] In one embodiment, generating a first task plan based on a target task and a first process prompt word template includes: filling a prompt context template with the target task and the first process prompt word template to obtain a prompt context; and generating the first task plan based on the prompt context using a second language model.

[0111] The prompt context template is a structured framework containing fixed formats and variable placeholders for systematically and structurally constructing prompts. The prompt context is the sum of all input information used to input the large language model, enabling the large language model to generate task planning. The second large language model is the large language model used to generate task planning. The second large language model can be the same as the first large language model, or they can be different large language models. If the first and second large language models are the same large language model, this large language model is an AI model with task classification and task planning capabilities.

[0112] After retrieving the first process prompt template, the target task and the first process prompt template can be merged. This involves filling the prompt context template with the target task and the first process prompt template, thus creating the prompt context. Then, based on the prompt context, the first task plan can be generated using the second language model. Specifically, the prompt context can be input into the second language model, which can then output the first task plan.

[0113] For example, such as Figure 3 As shown, when the first and second large language models are the same large language model, the large language model can include a classification network and a planning network. Based on the classification prompt information, the classification network in the large language model can perform semantic analysis on the target task to obtain the task type of the target task. Based on the prompt context, the planning network in the large language model can generate the first task plan.

[0114] In the above embodiments, since the target task and the first process prompt word template are first filled into the prompt context template to obtain the prompt context, the fusion of the target task and the first process prompt word template by the second large language model can be avoided, reducing the processing steps of the second large language model and thus improving the generation efficiency of task planning, thereby improving task processing efficiency. Furthermore, since the first task plan is generated using the second large language model, which is a pre-trained large language model specifically designed for task planning, the generation efficiency of task planning can be further improved, thereby improving task processing efficiency.

[0115] In one embodiment, filling the prompt context template with the target task and the first process prompt word template to obtain the prompt context includes: obtaining a list of agents based on the task type of the target task; and filling the prompt context template with the task type of the target task, the list of agents, the target task, and the first process prompt word template to obtain the prompt context.

[0116] Because different target tasks have different task types, the agents that can be used to process those tasks may also differ. Therefore, a list of agents can be obtained based on the task type of the target task, i.e., the list of agents corresponding to the task type. This list can be obtained locally, from a server, from a template library, or from a dedicated database. The agent list is a list of available agents, that is, a list consisting of all available agents. The agent list can include at least two agents.

[0117] Then, the agent list, target task, and first-process prompt word template can be integrated. This involves filling the prompt context template with the target task's task type, agent list, and first-process prompt word template to obtain the prompt context. Since the prompt context incorporates agents that the target task can use, the second language model can avoid determining the agent used for the target task, simplifying its processing and thus improving the efficiency of task planning generation.

[0118] For example, in a shopping scenario, the context for providing the prompt could be as follows:

[0119] As a professional shopping planner in [field name], you need to refer to the following rules to analyze user needs and develop a concise and focused execution plan:

[0120] {Flowchart Template}

[0121] Available Agents:

[0122] {List of Available Agents} / / Product search agent, parameter comparison agent, price search agent, cost-effectiveness analysis agent, shopping recommendation agent.

[0123] User needs: {User question} / / Recommendations for mobile phones under XXXX yuan, focusing on gaming and photography.

[0124] Output requirements: JSON format, including subtask ID, name, Agent type, input parameters, and dependencies.

[0125] As can be seen, the context template includes the domain (i.e., task type), process prompt word template, list of available agents, and user question (i.e., task or task content), which are the contents that need to be filled in.

[0126] For example, the above-mentioned prompt context can be input into the second language model to guide it in generating a structured plan that includes core steps such as product selection and price comparison. This structured plan can be: [

[0128] {

[0129] "task_id": "task001", #Identifier of the subtask

[0130] "name": "Product Filtering", #Name of the subtask

[0131] "agent_type": "Product Search Agent", #Agent type

[0132] "params": {"product_type": "mobile phone", "budget": "5000 yuan", "demands": ["games", "photography"]}, #parameters

[0133] "after_list": []

[0134] },

[0135] {

[0136] "task_id": "task002", #Identifier of the subtask

[0137] "name": "Parameter Comparison", # Subtask Name

[0138] "agent_type": "Parameter comparison Agent", #Agent type

[0139] "params": {"product_list": "{task1.output}"}, #parameters

[0140] "after_list": ["task001"] / / Depends on the results after task001 has processed them.

[0141] } ]

[0143] In the above embodiments, since the prompt context includes not only the target task and the first process prompt word template, but also the agent that the target task can use and the task type of the target task, the second language model can avoid determining the agent used by the target task, simplifying the processing of the second language model and thus improving the efficiency of task planning generation, which in turn improves task processing efficiency. Furthermore, the agent list is obtained based on the task type of the target task. Different task types yield different agent lists, leading to different task plans. This enables personalized task planning generation, improving the flexibility and adaptability of task planning.

[0144] In one embodiment, processing a target task based on a first task plan to obtain a first processing result of the target task includes: parsing the first task plan to obtain at least two sub-tasks of the target task; calling the intelligent agents corresponding to each sub-task to process each sub-task to obtain the processing result of each sub-task; and fusing the processing results of each sub-task to obtain the first processing result of the target task.

[0145] A subtask is a smaller, more specific, and easier-to-handle independent step or component obtained by breaking down and refining a larger, more complex main task.

[0146] Since the target task has been decomposed and refined into at least two subtasks during the generation of the second language model's first task plan, the first task plan includes at least two subtasks of the target task. Therefore, the first task plan can be parsed to obtain at least two subtasks of the target task. These at least two subtasks are all the subtasks obtained from the decomposition and refinement of the target task.

[0147] Since a corresponding agent has already been assigned to each subtask during the planning of the first task for generating the second language model, after parsing and obtaining at least two subtasks of the target task, the agents corresponding to each subtask can be invoked to process each subtask, thereby obtaining the processing results of each subtask. For example, a product retrieval agent or a price comparison agent can be invoked to handle shopping-related subtasks, a code generation agent or a code testing agent can be invoked to handle code-related subtasks, and a retrieval agent or a summary agent can be invoked to handle query-related subtasks. Different subtasks can be processed in parallel, sequentially, or a combination of parallel and sequential processing.

[0148] The processing results of each subtask can then be combined to obtain the first processing result of the target task. In other words, the first processing result of the target task can be generated based on the processing results of each subtask. This can be achieved by combining the processing results of all subtasks, or by combining the processing results of some subtasks from at least two subtasks.

[0149] In the above embodiments, the first task plan is first parsed to obtain at least two subtasks of the target task. Then, the corresponding intelligent agents for each subtask are invoked to process each subtask, obtaining the processing results of each subtask. Finally, the processing results of each subtask are merged to obtain the first processing result of the target task. Since different intelligent agents are invoked to process different subtasks, some subtasks can be processed in parallel, which can improve the processing efficiency of subtasks and thus improve the processing efficiency of the task. In addition, since the processing result of the task is obtained by fusing the processing results of the subtasks, the accuracy and reliability of the processing result of the task can be guaranteed while improving the processing efficiency of the task.

[0150] In one embodiment, parsing the first task plan to obtain at least two subtasks of the target task includes: parsing the first task plan to obtain at least two subtasks of the target task and the dependencies between each subtask; the task processing method further includes: determining a dependency graph based on the dependencies between each subtask; and calling the intelligent agent corresponding to each subtask to process each subtask and obtain the processing result of each subtask, including: calling the intelligent agent corresponding to each subtask to process each subtask based on the dependency graph and obtaining the processing result of each subtask.

[0151] Dependencies between subtasks refer to the logical, temporal, or resource-related interactions and constraints between different subtasks. A dependency graph is a tool that graphically and intuitively displays these dependencies. Nodes in a dependency graph represent independent subtasks, and directed edges point from preceding subtasks to succeeding subtasks, indicating that the latter depends on the former. Dependency graphs can be project network diagrams, directed acyclic graphs (DAGs), Gantt charts, mind maps, or other types of dependency graphs.

[0152] The first task plan can be parsed to obtain not only at least two subtasks of the target task, but also the dependencies between these subtasks, i.e., dependencies between at least two subtasks. For example, "parameter comparison" depends on "product filtering." Similarly, writing code for "testing" depends on "implementation."

[0153] Then, a dependency graph can be determined based on the dependencies between subtasks. Based on this graph, the corresponding agents for each subtask can be invoked to process them, yielding the results. The dependency graph can also be used to identify subtasks for parallel and sequential processing. For sequentially processed subtasks, the corresponding agents can be invoked sequentially according to the processing order. Similarly, for parallelly processed subtasks, the corresponding agents can be invoked simultaneously. This allows for both parallel and sequential processing of subtasks, ensuring the accuracy of the processing logic and consequently the accuracy and reliability of the results.

[0154] In the above embodiments, the first task plan is first parsed to obtain at least two subtasks of the target task and the dependencies between each subtask. Then, a dependency graph is determined based on the dependencies between the subtasks. The corresponding intelligent agents of each subtask can be called to process each subtask based on the dependency graph to obtain the processing results of each subtask. Since each subtask calls its corresponding intelligent agent based on the dependency graph, and the dependency graph is determined based on the dependencies of the subtasks, the accuracy of the subtask processing order can be guaranteed, thereby ensuring the accuracy and reliability of the subtask processing results, and thus improving the accuracy and reliability of the task processing results.

[0155] In one embodiment, based on a dependency graph, the agent corresponding to each subtask is invoked to process each subtask and obtain the processing result of each subtask, including: determining at least one subtask processing chain based on the dependency graph; invoking the corresponding agent according to the processing order of the subtasks in each subtask processing chain; processing the subtasks in each subtask processing chain based on the invoked agent and obtaining the processing result of each subtask processing chain; and fusing the processing results of each subtask to obtain the first processing result of the target task, including: fusing the processing results of each subtask processing chain to obtain the first processing result of the target task.

[0156] A subtask processing chain is a linear processing task composed of multiple subtasks of a single task, linked together in the order they are processed. The emphasis is on the order in which the subtasks are processed. A subtask processing chain can include at least two subtasks.

[0157] At least one subtask processing chain can be determined based on a dependency graph. The start and end nodes in the dependency graph can be identified, and the subtask processing chain can be determined based on the start and end nodes connected by directed edges, thus obtaining at least one subtask processing chain. A start node is a node in the dependency graph that has no arrows pointing to it, but has arrows pointing from it to other nodes. An end node is a node in the dependency graph that has arrows pointing to it, but no arrows pointing from it to other nodes. For example, suppose node A is the start node, and nodes C and E are the end nodes. Nodes A and C are connected by two directed edges, with node B between these two edges. Nodes A and E are also connected by two directed edges, with node D between these two edges. Based on nodes A and C, the subtask processing chain of subtask A → subtask B → subtask C can be determined, and based on nodes A and E, the subtask processing chain of subtask A → subtask D → subtask E can be determined.

[0158] Since the subtask processing chain includes the processing order or execution order of its subtasks, the corresponding intelligent agent can be invoked according to the processing order of the subtasks in each subtask processing chain. Then, based on the invoked intelligent agent, the subtasks in each subtask processing chain can be processed to obtain the processing results of each subtask processing chain. Different subtask processing chains can be processed in parallel.

[0159] Subtasks in a subtask processing chain are processed sequentially. After the first subtask in the chain is processed, the second subtask can be processed based on its result, and so on, until the last subtask is processed based on the result of the second-to-last subtask. It is evident that the processing results of subtasks in a subtask processing chain are interdependent, and each subtask processing chain yields one result. Therefore, the processing results of each subtask processing chain can be combined to obtain the first processing result of the target task.

[0160] For example, suppose the target task includes five subtasks, namely subtask A, subtask B, subtask C, subtask D, and subtask E. Two subtask processing chains can be determined based on the dependency graph: subtask processing chain 1 (A→B→C) and subtask processing chain 2 (A→D→E), as follows: Figure 4 As shown, subtask processing chain 1 and subtask processing chain 2 can be processed in parallel to obtain the processing results of subtask processing chain 1 and subtask processing chain 2. Then, the processing results of subtask processing chain 1 and subtask processing chain 2 can be merged to obtain the first processing result of the target task.

[0161] In the above embodiments, at least one subtask processing chain is determined based on the dependency graph. The corresponding intelligent agents are invoked according to the processing order of the subtasks in each subtask processing chain to process the subtasks in each chain, obtaining the processing results of each subtask processing chain. The processing results of each subtask processing chain are then fused to obtain the first processing result of the target task. Since the processing order of the subtasks is determined based on the processing order within the subtask processing chain, the accuracy of the subtask processing order can be guaranteed, thereby ensuring the success rate of subtask processing and improving the success rate and efficiency of task processing. Furthermore, since each subtask processing chain has only one final processing result, the processing result of the task can be obtained by fusing the processing results of the subtask processing chains, without needing to fuse the processing results of all subtasks. This reduces the number of processing results that need to be fused, thereby improving the efficiency of determining the task processing result and ultimately improving the task processing efficiency.

[0162] In one embodiment, based on the dependency graph, the agent corresponding to each subtask is invoked to process each subtask and obtain the processing result of each subtask, including: determining at least one dependency-free subtask based on the dependency graph; invoking the agent corresponding to each dependency-free subtask to process each dependency-free subtask and obtain the processing result of each dependency-free subtask; and fusing the processing results of each subtask to obtain the first processing result of the target task, including: fusing the processing results of each dependency-free subtask to obtain the first processing result of the target task.

[0163] If at least two subtasks within the target task contain independent subtasks, at least one independent subtask can be identified based on the dependency graph. An independent subtask, also known as an isolated subtask, is a subtask that has no dependency relationship with other subtasks.

[0164] Since independent subtasks have no dependencies on other subtasks, once an independent subtask is identified, its corresponding agent can be immediately invoked to process it and obtain its result. The processing of independent subtasks can be performed in parallel to improve efficiency. For example, the price query subtask and the parameter comparison subtask can be processed in parallel.

[0165] After obtaining the processing results of each independent subtask, the processing results of each independent subtask can be combined to obtain the first processing result of the target task.

[0166] In the above embodiments, at least one dependency-free subtask is determined based on the dependency graph. The corresponding agents for each dependency-free subtask are then invoked to process them, resulting in processing results for each subtask. These results are then fused to obtain the first processing result of the target task. Since there are no dependencies between dependency-free subtasks and other subtasks, these subtasks can be processed in parallel, improving their processing efficiency and thus the overall task processing efficiency. Furthermore, because there are no dependencies between dependency-free subtasks and other subtasks, fusing the processing results of these subtasks to obtain the final task processing result ensures the accuracy and reliability of the final result.

[0167] In one embodiment, based on a dependency graph, the agent corresponding to each subtask is invoked to process each subtask and obtain the processing result of each subtask, including: determining at least one subtask processing chain and at least one dependency-free subtask based on the dependency graph; invoking the corresponding agent to process the subtasks in each subtask processing chain according to the processing order of the subtasks in each subtask processing chain and obtaining the processing result of each subtask processing chain; invoking the agent corresponding to each dependency-free subtask to process each dependency-free subtask and obtain the processing result of each dependency-free subtask; and fusing the processing results of each subtask to obtain the first processing result of the target task, including: fusing the processing results of each subtask processing chain and the processing results of each dependency-free subtask to obtain the first processing result of the target task.

[0168] A subtask processing chain is a linear processing task composed of multiple subtasks of a single task, linked together in the order they are processed. The emphasis is on the order in which the subtasks are processed. A subtask processing chain can include at least two subtasks. A dependency-free subtask is a subtask that has no dependencies on other subtasks.

[0169] If at least two subtasks of the target task contain independent and dependent subtasks, at least one subtask processing chain and at least one independent subtask can be determined based on the dependency graph. Then, according to the processing order of the subtasks in each processing chain, the corresponding agents can be invoked to process the subtasks in each chain, obtaining the processing results of each chain. The agents corresponding to the independent subtasks can be invoked to process them, obtaining their processing results. The processing results of each chain and the independent subtasks can be combined to obtain the first processing result of the target task. A detailed description can be found above and will not be repeated here.

[0170] For example, suppose the target task includes four subtasks, namely subtask A, subtask B, subtask C, and subtask D. A subtask processing chain (i.e., A→B→C) and a dependency-free subtask (i.e., D) can be determined based on the dependency graph, such as... Figure 5 As shown, the subtask processing chain and the independent subtask can be processed in parallel to obtain the processing results of the subtask processing chain and the independent subtask. Then, the processing results of the subtask processing chain and the independent subtask can be merged to obtain the first processing result of the target task.

[0171] In the above embodiments, since there are no dependencies between independent subtasks and other subtasks, independent subtasks and subtasks in the subtask processing chain can be processed in parallel, improving the processing efficiency of subtasks and thus the overall task processing efficiency. Furthermore, since the processing order of subtasks is determined based on the processing order in the subtask processing chain, the accuracy of the processing order can be guaranteed, thus ensuring the success rate of subtask processing and further improving the success rate and efficiency of task processing. Moreover, since there are no dependencies between independent subtasks and other subtasks, a subtask processing chain has only one final processing result. The processing results of each independent subtask and each subtask processing chain can be merged to obtain the task processing result, without needing to merge the processing results of all subtasks. This reduces the number of processing results that need to be merged, thus ensuring the accuracy and reliability of the task processing result and improving the task processing efficiency.

[0172] In one embodiment, the task processing method further includes: monitoring the processing status of the target task; determining a first abnormal situation of the target task if the processing status of the target task is failure; obtaining the exception handling constraints of the first abnormal situation; adding the exception handling constraints of the first abnormal situation to a first process prompt word template to obtain a second process prompt word template; generating a second task plan based on the target task and the second process prompt word template; and processing the target task based on the second task plan to obtain a second processing result of the target task.

[0173] The processing status of a task, or its execution status, refers to the stage a task is in within its lifecycle. This can be in the process of processing, executing, or running; it can also be successful (completed successfully) or a failure. Task exceptions refer to all non-ideal states that deviate from the expected normal processing path during the task's operation. Exception handling constraints are a set of predefined strategies, limitations, processes, and decision criteria that must be followed when dealing with task exceptions. These constraints ensure a reliable, rapid, consistent, and controllable response to exceptions.

[0174] During the processing of the target task, its processing status can be monitored in real time or periodically. A failure status indicates that the target task has failed, and the first abnormal condition can be identified. For example, in the case of a shopping task, the abnormal condition could be a missing price or insufficient substitutes; in the case of a coding task, the abnormal condition could be a dependency error or syntax error; and in the case of a query task, the abnormal condition could be an empty query result or a multi-source conflict.

[0175] Next, the exception handling constraints for the first exceptional case can be obtained. The correspondence between task exceptional cases and exception handling constraints can be stored. After determining the first exceptional case of the target task, the exception handling constraints corresponding to the first exceptional case of the target task can be obtained based on the correspondence between task exceptional cases and exception handling constraints. Since the exceptional cases may differ depending on the task type, the correspondence between task exceptional cases and exception handling constraints can be obtained based on the task type of the target task. For example, if the target task is a shopping task, the exception handling constraint could be to relax the filtering conditions; if the target task is a coding task, the exception handling constraint could be to replace the dependency library; if the target task is a query task, the exception handling constraint could be to change the search engine.

[0176] Task exceptions can be those that have occurred and been resolved, those that have occurred but not been resolved, or those that have never occurred. If the first exception is either a previously unresolved exception or a previously unseen exception, there are no exception handling constraints for that first exception. Therefore, after obtaining the exception handling constraints for the first exception, the first exception can be queried from the correspondence between task exceptions and exception handling constraints. If the correspondence includes the first exception, its exception handling constraints can be obtained from that correspondence. If the correspondence does not include the first exception, the first exceptions for this task type can be collected for subsequent processing.

[0177] Next, exception handling constraints for the first exceptional case can be added to the first process prompt template to obtain the second process prompt template. Then, a second task plan can be generated based on the target task and the second process prompt template. The target task can then be processed based on the second task plan to obtain the second processing result. Generating the second task plan is similar to generating the first task plan; a detailed description can be found in the description of generating the first task plan. A detailed description of obtaining the second processing result of the target task based on the second task plan can be found in the relevant description of obtaining the first processing result of the target task based on the first task plan.

[0178] It is evident that the initial process prompt template obtained based on the task type query of the target task does not include exception handling constraints. This is to ensure that for a large language model, the prompts only guide it to complete a limited number of tasks, allowing it to focus on the current task planning and minimizing attention shifts. Upon encountering anomalies, corresponding exception handling constraints can be provided to the large language model to enable replanning based on those anomalies. At different stages, the necessary information and capability options can be provided to the large language model to prevent irrelevant information from interfering with its attention allocation.

[0179] During the processing of the target task, the time consumption, result data, and key indicators of the target task can be monitored in real time or periodically. Task consumption refers to the time taken from the start of task processing to its completion. Task result data includes all quantitative information, outputs, and metadata generated after task completion, used to objectively describe, evaluate, and demonstrate task completion. For example, task result data could be a list of candidate products, price data, etc. Key indicators of the task are the core data points used to quantitatively measure the task processing process and final results. For example, in the case of a shopping task, the key indicator could be price data integrity; in the case of a coding task, the key indicator could be code runnability; and in the case of a query task, the key indicator could be result accuracy.

[0180] In the above embodiments, when the processing status of the target task is failed, a first abnormal situation of the target task is determined, the abnormal handling constraints of the first abnormal situation are obtained, the abnormal handling constraints of the first abnormal situation are added to the first process prompt word template to obtain a second process prompt word template, a second task plan is generated based on the target task and the second process prompt word template, and the target task is processed based on the second task plan to obtain the second processing result of the target task. It can be seen that when task processing fails, the abnormal handling constraints of the task's abnormal situation can be added to the process prompt word template, and the task can be re-planned and processed based on the updated process prompt word template. This can avoid the situation where the task cannot be processed after failure, and can improve the success rate of task processing.

[0181] In one embodiment, the target task includes at least two subtasks. Monitoring the processing status of the target task includes: monitoring the processing status of each subtask; and determining the first abnormal condition of the target task when the processing status of the target task is failure, including: determining the abnormal condition of the target subtask when the processing status of a target subtask is failure, thereby obtaining the first abnormal condition of the target task.

[0182] The processing status of a subtask, also known as its execution status, refers to the stage of its lifecycle. It can be in the process of processing, executing, or running, or it can be successful (completed successfully) or failed. Abnormal conditions of a subtask refer to any non-ideal states that deviate from the expected normal processing path during its processing.

[0183] Since the target task includes at least two subtasks, the processing status of each subtask can be monitored in real time or periodically during the processing of the target task. If the processing status of any target subtask is "failed," it indicates that the target subtask has failed, and the abnormal situation of the target subtask can be identified, thus obtaining the first abnormal situation of the target task. The target subtask can be any one of the at least two subtasks.

[0184] Upon detecting a subtask failure, the anomaly of that subtask can be immediately identified, revealing the primary anomaly of the target task, and allowing for immediate replanning of the task. Alternatively, after all subtasks have completed processing, the failed subtask can be identified as the target subtask, and the anomalies of all target subtasks can be determined. Based on these anomalies, the primary anomaly of the target task can be identified. Immediately replanning and processing the target task after detecting a subtask failure improves the timeliness of anomaly handling. Alternatively, the target task can be replanned and processed only after all subtasks have been processed, or if processing becomes impossible, and only if subtask failures exist. This allows for comprehensive anomaly handling of multiple failed subtasks at once, avoiding multiple instances of anomaly handling and improving overall task processing efficiency.

[0185] During the processing of the target task, the time consumption, result data, and key indicators of each subtask can be monitored in real time or periodically. The time consumption of a subtask is the time taken from the start of processing the subtask to its completion. The result data of a subtask includes all quantitative information, outputs, and metadata generated after the task is completed, used to objectively describe, evaluate, and demonstrate the task's completion. The key indicators of a subtask are the core data points used to quantitatively measure the task processing process and the final outcome.

[0186] In the above embodiments, since the task includes subtasks, the processing status of the task can be determined by monitoring the processing status of the subtasks, and the abnormal processing status of the task can be determined based on the abnormal situation of the subtasks, thus achieving comprehensive monitoring of the task.

[0187] In one embodiment, the task processing method further includes: collecting a second abnormal situation corresponding to the task type, wherein the second abnormal situation is an abnormal situation that has never occurred before; and determining the abnormal handling constraints for the second abnormal situation.

[0188] During the processing of the target task, if an anomaly is detected, it can be determined whether the anomaly is a second anomaly, that is, whether the anomaly has occurred before. If the anomaly is a second anomaly, that is, an anomaly that has not occurred before, it indicates that the anomaly has not occurred before, that is, the anomaly is a newly occurring anomaly, and the second anomaly corresponding to this task type can be collected.

[0189] Next, exception handling constraints for the second exceptional case can be determined. Users can periodically handle the collected exceptional cases. Exception handling constraints for the second exceptional case can be determined in response to the handling operation. These constraints can then be stored for later invocation. For example, for shopping tasks, niche brand filtering rules can be added; for coding tasks, common dependency conflict handling can be added.

[0190] Exception handling constraints for abnormal situations can be stored locally, in a template library, or in a dedicated database.

[0191] In the above embodiments, previously unseen anomalies corresponding to the task type are collected, and anomaly handling constraints are determined for the collected anomalies. It is evident that anomaly handling constraints can be determined for the collected previously unseen anomalies, so that when these anomalies are encountered subsequently, the corresponding anomaly handling constraints can be used to handle the anomalies, enabling task replanning and processing, thereby improving the success rate of task processing.

[0192] In one embodiment, the task processing method further includes: obtaining a newly added third process prompt template; and adding the third process prompt template to the template library.

[0193] When a new process prompt template needs to be added, a third process prompt template can be obtained and then added to the template library. As you can see, adding a new process prompt template does not affect other process prompt templates stored in the template library; only the corresponding process prompt template needs to be added, without modifying the core system logic, resulting in low adaptation costs.

[0194] In addition, version rollback is supported. During the process prompt template update, the displayed process prompt template supports version rollback so that users are unaware of the update, thus improving the user experience.

[0195] In the above embodiments, newly added process prompt templates can be directly added to the template library without modifying other processing logic, which can reduce the cost of updating process prompt templates and thus improve the applicability and compatibility of process prompt template updates.

[0196] In one embodiment, such as Figure 6 As shown, the architecture can include an input layer, a core logic layer, an execution layer, an output layer, and an optimization layer. The input layer is the logic layer for user-inputted tasks. The core logic layer is used for dynamic problem classification, process prompt template management, and task planning, and can include a dynamic problem classification module, a template library, and a planning module. Dynamic problem classification is the process of automatically mapping problems or tasks to preset types, such as shopping, information retrieval, deep search, and coding, through LLM deep semantic analysis of user input, and outputting structured classification results. The execution layer is the logic layer for task processing based on task planning, and can include a multi-agent scheduling and execution module. This architecture adopts a multi-agent system. A multi-agent system is a collaborative system composed of multiple agents with different professional capabilities, which can process specific tasks by receiving planning instructions to achieve complex problem solving. The optimization layer is the logic layer used to replan and process tasks by optimizing the process prompt templates when task processing fails, and can include a closed-loop optimization module. The output layer is the logic layer used to output the processing results of the tasks. These are described in detail below.

[0197] like Figure 6 and Figure 7 As shown, users can input their target task in natural language through the input layer. The target task can be a shopping task, a coding task, a data search task, a deep search task, or other tasks. After receiving the target task input by the user, the input layer can send it to the dynamic problem classification module of the core logic layer.

[0198] After receiving the target task, the dynamic problem classification module of the core logic layer performs semantic analysis on the target task using the first major language model to determine the task type, mapping the target task to a preset task type, and then outputting a structured classification result. The core logic layer can then query the template library for the corresponding exclusive flow prompt template based on the target task's task type; this is the first flow prompt template. The template library can store flow prompt templates for shopping, coding, information retrieval, deep search, and other tasks. The shopping flow prompt template is for shopping tasks and can include steps such as product selection, parameter comparison, timing analysis, and product recommendation. Product selection involves filtering products that meet the requirements. Parameter comparison involves comparing the parameters of the selected products. Timing analysis involves analyzing the purchase timing of products based on their historical information. Product recommendation involves recommending worthwhile products to the user. The coding flow prompt template is for coding tasks and can include steps such as requirement definition, selection determination, code implementation, and code testing. Requirements definition involves identifying the user's code requirements to clarify their goals. Selection definition involves determining the technical path and system architecture to achieve the user's requirements. Code implementation involves writing the source code to solve the user's needs. Code testing involves testing the written source code. The data retrieval process prompt template is a process prompt template for data retrieval tasks, which may include steps such as question decomposition, question retrieval, and answer summarization. Question decomposition involves breaking down a complex problem into multiple simpler retrieval questions. Question retrieval involves retrieving the retrieval questions. Answer summarization involves generating the final answer based on the retrieval results for the retrieval questions. The deep search process prompt template is a process prompt template for deep search tasks, which may include multi-source retrieval, information analysis, and information integration. Multi-source retrieval involves retrieving information from different websites or databases. Information analysis involves filtering, credibility assessment, key point extraction, and logical relationship mining of information retrieved from different websites or databases. Information integration involves integrating information retrieved from different websites or databases based on the results of information analysis.

[0199] The planning module in the core logic layer can then construct a personalized prompt context by embedding corresponding process prompt word templates, i.e., the first process prompt word template. This involves filling the prompt context template with the target task and the first process prompt word template. Based on this prompt context, the first task plan can be generated using the second major language model, and then sent to the execution layer. The processing logic is the same for task plans of the same task type, but different for task plans of different task types.

[0200] After receiving the first task plan, the execution layer can schedule the corresponding domain agents to process the task according to the plan in the first task plan. That is, it processes the target task based on the plan in the first task plan to obtain the first processing result of the target task. For example, if the target task is a shopping task, the agents invoked may include a product retrieval agent and a price comparison agent. The product retrieval agent is used to retrieve products. The price comparison agent is used to compare product prices. For example, if the target task is a code task, the agents invoked may include a code generation agent and a code testing agent. The code generation agent is used to generate code. The code testing agent is used to test the generated code. For example, if the target task is a query task, the agents invoked may include a retrieval agent and a summarizing agent. The retrieval agent is used to retrieve information. The summarizing agent is used to summarize the retrieved information. For example, when the target task is a search-related task, the invoked agents may include multi-source search agents, analysis agents, etc. Multi-source search agents are multiple retrieval agents, which are different agents used for information retrieval. Analysis agents are agents used to analyze the retrieved information. While processing the target task, the multi-agent scheduling and execution module can monitor the processing status of the target task in real time, and also monitor the quality of the processing results in real time.

[0201] When the target task fails, indicating an anomaly, the closed-loop optimization module of the optimization layer can detect the first anomaly in the target task. For example, if the target task is a shopping task, the first anomaly might be a missing price; if it's a coding task, it might be a dependency error; and if it's a query task, it might be an empty result. The closed-loop optimization module can obtain the exception handling constraints for the first anomaly and add them to the original type template (i.e., add the exception handling constraints for the first anomaly to the first process prompt template) to obtain the second process prompt template. Based on the target task and the second process prompt template, a second task plan can be regenerated. Then, the target task can be processed based on the second task plan to obtain the second processing result. During the processing of the target task based on the second task plan, the optimization layer can monitor the target task's processing status in real time. If the target task fails, further optimization can be performed to improve the task planning effect through iterative optimization.

[0202] In addition, the optimization layer can collect anomalies corresponding to different task types so that anomaly handling constraints can be determined periodically for the collected anomalies.

[0203] Furthermore, if it is necessary to add new process prompt word templates to the template library, the newly added process prompt word templates can be obtained and then added to the template library.

[0204] For example, suppose the user's input task is "Recommendations for mobile phones within XXXX yuan, focusing on gaming and photography." Upon receiving this task, the first language model can perform semantic analysis to determine that the task type is shopping. Shopping process prompt templates can then be retrieved from the template library and embedded into the context of the second language model to guide its generation of a shopping plan. For example, the shopping plan could be as follows:

[0205] Step 1: Product Filtering (Agent: Product Search Agent): Filter mobile phone models within XXXX yuan that excel in gaming performance (processor / heat dissipation) and photography (camera parameters);

[0206] Step 2: Parameter Comparison (Agent: Parameter Comparison Agent): Compare the core parameters of the candidate models (processor, graphics processing unit (GPU), camera, battery, screen);

[0207] Step 3: Price Inquiry (Agent: Price Retrieval Agent): Obtain real-time prices and historical price reduction trends for candidate models across multiple platforms;

[0208] Step 4: Cost-effectiveness analysis (Agent: Cost-effectiveness analysis Agent): Combine parameters and price to generate a cost-effectiveness score, and mark the core advantages and disadvantages;

[0209] Step 5: Recommendation Generation (Agent: Shopping Recommendation Agent): Outputs 3 optimal models, including a parameter comparison table, price trends, and purchase channel suggestions.

[0210] The multi-agent system processes the data according to the plan. If the price retrieval agent does not obtain the price reduction data for a certain model XXX, the system regenerates the plan based on the shopping template (supplementing the "historical price reduction trend analysis" step), and finally outputs a recommendation report with complete analysis.

[0211] In this application, the embedded category-level templates guide the process, preventing model divergence and ensuring that the consistency of planning for tasks within the same category is greater than or equal to 90%. The accuracy of planning in specific sub-categories such as shopping can be improved by 40%. Furthermore, the highly targeted planning reduces invalid processing steps by approximately 50% and shortens the overall completion time for shopping tasks by 30%. Moreover, users do not need to provide technical details; they only need to describe their needs in natural language to obtain precise, category-specific planning, lowering the barrier to entry.

[0212] like Figure 8 As shown, when the terminal and server jointly execute the above task processing method, the terminal can receive the target task input by the user, then generate a processing request for the target task based on the target task, and then send the processing request including the target task to the server. After receiving the processing request, the server can parse the processing request to obtain the target task, then determine the task type of the target task, and based on the task type of the target task, query the template library for the first process prompt word template corresponding to the task type of the target task, generate a first task plan based on the target task and the first process prompt word template, parse the first task plan to obtain at least two subtasks of the target task, then generate subtask processing requests corresponding to each subtask, and then send the subtask processing requests to the corresponding intelligent agents. After receiving the subtask processing requests, the intelligent agents can process the subtasks to obtain the processing results of the subtasks, and then send the processing results of the subtasks to the server. After receiving the processing results of the subtasks returned by the intelligent agents, the server can merge the processing results of each subtask to obtain the first processing result of the target task.

[0213] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0214] It should be understood that the same or corresponding information in different embodiments can be referenced to each other.

[0215] Based on the same inventive concept, this application also provides a task processing apparatus for implementing the task processing method described above. The solution provided by this task processing apparatus is similar to the solution described in the task processing method above. Therefore, the specific limitations in the task processing apparatus embodiments provided below can be found in the limitations of the task processing method above, and will not be repeated here.

[0216] In one embodiment, such as Figure 9 As shown, a task processing apparatus is provided, comprising:

[0217] The determination module 901 is used to determine the task type of the target task in response to a processing request for the target task;

[0218] Query module 902 is used to query the template library for the first process prompt word template corresponding to the task type of the target task based on the task type of the target task;

[0219] The generation module 903 is used to generate the first task plan based on the target task and the first process prompt word template.

[0220] The processing module 904 is used to process the target task based on the first task plan and obtain the first processing result of the target task.

[0221] In one embodiment, the determining module 901 is specifically used to: in response to a processing request for the target task, obtain classification prompt information; based on the classification prompt information, perform semantic analysis on the target task using a first language model to obtain the task type of the target task.

[0222] In one embodiment, the generation module 903 is specifically used to: fill the target task and the first process prompt word template into the prompt context template to obtain the prompt context; and generate the first task plan based on the prompt context through the second language model.

[0223] In one embodiment, the generation module 903 fills the prompt context template with the target task and the first process prompt word template to obtain the prompt context, including: obtaining a list of agents based on the task type of the target task; and filling the prompt context template with the task type of the target task, the list of agents, the target task, and the first process prompt word template to obtain the prompt context.

[0224] In one embodiment, the processing module 904 is specifically used to: parse the first task plan to obtain at least two sub-tasks of the target task; call the intelligent agent corresponding to each sub-task to process each sub-task and obtain the processing result of each sub-task; and fuse the processing results of each sub-task to obtain the first processing result of the target task.

[0225] In one embodiment, the processing module 904 parses the first task plan to obtain at least two subtasks of the target task, including: parsing the first task plan to obtain at least two subtasks of the target task and the dependencies between each subtask; the determining module 901 is further configured to determine a dependency graph based on the dependencies between each subtask; the processing module 904 calls the intelligent agent corresponding to each subtask to process each subtask and obtain the processing result of each subtask, including: calling the intelligent agent corresponding to each subtask to process each subtask based on the dependency graph and obtaining the processing result of each subtask.

[0226] In one embodiment, the processing module 904, based on a dependency graph, calls the corresponding agents of each subtask to process each subtask and obtain the processing results of each subtask, including: determining at least one subtask processing chain based on the dependency graph; calling the corresponding agents according to the processing order of the subtasks in each subtask processing chain; processing the subtasks in each subtask processing chain based on the called agents and obtaining the processing results of each subtask processing chain; the processing module 904 merges the processing results of each subtask to obtain the first processing result of the target task, including: merging the processing results of each subtask processing chain to obtain the first processing result of the target task.

[0227] In one embodiment, the processing module 904, based on the dependency graph, calls the agent corresponding to each subtask to process each subtask and obtain the processing result of each subtask, including: determining at least one dependency-free subtask based on the dependency graph; calling the agent corresponding to each dependency-free subtask to process each dependency-free subtask and obtain the processing result of each dependency-free subtask; and the processing module 904 fuses the processing results of each subtask to obtain the first processing result of the target task, including: fusing the processing results of each dependency-free subtask to obtain the first processing result of the target task.

[0228] In one embodiment, the task processing device further includes: a monitoring module for monitoring the processing status of a target task; a determination module 901 for determining a first abnormal situation of the target task when the processing status of the target task is failure; a first acquisition module for acquiring the abnormal handling constraints of the first abnormal situation; a first addition module for adding the abnormal handling constraints of the first abnormal situation to a first process prompt word template to obtain a second process prompt word template; a generation module 903 for generating a second task plan based on the target task and the second process prompt word template; and a processing module 904 for performing task processing on the target task based on the second task plan to obtain a second processing result of the target task.

[0229] In one embodiment, the task processing device further includes: a collection module, configured to collect a second abnormal situation corresponding to the task type, wherein the second abnormal situation is an abnormal situation that has never occurred before; and a determination module 501, configured to determine anomaly handling constraints for the second abnormal situation.

[0230] In one embodiment, the task processing device further includes: a second acquisition module for acquiring newly added third process prompt word templates; and a second addition module for adding the third process prompt word templates to the template library.

[0231] In one embodiment, the task type is either a vertical type or a general type. Vertical types include shopping, stocks, and coding, while general types include information retrieval, multi-hop information filtering, data querying, and deep search.

[0232] Each module in the aforementioned task processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.

[0233] In one embodiment, a computer device is provided, which may be a terminal or a server. In this embodiment, the computer device is described as a terminal, and its internal structure diagram is as follows. Figure 10 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a task processing method. The display unit of the computer device is used to form a visually visible image. It can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0234] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0235] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0236] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0237] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0238] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0239] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, etc., and are not limited to these.

[0240] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0241] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A task processing method, characterized in that, include: In response to a processing request for a target task, the task type of the target task is determined; Based on the task type, query the template library for the first process prompt word corresponding to the task type; A first task plan is generated based on the target task and the first process prompt word template; Based on the first task plan, the target task is processed to obtain the first processing result of the target task.

2. The method according to claim 1, characterized in that, In response to a processing request for a target task, determining the task type of the target task includes: In response to a request to process the target task, obtain categorized prompts. Based on the classification prompts, semantic analysis of the target task is performed using the first major language model to obtain the task type of the target task.

3. The method according to claim 1, characterized in that, The step of generating a first task plan based on the target task and the first process prompt template includes: The target task and the first process prompt word template are filled into the prompt context template to obtain the prompt context; Based on the aforementioned contextual prompts, a first task plan is generated using a second major language model.

4. The method according to claim 3, characterized in that, The step of filling the target task and the first process prompt word template into the prompt context template to obtain the prompt context includes: Obtain a list of agents based on the task type; The task type, the list of intelligent agents, the target task, and the first process prompt word template are filled into the prompt context template to obtain the prompt context.

5. The method according to claim 1, characterized in that, The step of processing the target task based on the first task plan to obtain a first processing result for the target task includes: The first task plan is analyzed to obtain at least two sub-tasks of the target task; The corresponding intelligent agents for each subtask are invoked to process each subtask, and the processing results of each subtask are obtained. The processing results of each subtask are combined to obtain the first processing result of the target task.

6. The method according to claim 5, characterized in that, The step of parsing the first task plan to obtain at least two sub-tasks of the target task includes: The first task plan is parsed to obtain at least two subtasks of the target task and the dependencies between the subtasks. The method further includes: Based on the dependencies between the subtasks, a dependency graph is determined. The step of calling the intelligent agent corresponding to each subtask to process each subtask and obtain the processing result of each subtask includes: Based on the dependency graph, the agent corresponding to each subtask is invoked to process each subtask, and the processing result of each subtask is obtained.

7. The method according to claim 6, characterized in that, The step of calling the agent corresponding to each subtask based on the dependency graph to process each subtask and obtain the processing result of each subtask includes: Based on the dependency graph, at least one subtask processing chain is determined; The corresponding intelligent agent is invoked according to the processing order of the subtasks in each of the subtask processing chains. Based on the invoked intelligent agent, the subtasks in each subtask processing chain are processed to obtain the processing results of each subtask processing chain. The first processing result of the target task is obtained by fusing the processing results of each of the sub-tasks, including: The processing results of each subtask processing chain are combined to obtain the first processing result of the target task.

8. The method according to claim 6, characterized in that, The step of calling the agent corresponding to each subtask based on the dependency graph to process each subtask and obtain the processing result of each subtask includes: Based on the dependency graph, at least one dependency-free subtask is identified; Call the intelligent agent corresponding to each of the independent subtasks to process each of the independent subtasks and obtain the processing result of each of the independent subtasks; The first processing result of the target task is obtained by fusing the processing results of each of the sub-tasks, including: The processing results of each independent subtask are combined to obtain the first processing result of the target task.

9. The method according to any one of claims 1-8, characterized in that, The method further includes: Monitor the processing status of the target task; If the processing status of the target task is failure, determine the first abnormal condition of the target task; Obtain the exception handling constraints for the first abnormal situation; Add the exception handling constraint to the first process prompt word template to obtain the second process prompt word template; A second task plan is generated based on the target task and the second process prompt template; Based on the second task plan, the target task is processed to obtain the second processing result of the target task.

10. The method according to claim 9, characterized in that, The method further includes: Collect the second abnormal situation corresponding to the task type, where the second abnormal situation is an abnormal situation that has never occurred before; Determine the exception handling constraints for the second exception case.

11. The method according to any one of claims 1-8, characterized in that, The method further includes: Get the newly added third-process prompt word template; Add the third process prompt template to the template library.

12. The method according to claim 1, characterized in that, The task type can be either a vertical type or a general type. The vertical types include shopping, stocks, and coding, while the general types include information retrieval, multi-hop information filtering, data query, and deep search.

13. A task processing device, characterized in that, include: A determination module is used to determine the task type of the target task in response to a processing request for the target task; The query module is used to query the template library for the first process prompt word template corresponding to the task type based on the task type; The generation module is used to generate a first task plan based on the target task and the first process prompt word template; The processing module is used to perform task processing on the target task based on the first task plan, and obtain the first processing result of the target task.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 12.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.

16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.